[python-win32] Re: py2exe 0.5 and WMI?

Stefan Holmgren stefan.holmgren at accalon.se
Tue Feb 24 06:04:59 EST 2004


Hi, Thomas...

I made this thing to work, but I don't think it's a nice way to solve it...

.. At first I did a setup.py py2exe as below on my XP.
.. Then I opened the shared.zip and extracted all
'win32com\gen_py\565783C6-CB41-11D1-8B02-00600806D9B6x0x1x2' files
.. and renamed them to
'win32com\gen_py\565783C6-CB41-11D1-8B02-00600806D9B6x0x1x1'
.. appended the new structur into the zip-file..
.. In shared.zip I now got same files doubled
'win32com\gen_py\565783C6-CB41-11D1-8B02-00600806D9B6x0x1x2' and
'win32com\gen_py\565783C6-CB41-11D1-8B02-00600806D9B6x0x1x1'

Hope u understand what I have done!
This is working for me....
/Holmis

"Thomas Heller" <theller at python.net> skrev i meddelandet
news:smh15ypi.fsf at python.net...
> "Stefan Holmgren" <stefan.holmgren at accalon.se> writes:
>
> > At first... I'm new to py2exe.... the McMillian Installer is not
working.
> > I'm running py2exe on windows XP with this
> >     options = {"py2exe": {"typelibs":
> >                           # typelib for WMI
> >                           [('{565783C6-CB41-11D1-8B02-00600806D9B6}', 0,
1,
> > 2)],
> >
> > it is working well on that mashine.....
> >
> > When i'm trying to run my new exe-file on windows 2000 i got an error:
> >
> > Traceback (most recent call last):
> >   File "wxApp1.py", line 6, in ?
> >   File "wxFrame1.pyo", line 9, in ?
> >   File "wmi.pyo", line 132, in ?
> >   File "win32com\client\gencache.pyo", line 527, in EnsureDispatch
> >   File "win32com\client\CLSIDToClass.pyo", line 50, in GetClass
> > KeyError: '{76A6415C-CB41-11D1-8B02-00600806D9B6}'
>
> -------------------------------------------------------------------------
> >
> > Then when I rerun py2exe on my windows 2000, I have to change last digit
in
> > option to , 1:
> >     options = {"py2exe": {"typelibs":
> >                           # typelib for WMI
> >                           [('{565783C6-CB41-11D1-8B02-00600806D9B6}', 0,
1,
> > 1)],
> >
> > ok, how can I make this exe-file to work on both XP and 2000??
>
> I don't know if this is really the 'right' thing to do, but it seems to
> me that there are different typelibs on win2k and XP.  You could try to
> copy the win32com\gen_py\565783C6-CB41-11D1-8B02-00600806D9B6x0x1x1
> directory from the win2k machine to the XP machine, and build the exe
> there.
>
> options should then probably be set to this:
>
>      options = {"py2exe": {"typelibs":
>                    # typelibs for WMI
>                    [('{565783C6-CB41-11D1-8B02-00600806D9B6}', 0, 1, 1),
>                     ('{565783C6-CB41-11D1-8B02-00600806D9B6}', 0, 1, 2)],
>
>
> A totally different idea would be to create the makepy wrappers on the
> target machine, but I'm quite sure that doesn't work currently.
>
> If you find a solution (or even if not), it would be nice if you submit
> a short recipe to the py2exe wiki for people having similar problems.
>
> Thomas






More information about the Python-win32 mailing list