Basically I need to verify that a certain program is not running before installation. This is done via a custom action, which sets a property, APPRUNNING:
<CustomAction Id="CheckingAppIsRunning"
BinaryKey="AppIsRunning"
DllEntry="AppIsRunning"/>
<Binary Id="AppIsRunning"
SourceFile="CustomActions.CA.dll" />
But in the message displayed, APPRUNNING seems to be null, that is, it’s not set at all (should be either “0” or “1”).
<Condition Message="Exit all instances of [APPNAME] before installation (APPRUNNING = [APPRUNNING]).">
<![CDATA[APPRUNNING = "0"]]>
</Condition>
<InstallExecuteSequence>
<Custom Action="CheckingAppIsRunning" Before="LaunchConditions" />
</InstallExecuteSequence>
I suppose the custom action is not executed at the moment of the condition check. What are the options to perform a condition check after a custom action?
The LaunchConditions action is scheduled to run in both
InstallUISequenceandInstallExecuteSequence. As long as you schedule your custom action toInstallExecuteSequenceonly, the property won’t be set by the time LaunchConditions is fired inInstallUISequence.You should schedule your
CheckingAppIsRunningcustom action in both sequences. You might also want to define it withExecute='firstSequence'attribute – this way it will run the first sequence it is met in.This is what I mean, actually:
And the definition: