Article

From:
To:
Ken White
Subject:
Re: Version Control and Update 5 or XE3
Newsgroup:
embarcadero.public.delphi.install

Re: Version Control and Update 5 or XE3

Ken,

Thanks for explaining that technique for creating project information through a resource file.

That lead me to look in the dproj file, where, yes, the project version number appears, twice, and could be found by searching for the string ";FileVersion=", which doesn't appear anywhere else in
that file.

So, would it be the same to just modify the dproj file in my pre-build event ?? Or is that file too much under the control of Delphi to permit tinkering with it in a pre-build event ???

Regards,

Jim Fleming
<Ken White> escribió en el mensaje news:✉forums.embarcadero.com...
>> {quote:title=Jim Fleming wrote:}{quote}
>> development team. On that basis I think it is only right for me to expect Embarcadero to return 
>> the
>> old functionality without additional cost to me, the user.
>
> Only if they charged you specifically for the previous functionality. There's no guarantee 
> anywhere that the product won't change over time, or that each version will remain 100% compatible 
> with the prior version. (If that were the case, the addition of the 32-bit compiler and dropping 
> of the 16-bit one would have been an issue in Delphi 2's release a decade ago, for instance, or 
> the switch to using MSBuild in the IDE and for command-line compilation instead of relying on .cfg 
> and other files.)
>
>> As an additional question: Has anyone been able to "adjust" the generated version numbers to 
>> convert
>> them to auto-increment numbers in some automatic way, using the after-build facility, or maybe 
>> some
>> external program run just following each build, or by some other non-manual method ?? I would be
>> very interested in hearing how this could be done.
>
> You can do this pretty easily with your own utility app and a pre-build event for your project.
>
> Your utility would need to look in the project's folder (which can be passed on the command line 
> using $() macros in the pre-build event) for a version resource script (for instance, 
> 'ProjVersion.rc'). The text file contains a text VERSIONINFO resource - here's a sample:
>
> {code}
> 1 VERSIONINFO
> FILEVERSION 2,0,0,0
> PRODUCTVERSION 2,0,0,0
> FILEOS 0x4
> FILETYPE 0x1
> {
> BLOCK "StringFileInfo"
> {
> BLOCK "040904E4"
> {
> VALUE "CompanyName", "Your Company Name Here"
> VALUE "FileDescription", "Your File Description Here"
> VALUE "FileVersion", "2.0.0.0"
> VALUE "InternalName", "Your Internal Name"
> VALUE "LegalCopyright", "© Your Copyright Notice"
> VALUE "LegalTrademarks", "Your Trademark Notice"
> VALUE "OriginalFilename", "YourExeName"
> VALUE "ProductName", "Your Product Name"
> VALUE "ProductVersion", "2.0.0.0"
> VALUE "Comments", ""
> }
> }
>
> BLOCK "VarFileInfo"
> {
> VALUE "Translation", 0x0409 0x04E4
> }
> }
> {code}
>
> The utility simply updates the FILEVERSION value and the value in the "StringFileInfo" block where 
> the "FileVersion" is written and saves the file. (It can read the previous version, do the 
> incrementing, and write the updated version.)
>
> In your project, first turn off the inclusion of version information in the Project Options 
> dialog. Add to the project source (right below the "program" keyword:
>
> {code}
> {$R 'ProjVersion.res' 'ProjVersion.rc'}
> {code}
>
> This line causes the resource compiler to be invoked on the ProjVersion.rc file every time it 
> changes to re-create the ProjVersion.res file.
>
> Next, create a pre-build event that calls your utility, passing it $(PROJECTDIR)\ProjVersion.rc on 
> the command line. (You can choose from a list of these macros in the `Pre-Build event` dialog, 
> BTW.)
>
> Hmmm... Maybe I should do something along these lines myself... :-) I haven't, though, because 
> most of the stuff I work with is fine with the change in version numbers, as long as I can tell 
> from the version number which release of the app the user is running (the specific version doesn't 
> matter).
FYI: Phrase searches are enclosed in either single or double quotes
 
 
Originally created by
Tamarack Associates
Sat, 29 Jan 2022 00:41:50 UTC
Copyright © 2009-2022
HREF Tools Corp.