Tuesday, September 13, 2011

Uninstall MSI which fails to uninstall

Uninstall MSI which fails to uninstall sounds like strange, but it is possible.

Sometimes when you try to uninstall a msi the msi fails to uninstall with an error message like, the screenshot below.
This could be caused by a custom action which fails to execute.

To indicate if this is really the problem run the uninstall with the following command:

C:\Temp\ Setup.msi /log c:\uninstall.log

(if you don’t know where the msi is located, search the registry on the product name and you will find it. You should search until you find a match in “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData” like “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\B2729D7731537264797FB846DDDCF225\InstallProperties”)

The log file should now contain something like:
(The black line containing the name of the custom action). To make it possible to uninstall the product perform the following steps:
  1. Locate the msi in the C:\Windows\Installer\ (search in the registry on the product name and you will find it).
  2. Make a backup of the msi (you never know what happens)
  3. Open the original msi file in Orca.
  4.  Locate the CustomAction table.
  5.  Select the CustomAction which cause the problem.
  6.  Delete the selected custom action.
  7. Save the msi and close Orca.

No comments:

Post a Comment