Version Information Component

   
Release: 3.3.2
Date: 11 January 2014
Delphi Compatibility:
D1 D2 D3 D4 D5 D6 D7 D2005 D2006 D2007 D2009 D2010 DXE DXE2 DXE3 DXE4
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 Green LED Green LED Green LED

Overview

TPJVersionInfo is a non-visual component that reads any version information contained in a 32 bit or 64 bit Windows executable file.

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 file 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 when reading version information. Therefore the version information being read must follow the Microsoft guidelines – be warned that not all software complies!

TPJVersionInfo is compatible with all versions of the Delphi 32 bit and 64 bit native Windows compiler. It is not suitable for use with .NET.

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

Documentation

The component is fully documented online.

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.

The help file is a WinHelp file and WinHelp is not installed by default on Windows Vista and later.

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.
  2. HelpEgs.dpr implements all the examples from the component help file.

The demos required Delphi 7 and higher.

Compatibility

TPJVersionInfo compiles on all Win32 versions and personalities of Delphi. Releases up v3.3 have tested with Delphi versions 2, 3, 4, 6, 7, 2006 and 2010 while later releases have been tested on Delphi 7 and 2006 to XE3 and are assumed to work on later versions.

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.

Feedback & Queries

If you find any bugs or want to suggest a new feature please report them using the Issue Tracker.

Click the Create Ticket button to create a ticket then complete the form giving as much information as possible. Please note: this issue tracker is shared among all the projects in the DelphiDabbler Code Library, so please make sure you enter verinfo in the Project edit box. You should also choose Defect in the Type drop down list to report a bug or Enhancement to request a new feature.

If you have created a bug fix or have implemented a new feature please attach a zip file to your ticket that contains your source code.

Should you have any queries about using the components please read the documentation.

If you can't find an answer in the documentation then post a message in the discussion group.

Please do not email me or use the contact page to report bugs, ask for new features or to find out how to use the component.
I'm afraid I have very limited time available to support the code library, and can't guarantee I'll find time for personalised advice.

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.