RE: How do I get DLL file versions

This approach works >> 


use Win32::API;
sub GetFileVersion {

    my $fn = shift @_;

    if (! $ref_GetFileVersionInfoSize) {
        $ref_GetFileVersionInfoSize =
            new Win32::API("Version", "GetFileVersionInfoSize", [P, P], I);
        if ( ! defined $ref_GetFileVersionInfoSize) {
            warn "Cannot import KERNEL fcn : GetFileVersionInfoSize : $!";
            return undef;
         }
    }

    # OK, we've got a handle for GetFileVersionInfoSize; use it!
    my $z = 0;
    my $sz = $ref_GetFileVersionInfoSize->Call($fn, $z);

    if (! $ref_GetFileVersionInfo) {
        $ref_GetFileVersionInfo =
            new Win32::API("Version", "GetFileVersionInfo", [P, I, I, P],
I);
        if ( ! defined $ref_GetFileVersionInfo) {
            warn "Cannot import KERNEL fcn : GetFileVersionInfo : $!";
            return undef;
         }
    }

    # Allocate Space For File Version Info
    my $FileInfo = "\x00" x $sz;
    my $ignored = 0;

    my $rc = $ref_GetFileVersionInfo->Call($fn, $ignored, $sz, $FileInfo);
    $FileInfo =~ s/[^A-Za-z0-9.:]//go;

    # Get only the File Version Info; this xform is "brute-force", but it
works!

    $FileInfo =~ s/.*FileVersion([\d\.]*).*/$1/go;
    return($FileInfo);
}




Yours,
         Mike Genovese
         ATI/Marlboro
         QE
         xt. 3845
         5-881-3900, xt. 3845


-----Original Message-----
From: David Mamanakis [mailto:Efialtis@Efialtis.com] 
Sent: Wednesday, September 24, 2003 10:53 AM
To: Beginners@Perl.Org; Perl-Win32-Users
Subject: How do I get DLL file versions


I need a snippet of code that will get me the file versions from DLL files
in Windows

I have done a quick search, no luck... need it asap...

Thanks in ADVANCE!

--DM


_______________________________________________
Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
0
MichaelG
9/24/2003 4:26:29 PM
perl.beginners 29388 articles. 4 followers. Follow

0 Replies
664 Views

Similar Articles

[PageSpeed] 51
Get it on Google Play
Get it on Apple App Store

Reply:

Similar Artilces:

Help on how to get Product Version and File Version on exe file
Hi All, Is there a way of getting the Product and File version of my pb application during runtime? Is there a pb function I can use or do I have to use an API function to do this? Currently using PB 9.0.1 Build 7171 Regards and Thanks, Willie ...

Re: dll file in 2005 version
Hi, I want to convert only my code behind files in dlls. Then place the dlls in the bin folder. I try to use the Vbc tool but it cannot find my .vb file Can anyone suggest how it can be done? My big thnks in advance Dave         Hi Dave, I'm a little confused about your scenario.  Are you trying to upgrade a VS 2003 web application to VS 2005?  Or do something else? Thanks, Scott...

How i get the version info from any resource file (dll or exe)
Hello: How i get the version info from any resource file (dll or exe). The info is: File Description, Product Version, Company Name, Internal Name, Original Filename, Private Build, Special Build, Legal Copyright, Legal Trademarks, Language, Comments and OS. Thanks Diego Alvarez In article <u4Uo2mfk$GA.285@forums.sybase.com>, dlalvarez@altavista.net says... > Hello: > > How i get the version info from any resource file (dll or exe). The info is: > File Description, Product Version, Company Name, Internal Name, Original > Filename, Private Build,...

Get File Version from EXE File
hi folks how can i get the file version from a exe file. i need that information for a setup download website. best regards Philipp Use System.Diagnostics.FileVersionInfo.GetVersionInfo(path) to get the version info of a file.Hope this helps!Paul yes, thanks a lot :)...

