【问题标题】:BrowseDialog and InstallDirDlg wixBrowseDialog 和 InstallDirDlg wix
【发布时间】:2011-08-22 08:32:08
【问题描述】:

我有一个 InstallDirDLG,我需要其他浏览对话框,问题是当我在第二个浏览对话框中选择路径时,也会更改 installdir 路径。

这是控制代码:

<Control Id="IISLogDirectoryEdit" Type="PathEdit" X="45" Y="100" Width="220" Height="18" Disabled="yes" Property="IISLOGDIRECTORY" Indirect="yes" />
<Control Id="IIsLogDirectoryExplorer" Type="PushButton" X="267" Y="100" Width="56" Height="18" Text="Explorar..." />

这是发布:

<Publish Dialog="DirectoriesDlg" Control="Next" Event="SetTargetPath" Value="[IISLOGDIRECTORY]" Order="1">1</Publish>
<Publish Dialog="DirectoriesDlg" Control="Next" Event="SpawnDialog" Value="InvalidDirDlg" Order="2"><![CDATA[NOT IISLOGDIRECTORY]]></Publish>
<Publish Dialog="DirectoriesDlg" Control="Next" Event="NewDialog" Value="FtpDlg" Order="3">1</Publish>
<Publish Dialog="DirectoriesDlg" Control="IIsLogDirectoryExplorer" Property="_IISBrowseProperty" Value="[IISLOGDIRECTORY]" Order="1">1</Publish>
<Publish Dialog="DirectoriesDlg" Control="IIsLogDirectoryExplorer" Event="SpawnDialog" Value="IISBrowseDlg" Order="2">1</Publish>

谢谢。

【问题讨论】:

  • 你使用的一些sn-ps代码肯定会帮助回答这个问题......
  • 我认为问题在于属性IISLOGDIRECTORY默认有安装路径,但是如果我把另一个默认值设置为目录表中不存在路径的错误

标签: wix wix3.5


【解决方案1】:

为第二个浏览对话框使用不同的属性名称并将该属性值设置为某个默认位置

例如:

    <Control Id="TestPathEdit"      Type="PathEdit"   X="120"  Y="157" Width="160" Height="18" Property="TESTPROPERTY"/>
    <Control Id="TestBrowse" Type="PushButton" X="290" Y="157" Width="56" Height="17" Text="Browse">
      <Publish Property="_BrowseProperty" Value="TESTPROPERTY" Order="1">1</Publish>
      <Publish Event="SpawnDialog" Value="BrowseDlg" Order="2">1</Publish>     
    </Control>

以及默认属性值

  <Property Id="TESTPROPERTY" Value="C:\Test"/>

【讨论】:

  • I've tried this and when select the path i get error 2727: A property is being used as the destination path of a component, but that property does not exist in the Directory table.
  • @Caotz:错误是因为您可能在主 wxs 文件(即 Product.wxs)的目录结构中没有 TESTPROPERTY 值的条目为此属性添加条目并尝试....示例:
  • 我以为在目录结构中添加目录时,创建了一个空目录,但事实并非如此。现在完美运行,谢谢!
  • @vinay 感谢您的示例代码!几天来,我一直在寻找 PathEdit 的工作示例。现在它起作用了。极好的! +1
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-07-09
  • 2010-10-03
  • 2011-03-12
  • 1970-01-01
相关资源
最近更新 更多