Archive: DLL version numbering


DLL version numbering
While I've been trying GetDLLVersion functionality I discovered the following: the numbers which I obtain when calling this function (NSIS 1.99) and the numbers which I can see when viewing the properties of the file (File version tab) are not always the same. Here is a short list obtained from my Win98SE system -
filename file version tab GetDLLVersion returned value
OLEAUT32.DLL 2.40.4515 00020028 11A30000 - seems OK
MFC42.DLL 6.00.8665.0 00060000 21D90000 - seems OK
MSVCRT.DLL 6.10.8924.0 00060001 22DC0000 - .10.<>0001 !!!
FM20.DLL 2.01 00020001 17E00001 - what's that 17E00001?
COMDLG32.OCX 6.00.8418 00060000 00540012 - .8418 together?
IO.OCX 1.11 00010001 00010000 - .11 together?

Can anybody explain these irregularities to me? :igor:


There is at least three ways to obtain the version information about a file using Windows (at a programming level) so it can get confusing. I don't have time to investigate fully but as a quick alternative you might try http://www.clantpa.co.uk/nsis/x18sysinfoV0.0.zip which I wrote a while back. It allows you to get the following information (using msvcrt.dll as an example) :-

Method One:
GetDllVersion is not supported by msvcrt.dll but for files that do support it it returns Version, Build and Platform.

Method Two:
via the dll method GetFileVersion().
6.1.9359.0

Method Three:
via the dll method GetFileVersionValue().

Company Name: Microsoft Corporation
File Description: Microsoft (R) C Runtime Library
File Version: 6.10.9359.0
Internal Name: MSVCRT.DLL
LegalCopyright: Copyright (C) Microsoft Corp. 1981-1999
Original Filename: MSVCRT.DLL
Product Name: Microsoft (R) Visual C++
Product Version: 6.10.9359.0

Now I haven't looked at this for a while but what interests me is that methods two and three return slightly different numbers as you noticed. Maybe you can use the third method in my dll to always obtain the correct number.

[edit]
Just tried it on comdlg32.ocx and I get back :-
Method One: Not supported
Method Two: 6.0.84.18
Method Three: 6.00.8418
[/edit]