WiX/MSI installer successfully runs for uninstalli

2019-07-31 16:49发布

问题:

I created a Wix Installer for my Visual Studio 2017 project by using this Wix Toolset Visual Studio 2017 Extension from its original author Rob Mensching. The installer successfully installed the app but when I run the installer again to uninstall the app, the installer, as expected, first shows the option of either repairing or uninstalling the app.

When I choose Uninstall option it successfully runs indicating it's uninstalling and finally shows the Finish button, but when I go to my Windows 10 menu the app is still there and still works as usual - that clearly means it was not uninstalled.

I even re-started the computer to see if that makes any difference but the app is still there and working as usual. Question: What could be a cause of it happening - and what is the remedy?

Note: I'm using the latest version 3.11 of Wix

UPDATE

It's a VSTO add-in. Now it is working as follows: I manually uninstalled it from Windows' Add\Remove program and then installed it again using Wix/MSI. And then when I uninstalled again using Wix/MSI it successfully uninstalled it. Question: Why initially it was not uninstalling when using Wix/MSI?

回答1:

Duplicates: You have probably installed the product several times (at least two) whilst working on the package. This happens all the time, particularly if you use an automatically generated product code and haven't set up a major upgrade construct yet or the upgrade guid is missing or worse yet you set it to auto-generate. Upgrade codes should remain stable for "families" of products. Essentially all related editions that you don't want to install side-by-side.

So with duplicated installations, the uninstall of the product only removes the latest installation, leaving the files in place since the reference count is not zero as there are other installations. The solution is to keep a stable upgrade guid and set up a major upgrade construct. Before that uninstall all stray copies.

Maybe try this procedure:

  • Windows Key + tap R
  • Type appwiz.cpl and press Enter

Look for duplicate copies of the product in the list and uninstall them.


Hidden Products: It is also possible that some copies could be hidden from the above list.

  • Find Product Code: You can list all installed product codes and the product name using approaches described here: How can I find the product GUID of an installed MSI setup?
  • Uninstall: Once you have the product code you can uninstall via method 3 here: Uninstalling an MSI file from the command line without using msiexec
  • More Advanced: Here are some further options to uninstall via scripts: WIX (remove all previous versions).


标签: wix wix3.11