What Is a .vrc file, how is is generated and can you remove it using the IDE?
A .vrc
is a temporary file created by Delphi MSBuild process to compile resources files (.res) which will be linked in the final binary output. It is passed to CodeGear Resource Compiler/Binder (cgrc.exe) and deleted after the build process.
It doesn't appear anywhere in .dproj file. This behaviour is from BuildVersionResource
target, imported from $(BDS)\Bin\CodeGear.Common.Targets
. Look at this file (and at CodeGear.Delphi.Targets
) if you want to get a better understanding of build process.
Removing <Icon_MainIcon>
tag from .dproj it's not enough, as VERSIONINFO resources can also force the creation of .vrc file (I believe "vrc" stands for "Version Resource", although it is also used for main icon in applications).
In case of packages, Delphi always put version info in packages projects. The "include version information" IDE option is ignored with package projects.
So, if you (like me)
- don't rely on Delphi IDE to set application main icon
- don't rely on Delphi IDE to set version info resources; and
- do manage to include your own resources files for everything
you can disable its creation entirely by setting the SkipResGeneration
to true
in your msbuild call. E.g.:
msbuild.exe myProject /t:Build /p:Config=Release /p:SkipResGeneration=true
However, this only works for MSBuild-based builds. I don't know how to do the same for builds from Delphi IDE.
Just open your @[email protected] in any text editor file and find lines
<Icon_MainIcon>@PROJECT@_Icon.ico</Icon_MainIcon>
and delete them. You will find one per Build target. Save the file and you are done.
Edit: The original answer referred to the .dpr file, however note the section to edit is in the .dproj hence I've updated the the answer above to reflect this.