Skip to content

Customizing the Driver Version Information

The version information compiled into an IVI-C driver DLL, such as its file version, product name, company, and copyright, is generated by Nimbus from the settings on the General page of the driver settings. Nimbus writes these values to a header file (Version.h), and the code generation for this file is governed by the contents of a Nimbus text template (Version.h.ntt) file included in the IVI-C driver project, in the same way as the driver header file. Driver developers can edit the text template to take some or all of the version information from elsewhere.

The text template (Version.h.ntt) file appears in the driver project with the generated header file (Version.h) appearing as a dependency. The version resource itself is defined in Version.rc2, which includes Version.h and builds the version resource from the macros it defines.

The template defines one macro for each value in the version resource. The file macros describe the driver DLL itself, and the product macros describe the product the driver DLL belongs to.

MacroVersion resource fieldDefault value
VER_FILEVERSIONFILEVERSIONDriver version, as major,minor,build,revision
VER_FILEVERSION_STRFileVersionDriver version, as "major, minor, build, revision"
VER_FILEDESCRIPTION_STRFileDescriptionDriver name followed by “Module”
VER_COMMENTS_STRCommentsDescription
VER_INTERNALNAME_STRInternalNameDriver name
VER_ORIGINALFILENAME_STROriginalFilenameFile name of the 32-bit or 64-bit driver DLL
VER_PRODUCTNAME_STRProductNameDriver name followed by “Module”
VER_PRODUCTVERSIONPRODUCTVERSIONDriver version, as major,minor,build,revision
VER_PRODUCTVERSION_STRProductVersionDriver version, as "major, minor, build, revision"
VER_COMPANYNAME_STRCompanyNameDriver vendor
VER_LEGALCOPYRIGHT_STRLegalCopyrightCopyright

The auto-generated values are represented by replacement tags that are delineated by percent signs (%). For instance, the following excerpt from the template file shows the product macros.

/****************************************************************************
*------------------------ Product Version Defines -------------------------*
****************************************************************************/
#define VER_PRODUCTNAME_STR "%DriverName% Module\0"
#define VER_PRODUCTVERSION %VersionMajor%,%VersionMinor%,%VersionBuild%,%VersionRevision%
#define VER_PRODUCTVERSION_STR "%VersionMajor%, %VersionMinor%, %VersionBuild%, %VersionRevision%\0"
#define VER_COMPANYNAME_STR "%Company%\0"
#define VER_LEGALCOPYRIGHT_STR "%Copyright%\0"

The following replacement tags are available in the template.

Replacement tagValue
%DriverName%Driver name
%Description%Description
%Company%Driver vendor
%Copyright%Copyright
%VersionMajor%, %VersionMinor%, %VersionBuild%, %VersionRevision%The parts of the driver version
%FileName32%, %FileName64%File names of the 32-bit and 64-bit driver DLLs
%PrefixUpper%Driver prefix, in uppercase

At build time, these tags are replaced by Nimbus code generation with the appropriate values. Every macro that Version.rc2 uses must remain defined, whether by the template itself or by a file it includes.

Example Customization: Taking the product information from a shared header

Section titled “Example Customization: Taking the product information from a shared header”

A driver is often one component of a larger product that has its own name and release schedule. In that case the file version can continue to track the driver, while the product name and version reported by the driver DLL come from the larger product. In the excerpt below, the product macros in the text template are replaced by an include of a header file that is shared by every component of the product.

/****************************************************************************
*------------------------ Product Version Defines -------------------------*
****************************************************************************/
#include "ProductVersion.h"
#endif // __%PrefixUpper%_VERSION_HEADER

The shared header file defines the same five product macros.

#define VER_PRODUCTNAME_STR "Acme Digital Instrument Suite\0"
#define VER_PRODUCTVERSION 4,2,468,0
#define VER_PRODUCTVERSION_STR "4, 2, 468, 0\0"
#define VER_COMPANYNAME_STR "Acme Instruments, Inc.\0"
#define VER_LEGALCOPYRIGHT_STR "Copyright 2015-2026 Acme Instruments, Inc.\0"

When the build runs, the driver DLL reports its own file version from the driver settings, and the product name, product version, company, and copyright of the larger product.