-
Notifications
You must be signed in to change notification settings - Fork 563
/
install.bat
103 lines (87 loc) · 2.86 KB
/
install.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
@echo off
rem INSTALL.BAT - Easy installer for Python modules on Windows
rem version 0.04 2014-02-24 Philippe Lagadec - http://www.decalage.info
rem License:
rem This file install.bat can freely used, modified and redistributed, as
rem long as credit to the author is kept intact. Please send any feedback,
rem issues or improvements to decalage at laposte.net.
rem CHANGELOG:
rem 2007-09-04 v0.01 PL: - first version, for Python 2.3 to 2.5
rem 2009-02-27 v0.02 PL: - added support for Python 2.6
rem 2013-05-07 v0.03 PL: - added support for Python 2.7
rem 2014-02-24 v0.04 PL: - added support for py.exe
rem 1) test if py.exe or python.exe is in the path:
rem (py.exe is better because it can select python 2 or 3 according to shebang lines)
py.exe --version >NUL 2>&1
if errorlevel 1 goto notpy
echo py.exe found in the path.
py.exe setup.py install
if errorlevel 1 goto error
goto end
:NOTPY
python.exe --version >NUL 2>&1
if errorlevel 1 goto notpath
echo Python.exe found in the path.
python setup.py install
if errorlevel 1 goto error
goto end
:NOTPATH
rem 2) test for usual python.exe paths:
REM Python 2.7:
c:\python27\python.exe --version >NUL 2>&1
if errorlevel 1 goto notpy27
echo Python.exe found in C:\Python27
c:\python27\python.exe setup.py install
if errorlevel 1 goto error
goto end
:NOTPY27
REM Python 2.6:
c:\python26\python.exe --version >NUL 2>&1
if errorlevel 1 goto notpy26
echo Python.exe found in C:\Python26
c:\python26\python.exe setup.py install
if errorlevel 1 goto error
goto end
:NOTPY26
c:\python25\python.exe --version >NUL 2>&1
if errorlevel 1 goto notpy25
echo Python.exe found in C:\Python25
c:\python25\python.exe setup.py install
if errorlevel 1 goto error
goto end
:NOTPY25
c:\python24\python.exe --version >NUL 2>&1
if errorlevel 1 goto notpy24
echo Python.exe found in C:\Python24
c:\python24\python.exe setup.py install
if errorlevel 1 goto error
goto end
:NOTPY24
c:\python23\python.exe --version >NUL 2>&1
if errorlevel 1 goto notpy23
echo Python.exe found in C:\Python23
c:\python23\python.exe setup.py install
if errorlevel 1 goto error
goto end
:NOTPY23
"c:\program files\python\python.exe" --version >NUL 2>&1
if errorlevel 1 goto notpf
echo Python.exe found in C:\Program Files\Python
"c:\program files\python\python.exe" setup.py install
if errorlevel 1 goto error
goto end
:NOTPF
rem 3) last we just try to launch the script, if .py is associated to python.exe
echo Python.exe not found, trying to launch setup.py directly.
setup.py install
if errorlevel 1 goto error
goto end
:ERROR
echo.
echo If the installation is not successful, try to run "python setup.py install"
echo or simply "setup.py install" in the script directory.
echo You can also copy files by hand in the site-package directory of your
echo Python directory.
REM pause
:END
pause