1_install_service.bat 1.5 KB
Newer Older
1 2
@echo off
setlocal
3
pushd "%~dp0"
4

5
copy /y /b ..\bin\h2-*.jar ..\bin\h2.jar
6 7 8 9 10
fc /b ..\bin\h2-*.jar ..\bin\h2.jar
if not errorlevel 1 goto :start
echo Please ensure there is only one h2-*.jar file.
echo Process stopped
pause
11
goto :end
12

13
:start
14 15 16 17 18 19
rem Copyright (c) 1999, 2006 Tanuki Software Inc.
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.
20
goto :end
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41

:nt
rem
rem Find the application home.
rem
rem %~dp0 is location of current script under NT
set _REALPATH=%~dp0

rem Decide on the wrapper binary.
set _WRAPPER_BASE=wrapper
set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-x86-32.exe
if exist "%_WRAPPER_EXE%" goto conf
set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-x86-64.exe
if exist "%_WRAPPER_EXE%" goto conf
set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%.exe
if exist "%_WRAPPER_EXE%" goto conf
echo Unable to locate a Wrapper executable using any of the following names:
echo %_REALPATH%%_WRAPPER_BASE%-windows-x86-32.exe
echo %_REALPATH%%_WRAPPER_BASE%-windows-x86-64.exe
echo %_REALPATH%%_WRAPPER_BASE%.exe
pause
42
goto :end
43

44
:conf
45 46 47 48 49 50 51
rem
rem Find the wrapper.conf
rem
set _WRAPPER_CONF="%~f1"
if not %_WRAPPER_CONF%=="" goto startup
set _WRAPPER_CONF="%_REALPATH%wrapper.conf"

52
:startup
53 54 55 56
rem
rem Install the Wrapper as an NT service.
rem
"%_WRAPPER_EXE%" -i %_WRAPPER_CONF%
57
if not errorlevel 1 goto :end
58 59
pause

60
:end
61
popd