[Distutils] bdist_winexe command

Thomas Heller thomas.heller@ion-tof.com
Thu Nov 16 11:13:00 2000


I'm currently writing (it is nearly finished)
a bdist_wininst command, which is modeled
after Gordon's windows installer.

This command will create standalone executable
exe-files for the win32 platform from the
scripts which are specified in the setup script.

The exe-file contains all the python modules needed
by the script as well as the script itself in a
zip-archive appended to a small stub program.

The only other file needed is pythonxx.dll in
the same directory as the exe-file itself.
There is no need that the normal python distribution
is installed on the system.

Note: In case the script needs extension modules
(*.dll or *.pyd files) these are needed as separate files
as well, because they cannot be packed into the zip-archive.
(Well, they could be packed, but they would have to be
extracted before starting the script. This is in fact
what Gordon's installer does.)

Another note: There will be an option to use another stub,
which contains the extensions distributed with python as
separate pyd's: _sre, socket, zlib, ...

So far, so good.

Now for the problems:

1. I intend to distribute this command as a distutils
extension.
Unfortunately, it's a shame that we cannot use distutils
to distribute itself (or additional commands).
Distutils would install itself (in windows speak) in
c:\Python20\distutils, whereas the stock distutils
is located in c:\Python20\lib\distutils.
Should there be a special hack in the setup script?

2. Should this command be integrated into distutils?
Perhaps it is far too early for this question.

3. I would like to avoid the mistake I made in bdist_wininst,
that the stub program's bytes are appended to the text
of the bdist_wininst.py file, base64 encoded.
So there would be one (or more) binary file winstub.exe somewhere
on the file system.
Where?
  distutils\commands\winstub.exe
  distutils\data\winstub.exe
?

Thomas