我有这样定义的快捷方式,我将发布两个,但我还有更多:
<!--Shortcuts to be added if variant is not OPC or LOGGER-->
<Component Id="AlarmShortcut" Guid="1FB13893-5021-4C83-9136-00C89221100B" Directory="ProgramMenuDir">
<Condition><![CDATA[(VARIANT <> "OPC") OR (VARIANT <> "LOGGER")]]></Condition>
<Shortcut Id="AlarmShortcut" Directory="ProgramMenuDir" Name="Alarm Monitor" Icon="almon_nt.exe" IconIndex="0" Target="[BIN]almon_nt.exe">
<Icon Id="almon_nt.exe" SourceFile="$(var.Bin)\almon_nt.exe"/>
<ShortcutProperty Key="System.AppUserModel.ExcludeFromShowInNewInstall" Value="1"/>
</Shortcut>
<RegistryValue Root='HKCU' Key='Software\ShortcutProperty\[PRODUCTNAME]' Type='string' Value='1' KeyPath='yes' Name='AlarmShortcut'/>
</Component>
<Component Id="UserAShortcut" Guid="328BB0A4-18CA-4E2A-9F6B-CEC81EF45B26" Directory="ProgramMenuDir">
<Condition><![CDATA[(VARIANT <> "OPC") OR (VARIANT <> "LOGGER")]]></Condition>
<Shortcut Id="UserAShortcut" Directory="ProgramMenuDir" Name="User Analogs" Icon="usera_cf.exe" IconIndex="0" Target="[BIN]usera_cf.exe">
<Icon Id="usera_cf.exe" SourceFile="$(var.Bin)\usera_cf.exe"/>
<ShortcutProperty Key="System.AppUserModel.ExcludeFromShowInNewInstall" Value="1"/>
</Shortcut>
<RegistryValue Root='HKCU' Key='Software\ShortcutProperty\[PRODUCTNAME]' Type='string' Value='1' KeyPath='yes' Name='UserAShortcut'/>
</Component>
VARIANT = LOGGER
但是,即使在我不知道问题出在哪里时,条件也总是正确的。
该属性声明如下:<Property Id="VARIANT" Secure="yes"/>
任何人都知道为什么这不起作用?我查看了详细日志,并且 VARIANT 属性在任何地方都没有改变。