Monday, November 17, 2008

File versions vs. ProductVersion

Major upgrades in Windows Installer use only the first three fields of the ProductVersion property: the FindRelatedProducts action won’t distinguish version of a product from version

Some take this to mean that file versions in the File table are limited to three fields, which isn’t the case. The Version field of the File table uses the Version data type, described as, where each field is an integer from 0 through 65536.

To demonstrate this, create a file called versions.exe with version and place it in (say) C:\Program Files\Versions, and create another copy with version, adding it to an installer that installs it to that same directory. If you create a log file with msiexec /i version_test.msi /L*v everything.log, you can search for “file:” and find this (edited):

MSI (s): Executing op: FileCopy (SourceName=versions.exe, DestName=versions.exe,
Version=, ...)
MSI (s): File: C:\Program Files\Versions\versions.exe; Overwrite; Won't patch;
Existing file is a lower version

Or I guess you could just have checked to see if the new file was installed.

If MSI considered the versions identical, the log message would be (strange capitalization and all):

MSI (s): File: C:\Program Files\Versions\versions.exe; Won't Overwrite; Won't patch;
Existing file is of an equal version

No comments: