Version Information Component

   
Release: 3.3
Date: 3 November 2010
Delphi Compatibility:
 D1   D2   D3   D4   D5   D6   D7  D2005 D2006 D2007 D2009 D2010  DXE  DXE2
Red LED Green LED Green LED Green LED Green LED Green LED Green LED Green LED Green LED Green LED Green LED Green LED Green LED Grey LED

Overview

TPJVersionInfo is a non-visual component for all Win32 versions of Delphi and C++Builder that encapsulates the version information contained in an executable file's resources.

The component reads information from a designated file's VERSIONINFO resource. The required file is specified in the component's FileName property. Setting FileName to the empty string fetches version information for the executable containing the component. The boolean HaveInfo property indicates whether the file contains version information. This component can access variable file information for each language provided in the resource.

Run-time properties enable access to to version information. Properties enable:

  • Access to fixed file information, either by field or the whole record.
  • Access to the number of translations stored in the version information.
  • Selection of the translation for which information is to be returned by other properties.
  • Access to the language and code page of the current translation – by code and by name.
  • Access to the string file information for the current translation – named properties access the Microsoft-defined string information, while an array property gives access to any string item by name.

Version numbers are encapsulated in TPJVersionNumber records which, on Delphi 2006 or later, can be directly assigned to a string and can be compared using the normal equality operators. Helper functions are also provided for use with earlier Delphis that can format version numbers as text and can compare them.

The component makes calls to the Windows API. Therefore the version information being read must follow the Microsoft guidelines – be warned that not all software complies!

For detailed information about version information refer to the Win32 SDK.

Documentation

The component is documented in the Version Information Component Wiki.

Users of Delphi version 3 to 7 can also make use of the help file that is included in the download. This help file integrates with the Delphi 3-7 help system.

Demo Programs

The source code for two demo projects is included. The demos are:

  1. VIDemo.dpr is an application that can extract and display version information from any program, provided that the program has valid version information. (Requires Delphi 4 or later).
  2. HelpEgs.dpr implements all the examples from the component help file.

Compatibility

TPJVersionInfo compiles on all Win32 versions and personalities of Delphi. It has been tested with Delphi versions 2, 3, 4, 6, 7 and 2006 (Win32 personality) and Delphi 2010. It is assumed to work correctly with Delphis 5, 2005, 2007, 2009 and XE.

The unit name changed to PJVersionInfo at release 3 – this means that programs using earlier versions will need to be modified (or to have an alias set in Delphi's Project Options) before being recompiled using the new version. Functionally, the component is backward compatible with earlier versions.

Bug Reports and Feature Requests

If you find any bugs or want to suggest a new feature please report them using the Issue Tracker. Please select either the Defect report from user or Feature Request template as appropriate. Be sure to tag any issues as Project-verinfo. If you have created a bug fix or have implemented a new feature please attach a zip file or diff containing your source code.

About Box Component

TPJVersionInfo is required by the About Box Component when compiled under 32 bit versions of Delphi.

About Box Components earlier than v3.2 do not work with the current release of TPJVersionInfo and will need to be updated.