From e64bea04da00025a399f5f4029ce451fa00b8f6a 2011-12-11 13:25:34 From: Thomas Kluyver Date: 2011-12-11 13:25:34 Subject: [PATCH] Add post_install script to create start menu entries in Python 3. --- diff --git a/setup3.py b/setup3.py index 4cc13a7..a7bc9ab 100644 --- a/setup3.py +++ b/setup3.py @@ -1,4 +1,5 @@ import os.path +import sys from setuptools import setup from setuptools.command.build_py import build_py @@ -14,6 +15,20 @@ setup_args['packages'] = find_packages() setup_args['package_data'] = find_package_data() setup_args['cmdclass'] = {'build_py': record_commit_info('IPython', build_cmd=build_py)} +# Script to be run by the windows binary installer after the default setup +# routine, to add shortcuts and similar windows-only things. Windows +# post-install scripts MUST reside in the scripts/ dir, otherwise distutils +# doesn't find them. +if 'bdist_wininst' in sys.argv: + if len(sys.argv) > 2 and \ + ('sdist' in sys.argv or 'bdist_rpm' in sys.argv): + print >> sys.stderr, "ERROR: bdist_wininst must be run alone. Exiting." + sys.exit(1) + setup_args['scripts'] = [os.path.join('scripts','ipython_win_post_install.py')] + setup_args['options'] = {"bdist_wininst": + {"install_script": + "ipython_win_post_install.py"}} + def main(): setup(use_2to3 = True, **setup_args)