我有以下 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) 不为空时,如何有条件地设置参数?