Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set Delphi 7 project "Version Info" from code?

Is it possible to set the "Version Info" settings from code? I'd like to set the version numbering and the value for the "Comments" property without using the project options dialog.

like image 275
devployment Avatar asked Jul 07 '10 12:07

devployment


4 Answers

Rather than editing the binary RES file that the IDE manages for you, you may find it easier to maintain a text RC file that contains the version-info resource. Write the resource-script file, and then include it in your project with a line like this:

{$R resources.res resources.rc}

You should remove the {$R *.RES} line from your project's DPR file, or else you'll get duplicate version resources. Do not use your project name as the name of your custom resource file; that name is reserved by the IDE.

The IDE-managed resource file also contains the project icon, so you'll need to include that in your resource script as well.

You can edit the resource script by hand, or you can write a program to edit it or regenerate it as one of your build steps.

Using a text resource script has the added side effect that it's easier to track changes to it in whatever source-control system you use, like CVS.

like image 122
Rob Kennedy Avatar answered Oct 28 '22 12:10

Rob Kennedy


Solution would be to edit a project resource file. Check this c++ example http://www.codeproject.com/KB/cpp/UpdateVersion.aspx

like image 21
histrio Avatar answered Oct 28 '22 11:10

histrio


I would recommend using a build tool, like FinalBuilder (which I use a lot), which can do this for you according to an appropriate scheme. Then you know that the build options are all as you wish, your numbers are incremented appropriately, and you can do things like upload to FTP site and lots more. In my scripts, the build number is included all the way through from EXE to installer and all.

like image 4
mj2008 Avatar answered Oct 28 '22 12:10

mj2008


You have to write wizard for that. Check out IOTAProjectOptions in D7IOTA.HLP file, source code of ToolsAPI unit and this thread

like image 3
Free Consulting Avatar answered Oct 28 '22 13:10

Free Consulting