The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 4,180 other subscribers

The curse of the Project.res file.

Posted by jpluimers on 2016/11/29

A long time ago, Lars Fosdal wrote this on the Delphi G+ group:

It really is beyond me why there is no Project.rc file which includes

  • Project.version.rc
  • Project.icon.rc
  • Project.themes.rc
  • Project.manifest.xml
  • and so forth.

That way, the .res file would be a compile-time thing (or even a thing of the past) – and the resource linker would assemble the various bits from their individual sources.

It has been an issue forever. Vincent Parrett correctly commented that if you clean out too much out of the Project.res file, the IDE gets confused:

The only thing it is used for is version info and the mainicon (the IDE gets confused if don’t do that).

In my own experience, this isn’t the case for all Delphi versions, but I forgot which versions suffer and which don’t. I think the IDE theming issue omitting the Application word in the .dpr is related.

Like many of the G+ commenters, I’ve switched to script based resources for my own projects a long time ago. That’s also the reason why I forgot: this approach just works for any Delphi version.

This post is a reminder to self to see if the IDE has finally refrained from doing Project.res handling itself.


Source: The curse of the Project.res file…

Some related posts:

5 Responses to “The curse of the Project.res file.”

  1. KM said

    Reading the original G+ post, the issues looks to be located in FinalBuilder also. It does use the .res file to get some information (it shouldn’t, IMHO) – and that’s an issue. We handle everything outside the IDE (XE2) through .rc files (also compiled with Windows SDK resource compiler, not the Delphi one, which lacks some needed features). We also use specific manifests for each application, not every one has the same needs.

    No problems building with Jenkins or CruiseControl.NET.

    Delphi should really stop using the .dpr file and .res file as way to store build data. Everything should be really moved to project/solutions files. Also, the external resource support in the IDE is still primitive, and supports only very basic resource types.

    • Tom Cruise said

      “Delphi should stop using .dpr files”?!


      • jpluimers said

        “stop using the .dpr file and .res file as way to store build data” and that’s what I agree with.

        Information like what’s part of the project or just a used by it, which of them are designable, what designers to use for them, what version or icon should and much more should be in structured data not in unstructured comments or binary resource data.

        All that information should also be in once place (not doubled like currently in both .dpr and .dproj: those will get of of sync) and not intermixed over platforms (what the heck does mobile info have to do in non-mobile sections of a .dproj; why should a project having only Windows targets have truckloads of ever changing mobile settings in them, etc).

        From the start, Delphi has had this structured DFM file feature but it’s not used for project data only for form data. That’s a missed opportunity.

  2. WarrenP said

    Modern Delphi versions since at least XE4 stopped embedding the icon in the res file and instead the .dproj manages script file which in turn is compiled into a resource file. Is that what you mean? I no longer check .res files into version control since they fixed this. I believe this mismanaged .res debacle is the reason that even today some developers do not check dproj files in but instead build without msbuild or .dproj files, for production builds.


    • jpluimers said

      I’m still not sure what the IDE does in XE7/XE8 but everytime I save projects, it updates the .RES files into something slightly binary different.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: