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
PRODUCTVERSION 6666h,0000h,0000h,7777h
FILEFLAGSMASK 3Fh
FILEFLAGS fileflags
VS_FF_DEBUG (1= the file contains debugging information)
VS_FF_PATCHED (4= the version information has been changed
from original shipping version)
VS_FF_PRERELEASE (2= the file is a development version
only and not commercially available)
VS_FF_PRIVATEBUILD (8= the file was not built using standard
release procedures)
VS_FF_SPECIALBUILD (20h= the file was built using standard
release procedures but is a variation of the standard file of the same
version number)
FILEOS fileos
VOS_UNKNOWN (value zero - unknown)
VOS_DOS (1000h= file designed for DOS)
VOS_NT (4000h= file designed for Windows NT)
VOS__WINDOWS32 (4= file designed for 32 bit Windows)
VOS_NT_WINDOWS32 (40004h= file designed for 32 bit Windows running under Windows NT)
FILETYPE filetype
VFT_UNKNOWN (value zero=unknown)
VFT_APP (1= it’s an application)
VFT_DLL (2= it’s a DLL)
VFT_DRV (3= it’s a device driver)
VFT_FONT (4= it’s a font)
VFT_VXD (5= it’s a virtual device)
VFT_STATIC_LIB (7= it’s a static link library)
FILESUBTYPE subtype
VFT2_UNKNOWN (value zero -unknown)
VFT2_PRINTER (1= it’s a printer driver)
VFT2_KEYBOARD (2= it’s a keyboard driver)
VFT2_LANGUAGE (3= it’s a language driver)
VFT2_DISPLAY (4= it’s a display driver)
VFT2_MOUSE (5= it’s a mouse driver)
VFT2_NETWORK (6= it’s a network driver)
VFT2_SYSTEM (7= it’s a system driver)
VFT2_DRV_INSTALLABLE (8= it’s an installable driver)
VFT2_DRV_SOUND (9= it’s a sound driver)
VFT2_DRV_COMM (0Ah= it’s a communications driver)
VFT2_FONT_RASTER (1= a raster font)
VFT2_FONT_VECTOR (2= a vector font)
VFT2_FONT_TRUETYPE (3= a TrueType font)
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"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:
1 VERSIONINFO
FILEVERSION 2,0,0,0
PRODUCTVERSION 2,0,0,0
FILEFLAGSMASK 0x0000003FL
FILEFLAGS 0x0000000BL
FILEOS 0x00010001L
FILETYPE 0x00000001L
FILESUBTYPE 0x00000000L
{
BLOCK "StringFileInfo"
{
BLOCK "040904E4"
{
VALUE "CompanyName", "MySoftware Company"
VALUE "Contact e-mail", "MySoftware@ether.com"
VALUE "FileDescription","MySoftware.Exe"
VALUE "FileVersion", "3.45"
VALUE "DevelopmentFile","Dev345.asm"
VALUE "LegalCopyright","Copyright\251 2005 Co"
VALUE "Resources made using","GoRC.Exe"
}
}
BLOCK "VarFileInfo"
{
VALUE "Translation", 0x0409,1252
}
}