13

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.

Ken White
  • 123,280
  • 14
  • 225
  • 444
Bill
  • 2,993
  • 5
  • 37
  • 71
  • 1
    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 Oct 25 '13 at 15:15
  • @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 Oct 25 '13 at 15:41
  • 1
    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 Oct 25 '13 at 15:47
  • 1
    @Ken, Thanks for trying. This is strange. – Bill Oct 25 '13 at 16:06
  • Just to be thorough, I repeated the above with a new FMX Desktop HD app as well, and still ended up with no .vrc file. – Ken White Oct 25 '13 at 17:08
  • @Ken, The difference maybe that I am working with a dpk and you tested dpr. – Bill Oct 25 '13 at 17:30
  • I don't have any .vrc files *anywhere on my hard drive*, not just in the two test folders. I did a full drive search for anything with that extension, as well as testing with two new applications. Nada. I have about 200GB of data on my drive, the majority of which is development related, with no .vrc files to be found among them. – Ken White Oct 25 '13 at 17:33
  • You might not have recently tried to take a D2007 through XE level .dpr+.dproj folder and update it to latest .dproj level by opening it in XE3+? – Warren P Oct 25 '13 at 20:20
  • 1
    @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 https://forums.embarcadero.com/message.jspa?messageID=421310 – Jeroen Wiert Pluimers Nov 26 '13 at 12:11

5 Answers5

14

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.

F.D.Castel
  • 2,284
  • 1
  • 16
  • 15
11

Just open your @PROJECT@.dproj 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.

W.Prins
  • 1,286
  • 1
  • 14
  • 22
stonito
  • 169
  • 1
  • 4
  • 1
    These instructions just worked for me in XE5. I also deleted the delphi styles related tags – boggy May 22 '14 at 19:14
  • Saved me a big bug in XE5. Apparently, doing a local copy-paste based explorer sub-versioning of my projects causes this vrc mess and it throws IDE error like 'attempting to read write protected memory, BRCC and MS Build Error.... – user30478 Jun 16 '18 at 17:33
  • Remove the above tag, remove custom Icon via IDE, do a clean, close IDE + delete .local .identcache .vrc, reopen in IDE, close the IDE so that no .vrc exists now, finally open and do build. – user30478 Sep 19 '18 at 18:47
10

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.

Warren P
  • 65,725
  • 40
  • 181
  • 316
  • The dpk did have version information but it should not have been included because Include Version Info was not checked. I have no idea where the ico information came from and there was no ico in the source. I successfully installed the components by creating my own dpk and added the necessary files to the package. – Bill Oct 25 '13 at 18:39
  • 1
    It's probably IDE code that is appropriate to execute for .dpr+.dproj project type, but not appropriate for .dpks. The .dproj might have gotten upgraded from a pre-XE2 version, and in so doing, the IDE thinks during the upgrade, that it needs to create you a default icon file but it does not need to do so. As a workaround try just starting over, but this time, delete the .dproj, avoiding the upgrade of the .dproj version from a pre-XE2 version. – Warren P Oct 25 '13 at 19:41
  • I had to quit XE2, delete the .dproj and, .local, .res, .vrc files. Deleting it while XE2 is open didn't work for me. – Hein du Plessis Jun 05 '14 at 09:55
  • 1
    That would cause you to lose ALL your dproj information, but it would fix it. Bit of a "swatting a fly with a hammer" approach. Editing XML files is not that hard. – Warren P Jun 05 '14 at 15:16
1

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?

Hamad
  • 5,096
  • 13
  • 37
  • 65
David
  • 101
  • 1
  • 10
0

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.