Compile Exe-file with VersionInfo and Icon


(Attracs) #1

My project in Delphi load an icon from an resourcefile in exe-file by a compiler directive in dpr-file.

{$R ..\..\deploy\res\ClientResources.res}

Now of course I also want versioninfo in the exe-file.
I do like this:

  • Define a property set. Called it MyVersion.
  • Assign MajorVersion, MinorVersion etc from variables using Property Set assign in MyVersion…
  • Compile the exe. Versioninfo is using the MyVersion.

I got version in the exe-file, but only if I Build Delphi Actions project tab have checked Regenerate Resource.
Otherwise version is just 0 like 0.0.0.0

But problem is that to get an icon in exe-file I must clear the Regenerate Resource…
So any advice or recommendation what to do ?

Regards
Roland Bengtsson


(Tim Frost) #2

Your Delphi program can have multiple resource files. I just put images in one file, manifest in another, resource strings in a third, and leave Finalbuilder to manage the version resources by itself. I also have FB build my RES from RC files on each build, and set items like string resource RC files as project files so that they are built in the IDE as well as in the production build.


(Vincent Parrett) #3

Just to add to what Tim said, FinalBuilder regenerates the projectr resource file to update the version info and the icon, however the icon is optional, if the Icon field is blank then it will not add the MAINICON resource to the project resourse file, and if you are including another resource with a MAINICON resource then that will be used by windows.

The reason for putting the version info in the project.res file is that is what the delphi ide does, if we put it elsewhere you could potentially end up with multiple version info resources compiled in.


(Attracs) #4

Thanks, I believe I got it working now.