Running apache\apache_installservice.bat produces the following error:
- Code: Select all
The service name is invalid.
More help is available by typing NET HELPMSG 2185.
Running apache\apache_uninstallservice.bat produces the following error:
- Code: Select all
The specified service does not exist as an installed service.
The reason is that the BAT-files still contains references to the old Apache 2.2 version. This should be fixed by changing "Apache2.2" to "Apache2.4" in apache_installservice.bat on lines 11, 13 and 14 and in apache_uninstallservice.bat on lines 12, 13 and 14.
A better solution might be to use an environment variable for the service name, like so:
- apache_installservice.bat
- Code: Select all
@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
setlocal
set SERVICE=Apache2.4
echo Installing %SERVICE% as an Service
bin\httpd -k install
echo Now we Start %SERVICE% :)
net start %SERVICE%
endlocal
:exit
pause
- apache_uninstallservice.bat
- Code: Select all
@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
setlocal
set SERVICE=Apache2.4
echo Are you sure you wan't this?
echo now stopping %SERVICE% when it runs
net stop %SERVICE%
echo Time to say good bye to %SERVICE% :(
bin\httpd -k uninstall
endlocal
:exit
pause