Set executable assembly information

84 views
Skip to first unread message

Dirk Schuermans

unread,
Jan 15, 2022, 7:52:26 AMJan 15
to
Hey,

I'm wondering if you anyone could help me by pointing me in the right direction here.

When compiling an old clipper program using the free version of xHarbour, is it al all possible to set the resulting executable's version metadata?

I'm referring to the properties found under the "Details" tab when you right click the executable and open the properties dialog.

I'm interested in setting the "File version" and/or "Product version" properties.

Thanks!

Dirk Schuermans

unread,
Jan 15, 2022, 9:12:29 AMJan 15
to
Ah, figured it out myself :)

I've included a version.rc file in my sources and added it to my xbp file:

[src\version.rc]
MYC_FLAGS =
MYDEFINES =
MYPRG_FLAGS =

Contents of the version.rc file as per the following example:

https://docs.microsoft.com/nl-nl/windows/win32/menurc/versioninfo-resource#examples

Hope this helps anyone else trying to figure out the same thing :)

Cheers!

Enrico Maria Giordano

unread,
Jan 15, 2022, 11:06:42 AMJan 15
to
Il 15/01/2022 15:12, Dirk Schuermans ha scritto:

> Ah, figured it out myself :)
>
> I've included a version.rc file in my sources and added it to my xbp file:

Thank you for sharing. I didn't know we can use RC file even with
console programs.

EMG

http://www.emagsoftware.it
http://www.emagsoftware.it/emgmusic
http://www.emagsoftware.it/spectrum
http://www.emagsoftware.it/tbosg

CV

unread,
Jan 17, 2022, 8:12:39 AMJan 17
to
Hi all

Thing is, if you put a reference to an icon in the .RC file on a console app, I couldn't find a way to display it properly in the title bar when executing it.

If anyone has a clue is welcome!

Best regards
---
Claudio Voskian
Buenos Aires - Argentina

Rainer Berning

unread,
Jan 17, 2022, 11:44:51 AMJan 17
to
Hi

Try to use ResourceHacker. This work for me.

if Program name is xmain.exe and the icon name is chef.ico:

REM Icon in Programm einbinden
"C:\Program Files (x86)\Resource Hacker\ResourceHacker.exe" -open ".\xmain.exe" -save ".\xmain.exe" -action addskip -res ".\chef.ico" -mask ICONGROUP,MAINICON,

CV

unread,
Jan 17, 2022, 5:21:39 PMJan 17
to
Thank you Rainer, will try that!
Regards
C.

Jayadev U

unread,
Jan 18, 2022, 12:13:45 AMJan 18
to
Hi Claudio,

Please try this:

/* in your main program */

#include "gtinfo.ch" // xHarbour function for ICOn display (it may also
be hbgtinfo.ch)

#define PRGICON 101


Function Main
hb_gtInfo(HB_GTI_ICONRES,PRGICON)



In your .rc file

#define PRGICON 101
PRGICON ICON "youricon.ico"


HTH,

Warm regards,

Jayadev

Gary Williams

unread,
Jan 20, 2022, 5:08:00 AMJan 20
to
In my console app under the xharbour.com version, just adding the following line to the top of the RC file did the trick,
no other calls to GTInfo etc required

APPICON ICON "IconFileName.ico"

Change file name as needed above
Reply all
Reply to author
Forward
0 new messages