WiX user sequence before LaunchConditions

Can I perform a custom action before "LaunchConditions"?

This is my usual action:

<CustomAction Id="CA_vcAppRunning" BinaryKey="vcShowMsg" DllEntry="IsAppRunning" Return="check" Execute="immediate"/> 

Consistently in <InstallExecuteSequence/>

 <Custom Action="CA_vcAppRunning" Before="LaunchConditions" /> 

I tried this, opened the .msi file in Orca, and found that my custom action is being ordered at "99". But when I tried to install, it was never called.

I want to plan this before LaunchConditions, since this custom action should set the property that is used in LaunchCondition (if the application is running, exit the setup / update program).

+4
source share
1 answer

Don't plan it before LaunchConditions , plan it after FindRelatedProducts , and then add a second custom action that blocks the installation based on the results of your first CA.

This is the same method that is used to prevent demotion in many textbooks, for example.

 <CustomAction Id="CA_BlockOlderVersionInstall" Error="!(loc.LaunchCondition_LaterVersion)" /> <InstallExecuteSequence> <LaunchConditions After="AppSearch" /> <Custom Action="CA_BlockOlderVersionInstall" After="FindRelatedProducts"> <![CDATA[NEWERVERSIONDETECTED]]> </Custom> </InstallExecuteSequence> <InstallUISequence> <LaunchConditions After="AppSearch" /> <Custom Action="CA_BlockOlderVersionInstall" After="FindRelatedProducts"> <![CDATA[NEWERVERSIONDETECTED]]> </Custom> </InstallUISequence> 
+4
source

Source: https://habr.com/ru/post/1298996/


All Articles