The VERSIONINFO resource

Secondly, the VERSIONINFO resource (resource type 16), which is used to keep information about the version of the EXE, which may be required during its installation or if it is updated.

The version information can be retrieved in various ways using the APIs GetFileVersionInfo, GetFileVersionInfoSize, and VerQueryValue. Also it is the information which appears in the "Version" property sheet when looking at the "Properties" of an Executable file in Windows.

The syntax for this resource is:-

1 VERSIONINFO
[fixed-info statements]
{
 BLOCK "StringFileInfo"
 {
  BLOCK lang-charset
  {
   string-value statements
  }
 }
 BLOCK "VarFileInfo"
 {
  VALUE "Translation" lang/char statements
 }
}

Where, fixed-info statements can be one or more of the following statements with data as in the following examples. The data is used by the Resource Compiler to fill a structure of 13 dwords which is kept in the binary resource file and therefore in the EXE file (the VS_FIXEDFILEINFO structure)

 FILEVERSION 3h,0Ah,0,3Dh
this value needs to be written as four 16-bit values which are in fact recorded as two dwords: in this example the first dword (most significant) is 3000Ah and the second dword (least significant) is 3Dh, producing a version value of 3000A 0000003Dh.
PRODUCTVERSION 6666h,0000h,0000h,7777h
defines a product version of 66660000 00007777h
FILEFLAGSMASK 3Fh
specifies which bits in the next parameter are valid
FILEFLAGS fileflags
which can be one or more of the following flags or values
FILEOS fileos
where fileos specifies the operating system for which the file was designed and can be one of the following values
FILETYPE filetype
where filetype specifies the general type of the file and can be one of the following values
FILESUBTYPE subtype
where subtype specifies more information about the type of file, and if filetype is VFT_DRV can be one of the following values if filetype is VFT_FONT it can be one of the following values if filetype is VFT_VXD this value must be the virtual-device identifier included in the virtual-device control block

The names of the fixed-info statements are fixed and are used by the Resource Compiler to decide where in the VS_FIXEDFILEINFO structure to put the specified value. As you can see, certain values have definite meanings reserved by Microsoft, but there seems to be no reason why you cannot use your own values which may have a special meaning to your application.

lang-charset is a quoted string containing (in numbers) a hex number which gives the language and character set used in the string-value statements which follow. The most common value found here is "040904E4" meaning US English + Windows, multilingual character set

lang/char statements are two 16-bit numbers separated by a comma. The first represents a language and the second a character set supported by the application. If a lang/char statement is included in the VERSIONINFO resource, the system will initialise the "Version" property sheet found when looking at the "Properties" of the executable file, and will include a "Language" key. The most common value found is 0x409,1252 which is US English + Windows, multilingual character set, the latter being given in its decimal value, but 4E4h would do just as well

string-value statements are a series of statements containing two quoted strings with the following syntax:-

"name", "value"

"name"is a string which would be given to the API VerQueryValue in order to retrieve the value

The following strings are looked for by the system when showing the "Version" property sheet: