You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

InstallNTService.bat 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. @echo off
  2. setlocal
  3. rem Copyright (c) 1999, 2006 Tanuki Software Inc.
  4. rem
  5. rem Java Service Wrapper general NT service install script
  6. rem
  7. if "%OS%"=="Windows_NT" goto nt
  8. echo This script only works with NT-based versions of Windows.
  9. goto :eof
  10. :nt
  11. rem
  12. rem Find the application home.
  13. rem
  14. rem %~dp0 is location of current script under NT
  15. set _REALPATH=%~dp0
  16. rem Decide on the wrapper binary.
  17. set _WRAPPER_BASE=wrapper
  18. set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-x86-32.exe
  19. if exist "%_WRAPPER_EXE%" goto conf
  20. set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-x86-64.exe
  21. if exist "%_WRAPPER_EXE%" goto conf
  22. set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%.exe
  23. if exist "%_WRAPPER_EXE%" goto conf
  24. echo Unable to locate a Wrapper executable using any of the following names:
  25. echo %_REALPATH%%_WRAPPER_BASE%-windows-x86-32.exe
  26. echo %_REALPATH%%_WRAPPER_BASE%-windows-x86-64.exe
  27. echo %_REALPATH%%_WRAPPER_BASE%.exe
  28. pause
  29. goto :eof
  30. rem
  31. rem Find the wrapper.conf
  32. rem
  33. :conf
  34. set _WRAPPER_CONF="%~f1"
  35. if not %_WRAPPER_CONF%=="" goto startup
  36. set _WRAPPER_CONF="%_REALPATH%..\..\conf\wrapper.conf"
  37. rem
  38. rem Install the Wrapper as an NT service.
  39. rem
  40. :startup
  41. "%_WRAPPER_EXE%" -i %_WRAPPER_CONF%
  42. if not errorlevel 1 goto :eof
  43. pause