Gareth Lennox

MSI version matching upgrade woes

We’re distributing our .net application using Microsoft’s MSI installer technology (using the very powerful WiX to do it).

We’ve recently seen a problem with the installer not upgrading older versions, but rather just installing on top of the existing version, which results in the application being listed twice in the “Add/remove programs” (Programs and Features in Vista) section, one for each version. This results in weird things happening, like uninstalling one of them leaves the other one still installed with all the application files removed.

I ensured that we kept the same upgrade guid, with the version number incrementing, but all looked good. After searching and trying different things, I finally found this gem, hidden away in the MS documentation:

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.

Why?!??

Our version numbers are in the order of 3.2.0.1234, 3.2.0.1456 (where the 4th number increments based on the Subversion revision number). The installer was seeing the version numbers as 3.2.0, i.e. the same, and not uninstalling the old version. Changing the installer version number to 3.2.1234 fixes this.

One Response to MSI version matching upgrade woes

Rob Mensching says: 8 July 2009 at 6:41 pm

The reason why such an odd decision was made is lost to the past. I’ve never been able to track down the answer to why Windows Installer versions are different. It wasn’t like 3 part versions were popular when it was being developed.

It just is.