0
votes

The msi I am working on needs to send a property value for SERVER_MODE from the command line to launch. However, it seems the condition is not even there because the msi will just install without problems. The log file can't find the property name, which I assume it is not defined. Here is what I did:

 <Property Id="SERVER_MODE2"  Secure="yes">

 <CustomAction Id="CheckForDashboardProperty" Error="!(loc.LaunchFromDashboard)" />

 <InstallExecuteSequence>
     <Custom Action="CheckForDashboardProperty" Before="LaunchConditions">Not SERVER_MODE2 And Not Installed</Custom>
 </InstallExecuteSequence>

<InstallUISequence>
    <Custom Action="CheckForDashboardProperty" Before="LaunchConditions">Not SERVER_MODE2 And Not Installed</Custom>
</InstallUISequence>
1

1 Answers

2
votes

Launch conditions must evaluate to true for the install to proceed, therefore your condition should not negate the property value. Just say SERVER_MODE2.

You don't need a not Installed condition because you will never get that far - if the product (i.e. ProductCode) is already installed Windows won't run your MSI, it will go into maintenance mode for the currently installed product, which probably defaults to a repair.

So all you need as the condition is SERVER_MODE2

...and I assume SERVER_MODE in your text is a typo.