Tuesday, November 18, 2014

Disable MSI Uninstall


This is an unusual requirement but if there is a situation that justifies disabling the uninstall the following settings provide for it.

Set the standard action LaunchCondition in the InstallExcuteSequence table to have a condition of  REMOVE~="ALL"

Set an entry in the LaunchCondition table

Not Installed      Uninstall Disabled


If an uninstall is started the Condition of the LaunchCondition standard action in the InstallExecuteSequence table evaluates to TRUE

The LaunchCondition of Not Installed evaluates to FALSE and prevents the uninstall from continuing.

If /qb is used "Uninstall Disabled" is displayed to the user.  /qn is fully silent. The uninstall Exit code will be 1603.