views:

329

answers:

5

Is there a FOSS batch compiling solution for Delphi that takes version as an input parameter?

I am using Delphi 7 and this remains the most tedious operation. Are there any other solutions, workarounds to make this easy.

+6  A: 

Not really sure on your question, but I'm going to assume you are asking how to set the version number for a product from a batch file when compiling. I previously used a program called StampVer, You will need to already have version information in the file to use StampVer. StampVer is Freeware but not Open Source.

A good commercial solution that I strongly recommend would be FinalBuilder, which also has the ability to manipulate the version information in an executable as well as compile your Delphi application.

skamradt
Thanks for stampver info, seems like it will be a help to me.
mm2010
Forgot to mention, my one system have +- 150 executables, the others have less
mm2010
With StampVer something I forgot to mention... make sure your existing version information is large enough to receive your updated Version stamp. For example, if you are going to be writing version 10.99.99.1234 make sure that your existing version contains at least 13 digits.
skamradt
StampVer will be open source one day, I promise :)
Paul Dixon
+2  A: 

You could, for example, specify the version information in a resource script (.rc file) whose compiled representation you link inside your project source (.dpr) using something akin to {$R myver.res}. You can then have your batch build system generate the .res file from the .rc file using brcc32.exe (included in any Delphi version.)

Mihai Limbășan
Thats a lot of work if I have 150 executables in my system, for every compilation?
mm2010
That's some work up front - your build system (e.g., make) will handle the rest. I'm not aware of any FOSS tool which will automate this for you.
Mihai Limbășan
+2  A: 

We are using custom .res file - created from template during building by TortoiseSVN's WCREV tool (it takes revision number and replace keywords in template file).

Delphi 2006, no add-ons. I can post template and script tomorrow if you want.

DiGi
That will be great or a link if available.
mm2010
+1  A: 

http://svn.berlios.de/svnroot/repos/dzchart/utilities/dzPrepBuild/trunk/

might fit the bill.

"PrepBuild is a commandline tool for handling the version information for Delphi projects when compiling using the dcc32.exe commandline compiler. It can also be used as a Pre-Build tool in Delphi 2007."

Could add a bit of info of what is happening at the link, is not so clear.
mm2010
A: 

Using the (MPL) code from the XN Resource Editor, it's not very hard to write your own:

http://www.jasontpenny.com/blog/2009/05/08/program-to-set-delphi-resource-version-info-from-commandline/

jasonpenny