forked from jonsito/AgilityContest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAgilityContest.bat
62 lines (50 loc) · 1.78 KB
/
AgilityContest.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
@echo off
call settings.bat
cd /d %~dp0\xampp
echo AgilityContest Launch Script
rem for windows 8 and 10 disable w3svc service
net stop W3SVC
if not exist ..\logs\first_install GOTO mysql_start
echo Configuring first boot of XAMPP
set PHP_BIN=php\php.exe
set CONFIG_PHP=install\install.php
%PHP_BIN% -n -d output_buffering=0 -q %CONFIG_PHP% usb
:mysql_start
echo MySQL Database is trying to start
echo Please wait ....
start /B "" mysql\bin\mysqld --defaults-file=mysql\bin\my.ini --standalone --console
timeout /t 5
:apache_start
echo Starting Apache Web Server....
start /B "" apache\bin\httpd.exe
timeout /t 5
if not exist ..\logs\first_install GOTO browser_start
echo Creating AgilityContest Databases. Please wait
timeout /t 5
echo DROP DATABASE IF EXISTS agility; > ..\logs\install.sql
echo CREATE DATABASE agility; >> ..\logs\install.sql
echo USE agility; >> ..\logs\install.sql
type ..\extras\agility.sql >> ..\logs\install.sql
type ..\extras\users.sql >> ..\logs\install.sql
mysql\bin\mysql -u root < ..\logs\install.sql
del ..\logs\install.sql
del ..\logs\first_install
:browser_start
echo Opening AgilityContest console...
start /W /MAX "AgilityContest" https://localhost/agility/console
echo Please wait for navigator window to show up...
echo -------------------------------------------
echo DO NOT CLOSE THIS WINDOW UNTIL SESSION END
echo -------------------------------------------
set /p key= Press enter to finish AgilityContest session
echo Apache Web Server shutdowm ...
apache\bin\pv -f -k httpd.exe -q
if not exist apache\logs\httpd.pid GOTO stop_mysql
del apache\logs\httpd.pid
:stop_mysql
echo MySQL DataBase shutdowm ...
apache\bin\pv -f -k mysqld.exe -q
if not exist mysql\data\%computername%.pid GOTO finish
echo Delete %computername%.pid ...
del mysql\data\%computername%.pid
:finish