home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 September / Chip_2001-09_cd1.bin / zkuste / delphi / kolekce / d123456 / DFS.ZIP / VersInfo.txt < prev    next >
Text File  |  2001-06-28  |  17KB  |  286 lines

  1. TdfsVersionInfoResource v2.36
  2.  
  3. Description:
  4.   A component to read version info resources.  It is intended for Delphi 3,
  5.   but should work with any file that contains a properly formatted resource.
  6.  
  7.  
  8. Contact Information:
  9.   The lateset version will always be available on the web at:
  10.     http://www.delphifreestuff.com
  11.   If you have any questions, comments or suggestions, please use the Delphi
  12.   Free Stuff Support Forum at: 
  13.     http://www.delphifreestuff.com/discus/
  14.   If, for some reason, you can not use the web-based support forum, you can
  15.   email me at bstowers@delphifreestuff.com.  However, the support forum will
  16.   always take precedence over direct email since it provides a resource that
  17.   others can use when they have a problem.  Every message posted to the forum
  18.   is emailed directly to this account, so emailing me directly will not get 
  19.   your message to me any faster.  It will only make the message less important
  20.   for me to respond to since only one person (you) is benefiting from it
  21.   instead of everyone interested.  Having said all that, please do email me 
  22.   directly if it is regarding something that isn't really support related, 
  23.   i.e. just to say thanks (as novel as that idea is).  
  24.  
  25.  
  26. Installation:
  27.   Delphi 1:
  28.     * Select the 'Options | Install Components' menu item.
  29.     * In the Install Components dialog, click the Add button.
  30.     * In the Add Module dialog, enter the full path name of the component's 
  31.       registration unit (the unit that ends with 'Reg.pas', i.e. 
  32.       'BrowseDrReg.pas') and click OK.
  33.     * In the Add Module dialog, click OK.
  34.     * The component library will be rebuilt and a new tab named 'DFS' will
  35.       be available on the Component Palette.
  36.   
  37.   Delphi 2, C++Builder 1:
  38.     * Select the 'Component | Install' menu item.
  39.     * In the Install Components dialog, click the Add button.
  40.     * In the Add Module dialog, enter the full path name of the component's 
  41.       registration unit (the unit that ends with 'Reg.pas', i.e. 
  42.       'BrowseDrReg.pas') and click OK.
  43.     * In the Add Module dialog, click OK.
  44.     * The component library will be rebuilt and a new tab named 'DFS' will be 
  45.       available on the Component Palette.
  46.   
  47.   Delphi 3, 4, 5, C++Builder 3 & 4:
  48.     * Do one of the following:
  49.       + Create a new package by selecting File | New and choosing Package from
  50.         the New tab in the dialog.
  51.       + Open an existing package file.  I suggest you do this if you already
  52.         have a package that you like to use for small, third party components.
  53.         I specifically have a package named "3rdParty.dpk" that I use for 
  54.         small components that come from other people.  Or, if you are using
  55.         several of my components, you might create a "DFS.dpk" package and 
  56.         use it for all of my DFS components.
  57.     * In the resulting package window, click the Add button.
  58.     * In the Add dialog, on the Add Unit tab, enter the full path name of the 
  59.       component's registration unit (the unit that ends with 'Reg.pas', i.e. 
  60.       'BrowseDrReg.pas') and click OK.
  61.     * You may want to add the other source files (*.pas) to the package as 
  62.       well in the same manner as you did the registration unit.  While this is
  63.       not required, not doing it will cause compiler warnings when the package
  64.       is compiled.  The component will function fine either way, but I 
  65.       personally find the warnings very irritating and am not happy until 
  66.       every compiler warning and hint is gone.
  67.     * If this package is new, or it has never been installed, click the 
  68.       Install button in the package window.  If this package is already 
  69.       installed in Delphi, click the Compile button.
  70.  
  71.   C++Builder 5 and up:
  72.     * Perform the "Delphi 3 and up, C++Builder 3 and up" steps above, except
  73.       for the last step (Compile or Install).
  74.     * Select the package the component has been added to, and choose 
  75.       Project | Edit Option Source to open the package options in the editor.
  76.     * In the entry for PFLAGS, add the "-LUvcl50" option.  For example:
  77.         <PFLAGS value="-$YD -$W -$O -v -JPHNE -M -LUvcl50"/>
  78.     * Perform the final step from above, Compile or Install.
  79.     * For Borland's official word on this situation, open the C++Builder help
  80.       file and search the index for "dsgnintf.dcu" and see the "Compiling
  81.       packages with DsgnIntf" section.
  82.  
  83.   Delphi 6 and up:
  84.     * Perform the "Delphi 3, 4, 5, C++Builder 3 & 4" steps above, except
  85.       for the last step (Compile or Install).
  86.     * Add the DesignIDE package to the Requires list of the package into which
  87.       the component is being installed.
  88.     * Perform the final step from above, Compile or Install.
  89.     * This is necessary because of changes to the design-time support units
  90.       introduced in Delphi 6.  For complete information, see the Del6New.hlp
  91.       file in your Delphi 6 Help directory.  In the index, search for
  92.       "upgrade issues" and in the resulting list of topics, select the
  93.       "DsgnIntf renamed and related changes" topic.
  94.  
  95.  
  96. Notes:
  97.   * You can now compile TdfsVersionInfoResource as a non-component class. I had the
  98.     need for using version info in an app that was needed to remain very small
  99.     in size, but as it was, many of the Delphi units were being used by this
  100.     component that bloated the compiled size horribly. The worst offenders were
  101.     the Forms and DsgnIntf units.  So, I added a DFS_VERSION_INFO_AS_CLASS
  102.     conditional directive that will cause TdfsVersionInfoResource as a descendant
  103.     of TObject instead of TComponent.  This means that you lose the ability to
  104.     drop it on a form and fool with it at design time, but it also means you
  105.     will cut 150k to 200k from the compiled size of your app.  Now, you won't
  106.     get this savings if you are already using those VCL units in your app.  In
  107.     practice, this is really only useful for console apps since any "normal"
  108.     delphi app uses these core units anyway.  Also, it could be useful for
  109.     DLLs since they may not need those units.  The biggest problem you are
  110.     likely to run into using this directive is switching between projects that
  111.     use the different versions.  You will need to make sure you do a full build
  112.     of the project, otherwise you will get nasty errors since it could link the
  113.     component version DCU into your app that uses the TObject version, and vice
  114.     versa.  I can not stress this enough:  If you use this conditional define,
  115.     REBUILD YOUR PROJECT IMMEDIATELY when switching between projects that use
  116.     different versions.
  117.   * I have not tested this on anything but Delphi 3, 4 and C++Builder 3
  118.     generated EXEs with proper version info resources, and on Triplex generated
  119.     16-bit version info resources in a Delphi 1 EXE.
  120.   * The CreationDate property is faked under Delphi 1.  If anyone has a
  121.     function, or even pseudo-code, for converting the dwFileDateLS and MS
  122.     variables into TDateTime format, please send it to me.  For now, I just
  123.     get the date/time stamp of the file containing the ver info resource.
  124.  
  125. Known Issues:
  126.   * Using the version information built with Delphi 3 or C++Builder 3 and above
  127.     IDEs, (Project | Options | VersionInfo tab) will cause your ProductVersion
  128.     to always match your FileVersion.  Here is what I've found:
  129.  
  130.     It seems to me that this is a bug in the way Delphi builds the version
  131.     information resource.  Here is what Delphi 3 builds in the project's .RES
  132.     file:
  133.  
  134. 1 VERSIONINFO LOADONCALL MOVEABLE DISCARDABLE IMPURE
  135. FILEVERSION 2, 1, 5, 3
  136. PRODUCTVERSION 2, 1, 5, 3
  137. [..snip...]
  138. {
  139.  BLOCK "StringFileInfo"
  140.  {
  141.   BLOCK "040904E4"
  142.   {
  143.    [..snip...]
  144.    VALUE "FileVersion", "2.1.5.3\000\000\000\000\000R\203\003\000"
  145.    VALUE "ProductVersion", "1.0.0.0\000\000\000\000\000R\203\003\000"
  146.   }
  147.  
  148.  }
  149. }
  150.  
  151.  
  152.     Note in the "StringFileInfo" section, ProductVersion is 1.0.0.0.  But,
  153.     notice in the fixed information (at the top), PRODUCTVERSION is 2, 1, 5, 3.
  154.     It looks like everything you put into the version info grid in the IDE ends
  155.     up in the StringFileInfo section.  I'm pulling version numbers from the
  156.     fixed information, and it looks like the Delphi IDE just copies whatever
  157.     you assign to the FileVersion over to the ProductVersion for that.
  158.  
  159.     You've got a few options to deal with this:  1) don't use the IDE generated
  160.     version info, build your own with a resource editor and use {$R xxx.res}
  161.     to compile it into your app, or 2) pull the product version from the string
  162.     info like this:
  163.  
  164.       Info.Lines.Add('ProductVersion = ' + VersionInfo.ProductVersion.AsString);
  165.  
  166.     I've set up the AsString property to work such that it reads the version
  167.     from the StringFileInfo section (if it's there) rather than just building it
  168.     from the fixed information numbers.  That means that the numbers in
  169.     ProductVersion may be completely different than the AsString numbers in it.
  170.     That is, using the above example, if you read the numbers from
  171.     ProductVersion you would get 2.1.5.3, but if you used
  172.     ProductVersion.AsString you would get 1.0.0.0.
  173.  
  174.  
  175. Revision History:
  176. 2.36:  + Fixed a problem that occurred with some oddball version info resources.
  177.          Notably, Borland's Resource Workshop WORKSHOP.EXE file was unreadable
  178.          to the component (it crashed it even, I think).  I finally figured out
  179.          what they were doing that was goofy and it now gets along fine with it.
  180.        + Updated for Delphi 6 compatibility.  See updated install directions
  181.          above.
  182. 2.35:  + Updated for C++Builder 5 compatibility.
  183. 2.34:  + Changing the Filename property wouldn't cause controls to be
  184.          repopluated.
  185. 2.33:  + Changed the way the TVersionNumberInformation class' AsString property
  186.          works.  Before, it just converted the number into a string, but now it
  187.          reads the string from the stringfileinfo section.  This makes it
  188.          possible that the version number and the AsString version number could
  189.          be different.  See Known Issues section above for full discussion.
  190. 2.32:  + It's *really* D5 compatible now.  Small change between the D5 eval
  191.          version and the real, shipping D5 version broke it.
  192. 2.31:  + Classname changed.
  193.        + D5 compatibility.
  194. 2.30:  + Under Delphi 4, you could get AVs if the version resource didn't have
  195.          any translation info (I think).  Stemmed from the fact that I was
  196.          mixing an unsigned for control variable with a signed value to loop
  197.          to.  Thanks to Steve Sherwood for finding and fixing this.
  198.        + Delphi 2 style line comment ("//") snuck in, so it wouldn't compile
  199.          under Delphi 1 without fixing it.  I hate that...
  200. 2.29:  + There were some strings left that should have gone into resource
  201.          strings for completeness' sake.  The strings were never used in a
  202.          compiled application, but only in the property editor (Delphi IDE).
  203.          They have been fixed for those who want a "full" translation.
  204.        + Added DFS_VERSION_INFO_AS_CLASS conditional directive.  See Notes
  205.          section above for full description.
  206.        + Added VInfoReg unit.  All IDE specific code (i.e. registering the
  207.          component, property editors, etc.) are contained in this unit.  This
  208.          was done for two primary reasons:  1) Using the component in a Delphi
  209.          or C++Builder expert would register the component as well.  2) Reduce
  210.          code size in some cases -- usually the smart linker removes this sort
  211.          of stuff since the app never references it, but now it's for certain
  212.          since it isn't even in the unit.  This change means that you need to
  213.          install the component using the new "registration" unit instead of
  214.          the unit containing the component.
  215. 2.28:  + Moved hard-coded strings to resourcestrings for Delphi/Builder 3 and
  216.          higher.  They are normal consts for older compilers.  This aids in
  217.          internationalizing an app.
  218. 2.27:  + Peforming a Project | Build would cause an Internal Error L511 to be
  219.          generated.  It has something to do with the way the VersForm and
  220.          VersInfo units used each other, but I couldn't isolate exactly what
  221.          was causing it.  So, I've moved everything that was in VersForm into
  222.          VersInfo.  You can safely delete VersForm.* from your system if you are
  223.          upgrading from a previous version.
  224. 2.26:  + Update for Delphi 4 compatibility:  Linked controls are no longer
  225.          populated at design-time because of a change in Delphi 4.  Shouldn't
  226.          matter since you usually got the Delphi IDE version info at design
  227.          time anyway.
  228.        + Some version info resources (notably those in Microsoft Office apps)
  229.          use a "language neutral" ID (zero value) for the language ID and only
  230.          give a valid char set ID.  But, the actual version info uses a full
  231.          language and char set ID value.  So, apparently this neutral value is
  232.          supposed to be treated as a wildcard, but I can't find that behavior
  233.          documented anywhere, and it is not supported directly by the API calls.
  234.          So, I have implemented it such that if the ID value(s) is zero, a
  235.          default is inserted ('0409' for language and '04E4' for char set).
  236.          This does fix the MS Office apps, but I can't guarantee it'll fix
  237.          everything that uses this (somewhat questionable) scheme.  If you find
  238.          anything that it doesn't work for, let me know.
  239. 2.25:  + Added Version property.
  240. 2.24:  + If the resource does not have any language character set information,
  241.          a default value of '040904E4' is used now instead of ''.  There are a
  242.          couple of DLLs out there like this, and using '' will not find the
  243.          info in them.  Thanks to Jens Bretschneider
  244.          (j.bretschneider@hardsoft.de) for this.
  245. 2.23:  + Fixed problem with C++Builder 3 run-time packages.
  246. 2.22:  + The Comments element of the version information was not getting added
  247.          to the linked listview/grid.
  248. 2.21:  + Updated for new DFS.INC file, component tab name, history/comments
  249.          file.
  250. 2.20:  + Delphi 1 compile problems... '//' is habit forming...
  251.        + The VERSFORM unit is no longer installed seperately.  It is now
  252.          compatible with both Win16 and Win32.
  253. 2.12:  + Fixed nasty little recursion bug (wasn't supposed to recurse).
  254. 2.11:  + Small change for C++Builder compatibility.
  255. 2.10:  + All items in version 2.10 were done by Grahame S. Marsh
  256.          (grahame.s.marsh@corp.courtaulds.co.uk).  Many thanks to him!
  257.          name and email at work and will insert them here ASAP.
  258.          + noted that build numbers were not cleared, fixed by adding
  259.          boolean to show when the data is valid.
  260.        + Changed filename property from string to its own type to allow a
  261.          property editor to be hooked in.
  262.        + Added a TListView for WIN32, retained TStringGrid for 16 bit.
  263.        + Added ability to choose which resources are visible in the grid or
  264.          listview by a set selector.
  265.        + Provided a filename property editor, and a component editor that
  266.          shows the current resource values of an attached file.  This is
  267.          available in WIN 32 only, sorry.  (Note from Brad, I will look
  268.          into adding this under Win 16 soon)   Both of these are provided
  269.          in the VersForm unit -- this unit must be installed into Delphi to
  270.          use this functionality.
  271. 2.00:  + In a nutshell, Greg Nixon (gnixon@whanganui.ac.nz) added the
  272.          CopyrightLabel, DescriptionLabel, ProductLabel, VersionLabel and
  273.          VersionGrid properties. I tweaked and fiddled with some of it, but
  274.          he gets the credit for the work.
  275.        + Changed FileVersion and ProductVersion to be a new class type.
  276.          This class type will let you check individual values, as well as
  277.          get the entire version as a string.  The properties are:
  278.            Major, Minor, Release, Build, AsString
  279.          AsString is built like this:
  280.            <major>.<minor>.<release>.<build>  ex.  "2.1.0.391"
  281.          Thanks to Stefan de Vogelaere (Stefan.de.Vogelaere@telenet.be) for
  282.          this idea.
  283. 1.10:  + 16-bit compatibility. (not released as 2.00 version came too fast)
  284. 1.00:  + Initial release.
  285.  
  286.