Is there a "best" way to forcibly "uninstall" a product when the MSI fails during uninstall?

My install fails on uninstall because of a bug in my CustomAction. I've fixed the bug, but I now have a test machine with that product installed and I can't get it to uninstall (keeps rolling back and staying).

In the past (years ago), I used msizap.exe that comes with the Windows SDK. But it doesn't seem to come with it anymore. I installed it and can't find it. My only guess is that it's no longer relevant in Windows 10.

Anyway, is there a best way to forcibly remove the product so that Windows no longer thinks it's installed?

2

1 Answer

msizap.exe: You are correct, msizap.exe has been deprecated long ago.

Broken Uninstall Workarounds: This problem is very common. You can find a list of approaches for these kind of uninstall problems here.

Virtual Machines: It is obvious, but just to mention that you should check setups on virtual machines so you can just revert the virtual machine when you encounter "development and QA bugs" like these.

Custom Action Flag: You can also add a condition to each custom action so that you can disable the whole custom action from running by a custom command line sent to msiexec.exe.

If your flag is a property RUNCA="1", then you can disable it by setting this flag property to 0 via the command line - this is sort of a little inoculation for the package's uninstall feature breaking - you can disable custom actions from running at all during install / uninstall - it might even be useful for your tech-support guys and real-world installations:

msiexec.exe /x {PRODUCT-CODE} RUNCA=0 

ncG1vNJzZmirpJawrLvVnqmfpJ%2Bse6S7zGiorp2jqbawutJobW9wZ2yBeoWOoqpmrJiav6Z5wGaZnqukYsSixYytpmaen6ewqq7LsmSuppmjwLWty6VkmmWgp7ylwcKtZLCglaN6tbTEZqSsoV2brqq40mabrqqZow%3D%3D