播发未嵌套在File元素中的快捷方式



我正在为一个应用程序制作一个安装程序,如果用户选中一个框,该应用程序将在用户的桌面上创建两个快捷方式。由于它是可选的,我不能将快捷方式放在有问题的文件元素下。我不得不把它们放在单独的组件中。有点像这样:

<!--Desktop shortcuts are optional-->
<Component Id="DesktopShortcut.Executable1" Guid="PUT-GUID-HERE" Directory="DesktopFolder">
<Shortcut Id="desktopShortcut.Executable1" Advertise="yes"
WorkingDirectory="INSTALLFOLDER" Name="Executable 1" Directory="DesktopFolder"
Icon="icon.Executable1.exe"  IconIndex="0"
Target="INSTALLFOLDER_._Executable1.exe"/>
<Condition>
AddDesktopShortcut=1
</Condition>
</Component>
<Component Id="DesktopShortcut.Executable2" Guid="PUT-GUID-HERE" Directory="DesktopFolder">
<Shortcut Id="desktopShortcut.Executable2" Advertise="yes"
WorkingDirectory="INSTALLFOLDER" Name="Executable 2" Directory="DesktopFolder"
Icon="icon.Executable2.exe" IconIndex="0"
Target="INSTALLFOLDER_._Executable2.exe"/>
<Condition>
AddDesktopShortcut=1
</Condition>
</Component>

但是Wix不喜欢目标属性。有什么建议吗?

播发的快捷方式总是指向其组件的KeyPath。KeyPath必须是一个文件。因此,播发的快捷方式必须位于包含该文件的同一组件中。

WiX工具集不允许Target属性指向KeyPath以外的内容,从而避免了您的麻烦。

因此,删除Advertised=yes或Target属性。

最新更新