Urgent: unable to get version information from powerbuilder 8 generated dll files
begin 644 getversioninfo.txt M=6QO;F<)9'=(86YD;&4-"G5L;VYG"61W3&5N9W1H#0IS=')I;F<);'-?=F5R M<VEO;FME>7-;,3)=(#T@>R`B4')O9'5C=$YA;64B+"`B4')O9'5C=%9E<G-I M;VXB+"`F#0H)"0DB3W)I9VEN86Q&:6QE;F%M92(L(")&:6QE1&5S8W)I<'1I M;VXB+"`B1FEL959E<G-I;VXB+"`F#0H)"0DB0V]M<&%N>4YA;64B+"`B3&5G M86Q#;W!Y<FEG:'0B+"`B3&5G86Q4<F%D96UA<FMS(BP@)@T*"0D)(DEN=&5R M;F%L3F%M92(L(")0<FEV871E0G5I;&0B+"`B4W!E8VEA;$)U:6QD(BP@(D-O M;...

Urgent: unable to get version information from powerbuilder 8 generated dll files
Hi, Wins2K/PB8 Version 8.0.1 Build 9056 After I built machine codes (DLLs) for my application, my codes (in attachment) could not get version information of those files. It failed after calling VerQueryValueA API. By the way, my local external functions are declared as followed: FUNCTION ulong GetFileVersionInfoSizeA( REF string lpFilename, REF ulong lpdwHandle ) LIBRARY "version.dll" FUNCTION boolean GetFileVersionInfoA( REF string lpFilename, REF ulong lpdwHandle, ulong dwLen, REF string lpData ) LIBRARY "version.dll" FUNCTION boolean VerQueryValueA(...

Re: Re: how to get file's creation time
Thanks for Schwartz and Jay.I have known something from your words. On 28 Nov 2005 08:48:28 -0800, merlyn@stonehenge.com (Randal L. Schwartz) wrote: >>>>>> "Jay" == Jay Savage <daggerquill@gmail.com> writes: > > Jay> It depends on what you mean by "creation". stat() on POSIXish systems > Jay> returns ctime, which is the inode creation time, > > Nope. Inode *change* time. Will update any time you write to the > file, or change any metadata (owner, permissions, number of links > [including renaming], other ti...

How to get file version?
I read in a <filename> but I don't know how get the file version out of the file. It seems Perl stat() doesn't work this way. Anybody knows what Perl function or module will work? Thanks, HL Ha Le wrote: > I read in a <filename> but I don't know how get the file version out of > the file. It seems Perl stat() doesn't work this way. Anybody knows what > Perl function or module will work? > what file version do you refer to? david Could you be more specific about what you mean by "version"? You mean for an executable...

Re: Encrypt a file, was Re: Encrpt a file
On Mon, 18 Apr 2005, Anish Kumar K wrote: > Can [anyone] suggest a good algorithm for [encrypting] and > [decrypting] files ..I donot want to use any perl module for that... Check out the perl stuff on this site. I haven't actually used it yet, though I've been meaning to look at it. But their Java stuff is really good. http://www.cryptix.org/ Not sure why you don't want to use a module, but you could always pull out the parts you need. ****** CONFIDENTIALITY NOTICE ****** NOTICE: This e-mail message and all attachments transmitted with it may con...

Getting file version
I want to get the version of a file Here's what I have in the Global External Functions Function long GetFileVersionInfoSize (string lptstrFilename, long lpdwHandle) Library "version.dll" Alias for "GetFileVersionInfoSizeA" and here's what I have in a button in an empty window long ll_dummy = 0, ll_size = 0 string ls_file = "C:\MyFile.EXE" ll_size = GetFileVersionInfoSize (ls_file, ll_dummy) messagebox(string(ll_size), "") ll_size always = 0 no matter what. When I try the same code in Microsoft Access, it works perfect...

Re: How to get a file path string from nsI(Local)File to use with PR_Open or PR_LoadLibrary
Benjamin Smedberg wrote: > On 7/27/09 1:00 PM, Honza Bambas wrote: > >> Benjamin Smedberg wrote: >> >>> On 7/27/09 12:27 PM, Honza Bambas wrote: >>> >>> >>> >>>> Benjamin, thanks for your reply. We probably misunderstood each other. >>>> What I was asking for was how to get from nsIFile a path that can be >>>> passed to PL_LoadLibrary (and similar) functions. It means to how to >>>> pass paths from nsFile instances to NSPR functions. >>>> >>...

RE: [wxperl-users] How to get a sizer's reference from an XRC file? (or... More XRC and getting object references from it)
Hi, I don't know if there is a way to get the reference to the sizer, but maybe this work-around would help you. I don't add new items to the form later on. I create all possibly items within the XRC file and hide all the object I don't need initially ($ref->Show(0)). So you can use the FindWindowByName function to get the reference to the hidden objects and show them if needed ($ref->Show(1)). The advantage is that you don't need to take care of the layout at your application. Of course this isn't a good way if you need a lot of windows to hide/show.=20 ...

DLL-files.com
http://www.dll-files.com/ -- Don't turn your back on anything, until you're sure you have nothing to learn from it. ...

RE: Re: No such file
Thanks for the tips, however, I tried writing a new script using vi and still got the same result so I assume the problem is the kernel not being able to find the interpreter. The question is why and how to fix that. I know for sure perl is there since it works if I type perl formx.cgi. perl is definitely listed under /usr/bin Karthik Krishnamurthy <karthik.k@extremix.net> wrote: >it seems that the OS is not able to find the file to run to execute this file >for example when you start a script with >#!/usr/bin/perl >the kernel execs /usr/bin/perl and gives the file n...

Web resources about - RE: How do I get DLL file versions - perl.beginners

Android version history - Wikipedia, the free encyclopedia
Global Android version distribution since December 2009. As of September 2013, Android 4.1/4.2 Jelly Bean is the most widely-used Android version, ...

Amazon will reportedly release a smaller, less expensive version of its Echo speaker
... to grow. According to a new report from The Wall Street Journal , the Internet retailer is planning to unveil a smaller, less expensive version ...

Next-gen Porsche 911 may include plug-in hybrid version
Filed under: Green , Porsche , Coupe , Electric , Future , Hybrid , Luxury , Performance Porsche 911 product line director Dr. Erhard Mossle ...

Warning: All but one version of Internet Explorer will now be left open to attacks
Are you running an old version of Windows or reading this article in an old version of Microsoft's popular web browser, Internet Explorer ? It's ...

CBS, Warner Bros. Said to Consider Online Version of CW Network
CBS Corp. and Time Warner Inc.’s Warner Bros. have discussed creating a paid streaming service for their jointly owned CW network to generate ...

Dilly Dally release studio version of Drake cover
by Andrew Sacher photo: Dilly Dally at Baby's All Right in 2015 (more by Amanda Hatfield) As you probably know if you've seen them live lately, ...

Microsoft is killing support for old versions of Internet Explorer and Windows 8 today
... or security updates from Microsoft, leaving users out in the cold if it ever became compromised. According to Netmarketshare , the three versions ...

IDG Contributor Network: Post-acquisition, LastPass rolls out new version with more user interface bling ...
... I'd have to look elsewhere for all my password management needs. It seems my concerns might have been a little premature if the latest version ...

Betas for new iOS and OS X versions go public
Now you can try out the latest and greatest operating systems for Apple’s flagship products with public betas for both iOS 9.3 and OS X El Capitan ...

Yes, Fox Really Should Make A PG-13 Version Of 'Deadpool'
For those who don't know or don't care, "Beyond the Trailer" host Grace Randolphdropped a video on January 13th basically complaining that releasing ...

Resources last updated: 1/15/2016 8:24:18 PM