Hi,

does anybody knows, how to add a version info resource to a foreign exe via API UpdateResource? Is a little example out there?

Best regards,
Nordwind
Posted on 2007-04-29 14:43:59 by Nordwind64
:sad:

Ok, I made a new version resource via XNResourceEditor with place for big texts, saved it, used the binary code in my prog and put texts manually in the offsets.
Then use UpdateResource. It works...

My english isn't good enoug to understand, how to build the VS_FIXEDFILEINFO/VS_VERSION_INFO structures itself, sorry.
Posted on 2007-05-06 07:17:19 by Nordwind64
RT_VERSIONINFO is tricky one, none of known resource decompilers, decompiles versioninfo resource script w/o a single mistake (even resource_hacker fails, well except one .. my resource editor that is still in development stage :) ). First of all you should understand how VERSIONINFO script could look, it's very variable to say truth:
------
at first we always have:
fixed-info
FILEVERSION
PRODUCTVERSION
FILEOS
FILETYPE
...
then tricky part begins:
after "BEGIN" we can expect
either BLOCK "VarFileInfo" or BLOCK "StringFileInfo" (don't know which will be first)

then if we meet VarFileInfo block, there can be even more trickier
value statement can look like this:
VALUE "Translation", 0x0409, 0x04b0, 0x041d, 0x04b0
or like this:
VALUE "Translation", 0x0409, 0x04b0
VALUE "Translation", 0x041d, 0x04b0
each case compiles differently

then if we meet StringFileInfo block, it can contain undefined number of inner block:
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904B0"
BEGIN
....
END
BLOCK "041d04b0"
BEGIN
....
END

So everything I said reflects how you build VERSIONINFO bin resource, I believe all that stuff is nicely documented in PSDK, however, after a while I'm going to make a routine, which compiles VERSIONINFO_rc to VERSIONINFO_bin


Posted on 2007-05-06 13:51:56 by ramguru
Thank you, ramguru!

I believe all that stuff is nicely documented in PSDK


...if your mother language is english...  ;)

Best regards,
Nordwind
Posted on 2007-05-07 14:30:47 by Nordwind64