@ECHO OFF
CHCP 936 1>nul 2>nul

REM ====Run It As Administrator====
set FikCDNTempFileName=%SystemRoot%\System32\Test-UAC-In-FikCDN-%Random%-%Random%.temp
(echo "1" > %FikCDNTempFileName%) 1>nul 2>nul
if not exist %FikCDNTempFileName% (
echo !!!必须以Administrator用户权限运行!!!
pause
exit
) else (
del %FikCDNTempFileName% 1>nul 2>nul
)

REM ====请在这里设定安装目录====
if not exist .\local\FikCron\FikCron.exe (
cd /d C:\FikkerCDN 1>nul 2>nul
if not exist .\local\FikCron\FikCron.exe (
cd /d D:\FikkerCDN 1>nul 2>nul
if not exist .\local\FikCron\FikCron.exe (
echo !!!找不到安装包目录!!!请用记事本打开'注册服务.bat'文件自行设定!!!
pause
exit
)
)
)

echo ====Install Services====
.\local\apache2\bin\httpd.exe -k install -n "FikkerCDN_Apache2_Service"
.\local\mysql5\bin\mysqld.exe -install FikkerCDN_Mysql_Service
.\local\FikCron\FikCron.exe -install
pause
