##// END OF EJS Templates
Tried to fix the windows post install script. It now creates...
Brian Granger -
Show More
@@ -2,6 +2,7 b''
2 2 """Windows-specific part of the installation"""
3 3
4 4 import os, sys, shutil
5 pjoin = os.path.join
5 6
6 7 def mkshortcut(target,description,link_file,*args,**kw):
7 8 """make a shortcut if it doesn't exist, and register its creation"""
@@ -11,14 +12,8 b' def mkshortcut(target,description,link_file,*args,**kw):'
11 12
12 13 def install():
13 14 """Routine to be run by the win32 installer with the -install switch."""
14
15
15 16 from IPython.Release import version
16
17 # Get some system constants
18 prefix = sys.prefix
19 python = prefix + r'\python.exe'
20 # Lookup path to common startmenu ...
21 ip_dir = get_special_folder_path('CSIDL_COMMON_PROGRAMS') + r'\IPython'
22 17
23 18 # Some usability warnings at installation time. I don't want them at the
24 19 # top-level, so they don't appear if the user is uninstalling.
@@ -27,53 +22,74 b' def install():'
27 22 except ImportError:
28 23 print ('To take full advantage of IPython, you need ctypes from:\n'
29 24 'http://sourceforge.net/projects/ctypes')
30
25
31 26 try:
32 27 import win32con
33 28 except ImportError:
34 29 print ('To take full advantage of IPython, you need pywin32 from:\n'
35 30 'http://starship.python.net/crew/mhammond/win32/Downloads.html')
36
31
37 32 try:
38 33 import readline
39 34 except ImportError:
40 35 print ('To take full advantage of IPython, you need readline from:\n'
41 36 'https://launchpad.net/pyreadline')
42
43 ipybase = '"' + prefix + r'\scripts\ipython"'
37
38 # Get some system constants
39 prefix = sys.prefix
40 python = pjoin(prefix, 'python.exe')
41
42 # Lookup path to common startmenu ...
43 ip_start_menu = pjoin(get_special_folder_path('CSIDL_COMMON_PROGRAMS'), 'IPython')
44 44 # Create IPython entry ...
45 if not os.path.isdir(ip_dir):
46 os.mkdir(ip_dir)
47 directory_created(ip_dir)
45 if not os.path.isdir(ip_start_menu):
46 os.mkdir(ip_start_menu)
47 directory_created(ip_start_menu)
48
49 # Create .py and .bat files to make things available from
50 # the Windows command line
51 programs = 'ipython iptest ipcontroller ipengine ipcluster'
52 scripts = pjoin(prefix,'scripts')
53 for program in programs.split():
54 raw = pjoin(scripts, program)
55 bat = raw + '.bat'
56 py = raw + '.py'
57 # Create .py versions of the scripts
58 shutil.copy(raw, py)
59 # Create .bat files for each of the scripts
60 bat_file = file(bat,'w')
61 bat_file.write("@%s %s %%*" % (python, py))
62 bat_file.close()
63
64 # Now move onto setting the Start Menu up
65 ipybase = '"' + prefix + r'\scripts\ipython"'
48 66
49 67 # Create program shortcuts ...
50 f = ip_dir + r'\IPython.lnk'
68 f = ip_start_menu + r'\IPython.lnk'
51 69 a = ipybase
52 70 mkshortcut(python,'IPython',f,a)
53
54 f = ip_dir + r'\pysh.lnk'
71
72 f = ip_start_menu + r'\pysh.lnk'
55 73 a = ipybase+' -p sh'
56 74 mkshortcut(python,'IPython (command prompt mode)',f,a)
57
58 f = ip_dir + r'\pylab.lnk'
75
76 f = ip_start_menu + r'\pylab.lnk'
59 77 a = ipybase+' -pylab'
60 78 mkshortcut(python,'IPython (PyLab mode)',f,a)
61
62 f = ip_dir + r'\scipy.lnk'
79
80 f = ip_start_menu + r'\scipy.lnk'
63 81 a = ipybase+' -pylab -p scipy'
64 82 mkshortcut(python,'IPython (scipy profile)',f,a)
65
83
66 84 # Create documentation shortcuts ...
67 85 t = prefix + r'\share\doc\ipython\manual\ipython.pdf'
68 f = ip_dir + r'\Manual in PDF.lnk'
86 f = ip_start_menu + r'\Manual in PDF.lnk'
69 87 mkshortcut(t,r'IPython Manual - PDF-Format',f)
70
88
71 89 t = prefix + r'\share\doc\ipython\manual\html\index.html'
72 f = ip_dir + r'\Manual in HTML.lnk'
90 f = ip_start_menu + r'\Manual in HTML.lnk'
73 91 mkshortcut(t,'IPython Manual - HTML-Format',f)
74
75 # make ipython.py
76 shutil.copy(prefix + r'\scripts\ipython', prefix + r'\scripts\ipython.py')
92
77 93
78 94 def remove():
79 95 """Routine to be run by the win32 installer with the -remove switch."""
General Comments 0
You need to be logged in to leave comments. Login now