【发布时间】:2018-07-12 03:47:30
【问题描述】:
我有以下 WIX 快捷方式。
<!--Desktop shortcuts-->
<Directory Id="DesktopFolder" Name="Desktop">
<Component Id="CMP_DesktopShortcuts" Guid="{guidblah}">
<Shortcut Id="Shotcut_Editor_Desktop"
Name ="Software"
Description="Software Description"
Arguments="$(var.CmdLineArgs)"
Target="blah.exe">
</Shortcut>
<RegistryValue Root="HKCU"
Key="Software\blah"
Name="DesktopShortcutInstalled"
Type="integer"
Value="1"
KeyPath="yes"
/>
</Component>
</Directory>
我根据我正在构建的安装程序在我的构建脚本中设置 CmdLineArgs。我的一个构建脚本没有命令行参数,因此将 CmdLineArgs 设置为 null。
然后我得到这个错误:
错误 CNDL0006:Shortcut/@Arguments 属性的值不能是 空字符串。如果不需要值,只需删除整个 属性。
如何仅在 $(var.CmdLineArgs) 不为空时有条件地设置参数?
【问题讨论】:
标签: wix installation shortcut wix3.11