6

Hello I am building my delphi project using the following command:

Command: dcc32.exe project.dpr d:\exe_folder

The above command works good and I am able to cerate the exe in output folder. But when I build same project through IDE then on each build the build number is incremented as there is option 'Auto Increament Build Number' which I have checked. But while doing it through command line the build number is not getting increasing. Any option to revise the build info/version info through the command line??

Thanks..

Nalu
  • 1,107
  • 4
  • 20
  • 43

3 Answers3

10

dcc32.exe can't increase build number directly. Version info (including build number) is used from *.res file which is updated every time by IDE. To bypass IDE you can write RC script with version info section, small app that will increase build number in this script. Then, you can create bat file with the following actions for building:

  1. Run your app to increase build number
  2. Compile RC script using brcc32.exe (in - RC script, out - RES file)
  3. Compile your application with dcc32.exe with new .res file

P.S. Don't forget to include RES file with version info to your project:

{$R "yourversioninfofile.res"} 
TLama
  • 75,147
  • 17
  • 214
  • 392
DuXeN0N
  • 1,577
  • 1
  • 14
  • 29
4

No, the auto increment of the build number is an IDE feature. You will likely need to script your own auto increment facility using an appropriate scripting language.

If you wanted to use your own command line auto increment alongside the IDE's equivalent, here's what you'd need to do:

  1. Get your script to read the .res file that is managed by the IDE.
  2. Increment the build number.
  3. Re-create the .res file.
  4. Build the project.

To make this work I think you'd need to reverse engineer what's in the IDE generated .res file. But that's pretty easy. Any decent resource editing tool will help you do that.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
  • :( :( thanks for answer. Any hint to do the auto increment will be appriciated. I am using project.rc where i am mentioning the version info. I change version info manually to that .rc file then it will take effect after building through cmd. Now that means I have to auto increment changes in that .rc file. Am I correct or any other place i have to change? – Nalu Aug 20 '12 at 14:58
  • 1
    There is this: http://sourceforge.net/p/dzprepbuild/home/Home/ but as you are using Delphi 5.0 not sure how much help it could be. – Shambhala Aug 20 '12 at 15:00
  • Yes that's right. Update .rc, compile to .res, all as part of your build script. Not sure if you can use your own scripted version alongside the IDE facility. Personally I don't find IDE facility customizable enough for my needs so never use it. – David Heffernan Aug 20 '12 at 15:11
1

That's what I wrote dzPrepBuild for.

dummzeuch
  • 10,975
  • 4
  • 51
  • 158
  • hi @dummzeuch, thanks for the program. But when I ran it, it came up with error: dzPrepBuild version 1.3.0.353 built 2011-02-27 Exception: File does not exist. (ENoVersionInfo). Any idea? Thanks sam. – SamChen Jun 23 '14 at 04:43
  • @SamChen see http://sourceforge.net/p/dzlib/code/HEAD/tree/buildtools/trunk/PrepBuild.exe?format=raw for the latest version that definitely works. – dummzeuch Jun 23 '14 at 11:52
  • Thanks for the response, but it still fails with error: dzPrepBuild version 1.3.1.506 built 2013-03-04 Error: File does not exist. (ENoVersionInfo). I use: prepbuild --ReadDof=ProjectName --IncBuild --exec=prep.cmd. The dof file does exist in the project folder. – SamChen Jun 23 '14 at 22:07
  • Are these the exact error messages? They should normally contain the full filename. – dummzeuch Jun 24 '14 at 12:13
  • Yes, that's exactly what it says. Hummm. Thanks anyway – SamChen Jun 27 '14 at 04:40