Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Version info: DOF to RES ?

90 views
Skip to first unread message

Dan Stoian

unread,
Jul 30, 2001, 3:30:03 PM7/30/01
to
is it possible to have Delphi update the version info in RES file with same
info existing in DOF file?
for now it works only RES --> DOF...

TIA


Paulo França

unread,
Jul 30, 2001, 4:35:29 PM7/30/01
to
Dan Stoian <daniels...@frogware.com> escreveu nas notícias de
mensagem:3b65b4ab_2@dnews...

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

¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯


Simon Moscrop

unread,
Jul 31, 2001, 5:06:57 AM7/31/01
to
What then happens to your icons?


"Paulo França" <athr...@yahoo.com> wrote in message
news:3b65c5d3_1@dnews...

Dan Stoian

unread,
Jul 31, 2001, 10:58:43 AM7/31/01
to
Oops, I forgot something: add the two .RC files to your project...
Delphi will insert two include lines...


Dan Stoian

unread,
Jul 31, 2001, 10:49:41 AM7/31/01
to

"Paulo França" <athr...@yahoo.com> wrote in message
news:3b65c5d3_1@dnews...
> Dan Stoian <daniels...@frogware.com> escreveu nas notícias de
> mensagem:3b65b4ab_2@dnews...
> > is it possible to have Delphi update the version info in RES file with
> same
> > info existing in DOF file?
> > for now it works only RES --> DOF...
>
> 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>.
>

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?

Dan Stoian

unread,
Jul 31, 2001, 10:54:57 AM7/31/01
to

Paulo França

unread,
Jul 31, 2001, 12:18:16 PM7/31/01
to
> Dan Stoian <daniels...@frogware.com> escreveu nas notícias de
mensagem:3b66c692$1_1@dnews...

> Oops, I forgot something: add the two .RC files to your project...
> Delphi will insert two include lines...

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,

Paulo França

unread,
Jul 31, 2001, 12:16:04 PM7/31/01
to
> Simon Moscrop <SimonM...@Hotmail.com> escreveu nas notícias de
mensagem:3b66748b_2@dnews...

> What then happens to your icons?

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,

Brad White

unread,
Jul 31, 2001, 1:30:57 PM7/31/01
to
> Are you telling us that Delphi doesn't require the .RC to be compiled
previously

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 Stoian

unread,
Aug 2, 2001, 8:51:49 AM8/2/01
to
You're welcome! It works great isn't it?
Best regards to you, too.

Dan

"Paulo França" <athr...@yahoo.com> wrote in message

news:3b66dab4_1@dnews...

Paulo França

unread,
Aug 2, 2001, 12:29:57 PM8/2/01
to
Dan Stoian <daniels...@frogware.com> escreveu nas notícias de
mensagem:3b694bd2_1@dnews...

> You're welcome! It works great isn't it?
> Best regards to you, too.
>
> Dan

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,

Dan...@frogware.com

unread,
Aug 2, 2001, 4:58:52 PM8/2/01
to
yeah, that's what i found out today, too: you really need to put those
characters \000 in, at the end of the quoted values...

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...

Paulo França

unread,
Aug 2, 2001, 9:57:47 PM8/2/01
to
<Dan...@frogware.com> escreveu nas notícias de mensagem:3b69bf0c$1_2@dnews...

>
> 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 ?

--

0 new messages