BrowseDialog和InstallDirDlg wix

cam*_*aya 5 wix wix3.5

我有一个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..." />
Run Code Online (Sandbox Code Playgroud)

这是发布:

<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>
Run Code Online (Sandbox Code Playgroud)

谢谢.

vin*_*nay 8

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

例如:

    <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>
Run Code Online (Sandbox Code Playgroud)

和默认属性值

  <Property Id="TESTPROPERTY" Value="C:\Test"/>
Run Code Online (Sandbox Code Playgroud)

  • @Caotz:错误是因为您可能没有主wxs文件中目录结构中的TESTPROPERTY值的条目(即Product.wxs)为此属性添加条目并尝试....示例:<Directory Id ="TESTPROPERTY "Name ="TestDir"> </ Directory> (4认同)