7.12 Version-Information Resource

A version-information resource contains data that identifies the version, language, and distribution of the application, dynamic-link library, driver, or device containing the resource. Installation programs use the functions in the File Installation library (VER.DLL) to retrieve the version-information resource from a file and to extract the version-information blocks from the resource. (For more information about the File Installation library, see the Microsoft Windows Programmer's Reference, Volume 1.)

A version-information resource consists of one or more information blocks, each with the following form:

WORD    cbBlock;
WORD    cbValue;
char    szKey[];
BYTE    abValue[];

Following are the members in a version-information block:

cbBlock

Specifies the size, in bytes, of the complete block. This value includes the size of nested blocks, if any.

cbValue

Specifies the size, in bytes, of the abValue member.

szKey

Specifies the name of the block. This value is a null-terminated string. Additional zero bytes are appended to the string to align the last byte on a 32-bit boundary.

abValue

Specifies either an array of word values or a null-terminated string. The format of this member depends on the szKey value. Additional zero bytes are appended to align the last byte on a 32-bit boundary.

A block can contain nested blocks. In such cases, the nested block immediately follows the abValue member and the size specified by the cbBlock member in the first block is the sum of the two sizes. If a block contains more than one nested block, the nested blocks are stored sequentially and the cbBlock member in the first block specifies the total size of all blocks.

A version-information resource usually contains the following predefined blocks:

Root

Variable information

String information

Language-specific

In addition, the string and variable information blocks usually contain nested blocks that define the details about the file. This section describes the predefined information blocks.