PDA

View Full Version : Using more that first three version fields for product version comparisons



Barmen
10-02-2011, 09:49 AM
I am interesting to use more first three version fields for product version comparisons.

Example:
My current version number 2.6.6
I am interesting to use for the next version 2.6.6.1, but by the IS help only the first three version fields are used when making product version comparisons.
It mean on installation 2.6.6 and 2.6.6.1 it is a same version for the Installer and 2.6.6 not be uninstalled automatically on 2.6.6.1 installation.

Is there a way to use more the first three version fields?

joshstechnij
10-03-2011, 02:39 PM
Product version numbers for both Windows Installer and InstallScript based installations are stored in the registry as DWORDs. With 4 bytes available for a version, a product version is broken down into the following format:
Major.Minor.Build
Major version - 1 byte, values 0-255 allowed
Minor version - 1 byte, values 0-255 allowed
Build number - 2 bytes, value 0-65535 allowed

Since major, minor, and build consume all 4 bytes of a DWORD, there is no room left over for any other version fields. As such, specifying any fields besides major, minor, and build will cause the additional fields to be ignored. Product version comparisons are always made against a DWORD value.

See the following article for information on how Windows Installer defines and uses product version:
ProductVersion property (http://msdn.microsoft.com/en-us/library/windows/desktop/aa370859(v=vs.85).aspx)