I have an old Delphi codebase I have to maintain, lots of DLLs, some older than others. In some of these DLLs there is no version information in the Project Options dialog. The controls for adding a version are greyed out and I can't even add a version number by manually editing the .DOF file. How can I include a version number in these projects?
views:
788answers:
5Check if the default .RES file exists in the project source location. Delphi includes the version number of the project in a .res file with the same name as the .dpr file. If the .RES file does not exist, the simplest way to recreate it is to add the {$R *.RES} compiler directive to the .DPR file, immediately after the uses clause.
library foolib;
uses
foo in 'foo.pas',
baz in 'baz.pas';
{$R *.RES}
exports
foofunc name 'foofunc';
end;
As soon as you add the {$R *.RES} compiler directive Delphi will tell you it has recreated the foolib.res resource file.
You can create and embed resource files in libraries created under Delphi, by using the $R directive.
This link has information relevant to constructing the RES file. Delphi has its own resource compiler: BRCC32
I use a build control system (FinalBuilder) and that is able to add version resources to all my DLLs and EXEs that are all coherent. Therefore I can be confident that the file set is all labelled with the same build. There are some Delphi projects that don't have versions by default, and FB will add them for you anyway.
It seems the resource directive {$R *.RES}
is missing (or enclosed in conditional defines) in your .dpr file so that the IDE doesn't find it.
Inclusion of version info in dll's is a bit erratic. If you specify a lib_suffix the version info is not updated.