1@echo off 2rem INSTALL.BAT - Easy installer for Python modules on Windows 3 4rem version 0.03 2013-05-07 Philippe Lagadec - https://www.decalage.info 5 6rem License: 7rem This file install.bat can freely used, modified and redistributed, as 8rem long as credit to the author is kept intact. Please send any feedback, 9rem issues or improvements to decalage at laposte.net. 10 11rem CHANGELOG: 12rem 2007-09-04 v0.01 PL: - first version, for Python 2.3 to 2.5 13rem 2009-02-27 v0.02 PL: - added support for Python 2.6 14rem 2013-05-07 v0.03 PL: - added support for Python 2.7 15 16rem 1) test if python.exe is in the path: 17 18python.exe --version >NUL 2>&1 19if errorlevel 1 goto notpath 20echo Python.exe found in the path. 21python setup.py install 22if errorlevel 1 goto error 23goto end 24:NOTPATH 25 26rem 2) test for usual python.exe paths: 27 28REM Python 2.7: 29c:\python27\python.exe --version >NUL 2>&1 30if errorlevel 1 goto notpy27 31echo Python.exe found in C:\Python27 32c:\python27\python.exe setup.py install 33if errorlevel 1 goto error 34goto end 35:NOTPY27 36 37"c:\program files\python\python.exe" --version >NUL 2>&1 38if errorlevel 1 goto notpf 39echo Python.exe found in C:\Program Files\Python 40"c:\program files\python\python.exe" setup.py install 41if errorlevel 1 goto error 42goto end 43:NOTPF 44 45rem 3) last we just try to launch the script, if .py is associated to python.exe 46echo Python.exe not found, trying to launch setup.py directly. 47setup.py install 48if errorlevel 1 goto error 49goto end 50 51:ERROR 52echo. 53echo If the installation is not successful, try to run "python setup.py install" 54echo or simply "setup.py install" in the script directory. 55echo You can also copy files by hand in the site-package directory of your 56echo Python directory. 57REM pause 58 59:END 60pause 61