msi version numbers

前端 未结 2 1371

I\'m really confused about msi version numbers. Here the Version number as used for the ProductVersion in the Property table and in the Update table is restricted to having

2条回答
  •  一个人的身影
    2020-12-17 11:26

    Yes, MSI ProductVersion and version in MSI file table are unrelated.

    Yes, FILEVERSION in VERSIONINFO can be used to set the version in the MSI file table.

    Version terms in context

    When working with MSI version, the numbers are often retrieved from VERSIONINFO resource (used in resource files) or .NET assembly contexts. The MSI terms might be easier to understand when compared with those:

    Version

    • Windows installer: a string data type, used in the MSI file table for the files it contains
    • Resource files: data type consisting of 2x32-bit integers
    • .NET assembly: AssemblyName.Version might be comparable

    Product version

    • Windows installer: a string property (as such it can be found by Orca/SuperOrca within an MSI file)
    • Resource files: PRODUCTVERSION, a statement using the version data type
    • .NET assembly: AssemblyVersion, using AssemblyName.Version

    File version

    • Windows installer: is neither a property nor a data type. It is used as term to combine version string & language string. The windows installer methods Installer.FileVersion and MsiGetFileVersion ...

      [..] return the version string or language string

      No "FileVersion" property exists in the MSI.

    • Resource files: FILEVERSION, a statement using the version data type
    • .NET assembly: AssemblyFileVersionAttribute

    Version number restrictions

    The version data type in Windows installer - despite being a string - has the same limitations as the version data type in resource files ...

    The version consists of two 32-bit integers, defined by four 16-bit integers.

    ... as well as the AssemblyName.Version ...

    Metadata restricts the major, minor, build, and revision components for an assembly to a maximum value of UInt16.MaxValue - 1

    So in case:

    • the program is built using a resource file
    • PRODUCTVERSION or AssemblyVersion are used for the MSI ProductVersion property during the build/deploy process

    the developers has to heed:

    1. The limitations of VERSIONINFO/AssemblyName.Version (unsigned 16bit.16bit.16bit.16bit) and
    2. The limitations of Windows installer for product version (unsigned 8bit.8bit.16bit), while the fourth field doesn't matter:

      If you include a fourth field in your product version, the installer ignores the fourth field.


    So programs used in deploy processes which uses the version number of programs for their MSI setup have to heed the following limitations:

    • PRODUCTVERSION/AssemblyVersion: 8bit.8bit.16bit-1.16bit-1 (unsigned int)
    • FILEVERSION/AssemblyFileVersion: 16bit-1.16bit-1.16bit-1.16bit-1 (unsigned int)

    Please point out weaknesses/faults of those comparisons.

提交回复
热议问题