in reply to How to detect that a Windows DLL has a version resource, and pull data from it.

Have a look at Win32::Exe


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
RIP PCW
  • Comment on Re: How to detect that a Windows DLL has a version resource, and pull data from it.

Replies are listed 'Best First'.
Re^2: How to detect that a Windows DLL has a version resource, and pull data from it.
by CSJewell (Beadle) on Jul 03, 2009 at 17:25 UTC

    I did that. Got even more lost than I already was just looking at the documentation. Was hoping for other options short of writing the binary-parsing routine myself.

    Although I may have to look again. It was too early in the morning.

Re^2: How to detect that a Windows DLL has a version resource, and pull data from it.
by CSJewell (Beadle) on Jul 05, 2009 at 04:43 UTC
    The trick was getting the language code once I got the Win32::Exe object - and it isn't exactly the cleanest code in the world. I had to poke into the object to get it, because there isn't a documented interface for it.
    my $language; my $exe = Win32::Exe->new( $name[$object_id] ); my $vi = $exe->version_info(); if (defined $vi) { # To load the variable used below. $vi->get('OriginalFilename'); $language = hex substr $vi->{'cur_trans'}, 0, 4; # $language is now the language IN DECIMAL. # To get a hex number, drop the 'hex' before the substr. } # use $language if it's defined. ...