Version Information Component
ReadMe

Contents

Description

TPJVersionInfo is a 32 bit non-visual component for all Win32 versions of Delphi 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 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:

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.

Limitations

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!

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.

Further information

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

Installation

Important Note: If you are updating from an earlier version of this component and have installed the DelphiDabbler About Box Component (TPJAboutBoxDlg) you may need to uninstall it before updating this component, and re-install the about box component once the update has been installed. If the About Box Component is earlier that v3.2 it will need to be updated to the most recent version.

The Version Information Component is supplied in a zip file. Before installing you need to extract all the files from the zip file. The following files will be extracted:

In addition to the above files you will find the the source code of two demo projects along with readme files in the Demos\1 and Demos\2 sub-directories.

You can now install the component into the Delphi IDE.

For Delphi 3 onwards you must include PJVersionInfo.pas and PJVersionInfo.dcr in a design time package that is installed into the Delphi IDE. If you need help doing this see here.

Note that the help file included in the download can only integrate with the IDE in Delphi 3-7. For information on how to do this, see this article. Users of other versions of Delphi can either use the help file as a stand-alone file (in which case some links won't work) or you can use the component's online documentation.

Demo Projects

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 online documentation and help file.

These demos require Delphi 7 or later.

Note: To load the projects into Delphi 2007 first delete the relevant .dproj file and then load the project from the .bdsproj file.

With some minor changes they will also compile as 64 bit Windows targets using the 64 bit Delphi. (Tested with Delphi XE3). To do this create a 64 bit Windows target, ensure that the compiler can find the component source file (or a 64 bit compiled unit) and disable automatic version information generation.

Update History

A complete change log is provided in a text file that is included in the download.

License

This component is released under the terms of the Mozilla Public License v2.0.

Bugs and Feature Requests

Bugs can be reported or new features requested via the Issue Tracker.

If no similar report or request has been recorded already, use the New Issue link to add a new issue. Please select the Defect Report from User template and be sure to specify the Project-verinfo label.

Feature requests are also made using the Issue Tracker. This time please select the Feature Request template and, again, specify the Project-verinfo label.

About the Author

I'm Peter Johnson – a hobbyist programmer living in Ceredigion in West Wales, UK, writing write mainly in Delphi. My programs and code are available from: http://www.delphidabbler.com/.

I can be contacted via the website.

Please let me know if you have any comments about the component, but please use the Issue Tracker noted above to report bugs and request new features.