I have shortcuts defined like so, I will post two but I have many more:
<!--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>
However the conditions always are true even when VARIANT = LOGGER and I don’t know what the problem is.
The property is declared like: <Property Id="VARIANT" Secure="yes"/>
Anyone know why this is not working? Ive looked in the verbose log and the VARIANT property is not changing anywhere.
If I understand what you are aiming to do then you should change
to be
At the moment, if VARIANT is LOGGER then the left side of the
ORis returning true and the right is returning false, so theORstatement returns true, whereas it sounds like you only want it to return true if VARIANT is neither OPC nor LOGGER.