Pages

Tuesday, April 10, 2012

Windows Installer Guide
http://msdn.microsoft.com/en-us/library/aa370905(v=vs.85).aspx

Basic MSI custom actions
http://msdn.microsoft.com/en-us/library/windows/desktop/aa369786(v=vs.85).aspx

You can condition custom actions that are sequenced after InstallValidate to handle major upgrades by using the UPGRADINGPRODUCTCODE property:

  • If you want a custom action to run during an uninstallation of the product, but not during the removal of the product by a major upgrade, use this condition.

    REMOVE="ALL" AND NOT UPGRADINGPRODUCTCODE

If you want a custom action to run only during a major upgrade, use this condition.

UPGRADINGPRODUCTCODE

ALSO...

http://stackoverflow.com/questions/537584/how-to-execute-custom-action-only-in-install-not-uninstall


Add a condition on the action so it's only triggered during installation, not uninstallation.

Action run only during Install

NOT Installed AND NOT PATCH 

Action runs during Install and repair

NOT REMOVE 

Run on initial installation only:

NOT Installed 

Run on initial install or when repair is selected.

NOT Installed OR MaintenanceMode="Modify" 

Finally, to only run an action during uninstall use the following condition:

REMOVE