winapi32.GetFileVersionInfo() - problem

Heiko Wundram modelnine at ceosg.de
Fri Mar 25 06:58:36 EST 2005


> <snip the fourth and hopefully last repost>

Do you actually think anybody will reply to your mail if you keep reposting at 
this frequency? It'll rather make most people here kill-file you.

One post is enough; we've seen your problem, and it seems as though nobody 
here has a better solution than what Dennis Lee Bieber has already offered.

Just to make sure you understand what he said, I'll repeat it here: Your DLL 
doesn't contain a resources section, which in turn contains the version 
information you're asking for. So, please start reading MSDN and the VC++ 
documentation on how to add this information to your DLL.

If you wish to catch the exception that's raised (because the resource block 
isn't present), use something like the following:

try:
    d = win32api.GetFileVersionInfo(fname,r"\")
except:
    d = None

if d is None:
    print "No version info in file!"
else:
    <do something with the version info>

-- 
--- Heiko.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20050325/f9be7c64/attachment.sig>


More information about the Python-list mailing list