0
我对WiX工具集非常陌生。我必须创建一个有两个需求的安装程序:wix,如何将字符串添加到自定义路径
- 将程序安装到默认路径。这很好。
- 用户可以选择一个路径。这很好,但我必须总是添加目录的名称作为我给
"WIXUI_INSTALLDIR"
的字符串。
如何自动添加目录名称?
下面是一个代码示例:
<Directory Id="COMNET" Name="COMNET">
<Directory Id="DICSHS_1" Name="DICSHS">
<Component Id="DICSHS.EXE" DiskId="1" Guid="2E3EED9D-369D-41E4-A213-0479912E4A40">
<File Id="DICSHS.EXE" Name="DicsHs.exe" Source="C:\Wix_Tests\program files\COMNET\DICSHS\DicsHs.exe">
<Shortcut Id="desktopShortcut" Directory="DesktopFolder" Name="DicsHs" WorkingDirectory="INSTALLDIR" Advertise="yes" Icon="DesktopIcon.exe" IconIndex="0" />
<Shortcut Id="ExeShortcut" Directory="ProgramMenuDir" Name="DicsHs" Advertise="yes" Icon="StartMenuIcon.exe" IconIndex="0" />
</File>
</Component>
<Component Id="SHOWERROR.EXE" DiskId="1" Guid="14B32974-B447-4A8B-973D-C96D80251BE8">
<File Id="SHOWERROR.EXE" Name="ShowError.exe" Source="C:\Wix_Tests\program files\COMNET\DICSHS\ShowError.exe" />
</Component>
这里我使用WIXUI_INSTALLDIR目录COMNET:
<Property Id="WIXUI_INSTALLDIR" Value="COMNET" />
<UIRef Id="WixUI_InstallDir" />
但是,当用户选择的路径,我总是添加字符串COMNET上自定义路径的结尾。这是我的问题。
非常感谢,它工作得很好,:-)))))) – 2013-04-24 12:08:43