cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Launch a Custom Action only when Uninstall is Selected from Add/Remove Programs

Launch a Custom Action only when Uninstall is Selected from Add/Remove Programs

Summary

This article will discuss the conditions and sequence position to use to launch a custom action when uninstall is selected through Add/Remove Programs (ARP).

Synopsis


This article will discuss which conditions to use to launch a custom action when uninstall is selected through Add/Remove Programs (ARP). The purpose of this would be to not launch the same custom action if uninstall was performed through maintenance mode.

Discussion


We must first understand the difference between an uninstall that occurs from ARP as opposed to through Maintenance Mode.

When an uninstall occurs through ARP, Windows Installer will automatically set the property UILevel=3 . This is a basic User Interface which will only handle simple progress and error handling.
When an uninstall occurs through maintenance mode the Windows Installer will set the property to UILevel=5. This is a full User Interface.

With this in mind we must be careful not to place the custom action in the User Interface Sequence, as this will not be launched during an ARP uninstall.

Additional conditions that we can use are REMOVE="ALL". This option will work in the execute sequence after InstallValidate to detect a complete uninstallation. Mind the capitalization and quotation marks.

Finally to prevent a silent uninstall caused by a Major Upgrade meeting the above 2 conditions we can also use "NOT UPGRADINGPRODUCTCODE"

Therefore the custom action should be placed after Installvalidate in the Execute Sequence and its full condition would be:

REMOVE="ALL" AND UILevel=3 AND NOT UPGRADINGPRODUCTCODE

Additional Information


UILevel Property
http://msdn.microsoft.com/en-us/library/aa372096(v=vs.85).aspx

REMOVE Property
http://msdn.microsoft.com/en-us/library/aa371194(v=vs.85).aspx

UPGRADINGPRODUCTCODE Property
http://msdn.microsoft.com/en-gb/library/aa372380(v=vs.85).aspx

Further details on REMOVE="All" Property:
http://www.robertdickau.com/msi_tips.html

Labels (1)
Was this article helpful? Yes No
No ratings
Version history
Last update:
‎Jul 31, 2024 08:25 AM
Updated by:
Contributors