📄 versinfo.txt
字号:
VALUE "FileVersion", "2.1.5.3\000\000\000\000\000R\203\003\000"
VALUE "ProductVersion", "1.0.0.0\000\000\000\000\000R\203\003\000"
}
}
}
Note in the "StringFileInfo" section, ProductVersion is 1.0.0.0. But,
notice in the fixed information (at the top), PRODUCTVERSION is 2, 1, 5, 3.
It looks like everything you put into the version info grid in the IDE ends
up in the StringFileInfo section. I'm pulling version numbers from the
fixed information, and it looks like the Delphi IDE just copies whatever
you assign to the FileVersion over to the ProductVersion for that.
You've got a few options to deal with this: 1) don't use the IDE generated
version info, build your own with a resource editor and use {$R xxx.res}
to compile it into your app, or 2) pull the product version from the string
info like this:
Info.Lines.Add('ProductVersion = ' + VersionInfo.ProductVersion.AsString);
I've set up the AsString property to work such that it reads the version
from the StringFileInfo section (if it's there) rather than just building it
from the fixed information numbers. That means that the numbers in
ProductVersion may be completely different than the AsString numbers in it.
That is, using the above example, if you read the numbers from
ProductVersion you would get 2.1.5.3, but if you used
ProductVersion.AsString you would get 1.0.0.0.
Revision History:
2.36: + Fixed a problem that occurred with some oddball version info resources.
Notably, Borland's Resource Workshop WORKSHOP.EXE file was unreadable
to the component (it crashed it even, I think). I finally figured out
what they were doing that was goofy and it now gets along fine with it.
+ Updated for Delphi 6 compatibility. See updated install directions
above.
2.35: + Updated for C++Builder 5 compatibility.
2.34: + Changing the Filename property wouldn't cause controls to be
repopluated.
2.33: + Changed the way the TVersionNumberInformation class' AsString property
works. Before, it just converted the number into a string, but now it
reads the string from the stringfileinfo section. This makes it
possible that the version number and the AsString version number could
be different. See Known Issues section above for full discussion.
2.32: + It's *really* D5 compatible now. Small change between the D5 eval
version and the real, shipping D5 version broke it.
2.31: + Classname changed.
+ D5 compatibility.
2.30: + Under Delphi 4, you could get AVs if the version resource didn't have
any translation info (I think). Stemmed from the fact that I was
mixing an unsigned for control variable with a signed value to loop
to. Thanks to Steve Sherwood for finding and fixing this.
+ Delphi 2 style line comment ("//") snuck in, so it wouldn't compile
under Delphi 1 without fixing it. I hate that...
2.29: + There were some strings left that should have gone into resource
strings for completeness' sake. The strings were never used in a
compiled application, but only in the property editor (Delphi IDE).
They have been fixed for those who want a "full" translation.
+ Added DFS_VERSION_INFO_AS_CLASS conditional directive. See Notes
section above for full description.
+ Added VInfoReg unit. All IDE specific code (i.e. registering the
component, property editors, etc.) are contained in this unit. This
was done for two primary reasons: 1) Using the component in a Delphi
or C++Builder expert would register the component as well. 2) Reduce
code size in some cases -- usually the smart linker removes this sort
of stuff since the app never references it, but now it's for certain
since it isn't even in the unit. This change means that you need to
install the component using the new "registration" unit instead of
the unit containing the component.
2.28: + Moved hard-coded strings to resourcestrings for Delphi/Builder 3 and
higher. They are normal consts for older compilers. This aids in
internationalizing an app.
2.27: + Peforming a Project | Build would cause an Internal Error L511 to be
generated. It has something to do with the way the VersForm and
VersInfo units used each other, but I couldn't isolate exactly what
was causing it. So, I've moved everything that was in VersForm into
VersInfo. You can safely delete VersForm.* from your system if you are
upgrading from a previous version.
2.26: + Update for Delphi 4 compatibility: Linked controls are no longer
populated at design-time because of a change in Delphi 4. Shouldn't
matter since you usually got the Delphi IDE version info at design
time anyway.
+ Some version info resources (notably those in Microsoft Office apps)
use a "language neutral" ID (zero value) for the language ID and only
give a valid char set ID. But, the actual version info uses a full
language and char set ID value. So, apparently this neutral value is
supposed to be treated as a wildcard, but I can't find that behavior
documented anywhere, and it is not supported directly by the API calls.
So, I have implemented it such that if the ID value(s) is zero, a
default is inserted ('0409' for language and '04E4' for char set).
This does fix the MS Office apps, but I can't guarantee it'll fix
everything that uses this (somewhat questionable) scheme. If you find
anything that it doesn't work for, let me know.
2.25: + Added Version property.
2.24: + If the resource does not have any language character set information,
a default value of '040904E4' is used now instead of ''. There are a
couple of DLLs out there like this, and using '' will not find the
info in them. Thanks to Jens Bretschneider
(j.bretschneider@hardsoft.de) for this.
2.23: + Fixed problem with C++Builder 3 run-time packages.
2.22: + The Comments element of the version information was not getting added
to the linked listview/grid.
2.21: + Updated for new DFS.INC file, component tab name, history/comments
file.
2.20: + Delphi 1 compile problems... '//' is habit forming...
+ The VERSFORM unit is no longer installed seperately. It is now
compatible with both Win16 and Win32.
2.12: + Fixed nasty little recursion bug (wasn't supposed to recurse).
2.11: + Small change for C++Builder compatibility.
2.10: + All items in version 2.10 were done by Grahame S. Marsh
(grahame.s.marsh@corp.courtaulds.co.uk). Many thanks to him!
name and email at work and will insert them here ASAP.
+ noted that build numbers were not cleared, fixed by adding
boolean to show when the data is valid.
+ Changed filename property from string to its own type to allow a
property editor to be hooked in.
+ Added a TListView for WIN32, retained TStringGrid for 16 bit.
+ Added ability to choose which resources are visible in the grid or
listview by a set selector.
+ Provided a filename property editor, and a component editor that
shows the current resource values of an attached file. This is
available in WIN 32 only, sorry. (Note from Brad, I will look
into adding this under Win 16 soon) Both of these are provided
in the VersForm unit -- this unit must be installed into Delphi to
use this functionality.
2.00: + In a nutshell, Greg Nixon (gnixon@whanganui.ac.nz) added the
CopyrightLabel, DescriptionLabel, ProductLabel, VersionLabel and
VersionGrid properties. I tweaked and fiddled with some of it, but
he gets the credit for the work.
+ Changed FileVersion and ProductVersion to be a new class type.
This class type will let you check individual values, as well as
get the entire version as a string. The properties are:
Major, Minor, Release, Build, AsString
AsString is built like this:
<major>.<minor>.<release>.<build> ex. "2.1.0.391"
Thanks to Stefan de Vogelaere (Stefan.de.Vogelaere@telenet.be) for
this idea.
1.10: + 16-bit compatibility. (not released as 2.00 version came too fast)
1.00: + Initial release.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -