12
votes

I am trying to install a commercial component called JamShellBrowser but it will not install.

I have contacted the developer, but meanwhile I'd like to know:

  1. What is a vrc file?
  2. How is it produced?
  3. Can it be controlled or modified with the Delphi XE4 IDE?

I checked the IDE's help but I could not find anything about vrc files and I searched for Delphi vrc and did not find anything that would help me.

The error message is:

Checking project dependencies...

Compiling JamShellDelphiXE4.dproj (Release, Win32)

brcc32 command line for "JamShellDelphiXE4.vrc"

c:\program files (x86)\embarcadero\rad studio\11.0\bin\cgrc.exe -c65001 JamShellDelphiXE4.vrc -foJamShellDelphiXE4.res

[BRCC32 Error] JamShellDelphiXE4.vrc(2): file not found: JamShellDelphiXE2_Icon.ico

Failed

Elapsed time: 00:00:00.1

I searched the components folders for an ico file, but there is none... thus the message, but even if I remove the line MAINICON ICON "JamShellDelphiXE2_Icon.ico" from the vrc file or even delete the vrc file it is automatically generated when I try to install.

I moved from Delphi 2010 to XE4 a few months ago and noticed the apparently new vrc file but I do not know what it is or how to handle these files.

5
It's a resource script file, apparently, as it's being passed to the Code Gear Resource Compiler (cgrc.exe). As you purchased the commercial components, don't they have technical support available that could help you with this?Ken White
@Ken.. See the second line in my question. Yes I have contacted them. Meanwhile my questions are pretty simple. How is it produced and can you control it from the IDE?Bill
I don't know. I create a new XE5 VCL Forms application and save it. I add an icon resource through "Resources and Images" from the Project menu, save, and build, and no .vrc file. I scan my entire hard drive, which has Delphi 2007, XE, XE4, XE5, and Delphi Prism installed, along with all of the sample apps, third party components, external libs, and other stuff I've accumulated, and there isn't a single '.vrc' file to be found.Ken White
@Ken, Thanks for trying. This is strange.Bill
@Bill .VRC files normally are temporary, so they are deleted when the build finishes. They are used to re-generate the .res file on each compile. See forums.embarcadero.com/message.jspa?messageID=421310Jeroen Wiert Pluimers

5 Answers

10
votes

I believe this is a built in IDE behaviour of Delphi XE4 and XE5, possibly caused by an upgrade bug. Generation of VRC files is something that you can not disable except by removing the tags in the dproj file that cause it to be generated.

If there was a way to fix it or remove it, it might involve comparing your dproj file with another dproj file and looking for something that was appropriate only to a .dpr+.dproj Project that somehow got into your .dpk+.dproj project, like <Icon_MainIcon>.

It appears to be an intermediate file that is auto-generated when a .dpr+.dproj project has some version information which must be written out of the .dproj file, and into a temporary location and then compiled and linked into your application as a version info resource. However, I have also seen it get generated for a .dpk+.dproj project, and this mystifies me as well.

It also seems to contain a resource for your default application icon and version information, and packages do not normally have a versioninfo or application icon resource.

What I find to be possibly a BUG is that there is no UI in the Delphi IDE to let you set the Application Icon of a Package. Yet, I sometimes get a .VRC and an .ICO file. But I am not aware of a fix, other than to report the issue to Embarcadero Quality Central.

With a .dproj project, a .VRC intermediate file makes at least some sense. I see the following content: Version Info, Application Icon, and VCL Styles (ie AquaLightSlate.vsf) resource linkage.

14
votes

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.

11
votes

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.

1
votes

this is a clarification...

I've just started to install several component libraries into Delphi RAD Studio XE5 that I've got installed in XE2 and XE4. When I try to Build most of them, I get this same error.

The problem isn't so much the .vrc file itself, it's this particular error:

[BRCC32 Error] <project_name>.vrc(2): file not found: <project_name>_Icon.ico

I can't figure out a way to bypass it, and I have no idea what it's looking for or where.

I tend to copy my component libs from one version to the next, opening them, building them, and installing them (ie. the ones that don't come with installers). I've never seen this happen in prior versions. However, this is the first time I've had RAD Studio installed; in the past I've just had Delphi. So perhaps it has something to do with having C++ installed as well?

0
votes

I had to change my X.optset file to get this to work. X being the name of your Delphi version you brought over these options from. Mine was PolyDelphiXE2.optset. Once I corrected the name here no more funny compiling that brought in a different ico reference.