ProductVersion property
Applies to: desktop apps only
The value of the ProductVersion property is the version of the product in string format. This property is REQUIRED.
The format of the string is as follows:
- major.minor.build
The first field is the major version and has a maximum value of 255. The second field is the minor version and has a maximum value of 255. The third field is called the build version or the update version and has a maximum value of 65,535.
Remarks
At least one of the three fields of ProductVersion must change for an upgrade using the Upgrade table. Any update that changes only the package code, but leaves ProductVersion and ProductCode unchanged is called a small update. The three versions fields are provided primarily for convenience. For example, if you want to change ProductVersion, but do not want to change either the major or minor versions, you can change the build version.
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.
Requirements
|
Version | Windows Installer 5.0 on Windows Server 2008 R2 or Windows 7. Windows Installer 4.0 or Windows Installer 4.5 on Windows Server 2008 or Windows Vista. Windows Installer on Windows Server 2003, Windows XP, and Windows 2000. See the Windows Installer Run-Time Requirements for information about the minimum Windows service pack that is required by a Windows Installer version. |
|---|
See also
Send comments about this topic to Microsoft
Build date: 2/3/2012
If a package is installed, you can access the ProductVersion property through a productInformation property named VersionString. In this case, all four parts of the version number are displayed (if present.)
If a package is only advertised, the above doesn't work, but you can access the property through a product information property named Version which is a 32-bit decimal number, which needs to be formatted to reveal the version number one might expect. The above description of how the version is stored, so for example to format it in jscript, use :
function GetVersion(installer, productCode) {
if (installer.ProductState(productCode) == 1) {
var version = installer.ProductInfo(productCode, "Version");
return "".concat(
(version >> 24) & 0xff, '.',
(version >> 16) & 0xff, '.',
version & 0xffff);
} else {
return installer.ProductInfo(productCode, "VersionString");
}
}
- 10/12/2010
- Burt.Harris
- 10/12/2010
- Burt.Harris