I’d like to create a version.rc file without having to put in place a whole pipeline.
I’d simply like for some code to run whenever Delphi build an executable in order to create that file.
I’m using 10.3.
You can use the build events for that purpose. You find those events in project options / Building / Build events.
You have the choice of 3 event groups : one before Delphi build your project, one before Delphi linker is called and one after the build is done.
In you case, you shall use pre-build events.
As command, you can specify a program or batch file which will create your rc file.
The documentation is there : https://docwiki.embarcadero.com/RADStudio/Athens/en/Creating_Build_Events
2
You can use the Pre-build events in Project Options:
Create a program that does what you want, and call it from the “Commands” part of the Pre-build events.
Remember that these options are Build-dependant, so if you want it for ALL builds for ALL targets, make sure to select that instead of (as in the picture) Debug/Win32.
Check out the “Build events” that the Delphi IDE has; although they are triggered when performing the Build/Link, not the Compilation.
You can check the documentation in the Wiki:
https://docwiki.embarcadero.com/RADStudio/Athens/en/Creating_Build_Events
Every time you do one of these operations:
- Post-build events
- Pre-build events
- Pre-link events
You can schedule an event.