I was wanting to create a small tool in Delphi which can update the Delphi version information in another exe file. I know several existing utilities are out there for this but I need full programmatic control and would prefer no shelling out to the command line, etc.
After a web search I couldn’t find any Delphi source code examples of modifying version information in an exe, could anyone provide some code or direction?
I can’t give a complete answer, but I can get you started. There is an article at DelphiDabbler.com that fills in how to get to the version information out of a file.
GetFileVersionInfois the Windows API to do that. To set it, I believeUpdateResourceis the Windows API function you’ll need to use. There is another article at CodeProject that covers this, using C, but it should give you a solid idea of what needs to be done.Good luck!
Edit: I found some code on the Delphi newsgroups that might give you some more help:
It’s just a snippet, and will require some work on your part, but that’s the lion’s share of the work!