Skip to content
This repository

Add post_install script to create start menu entries in Python 3 #1143

Closed
wants to merge 1 commit into from

2 participants

Thomas Kluyver Min RK
Thomas Kluyver
Collaborator

This should fix #1119, but I can't test it, because I don't have a Windows machine handy, and Python in Wine seems to be having problems.

Can someone with a Windows machine test it? You'll need Python 3.2 installed. With this branch checked out, run C:\python32\python.exe setup.py bdist_wininst. This will produce a .exe installer - run that, and see if it completes without errors and creates start menu entries for IPython on Python 3.

Min RK
Owner

Thanks, this I understand and am super comfortable with, so I'll do a test in a VM, and merge if it works.

Min RK
Owner

Various few small fixes (print_statement, '3' suffix on files) are required to the script itself, but I've made them locally and this works just fine. I'll merge in a sec.

Min RK minrk referenced this pull request from a commit December 11, 2011
Min RK Merge PR #1143 (Python3 StartMenu items)
Start Menu items are now installed with bdist_wininst on Python 3.

closes #1143
5047149
Min RK minrk closed this pull request from a commit December 11, 2011
Min RK Merge PR #1143 (Python3 StartMenu items)
Start Menu items are now installed with bdist_wininst on Python 3.

closes #1143
5047149
Min RK minrk closed this in 5047149 December 11, 2011
Thomas Kluyver
Collaborator

Thanks, Min.

Brian E. Granger ellisonbg referenced this pull request from a commit January 10, 2012
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Dec 11, 2011
Thomas Kluyver Add post_install script to create start menu entries in Python 3. e64bea0
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 15 additions and 0 deletions. Show diff stats Hide diff stats

  1. 15  setup3.py
15  setup3.py
... ...
@@ -1,4 +1,5 @@
1 1
 import os.path
  2
+import sys
2 3
 from setuptools import setup
3 4
 from setuptools.command.build_py import build_py
4 5
 
@@ -14,6 +15,20 @@
14 15
 setup_args['package_data'] = find_package_data()
15 16
 setup_args['cmdclass'] = {'build_py': record_commit_info('IPython', build_cmd=build_py)}
16 17
 
  18
+# Script to be run by the windows binary installer after the default setup
  19
+# routine, to add shortcuts and similar windows-only things.  Windows
  20
+# post-install scripts MUST reside in the scripts/ dir, otherwise distutils
  21
+# doesn't find them.
  22
+if 'bdist_wininst' in sys.argv:
  23
+    if len(sys.argv) > 2 and \
  24
+           ('sdist' in sys.argv or 'bdist_rpm' in sys.argv):
  25
+        print >> sys.stderr, "ERROR: bdist_wininst must be run alone. Exiting."
  26
+        sys.exit(1)
  27
+    setup_args['scripts'] = [os.path.join('scripts','ipython_win_post_install.py')]
  28
+    setup_args['options'] = {"bdist_wininst":
  29
+                             {"install_script":
  30
+                              "ipython_win_post_install.py"}}
  31
+
17 32
 def main():
18 33
     setup(use_2to3 = True, **setup_args)
19 34
     
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.