[Distutils] --post-install on win32

Thomas Heller theller@python.net
Thu Jan 9 03:14:02 2003


Cory Dodt <corydodt@yahoo.com> writes:

> I have been working with the --post-install option to bdist_wininst and
> have noticed the following behavior, which appears to be a bug or possibly
> a misdesign.  The consequence of this behavior is at the end, it will take
> some explaining to get there...
> 
> I'm going to use the following terms:
> 
> pre-build time: the moment you issue the command
>                 C:\...\>setup.py bdist_wininst --install-script=x
> build time: while build_* is happening
> post-install time: after you've run the bdist_wininst installer and gone
> through the wizard; the very last page of the wizard, when it runs the
> post-install script.
> post-install-arg: what you gave as an argument to --install-script=...
> 
> The argument to --install-script at pre-build time has to match an entry
> in setup_args['scripts'], that is, if you have
>   { ... 'scripts': ['my-postinstall.py'] }
> You have to provide --install-script=my-postinstall.py but if you have
>   { ... 'scripts': ['win32/my-postinstall.py'] }
> You have to provide --install-script=win32\my-postinstall.py
> 
> If they don't match, bdist_wininst gives up with the error "install_script
> 'my-postinstall.py' not found in scripts".
> 
> At install time, the basename part of <post-install-arg> gets copied to
> C:\python22\scripts, regardless of where it was found at pre-build-time,
> so you always have C:\python22\scripts\my-postinstall.py.
> 
> But at post-install time, the installer looks for
> C:\python22\scripts\<post-install-arg>.  That is:
> 
> --install-script=<argument>                           where it searches
> ---------------------------                           -----------------
> my-postinstall.py                 C:\python22\scripts\my-postinstall.py
> win32\my-postinstall.py     C:\python22\scripts\win32\my-postinstall.py
> (I have verified this with filemon.exe.)

I thought I fixed this bug before Python 2.3a0, but it seems it's not.
Which version are you using?

Thomas