2004-08-19 04:48:42 +00:00
|
|
|
@echo off
|
|
|
|
setlocal
|
|
|
|
|
|
|
|
rem
|
|
|
|
rem Java Service Wrapper general NT service install script
|
|
|
|
rem
|
|
|
|
|
|
|
|
if "%OS%"=="Windows_NT" goto nt
|
|
|
|
echo This script only works with NT-based versions of Windows.
|
|
|
|
goto :eof
|
|
|
|
|
|
|
|
:nt
|
|
|
|
rem
|
|
|
|
rem Find the application home.
|
|
|
|
rem
|
|
|
|
rem %~dp0 is location of current script under NT
|
|
|
|
set _REALPATH=%~dp0
|
2004-08-19 05:41:36 +00:00
|
|
|
set _WRAPPER_EXE=%_REALPATH%I2Psvc.exe
|
2004-08-19 04:48:42 +00:00
|
|
|
|
|
|
|
rem
|
|
|
|
rem Find the wrapper.conf
|
|
|
|
rem
|
|
|
|
:conf
|
|
|
|
set _WRAPPER_CONF="%~f1"
|
|
|
|
if not %_WRAPPER_CONF%=="" goto startup
|
2004-09-09 02:26:42 +00:00
|
|
|
set _WRAPPER_CONF="%_REALPATH%wrapper.config"
|
2004-08-19 04:48:42 +00:00
|
|
|
|
2011-08-31 17:11:23 +00:00
|
|
|
call "%_REALPATH%"\set_config_dir_for_nt_service.bat install
|
|
|
|
|
2004-08-19 04:48:42 +00:00
|
|
|
rem
|
|
|
|
rem Install the Wrapper as an NT service.
|
|
|
|
rem
|
|
|
|
:startup
|
2011-06-14 22:00:42 +00:00
|
|
|
:: We remove the existing service to
|
|
|
|
:: 1) force the service to stop
|
|
|
|
:: 2) update service configuration in case wrapper.config was edited
|
2011-08-31 17:11:23 +00:00
|
|
|
:: 3) prevent hanging the installer if 'install as service' is selected
|
2011-06-14 22:00:42 +00:00
|
|
|
:: and it's already enabled as a service.
|
|
|
|
"%_WRAPPER_EXE%" -r %_WRAPPER_CONF%
|
2004-08-19 04:48:42 +00:00
|
|
|
"%_WRAPPER_EXE%" -i %_WRAPPER_CONF%
|
|
|
|
if not errorlevel 1 goto :eof
|
2011-03-12 21:53:55 +00:00
|
|
|
if %2=="--nopause" goto :eof
|
2004-08-19 04:48:42 +00:00
|
|
|
pause
|
|
|
|
|
2011-06-14 21:45:20 +00:00
|
|
|
:eof
|