-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstaller.bat
More file actions
67 lines (50 loc) · 2.21 KB
/
installer.bat
File metadata and controls
67 lines (50 loc) · 2.21 KB
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
@echo OFF
REM TODO use the call command to set some variables common to both the installer/uninstaller
set PYTHON_VERSION=2.7.2
set PYTHON_SHORT_VERSION=2.7
set PYWIN32_BUILD=216
set APACHE_VERSION=2.2.21
set WAMP_VERSION=2.2a
set ADDON=Python
set BIN=installer\bin
set TMP=installer\temp
set WAMP=c:\wamp
set WAMP_PYTHON=%WAMP%\bin\python
set WAMP_APACHE_MODULES=%WAMP%\bin\apache\apache%APACHE_VERSION%\modules
set PYTHON_FILE=python-%PYTHON_VERSION%.msi
set PYWIN32_FILE=pywin32-%PYWIN32_BUILD%.win32-py%PYTHON_SHORT_VERSION%.exe
set PYTHON_DIR=python%PYTHON_VERSION%
set PYTHON_BIN=%WAMP_PYTHON%\%PYTHON_DIR%
set PYTHON_DOWNLOAD=http://python.org/ftp/python/%PYTHON_VERSION%/%PYTHON_FILE%
set PYWIN32_DOWNLOAD=http://downloads.sourceforge.net/project/pywin32/pywin32/Build%PYWIN32_BUILD%/%PYWIN32_FILE%
set PATH=%PATH%;%BIN%
echo Welcome to the %ADDON% Addon installer for WampServer %WAMP_VERSION%
REM set up the temp directory
IF NOT EXIST %TMP% GOTO MKTMP
echo Temp directory found from previous install: DELETING
rd /S /Q %TMP%
:MKTMP
echo Setting up the temp directory...
mkdir %TMP%
REM download Python files to temp directory
echo Downloading %ADDON% binaries to temp directory...
wget.exe -nd -q -P %TMP% %PYTHON_DOWNLOAD%
if not %ERRORLEVEL%==0 (echo FAIL: could not download %ADDON% binaries& pause& exit 1)
wget.exe -nd -q -P %TMP% %PYWIN32_DOWNLOAD%
if not %ERRORLEVEL%==0 echo WARNING: could not download %ADDON% win32 extensions
REM install the binary files in the WampServer install directory
echo Installing %ADDON% to the WampServer install directory...
msiexec /i %TMP%\%PYTHON_FILE% /passive TARGETDIR=%PYTHON_BIN%
if not %ERRORLEVEL%==0 (echo FAIL: could not install %ADDON% binaries& pause& exit 1)
REM FIXME: 25
echo Installing the Windows Extensions for Python...
%TMP%\%PYWIN32_FILE%
if not %ERRORLEVEL%==0 echo WARNING: could not install %ADDON% win32 extensions
REM add the Python bin directory to the PATH so apache can find them
echo Setting enviorment variables...
setenv -a PATH %PYTHON_BIN%
REM clean up temp files
echo Cleaning up temp files...
rd /S /Q %TMP%
echo %ADDON% is installed successfully. Please restart WampServer.
pause