[Distutils] bdist_wininst: post-installation changes?
Thomas Heller
thomas.heller@ion-tof.com
Mon Apr 29 13:14:25 2002
From: "M.-A. Lemburg" <mal@lemburg.com>
> Steven Knight wrote:
> >
> > I don't think this is supported, but I just want to make sure...
> >
> > Is there any way, in the generated Win32 installer, to have it perform
> > some arbitrary post-installation editing?
>
> Yes. Thomas Heller has checked in an update of the installer
> which supports this. You have to get it from CVS, though.
>
Right. The only documentation so far are the last two logmessages
(ask me if you need more):
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/python/distutils/misc/install.c
and the updated bdist_wininst.py is here (watch out for wrapped URL):
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/python/distutils/distutils/command/bdist_wininst.py?rev=1.31
> > To cover Win9x systems, I'd like to install a .bat file in C:\PythonXX\
> > using the Bruce Eckel preamble from the Python FAQ:
> >
> > @echo off
> > rem = """
> > rem run python on this bat file. Needs the full path where
> > rem you keep your python files. The -x causes python to skip
> > rem the first line of the file:
> > python -x c:\aaa\Python\\"%0".bat %1 %2 %3 %4 %5 %6 %7 %8 %9
> > goto endofpython
> > rem """
> >
> > # The python program goes here:
> >
> > The problem is that the "%0" expansion needs the full path name to where
> > the .bat file is installed (C:\PythonXX\), and that's not known until
> > the installer runs and consults the registry to find out where Python is
> > located.
Bruce's preamble can be simplyfied to this one:
@runpython c:\aaa\Python\%0.bat %1 %2 %3 %4 %5 %6 %7 %8 %9
# start of python code
print "Hello" # or whatever
# EOF - you don't have to supply the 'endofpython' footer from above.
when you have a batch file in your PATH named 'runpython.bat'
which looks like this:
@c:\python22\python -x %1 %2 %3 %4 %5 %6 %7 %8 %9
The full path before the %0.bat in the first file is still needed,
unfortunately (or you always have to call your batch file with it's full
pathname).
Thomas