TIA
That's not true.
If you want to recreate the RES file from respective DOF, do this:
a) Close the project/group if it's open under IDE - it's crucial.
b) Delete the current RES file for that project.
c) Reopen the project on IDE.
d) Delphi will warn you a new RES will be created (from DOF).
e) Confirm the recreation by pressing <ENTER>.
That's all.
Paulo França
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Plug smartness into your applications!
Download SmartPlugin at:
AthraSoft Components
http://athrasoft.cjb.net (primary)
http://athrasoft1.cjb.net (mirror 1)
http://athrasoft2.cjb.net (mirror 2)
Emails:
mailto:athr...@yahoo.com
Discussion Group:
SmartPlugi...@yahoogroups.com
http://groups.yahoo.com/group/SmartPlugin
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
"Paulo França" <athr...@yahoo.com> wrote in message
news:3b65c5d3_1@dnews...
Thanks, Paulo, but I can't use that!
One: you can't automate that;
Two: this way you lose your main icon... because .dof file doesn't store
it... and you don't want to manually add your icons for all your targets on
every build you make...
For anyone interested, I finally found the solution.
Do NOT use the resource inclusion {$R *.res}, mostly because there's no full
control over this file.
Delete the line containing: {$R *.res}.
Create two .RC files (plain text), one for the main icon, one for the
version info. This way one can automate the replacement of version info,
too.
So: the MyExeIcon.RC file would contain one line:
MAINICON ICON D:\MyProject\MyIcon.ico
The MyExeVer.RC file would contain something like this:
1 VERSIONINFO
FILEVERSION 1,0,0,365
PRODUCTVERSION 1,0,0,365
FILEOS VOS__WINDOWS32
FILETYPE VFT_APP
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
BEGIN
VALUE "FileVersion", "1.0.0.365"
VALUE "FileDescription", "My Kind of Application\000"
VALUE "LegalCopyright", "1990-2000 ThisCompany, Inc."
VALUE "Comments", ""
VALUE "CompanyName", "ThisCompany, Inc."
VALUE "InternalName", "myfilename"
VALUE "LegalTrademarks", ""
VALUE "OriginalFilename", "myfilename.exe"
VALUE "ProductName", "myappname"
VALUE "ProductVersion", "1.0.0.365"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0409 0x04E4
END
END
The first part has been suggested by Christian NineBerry Schwarz in a
posting on the borland.public.delphi.oleautomation newsgroup on 06/22/2001
(see Re: Custom Icon for COM DLL). Christian's posting is also very useful
for adding an icon to dll-s, console apps (or apps without forms...) as
Delphi doesn't allow setting icons for this kind of apps.
For the second part I got great help from here:
http://www.sandbrooksoftware.com/DPSC/Tips/GregLief/gl_q&a10.html
Still, I tried several ways to make it work properly in D5Enterprise.
Please note that the characters "\000" in FileDescription value are needed
in order for that string to show up properly. Those characters don't seem to
be needed for the other strings...
Another interesting thing is that this way one can add version info to a
DLL. Hm. Although Delphi behaves like adding version info to a DLL, it
doesn't actually put it there... try for yourself and then right click your
dll... I wonder if that's a bug?
Are you telling us that Delphi doesn't require the .RC to be compiled previously
?
If that's the case, it's wonderful. I'll give t a try.
Thanks for the tip, an.
Best regards,
Dan is right: icons get lost.
That doesn't matter to my case, because I use the approach I mentioned on plugin
templates only,
so that Delphi creates the default icon (for the just created dll-plugin) as
well as version info properly.
Regards,
Right.
If you just use
{$R MyRes.res}
you have to compile it yourself.
But if you also include it in the
project it will compile it as needed,
just like a pas file.
--
Brad.
-------------------------------
All spam will be responded to
by forwarding to SpamCop.
Dan
"Paulo França" <athr...@yahoo.com> wrote in message
news:3b66dab4_1@dnews...
Yes, that's really great. I have been blind about such capability for all these
years !!
A single note, though:
> Please note that the characters "\000" in FileDescription value are needed
> in order for that string to show up properly. Those characters don't seem to
> be needed for the other strings...
In fact, I had to append the "\000" termination to every string entry, then it
worked properly.
Here are the tools I used to check out the result internally:
JCL-based PE Viewer (by Petr Vones) - FULL SOURCES:
http://ww6.borland.com/codecentral/ccweb.exe/listing?id=15214
http://www.volweb.cz/pvones/delphi/
PE Explorer for Windows - COMMERCIAL PRODUCT:
http://www.heaventools.com
Many thanks for the tip, Dan. Very useful !!
Regards,
here's how the version info resource template works for me:
1 VERSIONINFO
FILEVERSION 1,0,0,365
PRODUCTVERSION 1,0,0,365
FILEOS VOS__WINDOWS32
FILETYPE VFT_APP
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
BEGIN
VALUE "FileVersion", "1.0.0.365" {*}
VALUE "FileDescription", "My Kind of Application\000"
VALUE "LegalCopyright", "1990-2000 ThisCompany, Inc.\000"
VALUE "Comments", ""
VALUE "CompanyName", "ThisCompany, Inc.\000"
VALUE "InternalName", "myfilename\000"
VALUE "LegalTrademarks", ""
VALUE "OriginalFilename", "myfilename.exe\000"
VALUE "ProductName", "myappname\000"
VALUE "ProductVersion", "1.0.0.365" {*}
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0409 0x04E4
END
END
to me, it doesn't seem necessary to attach \000 characters for lines noted
with {*}... as it works fine like that...
Yes, it seems not to be needed, at least for now... who knows about future
releases of Delphi ?
--