From c02e0f4810cea9fa84c3c57d67a930a48ca092b5 Mon Sep 17 00:00:00 2001 From: "shiyangyangwork@yahoo.cn" Date: Thu, 1 Mar 2012 06:23:43 +0000 Subject: [PATCH] * add for running apache and mysql as service. --- build/windows/xampp/apache_installservice.bat | 17 +++++++++ .../windows/xampp/apache_uninstallservice.bat | 18 ++++++++++ build/windows/xampp/mysql_installservice.bat | 36 +++++++++++++++++++ .../windows/xampp/mysql_uninstallservice.bat | 20 +++++++++++ 4 files changed, 91 insertions(+) create mode 100755 build/windows/xampp/apache_installservice.bat create mode 100755 build/windows/xampp/apache_uninstallservice.bat create mode 100755 build/windows/xampp/mysql_installservice.bat create mode 100755 build/windows/xampp/mysql_uninstallservice.bat diff --git a/build/windows/xampp/apache_installservice.bat b/build/windows/xampp/apache_installservice.bat new file mode 100755 index 0000000000..6a0ecff7fb --- /dev/null +++ b/build/windows/xampp/apache_installservice.bat @@ -0,0 +1,17 @@ +@echo off + +if "%OS%" == "Windows_NT" goto WinNT + +:Win9X +echo Don't be stupid! Win9x don't know Services +echo Please use apache_start.bat instead +goto exit + +:WinNT +echo Installing Apache2.2 as an Service +bin\httpd -k install +echo Now we Start Apache2.2 :) +net start Apache2.2 + +:exit +pause diff --git a/build/windows/xampp/apache_uninstallservice.bat b/build/windows/xampp/apache_uninstallservice.bat new file mode 100755 index 0000000000..2ec028ed79 --- /dev/null +++ b/build/windows/xampp/apache_uninstallservice.bat @@ -0,0 +1,18 @@ +@echo off + +if "%OS%" == "Windows_NT" goto WinNT + +:Win9X +echo Don't be stupid! Win9x don't know Services +echo Please use apache_stop.bat instead +goto exit + +:WinNT +echo Are you sure you wan't this? +echo now stopping Apache2.2 when it runs +net stop Apache2.2 +echo Time to say good bye to Apache2.2 :( +bin\httpd -k uninstall + +:exit +pause diff --git a/build/windows/xampp/mysql_installservice.bat b/build/windows/xampp/mysql_installservice.bat new file mode 100755 index 0000000000..902f74d9fa --- /dev/null +++ b/build/windows/xampp/mysql_installservice.bat @@ -0,0 +1,36 @@ +@echo off + +if "%OS%" == "Windows_NT" goto WinNT + +:Win9X +echo Don't be stupid! Win9x don't know Services +echo Please use mysql_start.bat instead +goto exit + +:WinNT +if exist %windir%\my.ini GOTO CopyINI +if exist c:\my.cnf GOTO CopyCNF +if not exist %windir%\my.ini GOTO MainNT +if not exist c:\my.cnf GOTO MainNT + +:CopyINI +echo Safe the %windir%\my.ini as %windir%\my.ini.old! +copy %windir%\my.ini /-y %windir%\my.ini.old +del %windir%\my.ini +GOTO WinNT + +:CopyCNF +echo Safe the c:\my.cnf as c:\my.cnf.old! +copy c:\my.cnf /-y c:\my.cnf.old +del c:\my.cnf +GOTO WinNT + +:MainNT +echo Installing MySQL as an Service +copy "%cd%\bin\my.cnf" /-y %windir%\my.ini +bin\mysqld --install mysql --defaults-file="%cd%\bin\my.ini" +echo Try to start the MySQL deamon as service ... +net start MySQL + +:exit +pause diff --git a/build/windows/xampp/mysql_uninstallservice.bat b/build/windows/xampp/mysql_uninstallservice.bat new file mode 100755 index 0000000000..365751c594 --- /dev/null +++ b/build/windows/xampp/mysql_uninstallservice.bat @@ -0,0 +1,20 @@ +@echo off + +if "%OS%" == "Windows_NT" goto WinNT + +:Win9X +echo Don't be stupid! Win9x don't know Services +echo Please use mysql_stop.bat instead +goto exit + +:WinNT +echo now stopping MySQL when it runs +net stop mysql +echo Uninstalling MySql-Service +bin\mysqld.exe --remove mysql +if not exist %windir%\my.ini GOTO exit +echo Remove %windir%\my.ini +del %windir%\my.ini + +:exit +pause