WIX (remove all previous versions)

Ignoring Digits: Extract from the MSI SDK documentation for the ProductVersion property:

Note that Windows Installer uses only the first three fields of the product version. If you include a fourth field in your product version, the installer ignores the fourth field...At least one of the three fields of ProductVersion must change for an upgrade using the Upgrade table.

In order to get rid of installations in the wild, there are a few approaches.

Uninstall By Product Code: I would just get a list of product codes and uninstall corporate-wide if you are delivering an in-house application: How can I find the product GUID of an installed MSI setup? The list of product codes you assemble can then be passed to msiexec.exe /x {productcode} as explained in section 3 here. Just a simple batch file. Or you can try WMI, or one of the other approaches.

Uninstall By Upgrade Code: You can check if all your setup versions share the same upgrade code by using the code from here: How can I find the Upgrade Code for an installed MSI file? (they probably do). There is even a VBScript version here. Throwing in a link to an answer where I link to several other ways to uninstall, such as by uninstalling all setups that share the same upgrade code. And a direct link to actual code to do so (uninstall by upgrade code).

Uninstall By Product Name: You can uninstall by product name matching as well. Some samples here (VBScript): Is there an alternative to GUID when using msiexec to uninstall an application?. And here is a .NET DTF uninstall function: Uninstalling program (distinctively simplistic, needs tweaking for real-world use).

Some Links:

  • Wix MajorUpgrade will not detect last position of product version
  • http://blog.deploymentengineering.com/2010/08/wix-users-exceeding-version-limits.html (here be exotic workaround)
  • Powershell: Uninstall application by UpgradeCode
  • Wix MajorUpgrade problems (the AllowSameVersionUpgrades WiX concept)

Leave a Comment