Skip over navigation

Welcome to the all new DelphiDabbler website.

I hope you like it.

There are going to be bugs. Please report any you find on the website's issues page (GitHub account required). Thanks.

Click the close button and you won't see this message again.

Version Information Component

Component to read a program's version information.

Version 3.3.2
Released 11 Jan 2014
Platforms Win32 & Win64
Framework VCL & FMX
Compatibilty Delphi 2 and later

Overview

TPJVersionInfo is a non-visual component that reads 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 the version information of 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 the 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 that can compare and format version numbers as text are provided for use with Delphi 2005 and earlier.

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!

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

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.

Get The Code

You can download the latest version of the Version Information Component directly from SourceForge as dd-verinfo-3.3.2.zip.

Download v3.3.2

Version Information Component is a sub-project of the DDabLib project which is maintained in a Subversion repository. The code is developed in the trunk/projects/verinfo branch.

Subversion users can check out the source code of the current release from the repository on SourceForge by doing:

svn checkout http://svn.code.sf.net/p/ddablib/code/tags/projects/verinfo/release-3.3.2 codedir

where codedir is the directory where you want to checkout code. To check out other versions, simply specify a different version number.

The latest development tree can be checked out using:

 svn checkout http://svn.code.sf.net/p/ddablib/code/trunk/projects/verinfo codedir

Check outs are read only, but you can easily contribute code: see Feedback & Queries below.

Installation

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:

  • PJVersionInfo.pas – component source code.
  • PJVersionInfo.dcr – resource file containing the component palette glyph.
  • ReadMe.htm – read-me file.
  • ChangeLog.txt – the project's change log.
  • MPL-2.txt – the Mozilla Public License v2.0.
  • Documentation.URL – short-cut to the component's online documentation.
  • PJVersionInfo.hlp – component help file that integrates with the Delphi 4 to 7 OpenHelp system. Deprecated
  • PJVersionInfo.als – a-link keyword file for integration with the Delphi 6 or 7 OpenHelp system. Deprecated

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

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.

Documentation

The Version Information Component is comprehensively documented online here

The project's change log can be viewed on SourceForge

A read-me file (ReadMe.htm) is included in the project download.

A legacy WinHelp help file is included in the download that can only be integrated with the IDE in Delphi 7 and earlier. This article explains how to do it.

This help file is deprecated and is no longer being updated. It will be removed from any future release.

WinHelp is an optional download for Windows Vista through to Windows 8.1 and can't be installed at all on Windows 10.

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.

The 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 to make it clear which project you are referring to. 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 component please read the documentation. If you can't find an answer in the documentation then post a message in the discussion group

License

The Version Information Component is open source. It is copyright © 1998-2014 by Peter Johnson. The source code is made available under the terms of the Mozilla Public License v2.0. All relevant trademarks are acknowledged.