37

It appears to be what console application projects generated by IDE's intrinsic wizard cannot have version resource managed by IDE <- note the emphasis here.

Is there any workaround(s) for this issue? (i even ready to write an OTA wizard)

Toby Allen
  • 10,997
  • 11
  • 73
  • 124
Premature Optimization
  • 1,917
  • 1
  • 15
  • 24
  • @Robert - in my opinion, a lot of people don't know this. And on the other side versioning is important for the product life cycle, bug tracking, etc... – RBA May 30 '11 at 07:01
  • @RBA, i second that, there is still place left for practical "recipes" (i've chosen object repository) and/or explanation what happens behind the scene (desired effect achieved before resource file creation, as result of IOTAProjectResources creation, meaning unsaved/unnamed project can have version info too). IMO, this deserves a place in the FAQ as truly hidden IDE feature – Premature Optimization May 30 '11 at 10:08
  • Well, is this Question Frequently Asked? It looks like this was the first time it was asked here at all. – GolezTrol May 30 '11 at 12:03
  • 2
    No, this is not an hidden IDE feature, IMHO this is a bug. Vote for QC #4723, which is open since 2003 and Delphi 7, and never fixed... –  May 30 '11 at 12:26
  • @ldsandon at least - inconsistent behaviour (probebly related to the fact developers are considering console appication project as second-class, backward, or something alike). Voted it up. – Premature Optimization May 30 '11 at 16:53

1 Answers1

57

Add in your .dpr ( for example above the begin of the main code) the line:

{$R *.res}

Then build your project.

It will force a resource file (.res) to be created. This also allows you to set the version info in the project options.

Update: I noticed that this 'bug' is fixed in Delphi 10 Seattle, or maybe in an earlier version. When I create a new console application, it will automatically have that $R directive.

GolezTrol
  • 114,394
  • 18
  • 182
  • 210