py2exe for WMI

GMane Python s_david_rose at hotmail.com
Tue May 24 09:50:45 EDT 2005


Hello All.
  I'm trying to 'compile-to-EXE' a python program which uses Win32 & WMI to
pull system info. from the PC such as serial number, CPU speed, etc.  I'm
having problems with py2exe -- with regard to Win2000 & WinXP platforms.  It
seems that the program only works if I have one typelib for WinXP and a
slightly different one for Win2000.  Here is my relevent section from the
py2exe setup.py:
setup(
    options = {"py2exe": {"typelibs":
##                          # typelib for WMI - WinXP
##                          [('{565783C6-CB41-11D1-8B02-00600806D9B6}', 0,
1, 2)],

                          # typelib for WMI - Win2000
                          [('{565783C6-CB41-11D1-8B02-00600806D9B6}', 0, 1,
1)],

                          # create a compressed zip archive
                          "compressed": 1,
                          "optimize": 2,
                          "packages": ["encodings"],
                          "excludes": excludes}},
    # The lib directory contains everything except the executables and the
python dll.
    # Can include a subdirectory name.
    zipfile = "lib/shared.zip",

Can anyone tell me how I might make one unified py2exe setup.py that'll
'compile' for both Win2000 & WinXP?

If not, can someone give me a hint as to how I can have a python 'launcher'
which can determine the difference between Win2000 & WinXP?  Using the
sys.platform, they both show as Win32.

Thanks!
Dave






More information about the Python-list mailing list