Summary
Running Custom Actions Only During an UninstallationSynopsis
This articles applies to Basic MSI projects. Sometimes a custom action should only be run if the user selects the Remove option during the Maintenance sequence, not after the Modify selection.
Discussion
To make sure that a custom action runs only if the user has chosen uninstallation, you should use the windows installer REMOVE property. This property can be used as a condition. The REMOVE property resolves to true if a feature has been selected to be removed during maintenance mode. To only run a custom action if a particular feature is set for uninstall, you can use this condition REMOVE AND &featurename = 2. This evaluates to true if the feature is set to INSTALLSTATE_ABSENT. The custom action must be placed after the InstallValidate standard action in the Installation\Execute sequence.
The following condition can be used to only fire off or run a custom action during an uninstall, but not during a major upgrade:
(REMOVE~="ALL") And (NOT UPGRADINGPRODUCTCODE)
Additional Information
The following link includes a list of commonly used MSI conditions.URL: http://resources.flexerasoftware.com/web/pdf/archive/IS-CHS-Common-MSI-Conditions.pdf
Related KB Articles
Q103207Related Articles
How to Run a Custom Action Only During a Silent Install 23Number of Views Launch a Custom Action Only When Uninstall is Selected From Add/Remove Programs 10Number of Views PowerShell Custom Actions Failing at Runtime 3Number of Views Debug InstallScript Custom Action Running Deferred In System Context. 4Number of Views Troubleshooting Failures Of DLL Custom Actions 5Number of Views
Hi, I am Reva - Ask me anything.
No new updates
Thanks for the feedback!
Your feedback has been saved.Rate this response:
Add Additional feedback ( Optional )
Are you sure you want to cancel
the case creation?
Are you sure you want to cancel the case creation?
Are you sure you want to close this case
| Products | Region | Phone Numbers |
|---|---|---|
| FlexNet Operations FlexNet Embedded FlexNet Publisher FlexNet Connect FlexNet Code Insight InstallAnywhere InstallShield |
North America * |
+1 630-332-2513 (toll) +1 877-279-2853 (toll-free in North America) |
| Europe * |
+44 1925 944367 (toll) +44 800 047 8642 (toll-free in Europe) |
|
| Japan * | +81 3-4540-5335 (select option 2) | |
| Australia * |
+61 3 9895 2177 +61 1800 560 603 (toll-free in Australia) |
|
|
Usage Intelligence (formerly
Revulytics) Compliance Intelligence |
Please use the Case Portal to submit your support ticket or reach out to your Revenera contact. | |
Revenera Assistant
Case id: 00001065
Activity: Status change: 2 hours ago