What are the constraints with regards to version numbers when using installshield and msi
Asked Answered
G

1

5

For internal reasons our current version was set to 901.0.1500.0, our project is a C# .NET one and uses installShield for installation, patch creation, upgrades etc... During our testing it all worked fine but we did recently came across several articles (mostly pretty old ones) that state that the version numbers of a.b.c.d must follow the rule that a and b must be smaller than 255. Again, we haven't encountered any issues during our testing but that made us a little worried.

Can anyone assist in clearing this out ?

Thanks a lot.

Getup answered 2/10, 2014 at 8:40 Comment(0)
L
8

There are three kinds of versions that one encounters in a Windows Installer Package:

  • Product Version: this is stored in the ProductVersion property, and due to a compressed copy of it being stored as a DWORD in the registry to support Major Upgrades, it must be in the format of up to 255.255.65535.x (where x is ignored for version comparisons) in order to work correctly.
  • File Version: these are stored in version blocks of many PE format files (.exe, .dll, .etc) and also often stored in the Version column of the File table. The two are compared as part of File Versioning Rules to determine whether a given file replaces another or has already been replaced. They typically will correctly compare versions up to 65535.65535.65535.65535.
  • Assembly Version: If you're working with .NET, you may encounter these and confuse them with File Versions. Windows Installer only cares about these when working with the GAC. Most operations rely on the File Version instead.

I think you're talking about the first case. The problem you can encounter is that the version comparisons done to see if a given installed product is in the version range described in the Upgrade table is done with the DWORD representation. When a major version such as 901 is smashed into a single byte, it will overflow in ways that are hard to predict and leverage. Odds are good it will act similarly to a major version of 103, and may otherwise work out. However a large number in the minor version slot may impact the value seen as the major version.

See Installshield 2011 - Problem Upgrading existing software with Version format 2009.727.1365 for an example of the possible fallout.

Lapham answered 2/10, 2014 at 12:19 Comment(1)
As Michael says ProductVersion is probably what you are referuring to, and here's Microsoft's comments msdn.microsoft.com/en-us/library/aa370859(v=vs.85).aspx , It's still relevant now I believe.Semele

© 2022 - 2024 — McMap. All rights reserved.