@echo off
set INSTDIR=d:\SOFT_PHP_PACKAGE
if NOT Exist %INSTDIR% md %INSTDIR%
if NOT Exist %INSTDIR% (
	echo "安装目录不存在，安装中止"
	exit
)

REM ===========================PHP============

md %INSTDIR%\php
md %INSTDIR%\phptmp


cacls %INSTDIR%\php /e /g everyone:r
cacls %INSTDIR%\phptmp /e /g everyone:f
cacls d:\ /e /g everyone:r

xcopy php %INSTDIR%\php /e /c /q /h /r /y

md %INSTDIR%\Zend
cacls %INSTDIR%\Zend /e /g everyone:r

xcopy Zend %INSTDIR%\Zend /e /c /q /h /r /y


REM ===========================PHPMYADMIN============

md %INSTDIR%\phpmyadmin
cacls %INSTDIR%\phpmyadmin /e /g everyone:r

xcopy phpmyadmin %INSTDIR%\phpmyadmin /e /c /q /h /r /y

REM ===========================MYSQL============

md %INSTDIR%\mysql
net user mysql china2008go /add
kit\ntrights.exe +R SeServiceLogonRight -u mysql
cacls %INSTDIR%\mysql /e /g mysql:r
xcopy mysql %INSTDIR%\mysql /e /c /q /h /r /y
echo y|cacls %INSTDIR%\mysql /t /P administrators:f mysql:f
%INSTDIR%\mysql\bin\mysqld.exe --install
sc config mysql obj= .\mysql password= china2008go
net start mysql

cscript install.vbs
regedit /s inst.reg