0

Instead of manually editing the version info inside the IDE, is there a way to Delphi get this information from an external file ?

I'm trying to make an automated building system for my apps and the steps would be edit the version number, compile the project with dcc32.exe , sign the EXE and so on.

enter image description here

delphirules
  • 6,443
  • 17
  • 59
  • 108

1 Answers1

4

One way of doing this, is by not using the Delphi Project Options. On the dialog of your screenshot, disable "Include version information in project". Remember to do this for all targets. I've struggled with conflicting settings between targets before, and typically got rid of the troubles by modifying the .dproj XML data manually.

Create an empty file with extension .rc, choose something different than your project name as file name. Then add the file with Project > Add to project..., you may have to change the file type to Resource file (*.rc). It will add something to the .dpr file that looks like this:

{$R 'verinfo.res' 'verinfo.rc'}

Don't worry about the .res file, it will get generated by the compilation process based on your .rc file. (Actually it's BRCC32.EXE that will get called to do this.)

Edit the .rc file and add a VERSIONINFO section, as described here. If you edit this file, or (re-)generate it by the automated building prior compilation, the resulting binaries should have this version data as official version by the file properties.

Stijn Sanders
  • 35,982
  • 11
  • 45
  • 67
  • 3
    If you have _Project Magician_ installed and configured correctly, you can just set the version info in the base configuration without bothering the other configurations. https://www.uweraabe.de/Blog/2018/05/17/keep-your-project-files-clean-with-project-magician/ – Uwe Raabe Feb 20 '20 at 21:42