Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Windows workdir #198

Merged
2 commits merged into from

2 participants

@ddale

The IPython windows installer creates links in the start menu, but the working directory is not specified and defaults to something like C:\Windows . This small patch sets the default working directory to the current user's home directory.

@ddale ddale specify windows working directory
The create_shortcut built-in function used in the windows post-installation
script allows the working directory to be specified. If it is not specified,
the working directory will default to something like "C:\Windows". Specifying
the working directory as "%HOMEDRIVE%%HOMEPATH%" seems a better default, it
sets the working directory the the current user's home directory.
fd5c092
@fperez
Owner

Darren, does the installer actually work? Last time I checked it, I got no Start menu entries made at all, but debugging that stuff is terribly unpleasant and time-consuming, and I couldn't afford the time...

@ddale

I know, every time I have to work with windows, I work myself into a white-hot fury. That I bothered to offer this improvement is proof of my everlasting love for you, I mean IPython, I mean that I had to do it for a project of my own and wanted IPython to benefit as well.

But you were right, the post-install routines were kinda hosed, especially when setuptools is installed. I just posted an additional commit that takes care of it. As far as I can tell, windows post-installation scripts only work with bdist_wininst, they don't seem to be executed with bdist_msi. Worth bearing in mind when it comes time to cutting a release.

@fperez
Owner

Thanks a lot, Darren! Given how much I hate debugging that windows installer, you've just earned a beer next time we meet :)

Merging now, merge commit will close the request when I push in a sec.

@damianavila damianavila referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 2, 2010
  1. @ddale

    specify windows working directory

    ddale authored
    The create_shortcut built-in function used in the windows post-installation
    script allows the working directory to be specified. If it is not specified,
    the working directory will default to something like "C:\Windows". Specifying
    the working directory as "%HOMEDRIVE%%HOMEPATH%" seems a better default, it
    sets the working directory the the current user's home directory.
  2. @ddale
This page is out of date. Refresh to see the latest.
Showing with 10 additions and 8 deletions.
  1. +9 −5 scripts/ipython_win_post_install.py
  2. +0 −2  setup.py
  3. +1 −1  setupbase.py
View
14 scripts/ipython_win_post_install.py
@@ -51,26 +51,30 @@ def install():
# Now move onto setting the Start Menu up
ipybase = pjoin(scripts, 'ipython')
+ if 'setuptools' in sys.modules:
+ # let setuptools take care of the scripts:
+ ipybase = ipybase + '-script.py'
+ workdir = "%HOMEDRIVE%%HOMEPATH%"
link = pjoin(ip_start_menu, 'IPython.lnk')
cmd = '"%s"' % ipybase
- mkshortcut(python,'IPython',link,cmd)
+ mkshortcut(python, 'IPython', link, cmd, workdir)
link = pjoin(ip_start_menu, 'pysh.lnk')
cmd = '"%s" -p sh' % ipybase
- mkshortcut(python,'IPython (command prompt mode)',link,cmd)
+ mkshortcut(python, 'IPython (command prompt mode)', link, cmd, workdir)
link = pjoin(ip_start_menu, 'scipy.lnk')
cmd = '"%s" -p scipy' % ipybase
- mkshortcut(python,'IPython (scipy profile)',link,cmd)
+ mkshortcut(python, 'IPython (scipy profile)', link, cmd, workdir)
link = pjoin(ip_start_menu, 'ipcontroller.lnk')
cmd = '"%s" -xy' % pjoin(scripts, 'ipcontroller')
- mkshortcut(python,'IPython controller',link,cmd)
+ mkshortcut(python, 'IPython controller', link, cmd, workdir)
link = pjoin(ip_start_menu, 'ipengine.lnk')
cmd = '"%s"' % pjoin(scripts, 'ipengine')
- mkshortcut(python,'IPython engine',link,cmd)
+ mkshortcut(python, 'IPython engine', link, cmd, workdir)
# Create documentation shortcuts ...
t = prefix + r'\share\doc\ipython\manual\ipython.pdf'
View
2  setup.py
@@ -232,8 +232,6 @@ def cleanup():
test='nose>=0.10.1',
security='pyOpenSSL>=0.6'
)
- # Allow setuptools to handle the scripts
- scripts = []
else:
# If we are running without setuptools, call this function which will
# check for dependencies an inform the user what is needed. This is
View
2  setupbase.py
@@ -278,7 +278,7 @@ def find_scripts():
file=sys.stderr)
sys.exit(1)
scripts.append(pjoin('scripts','ipython_win_post_install.py'))
-
+
return scripts
#---------------------------------------------------------------------------
Something went wrong with that request. Please try again.