Delphi – How to include Subversion revision number into Delphi project


I'd like to have revision number of source code to Delphi's source code and exe version. What is the best way to do this automatically?

I'd like to display the revision number in "About" screen and in the version info of the project.

I'm using currently Delphi IDE (2006/2007) and Tortoise SVN.

Best Solution

There is a program called SubWCRev.exe that comes with TortoiseSVN that will do token replacement for you. So somewhere in your source, you insert the token, and pass the input and output filenames to SubWCRev.exe, and it will replace the token with various SVN info, e.g., revision number. Note, this is a standalone program you can use with your build script, you do not need to use TortoiseSVN with it.