Aaron Stebner's WebLog

Thoughts about setup and deployment issues, WiX, XNA, the .NET Framework and Visual Studio

Trick for setup developers - how to remove a setup package with a known uninstall bug

Trick for setup developers - how to remove a setup package with a known uninstall bug

  • Comments 7

I was recently working on developing an MSI-based setup package as a learning exercise to teach myself some of the fundamental concepts of Windows Installer XML (WiX).  During this process, I created a test MSI package and tried to install it on my development machine.  Then, when I tried to uninstall it, I found that one of my launch conditions was being triggered incorrectly, which blocked me from being able to uninstall the package.

It was relatively simple to figure out why the launch condition was incorrect and fix it in my MSI package - I needed to schedule the AppSearch action to occur before LaunchConditions (since one of my launch conditions needed to use the results of one of my app searches) and also condition my AppSearch so it would happen in repair/uninstall cases and not only during initial install.  However, I was stuck with the buggy version of the MSI installed on my development machine and blocked from uninstalling it.

I found a couple of options that allowed me to fix my development machine and work around the buggy uninstall logic that I had introduced and I wanted to share them here in case they are useful to any other setup developers reading this:

  1. Forcibly install a fixed version of the MSI - for this option, I took my newly fixed MSI that no longer had the uninstall bug and ran the following Windows Installer command line to force it to be installed over the top of the buggy one that was stuck on my system: msiexec.exe /fvecmus my_product.msi.  This command line forcibly replaced the old installation with the new one by running from the source MSI and recaching the copy of the MSI in %windir%\installer.  This removed the bug that blocked uninstall, and after that I was able to launch uninstall from Add/Remove Programs and everything worked as expected for me.
  2. Manually edit the cached MSI - for this option, I found the locally cached copy of the MSI in %windir%\installer (by looking at timestamps and finding the most recently created file in that folder), opened it in the Orca MSI editing tool, and then manually removed the entries from the LaunchCondition table that were blocking uninstall from running.  This option can be used to fix simple errors, but complex errors will likely be difficult to manually fix in an MSI editor such as Orca.

 

  • Thank God for Aaron! My prayers were answered when I found your website and was able to fix a broken install while on the road!

    Thanks so much!
    Kevin B
  • I have to say this is one of the best blogs.  I love it.  Very helpful Aaron.  You are a lifesaver.
  • Msizap should do this sort of thing well

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msizap_exe.asp

  • Hi Hebbja - Msizap will remove the Windows Installer registry information for a product, but it will not actually remove the files/registry that the product installs.  It is cleaner to try to fix the broken MSI using the steps in this blog post and then perform a product uninstall if possible.

  • Today was the 2nd time I managed to cause a machine at work to not be able to uninstall the project I've

  • Thank-you, just thank-you.

  • Thanks, saved the day. Here's my bitcookie #8635.

Page 1 of 1 (7 items)
Leave a Comment
  • Please add 5 and 7 and type the answer here:
  • Post