[Distutils] [ANN] setuptools post install script for bdist_wininst
manlio.perillo at gmail.com
Sat Sep 11 16:42:40 CEST 2010
-----BEGIN PGP SIGNED MESSAGE-----
Following the suggestion to use a post installation script in order to
install dependencies for a package installed using bdist_wininst, I
wrote this reusable script:
In order to use it, the script must be declared as a script in the
In order to ensure setuptools is installed, the same should be do with
the ez_setup bootstrap script.
The ez_post_install script will do:
1) Get the installed project name by parsing the bdist_wininst file name
2) Make sure setuptools is installed (if ez_setup is available)
3) Install all dependencies of the installed package, using easy_install
4) Optionally add shortcuts of all gui scripts in the
Start Menu\Programs\<project name> special folder
5) Optionally add shortcuts of all gui scripts in the Desktop
Since the post install script may take some time downloading and
installing packages, the UI of the Windows installer is frozen, without
giving user any feedback.
This is a problem with the installer, since stdout and stderr are fully
In case a dependency have extension code that must compiled, in 99% of
the cases the post install script will fail, since the compiler or some
library is not available.
This should not happen; the post install script should, instead, check
if in the package download_url there is a bdist_wininst executable,
download it and execute it.
Suggestions are welcome.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
-----END PGP SIGNATURE-----
More information about the Distutils-SIG