[python-win32] Re: py2exe 0.5 and WMI?
Thomas Heller
theller at python.net
Wed Feb 25 14:12:10 EST 2004
"Stefan Holmgren" <stefan.holmgren at accalon.se> writes:
> 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
Stefan, I thought of this:
Assuming you want to create the exe on the XP machine:
Go to the win2k machine, run your program there, and a folder named
win32com\gen_py\565783C6-CB41-11D1-8B02-00600806D9B6x0x1x1
should be created. This contains the makepy generated Python wrappers
for version 1.1 of the wmi typelibs.
Copy this folder to the XP machine, which should now have both the
folders
win32com\gen_py\565783C6-CB41-11D1-8B02-00600806D9B6x0x1x1
and
win32com\gen_py\565783C6-CB41-11D1-8B02-00600806D9B6x0x1x2
Now, change your setup script so that wrappers for both typelibs are
included:
options = {"py2exe": {"typelibs":
# typelibs for WMI
[('{565783C6-CB41-11D1-8B02-00600806D9B6}', 0, 1, 1),
('{565783C6-CB41-11D1-8B02-00600806D9B6}', 0, 1, 2)],
and build the exe by running the setup script.
Now you should have an exe which should be able to run on both 2k and XP
machines.
Probably you did something having the same effect.
Thomas
More information about the Python-win32
mailing list