I have a property for whether to install shortcuts that need to be passed via command line arguments. The conditions seem to work when I set the properties within the wxs file, but they seem to be ignored when setting them through the command line. From the log I see that they are being set:
MSI (s) (24:C8) [11:01:32:234]: PROPERTY CHANGE: Modifying INSTALLSTARTUPSHORTCUT property. Its current value is '0'. Its new value: '1'.
MSI (s) (24:C8) [11:01:32:234]: PROPERTY CHANGE: Modifying INSTALLSTARTMENUSHORTCUT property. Its current value is '0'. Its new value: '1'.
MSI (s) (24:C8) [11:01:32:234]: PROPERTY CHANGE: Modifying INSTALLDESKTOPSHORTCUT property. Its current value is '0'. Its new value: '1'.
However, they the shortcuts aren't being installed.
Also, it seems like since they need to be in their own component to be able to set conditions on them, they can no longer be advertised shortcuts. How would you get conditionally installed advertised shortcuts?
Current shortcut code:
<Property Id="INSTALLSTARTMENUSHORTCUT" Value="0"/>
...
<Component Id="StartMenuShortcut" Guid="MY-GUID">
<Condition>INSTALLSTARTMENUSHORTCUT</Condition>
<Shortcut Id="StartMenuServerShortcut"
Directory="ProgramMenuDir"
Name="Application Name" WorkingDirectory="INSTALLDIR" Advertise="no"
Target="[!FileEXE]"
Icon="Icon.ico" />
</Component>
And repeated for other shortcuts
Edit:
Trying what Sacha suggested and adding the following:
<Property Id="INSTALLSTARTUPSHORTCUT" Value="0" Secure="yes"/>
<Property Id="INSTALLDESKTOPSHORTCUT" Value="0" Secure="yes"/>
<Property Id="INSTALLSTARTMENUSHORTCUT" Value="0" Secure="yes"/>
Now it installs all the shortcuts even though they're set to 0 both in the xml and on the command line. The command line I'm passing is:
msiexec /i MySetup.msi INSTALLSTARTUPSHORTCUT=0 INSTALLDESKTOPSHORTCUT=0 INSTALLSTARTMENUSHORTCUT=0 /l*v inst.log /qb
tried putting the values in quotes and still no go. Not shown here, but I was successful in manipulating the ALLUSERS property to do per-user or per-machine registries by doing ALLUSERS="" or ALLUSERS="2" So passing in properties should be possible, but I'm not sure what I'm doing wrong.