私はそのように定義されたショートカットを持っています、私は2つを投稿しますが、私はもっとたくさん持っています:
<!--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プロパティはどこにも変更されていません。