InstallApp-NT.bat 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. @echo off
  2. setlocal
  3. rem
  4. rem Copyright (c) 1999, 2011 Tanuki Software, Ltd.
  5. rem http://www.tanukisoftware.com
  6. rem All rights reserved.
  7. rem
  8. rem This software is the proprietary information of Tanuki Software.
  9. rem You shall use it only in accordance with the terms of the
  10. rem license agreement you entered into with Tanuki Software.
  11. rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html
  12. rem
  13. rem Java Service Wrapper general passthrough startup script.
  14. rem
  15. rem -----------------------------------------------------------------------------
  16. rem These settings can be modified to fit the needs of your application
  17. rem Optimized for use with version 3.5.14 of the Wrapper.
  18. rem The base name for the Wrapper binary.
  19. set _WRAPPER_BASE=wrapper
  20. rem The name and location of the Wrapper configuration file. This will be used
  21. rem if the user does not specify a configuration file as the first argument to
  22. rem this script.
  23. set _WRAPPER_CONF_DEFAULT=../conf/wrapper.conf
  24. rem _PASS_THROUGH tells the script to pass all arguments through to the JVM
  25. rem as is.
  26. rem set _PASS_THROUGH=true
  27. rem Do not modify anything beyond this point
  28. rem -----------------------------------------------------------------------------
  29. rem
  30. rem Resolve the real path of the wrapper.exe
  31. rem For non NT systems, the _REALPATH and _WRAPPER_CONF values
  32. rem can be hard-coded below and the following test removed.
  33. rem
  34. if "%OS%"=="Windows_NT" goto nt
  35. echo This script only works with NT-based versions of Windows.
  36. goto :eof
  37. :nt
  38. rem
  39. rem Find the application home.
  40. rem
  41. rem %~dp0 is location of current script under NT
  42. set _REALPATH=%~dp0
  43. rem
  44. rem Decide on the specific Wrapper binary to use (See delta-pack)
  45. rem
  46. if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto amd64
  47. if "%PROCESSOR_ARCHITECTURE%"=="IA64" goto ia64
  48. set _WRAPPER_L_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-x86-32.exe
  49. goto search
  50. :amd64
  51. set _WRAPPER_L_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-x86-64.exe
  52. goto search
  53. :ia64
  54. set _WRAPPER_L_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-ia-64.exe
  55. goto search
  56. :search
  57. set _WRAPPER_EXE=%_WRAPPER_L_EXE%
  58. if exist "%_WRAPPER_EXE%" goto conf
  59. set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%.exe
  60. if exist "%_WRAPPER_EXE%" goto conf
  61. echo Unable to locate a Wrapper executable using any of the following names:
  62. echo %_WRAPPER_L_EXE%
  63. echo %_WRAPPER_EXE%
  64. pause
  65. goto :eof
  66. rem
  67. rem Find the wrapper.conf
  68. rem
  69. :conf
  70. set _WRAPPER_CONF="%~f1"
  71. if not [%_WRAPPER_CONF%]==[""] (
  72. shift
  73. goto :startup
  74. )
  75. set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT%"
  76. rem
  77. rem Start the Wrapper
  78. rem
  79. :startup
  80. rem Collect an parameters
  81. :parameters
  82. set _PARAMETERS=%_PARAMETERS% %1
  83. shift
  84. if not [%1]==[] goto :parameters
  85. if [%_PASS_THROUGH%]==[] (
  86. "%_WRAPPER_EXE%" -i %_WRAPPER_CONF%
  87. ) else (
  88. "%_WRAPPER_EXE%" -i %_WRAPPER_CONF% -- %_PARAMETERS%
  89. )
  90. if not errorlevel 1 goto :eof
  91. pause