I want to produce two different versions of my application, with different icons based on a DEFINE.
I succeeded to include different resource files based on the define but I cannot get rid of the MAINICON
in the default .res file of my project.
I added a resource Version1.rc file with the following line:
MAINICON icon "resource\icons\Version1.ico"
But if I try to compile MyProject using the IDE I always get the following error:
E2161 Duplicate resource: Type 14 (ICON GROUP), ID MAINICON; File C:\MyProject\Version1.RES resource kept; file C:\MyProject\MyProject.RES resource discarded.
I tried to edit MyProject.res
using a resource editor and deleted MAINICON, but delphi automatically seems to recreate the file including the icon.
compile_resources.bat
and then I clickBuild All
in my project group in the IDE. Delphi however seems to overwrite the MyProject.res in this process. I understand the value of having a script to compile everything, but I think this would be quite some work. On the other hand I would also like to be able to set a define in the IDE and have the right exe being generated. – Wengert{$R *.res}
line from the .dpr file, and you are good to go. On the other hand, if you'd rather stick to building in the IDE, then you are going to struggle with such tasks. If that's what you would prefer to do, then that's up to you obviously. – Cordwainer{$R *.res}
, the error is gone and I have the right icon. But version information, application title, language info etc. are gone as well. Do you have a link or an example rc-file that I could use to generate my custom MyProject.res? – Wengert