Another Good Use Of the Version Resource

David B. Pearce
Program Manager, Anti-Piracy

31 January, 1996

History of Version Resource

The Microsoft Windows® 3.x and Win32® SDKs provide the facility to include a version-information resource with files such as applications, dynamic link libraries, drivers, fonts, and others. The structure of this version resource includes data that identifies the version, language, and distribution of the file. 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.

Until Windows 95 was released, exposing the information stored in this resource was not easy for the casual user. Under Windows 95, when checking a program's Properties, information stored in the version resource appears under the Version tab.

The version tab gets its information from a version resource that can be added to any resource source file. A version resource is also automatically created by the project wizard in VC++. You can either add or edit the VERSIONINFO statement in the resource source file with a text editor or use the graphical editor included with VC++.

The version resource contains among other things information about the file as its version number, its target operating system, and its original filename. The resource is intended to be used with the File Installation library functions. The table below lists some pertinent but not all-inclusive  parameters in the VERSIONINFO statement that can be returned with the GetFileVersionInfo function.

Parameter Description
langID Specifies one of 45 unique language identifiers

Parameter Description
string-name Specifies one of the following predefined names:

Name Value
CompanyName Specifies the company that produced the file—for example, "Microsoft Corporation" or "Standard Microsystems Corporation, Inc.". This string is required.
FileDescription Specifies a file description to be presented to users. This string may be displayed in a list box when the user is choosing files to install—for example, "Keyboard Driver for AT-Style Keyboards" or "Microsoft Word for Windows". This string is required.
FileVersion Specifies the version number of the file—for example, "3.10" or "5.00.RC2". This string is required.
InternalName Specifies the internal name of the file, if one exists—for example, a module name if the file is a dynamic-link library. If the file has no internal name, this string should be the original filename, without extension. This string is required.
LegalCopyright Specifies all copyright notices that apply to the file. This should include the full text of all notices, legal symbols, copyright dates, and so on—for example, "Copyright Microsoft Corp. 1990,1991". This string is optional.
OriginalFilename Specifies the original name of the file, not including a path. This information enables an application to determine if a file has been renamed by a user. The format of the name depends on the file system for which the file was created. This string is required.
ProductName Specifies the name of the product with which the file is distributed—for example, "Microsoft Windows". This string is required.
ProductVersion Specifies the version of the product with which the file is distributed—for example, "3.10" or "5.00.RC2". This string is required.

So, What's The Good Use of This Resource?

I'm glad you asked that question. Many corporations and auditing firms have a need for technology to aid them in tracking software installed on desktop and server PC's. In order to address this gap in technology, Microsoft has developed an engine that scans a hard disk and outputs information about installed software to a comma-delimited text file. We expect to release in Q296 the Microsoft Auditing Resource Kit (ARK). The focus of the Resource Kit is to provide a set of tools and development resources to help perform the data collection and reporting for auditing Windows software.

The key core component of the Resource Kit is SCANVER.EXE. This code accepts user parameters, recursively scans a drive, and reports on the files specified by the user. For files containing information in the Windows API Version Resource, the above information about the product goes into a data file. For files not containing this information, the path and file name is recorded if specified.

The Resource Kit contains this scanning "engine" and it's source code; a "collecting" application and it's source code; a sample VB module for importing collected data into an Access database using DAO; sample spreadsheet and database front ends for reporting on the data collected; and documentation on planning and processing the data. Users of the Resource Kit can perform small to medium audits with the front end software provided in the Resource Kit. Users needing to perform larger or custom audits have the specifications to these reports and the source code for the engine in order to extend the functionality and scope of auditing.

Unlike other auditing tools on the market, the Auditing Resource Kit is not dependent on building and maintaining a database of known software. Instead, it builds a database of information about installed software for each computer inventoried. Just by having a version resource your software will be detected, rather than having to insure that your software is known by the various auditing tools, or the tool vendors having to insure they have all known software in their database.

Moreover, the core audit processing code illustrated in the Resource Kit pulls these database files into a relational database making reporting extremely easy for both small and large auditing tasks. For corporations or consultants with in-house development teams the Resource Kit provides all source code, making customization easy.

OK, So Where Do I Get This Resource Kit?

At this time we plan for the Auditing Resource Kit to be available free of charge from Microsoft, including all electronic sites (WWW, MSN, CompuServe, FTP, and Gopher sites). Since this is not yet a shipping item, the exact location will be posted at a later time.