TPJVersionInfo Component


Contents


Description

This is a 16 bit non-visual component for Delphi 1 that encapsulates file version resource information contained in a file.

The component reads information from the file's VERSIONINFO resource. If the file has no such resource then this component returns no information. Use the HaveInfo property to find whether the component has been able to get version information from the file.

The file from which resource information is gleaned is determined by the FileName property. Setting the file name property to the empty string makes the component read information from the executable file in which it embedded. Apart from the usual Name and Tag properties the FileName property is the only design-time property of the component. Other properties are available at run time only and are read only. They present the information from the VERSIONINFO resource to the user. See the help file for further information.

The component introduces no new methods and it has no events.

Limitations

VERSIONINFO resources can contain more than one set of string resource information (in StringFileInfo blocks) - usually used to present the information in various languages. This component only reads the information for the first language/character set described in the first VarFileInfo block.

This version of the component makes calls to the 16 bit Windows API. It is not suitable for compilation using the 32 bit Delphi compilers.

Further information

For detailed information about file version information see the 16 bit Windows API help topics Version-Information Resource and VERSIONINFO.


Compatibility

This version of the component works only with Delphi 1. Other versions of the component are available for later versions of the compiler.


Installation

In these instructions $(DELPHI) is to be taken to represent the path where Delphi was installed. For example, if you have Delphi 1 installed on the path C:\Borland\Delphi then $(DELPHI) represents that path.

  1. Unzip the file vinfo16.zip into a folder, preserving the directory structure.
  2. Copy the files verinfo.pas and verinfo.dcr to the folder from where you wish to install the component into the Delphi Component Palette. This will probably be an existing folder where you keep the library components - say the default $(DELPHI)\lib folder.
  3. Copy the help file verinfo.hlp into the $(DELPHI)\bin folder.
  4. Copy the help keyword file verinfo.kwf into the $(DELPHI)\help folder.
  5. Ensure Delphi is not running. Merge the help keyword file by running helpinst.exe from the $(DELPHI)\help folder. When helpinst.exe is running open the delphi.hdx file and add verinfo.kwf and click on the Save button.
  6. Start Delphi. Select the Options | Install Components menu option. Click the Add button, then the Browse button and navigate to the verinfo.pas file in the directory where you placed it. Click OK to recompile the components library. You can now delete verinfo.pas from the placed where you copied it if you wish.
  7. The component will appear on a palette called PJ Stuff. You can move the component to a different palette as required, or hack the source code (before installation) by finding the Register procedure at the end of the code and changing the string 'PJ stuff' to the name of the required palette.


Known Issues

Under Win 95/8 it is possible that the first time you try to access the help file by selecting the component on a form and pressing F1 (or from a property in the object inspector) the help file may not be found. In this case find the help file manually (in the $(DELPHI)\bin folder). The location of the help file will be remembered in future.


Update History

Un-released
VerInfo v1.0 of 25/04/1998

Release 1.0 of 08/07/1999
VerInfo v1.0a of 09/04/1999
(This release also included Release 2.0 of 32 bit VerInfo v2.0a - see vinfo32.htm for details).

Release 1.0.1 of 28/11/1999
VerInfo v1.0a of 27/11/1999
(Separated 16 bit and 32 bits versions into separate releases).


License & Disclaimer

This component is copyright © P.D.Johnson, 1998-1999.

The source code and help files can be freely distributed on a not-for-profit basis providing that:

  1. the source code is not altered.
  2. this readme file is distributed with it unchanged

By not-for-profit I mean that you may recover out of pocket expenses incurred in distributing the code, but should not make a profit from this.

If you discover any bugs in this implementation, or if you have any update suggestions, please contact me on peter.johnson@openlink.org.

Please do modify the code for you own use. I'd like to see any changes you make - I could incorporate them into future versions. Please notify me of changes on at the above e-mail address.

This software is provided as is - no warranty is given as to its suitability for any purposes to which you may wish to put it.


About the Author

I'm Peter Johnson - a hobbyist programmer living in Ceredigion in West Wales, UK. I write mainly in Delphi, but occasionally dabble in C, C++ and Java. My programs are available for download on my web-site: http://homepages.tesco.net/~p.d.johnson/.

I can be contacted by e-mail on peter.johnson@openlink.org.