Delphi – How to automatically set Version Info in Delphi

build-automationdelphimanifest

I would like to have my CodeGear Delphi 2007 project to automatically set the debug module attributes depending on whether my project is in debug or release mode.

I can manually set this value by right clicking on the project->Version Info->Edit values as needed. These are for the project as a whole and are the same for the debug and release builds.

Is there a way to automatically set the manifest to Debug if the #debug compiler directive is present?

Is there another way to easily detect is an exe was build as a debug or release version?

Best Answer

You could if you do it the other way around if you use the commandline compiler. Tell the compiler to compile for debug or release. Set a compiler directive to DEBUG for the debug build (it does that by default).

msbuild YourProject.dproj /p:Configuration=Release

msbuild YourProject.dproj /p:Configuration=Debug