2011-08-22 77 views
5

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

这是控制代码:

<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> 

感谢。

+0

的一些片段你使用的代码肯定会有助于回答这个问题... –

+0

我认为问题是属性IISLOGDIRECTORY默认具有安装路径,但如果我把anoth呃默认值生成一个错误,该路径不存在于目录表 – camaya

回答

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> 

和默认属性值

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

我试过这个,当选择路径时我得到错误2727: 一个属性被用作组件的目标路径,但该属性在目录表中不存在。 – camaya

+4

@Caotz:错误是因为您可能没有在主wxs文件(即Product.wxs)的目录结构中添加TESTPROPERTY值的条目为此属性添加条目并尝试....例如: vinay

+0

我认为在目录结构中添加目录时,创建了一个空目录,但它不是那样的。 现在工作完美,谢谢! – camaya