Subversion Repositories spacemission


Go to most recent revision | Blame | Last modification | View Log | RSS feed

  2. <HTML>
  4. <HEAD>
  5.   <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
  6.   <TITLE>PJSoft Info Sheet: TPJVersionInfo Component (32 bit)</TITLE>
  7.   <BASE target="_blank">
  8. </HEAD>
  10. <BODY>
  11. <h1>TPJVersionInfo Component (32 bit)</h1>
  12. <p></P>
  14. <P>
  15. <HR noshade>
  16. <p></P>
  18. <H2>Contents</H2>
  20. <UL>
  21.   <LI><A HREF="#Description" target="_self">Description</A>
  22.   <LI><A HREF="#Compatibility" target="_self">Compatibility</A>
  23.   <LI><A HREF="#Installation" target="_self">Installation</A>
  24.   <LI><A HREF="#Issues" target="_self">Known Issues</A>
  25.   <LI><A HREF="#Update" target="_self">Update History</A>
  26.   <LI><A HREF="#License" target="_self">License and Disclaimer</A>
  27.   <LI><A HREF="#Author" target="_self">About the Author</A>
  28. </UL>
  30. <P>
  31. <HR noshade>
  32. <p></P>
  34. <H2><A NAME="Description"></A>Description</H2>
  36. <P>This is a 32 bit non-visual component for Delphi 2 to 6 that encapsulates file
  37.   version resource information contained in a file.</P>
  39. <P>The component reads information from the file's VERSIONINFO resource. If the
  40.  file has no such resource then this component returns no information. The HaveInfo
  41.  property informs whether the component has been able to get version information
  42.  from the file. The 32 bit version of TPJVersionInfo can access variable file
  43.  information for each language provided in the resource.</P>
  45. <P>The file from which resource information is gleaned is determined by the FileName
  46.  property. Setting the file name property to the empty string makes the component
  47.  read information from the executable file in which it embedded. Apart from the
  48.  usual Name and Tag properties the FileName property is the only design-time
  49.  property of the component. With the exception of the property that selects the
  50.  language for which variable file information is to be returned, all other properties
  51.  are read only. These properties present the information from the VERSIONINFO
  52.  resource to the user. See the help file for further information.</P>
  53. <P>The component introduces no new methods and it has no events.</P>
  55. <H3>Limitations</H3>
  57. <P>This version of the component makes calls to the 32 bit Windows API. It is
  58.  not suitable for compilation using the 16 bit Delphi 1 compiler.</P>
  60. <H3>Further information</H3>
  62. <P>For detailed information about file version information refer to the Win32
  63.  SDK.</P>
  65. <P>
  66. <HR noshade>
  67. <p></P>
  69. <H2><A NAME="Compatibility"></A>Compatibility</H2>
  71. <P>This version of the component works only with 32 bit versions of Delphi. It
  72.  has been tested with Delphi versions 2, 3, 4 and 6. It is assumed to work correctly
  73.  with Delphi 5. A separate version of the component is available for 16 bit Delphi
  74.  1.</P>
  76. <P>The unit name has changed to <code>PJVersionInfo</code> in this release of
  77.  the code - this means that programs using earlier versions will need to be modified
  78.  (or to have an alias set in Delphi's Project Options) before being recompiled
  79.   using the new version.</P>
  80. <P>This component is backward compatible with previous 32 bit releases. In previous
  81.   releases the help file was designed for integration with the Delphi 2 IDE but
  82.   was not compatible with the OpenHelp system used from Delphi 3 onwards. From
  83.   this release the help file has been updated to integrate with the Delphi 3 and
  84.   later IDE. It is no longer compatible with the Delphi 2 IDE, although can be
  85.   used separately.</P>
  87. <P>
  88. <HR noshade>
  89. <p></P>
  91. <H2><A NAME="Installation"></A>Installation</H2>
  93. <P>In these instructions <CODE><STRONG>$(DELPHI)</STRONG></CODE> is to be taken to represent the path where your 32 bit version of Delphi was installed. For example, if you have Delphi 4 installed on the path <CODE>C:\Program&nbsp;Files\Borland\Delphi4</CODE> then <CODE>$(DELPHI)</CODE> represents that path.</P>
  95. <H3>Installation with Delphi 2</H3>
  97. <p>Note that although the provided help file gives information about using the
  98.   component it cannot be linked into the Delphi 2 environment.</p>
  99. <OL>
  100.   <LI>Unzip the component's <code>.zip</code> file into a folder, preserving the
  101.    directory structure.
  102.  <li>Copy the files <CODE>PJVersionInfo.pas</CODE> and <CODE>PJVersionInfo.dcr</CODE>
  103.    to the folder from where you wish to install the component into the Delphi
  104.    Component Palette. This will probably be an existing folder where you keep
  105.    the library components - say the default <CODE>$(DELPHI)\lib</CODE> folder.
  106.  </li>
  107.  <li>Start Delphi. Select the <EM>Options | Install Components</EM> menu option.
  108.    Click the <EM>Add</EM> button, then the <EM>Browse</EM> button and navigate
  109.    to the <CODE>PJVersionInfo.pas</CODE> file in the folder where you placed
  110.    it. Click <EM>OK</EM> to recompile the components library. </li>
  111.  <LI>You can now delete <code>PJVersionInfo.pas</code> from the place where you
  112.    copied it if you wish. The component will appear on a palette called <EM>PJ
  113.    Stuff</EM>. You can move the component to a different palette as required,
  114.    or hack the source code (before installing the component) by finding the <CODE>Register</CODE>
  115.    procedure at the end of the code and changing the string <CODE>'PJ stuff'</CODE>
  116.    to the name of the required palette.
  117. </OL>
  119. <H3>Installation with Delphi 3 and later</H3>
  121. <OL>
  122.  <LI>Unzip the component's <code>.zip</code> file into a folder, preserving the
  123.     directory structure.
  124.   <li>Copy the files <CODE>PJVersionInfo.pas</CODE> and <CODE>PJVersionInfo.dcr</CODE>
  125.     to the folder from where you wish to install the component into the Delphi
  126.     Component Palette. This will probably be a sub-folder of the <CODE>$(DELPHI)\lib</CODE>
  127.     folder. </li>
  128.   <LI>Install the component into the palette by choosing the <EM>Component | Install
  129.     Component</EM> menu option. The following instructions assume you are installing
  130.     into the default "users components" package:
  131.     <UL>
  132.       <LI>Select the "Into existing package" page of the <EM>Install Components</EM>
  133.         dialogue box.
  134.       <LI>Browse to the folder where you saved <CODE>PJVersionInfo.pas</CODE>
  135.         and select the file.
  136.       <LI>Ensure that the "Package file name" edit box contains <CODE>$(DELPHI)\lib\dclusrX0.dpk</CODE>
  137.         (where X is the version number of Delphi).
  138.       <LI>Accept that the package will be rebuilt.
  139.       <LI>A dialogue box should be displayed saying that <em>TPJVersionInfo</em>
  140.         has been added to the component palette.
  141.     </UL>
  142.   <LI>You can now delete <CODE>PJVersionInfo.pas</CODE> from the place where you
  143.     copied it if you wish. The component will appear on a palette called <EM>PJ
  144.     Stuff</EM>. You can move the component to a different palette as required,
  145.     or hack the source code (before installing the program) by finding the <CODE>Register</CODE>
  146.     procedure at the end of the code and changing the string <CODE>'PJ stuff'</CODE>
  147.     to the name of the required palette.
  148.   <li>The simplest way to install the help file is to use the <em>PJSoft Component
  149.     Help Installer Expert,</em> available from my website. To install manually,
  150.     proceed as follows (replace X is your version of Delphi): </li>
  151.   <ul>
  152.     <li>Copy <code>PJVersionInfo.hlp</code> to whichever folder you wish to install
  153.       it to. </li>
  154.     <li>Create a text file named <code>PJVersionInfo.cfg</code> in your Delphi
  155.       Help folder. Enter the following two lines:<code><br>
  156.       &nbsp;&nbsp;&nbsp;:Index PJSoft Version Info Component=PJVersionInfo.hlp<br>
  157.       &nbsp;&nbsp;&nbsp;:Link PJVersionInfo.hlp</code><br>
  158.     </li>
  159.     <li>Edit the <code>DelphiX.cnt</code> file (where is is your Delphi version)
  160.       and add the line:<br>
  161.       <code>&nbsp;&nbsp;&nbsp;:Include PJVersionInfo.cfg </code></li>
  162.     <li>Using RegEdit open the key <code>HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Help</code>
  163.       and add a new string value named <code>PJVersionInfo.hlp</code> whose value
  164.       is the path where you copied the help file (probably <code>($DELPHI)\Help</code>).
  165.     </li>
  166.   </ul>
  167. </OL>
  168. <P>
  169. <HR noshade>
  170. <p></P>
  172. <H2><A NAME="Issues"></A>Known Issues</H2>
  174. <UL>
  175.   <LI>None known.
  176. </UL>
  178. <P>
  179. <HR noshade>
  180. <p></P>
  182. <H2><A NAME="Update"></A>Update History</H2>
  184. <P><STRONG>Unreleased</STRONG><BR>
  185.   <EM>VerInfo v1.0 of 26/04/1998</EM></P>
  186. <UL>
  187.   <LI>Original version - 16 bit only.
  188. </UL>
  190. <P><STRONG>Unreleased</STRONG><BR>
  191.   <EM>VerInfo v2.0 of 06/12/1998</EM></P>
  192. <UL>
  193.   <LI>Revised for use with Win32. Not compatible with v1.0 which continued to
  194.     be used with 16 bit Delphi (see <CODE>vinfo16.htm</CODE> for continued update
  195.     history of v1).
  196. </UL>
  198. <P><STRONG>Release 2.0.1 of 08/07/1999</STRONG><BR>
  199.   <EM>VerInfo v2.0.1 of 09/04/1999</EM> <BR>
  200.   (This release also included Release 1.0 of 16 bit VerInfo v1.0.1 - see <CODE>vinfo16.htm</CODE> for details).</P>
  201. <UL>
  202.   <LI>Changed palette where component installs to "PJ Stuff" from "Own".
  203.   <LI>Added HTML documentation (shared documentation with Release 1.0.1).
  204. </UL>
  206. <P><STRONG>Release 2.1 of 28/11/1999</STRONG><BR><EM>VInfo v2.1 of 28/11/1999</EM>
  207. <BR>(Separated 16 bit and 32 bits versions into separate releases).</P>
  208. <UL>
  209.   <LI>Changed unit name from VerInfo to VInfo to allow component to install under Delphi 3 &amp; 4
  210.   (VerInfo clashes with an existing unit in these versions).
  211.   <LI>Removed superfluous conditional compilation directives.
  212.   <LI>Updated HTML documentation to separate 16 bit from 32 bit version, to to include
  213.   installation notes for Delphi 3/4 and to include update history.
  214. </UL>
  216. <P><strong>Release 3.0 of 17/02/2002</strong><br>
  217.   <em>PJVersionInfo v3.0 of 17/02/2002</em>
  218. <ul>
  219.   <li>Added ability to access all "translations" stored in a file's version information,
  220.    rather than just first one. This has been done so that code using earlier
  221.    versions of this component should continue to work unchanged.
  222.  <li>Added new property to expose fixed file information record.
  223.  <li>Added new "string array" property to give access to string information by
  224.    name: this property can access any custom string information if the name is
  225.    known.
  226.  <li>Added properties to return number of "translations" and to select index
  227.    of "translation" to be used.
  228.  <li>Added properties to return language and character set codes in addition
  229.    to descriptive strings.
  230.  <li>All string info, language and character set properties now return values
  231.    from the currently selected translation (which defaults to the first translation
  232.    maintaining backward compatibilty).
  233.  <li>Empty FileName property now accesses name of host application per command
  234.    line rather than using Application.ExeName.
  235.  <li>CharSet property now returns '' for unknown value rather than 'Unknown'.
  236.  <li>Renamed TVersionNumber record to TPJVersionNumber.
  237.  <li>Replaced Tvs_FixedFileInfo record with use of Windows unit defined type
  238.    TVSFixedFileInfo
  239.  <li>Renamed unit to PJVersionInfo.
  240.  <li>Changed component palette from PJ Stuff to PJSoft.
  241. </ul>
  242. <p>
  243. <P>
  244. <HR noshade>
  245. <p></P>
  247. <H2><A NAME="License"></A>License &amp; Disclaimer</H2>
  249. <P>This component is copyright &copy; P.D.Johnson, 1998-2002.</P>
  251. <P>The source code and help files can be freely distributed on a not-for-profit basis providing that:</P>
  253. <OL>
  254.  <LI>the source code is not altered.
  255.  <LI>this readme file is distributed with it unchanged
  256. </OL>
  258. <P>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.</P>
  260. <P>If you discover any bugs in this implementation, or if you have any update suggestions, please contact me on <A HREF=""></A>.</P>
  262. <P>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.</P>
  264. <P>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.</P>
  266. <P>
  267. <HR noshade>
  268. <p></P>
  270. <H2><A NAME="Author"></A>About the Author</H2>
  272. <P>I'm Peter Johnson - a hobbyist programmer living in Ceredigion in West Wales,
  273.  UK, writing mainly in Delphi. My programs are available for download on my
  274.  website: <a href=""></a>.</P>
  276. <P>I can be contacted by e-mail on <A HREF=""></A>.
  278. </BODY>
  280. </HTML>