-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.bat
More file actions
104 lines (80 loc) · 3.41 KB
/
install.bat
File metadata and controls
104 lines (80 loc) · 3.41 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
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
104
@echo OFF
REM script requires mysql to be running
set BUGZILLA_VERSION=4.2
set APACHE_VERSION=2.2.21
set WAMP_VERSION=2.2d
set MYSQL_VERSION=5.5.20
set MYSQL_USER=root
set MYSQL_PASSWORD=
set BUGZILLA_ANSWERS=files\answers.txt
set DB_SETUP_SCRIPT=files\createdb.sql
set LOCALCONFIG=files\localconfig
set ADDON=Bugzilla
set BIN=installer\bin
REM using %MYTMP% in this script because install-module.pl fails to install
REM some modules if %TMP% is changed from default. might need to open a bug with bugzilla
set MYTMP=installer\temp
set WAMP=c:\wamp
set WAMP_ALIAS=%WAMP%\alias
set WAMP_APPS=%WAMP%\apps
set WAMP_MYSQL=%WAMP%\bin\mysql\mysql%MYSQL_VERSION%\bin
set WAMP_BUGZILLA=%WAMP_APPS%\bugzilla%BUGZILLA_VERSION%
set BUGZILLA_FILE=bugzilla-%BUGZILLA_VERSION%
set BUGZILLA_DIR=Bugzilla%BUGZILLA_VERSION%
set BUGZILLA_BIN=%WAMP_BUGZILLA%
set BUGZILLA_DOWNLOAD=http://ftp.mozilla.org/pub/mozilla.org/webtools/%BUGZILLA_FILE%.tar.gz
set BUGZILLA_ALIAS=bugzilla.conf
set PATH=%PATH%;%BIN%;%WAMP_MYSQL%
echo Welcome to the %ADDON% Addon installer for WampServer %WAMP_VERSION%
REM set up the temp directory
IF NOT EXIST %MYTMP% GOTO MKTMP
echo Temp directory found from previous install: DELETING
rd /S /Q %MYTMP%
:MKTMP
echo Setting up the temp directory...
mkdir %MYTMP%
REM download Bugzilla archive to temp directory
echo Downloading %ADDON% binaries to temp directory...
wget.exe -nd -q -P %MYTMP% %BUGZILLA_DOWNLOAD%
if not %ERRORLEVEL%==0 (echo FAIL: could not download %ADDON% binaries& pause& exit 1)
REM unzip the downloaded source files and install them
echo Extracting the files from the downloaded archive...
gzip.exe -d %MYTMP%\%BUGZILLA_FILE%.tar.gz
REM FIXME: 1, 2
tar.exe -xf %MYTMP%\%BUGZILLA_FILE%.tar -C "installer\\temp"
if not %ERRORLEVEL%==0 (echo FAIL: could not extract downloaded files& pause& exit 1)
REM install the binary files in the WampServer install directory
echo Moving the files to the WampServer install directory...
ren %MYTMP%\%BUGZILLA_FILE% %BUGZILLA_DIR%
xcopy /E /I /Q %MYTMP%\%BUGZILLA_DIR% %WAMP_APPS%\%BUGZILLA_DIR%
if not %ERRORLEVEL%==0 (echo FAIL: could not move the files& pause& exit 1)
REM install the apache config file for Bugzilla
echo Installing %ADDON% configuration files...
copy wamp\alias\%BUGZILLA_ALIAS% %WAMP_ALIAS%
if not %ERRORLEVEL%==0 (echo FAIL: could not install WampServer alias file& pause& exit 1)
REM install extra perl modules needed by Bugzilla
echo Installing extra Perl modules needed by Bugzilla...
echo This could take several minutes. Please be patient.
pushd %WAMP_BUGZILLA%
REM FIXME: 3
perl install-module.pl --all > NUL 2>&1
popd
REM fix shbang so windows can guess CGI interpreter without requiring registry edits
for /R %WAMP_BUGZILLA% %%i in (*.cgi *.pl) do perl -p -i.bak -e "s@/usr/bin/@@" %%i
REM FIXME getting some access denied errors on delete.
for /R %WAMP_BUGZILLA% %%i in (*.bak) do del %%i
REM setup MySQL database/user for Bugzilla
echo Setting up the %ADDON% database
mysql -u %MYSQL_USER% < %DB_SETUP_SCRIPT%
copy %LOCALCONFIG% %WAMP_BUGZILLA%
REM FIXME 7
copy %BUGZILLA_ANSWERS% %WAMP_BUGZILLA%
pushd %WAMP_BUGZILLA%
perl %WAMP_BUGZILLA%\checksetup.pl answers.txt > NUL 2>&1
del %WAMP_BUGZILLA%\answers.txt
popd
REM clean up temp files
echo Cleaning up temp files...
rd /S /Q %MYTMP%
echo %ADDON% is installed successfully. Please restart WampServer.
pause