WIX - user actions during installation, but not during uninstallation or updating

I have a wix installer in which several user actions are performed, such as registering, etc. However, we want them to run only in Install, not when updating or uninstalling.

I tried to set it to NOT Installed AND REINSTALL, but this does not work either.

Does anyone know what the correct property is when you want to run certain applications using custom actions only during installation, and not during updating or uninstalling?

<InstallExecuteSequence> <Custom Action="PosConfig.CustomAction" Before="StartServices"><![CDATA[NOT Installed AND NOT UPGRADINGPRODUCTCODE AND UILevel>3]]></Custom> <Custom Action="Register.CustomAction" After="PosConfig.CustomAction">NOT Installed AND NOT UPGRADINGPRODUCTCODE </Custom> <Custom Action="OPOSSelectorFirst.CustomAction" After="Register.CustomAction"><![CDATA[NOT Installed AND NOT UPGRADINGPRODUCTCODE AND &ProductFeature=3 AND Not OPOSDLLINSTALLED]]></Custom> <Custom Action="OPOSSelectorUpdate.CustomAction" After="OPOSSelectorFirst.CustomAction"><![CDATA[NOT Installed AND NOT UPGRADINGPRODUCTCODE AND &ProductFeature=3 AND Not OPOSDLLINSTALLED]]></Custom> </InstallExecuteSequence> 

EDIT: Added my custom action sequence.

+6
source share
2 answers

NOT Installed AND REINSTALL never be true at the same time. This would mean that the application is not installed, but is currently reinstalling. How it works?

Schedule your custom action using this condition:

NOT Installed AND NOT UPGRADINGPRODUCTCODE

This prevents it from starting with major updates.

+12
source

UPGRADINGPRODUCTCODE is set during the RemoveExistingProducts action. Depending on your MajorUpgrade Schedule may be too late. I came up with a solution NOT Installed AND NOT WIX_UPGRADE_DETECTED .

+1
source

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


All Articles