DLL version number

Hung Jung Lu hungjunglu at yahoo.com
Tue Mar 9 14:48:24 EST 2004


"Roger Upole" <rupole at hotmail.com> wrote in message news:<404d1159_5 at 127.0.0.1>...
> You can use win32api.GetFileVersionInfo.
> See /demos/getfilever.py for an example of how to use it.
>        Roger
> 
> "Hung Jung Lu" <hungjunglu at yahoo.com> wrote in message
> news:8ef9bea6.0403081509.31b3f9e at posting.google.com...
> >
> > If I have a Windows DLL file, how can I retrieve its version number
> > (e.g.: 2.40.4275.1)? Does Win32 extensions, ctypes or related modules
> > provide such a utility?

Thanks. However, I still have problems. What I need are the 4-part
version numbers, which GetFileVersionInfo() does not provide.

I tried several alternatives, including GetFileVersionInfo() and the
mwi module. However, these alternatives do NOT give the 4-part version
number that one sees by right-clicking on a DLL (on Win2k.) The
puzzling part is that apparently at the C level, the data structure
_DllVersionInfo contains only 3 parts: dwMajorVersion, dwMinorVersion,
dwBuildNumber.

(For COMCAT.DLL, GetFileVersionInfo() gives only two-part version
number: 4.71, whereas if you right click in Windows 2000, you get a
four-part version number: 4.71.1460.1)

Anyway, the relationship between the 4-part version number and the
3-part version number is highly non-trivial and I do not see any easy
rules that applies to all DLLs. (For some DLLs, the last part of a
3-part version number can be split into the last two parts of the
4-version number, but this rule is not universal.)

I wonder what Windows uses internally to get the 4-part version
numbers?

regards,

Hung Jung



More information about the Python-list mailing list