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.
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!
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.
For detailed information about version information refer to the Windows SDK.
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
– Component palette
glyph.
PJVersionInfo.hlp
– Help file that integrates into the
Delphi 3-7 IDE.
PJVersionInfo.als
– Keyword file required when
integrating the help file with Delphi 6 and 7.
ReadMe.htm
– This read-me file.
ChangeLog.txt
– Change log.
MPL-2.txt
– Mozilla Public License v2.0.
Documentation.URL
– Shortcut to the component's online
documentation.
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.
The source code for two demo projects is included. The demos are:
VIDemo.dpr
is an application that can extract and display
version information from any program (provided that the program has valid
version information).
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.
A complete change log is provided in a text file that is included in the download.
This component is released under the terms of the Mozilla Public License v2.0.
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.
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.