-
Notifications
You must be signed in to change notification settings - Fork 2
/
start.cmd
44 lines (39 loc) · 1.14 KB
/
start.cmd
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
@ECHO OFF
cd /D %~dp0
set "_FilePath=%~f0"
setlocal EnableExtensions EnableDelayedExpansion
fltmc >nul 2>&1 || (
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\GetAdmin.vbs"
echo UAC.ShellExecute "!_FilePath!", "", "", "runas", 1 >> "%temp%\GetAdmin.vbs"
"%temp%\GetAdmin.vbs"
del /f /q "%temp%\GetAdmin.vbs" >nul 2>&1
exit
)
call :stop_apache
call :stop_mysql
call :start_apache
call :start_mysql
explorer http://localhost/
echo [Success] Installation completed.
pause
goto :eof
:start_apache
COPY php\libssh2.dll C:\Windows\System32\libssh2.dll
COPY php\libeay32.dll C:\Windows\System32\libeay32.dll
COPY php\ssleay32.dll C:\Windows\System32\ssleay32.dll
apache\bin\httpd -t
apache\bin\httpd -k install -n .apache
net start .apache
goto :eof
:stop_apache
(sc query .apache | find ".apache">nul && net stop .apache)
(sc query .apache | find ".apache">nul && sc delete .apache)
goto :eof
:start_mysql
mysql\bin\mysqld --install .mysql
(sc query .mysql | find ".mysql">nul && net start .mysql)
goto :eof
:stop_mysql
(sc query .mysql | find ".mysql">nul && net stop .mysql)
(sc query .mysql | find ".mysql">nul && sc delete .mysql)
goto :eof