In windows xp, whenever we right click on an executable file, we can see a Version info tab.

Tab displays additional information of the executable

Tab displays additional information of the executable

To include this information in our application, we need to create a VERSIONINFO resource in our application. This would generally be in your .rc file.

For example the resource file for the above executable is as follows.

#DEFINE VER_FILEVERSION          1,0,0,0
#DEFINE VER_FILEVERSION_STR      "1.0"
#DEFINE VER_PRODUCTVERSION       1,0,0,0
#DEFINE VER_PRODUCTVERSION_STR   "1.0"

VS_VERSION_INFO        VERSIONINFO
FILEVERSION            VER_FILEVERSION
PRODUCTVERSION         VER_PRODUCTVERSION
FILEOS                 VOS_NT_WINDOWS32
FILETYPE               VFT_APP
FILESUBTYPE            VFT2_UNKNOWN
BEGIN
     BLOCK "StringFileInfo"
     BEGIN
         BLOCK "040904E4"
         BEGIN
             VALUE "CompanyName"          "Testing Times"
             VALUE "FileDescription"      "Testing My Version Info"
             VALUE "LegalCopyright"       "Copyright 2009 (c) PJ. All rights reserved."
             VALUE "ProductName"          "Test Ahoy!!"
             VALUE "ProductVersion"       VER_PRODUCTVERSION_STR
             VALUE "FileVersion"          VER_FILEVERSION_STR
         END
     END
END

We can also define custom parameters in the StringFileInfo block, such asĀ  support information, contact information etc.

The msdn article on VERSIONINFO is quiet detailed, so I am just going to point to it for further reference.

VERSIONINFO – Click here to goto to MSDN.

Advertisements