Changeset d084d18


Ignore:
Timestamp:
Sep 10, 2011 3:54:30 PM (8 years ago)
Author:
kytv <kytv@…>
Branches:
master
Children:
435bc826
Parents:
690f62b
Message:

Update of Windows service installation/removal scripts

These scripts are based on InstallApp?-NT.bat.in and UninstallApp?-NT.bat.in from
WRAPPERSRC/src/bin of version 3.5.9 of the wrapper.

Tested in XP and Win7.

Location:
installer/resources
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • installer/resources/install_i2p_service_winnt.bat

    r690f62b rd084d18  
    22setlocal
    33
     4rem Copyright (c) 1999, 2011 Tanuki Software, Ltd.
     5rem http://www.tanukisoftware.com
     6rem All rights reserved.
     7rem
     8rem This software is the proprietary information of Tanuki Software.
     9rem You shall use it only in accordance with the terms of the
     10rem license agreement you entered into with Tanuki Software.
     11rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html
    412rem
    513rem Java Service Wrapper general NT service install script
    614rem
    715
     16rem -----------------------------------------------------------------------------
     17rem These settings can be modified to fit the needs of your application
     18rem Optimized for use with version 3.5.9 of the Wrapper.
     19
     20rem The base name for the Wrapper binary.
     21set _WRAPPER_BASE=i2psvc
     22
     23rem The name and location of the Wrapper configuration file.   This will be used
     24rem  if the user does not specify a configuration file as the first argument to
     25rem  this script.
     26set _WRAPPER_CONF_DEFAULT=.\wrapper.config
     27
     28rem _PASS_THROUGH tells the script to pass all arguments through to the JVM
     29rem  as is.
     30rem set _PASS_THROUGH=true
     31
     32rem Do not modify anything beyond this point
     33rem -----------------------------------------------------------------------------
     34
     35rem
     36rem Resolve the real path of the wrapper.exe
     37rem  For non NT systems, the _REALPATH and _WRAPPER_CONF values
     38rem  can be hard-coded below and the following test removed.
     39rem
    840if "%OS%"=="Windows_NT" goto nt
    941echo This script only works with NT-based versions of Windows.
     
    1648rem %~dp0 is location of current script under NT
    1749set _REALPATH=%~dp0
    18 set _WRAPPER_EXE=%_REALPATH%I2Psvc.exe
     50
     51rem
     52rem Decide on the specific Wrapper binary to use (See delta-pack)
     53rem
     54if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto amd64
     55if "%PROCESSOR_ARCHITECTURE%"=="IA64" goto ia64
     56set _WRAPPER_L_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-x86-32.exe
     57goto search
     58:amd64
     59set _WRAPPER_L_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-x86-64.exe
     60goto search
     61:ia64
     62set _WRAPPER_L_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-ia-64.exe
     63goto search
     64:search
     65set _WRAPPER_EXE=%_WRAPPER_L_EXE%
     66if exist "%_WRAPPER_EXE%" goto conf
     67set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%.exe
     68if exist "%_WRAPPER_EXE%" goto conf
     69echo Unable to locate a Wrapper executable using any of the following names:
     70echo %_WRAPPER_L_EXE%
     71echo %_WRAPPER_EXE%
     72pause
     73goto :eof
    1974
    2075rem
     
    2378:conf
    2479set _WRAPPER_CONF="%~f1"
    25 if not %_WRAPPER_CONF%=="" goto startup
    26 set _WRAPPER_CONF="%_REALPATH%wrapper.config"
     80if not [%_WRAPPER_CONF%]==[""] (
     81    shift
     82    goto :startup
     83)
     84set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT%"
    2785
     86:: Add service path to wrapper.config
    2887call "%_REALPATH%"\set_config_dir_for_nt_service.bat install
    2988
     
    3291rem
    3392:startup
     93
     94rem Collect an parameters
     95:parameters
     96set _PARAMETERS=%_PARAMETERS% %1
     97shift
     98if not [%1]==[] goto :parameters
     99
    34100:: We remove the existing service to
    35101:: 1) force the service to stop
     
    37103:: 3) prevent hanging the installer if 'install as service' is selected
    38104::    and it's already enabled as a service.
    39 "%_WRAPPER_EXE%" -r %_WRAPPER_CONF%
    40 "%_WRAPPER_EXE%" -i %_WRAPPER_CONF%
     105if [%_PASS_THROUGH%]==[] (
     106    "%_WRAPPER_EXE%" -r %_WRAPPER_CONF%
     107    "%_WRAPPER_EXE%" -i %_WRAPPER_CONF%
     108) else (
     109    "%_WRAPPER_EXE%" -r %_WRAPPER_CONF% -- %_PARAMETERS%
     110    "%_WRAPPER_EXE%" -i %_WRAPPER_CONF% -- %_PARAMETERS%
     111)
    41112if not errorlevel 1 goto :eof
    42 if %2=="--nopause" goto :eof
     113if "%2"=="--nopause" goto :eof
    43114pause
    44115
  • installer/resources/uninstall_i2p_service_winnt.bat

    r690f62b rd084d18  
    22setlocal
    33
     4rem Copyright (c) 1999, 2011 Tanuki Software, Ltd.
     5rem http://www.tanukisoftware.com
     6rem All rights reserved.
     7rem
     8rem This software is the proprietary information of Tanuki Software.
     9rem You shall use it only in accordance with the terms of the
     10rem license agreement you entered into with Tanuki Software.
     11rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html
    412rem
    513rem Java Service Wrapper general NT service uninstall script
    614rem
    715
     16rem -----------------------------------------------------------------------------
     17rem These settings can be modified to fit the needs of your application
     18rem Optimized for use with version 3.5.9 of the Wrapper.
     19
     20rem The base name for the Wrapper binary.
     21set _WRAPPER_BASE=i2psvc
     22
     23rem The name and location of the Wrapper configuration file.   This will be used
     24rem  if the user does not specify a configuration file as the first argument to
     25rem  this script.
     26set _WRAPPER_CONF_DEFAULT=.\wrapper.config
     27
     28rem Note that it is only possible to pass parameters through to the JVM when
     29rem  installing the service, or when running in a console.
     30
     31rem Do not modify anything beyond this point
     32rem -----------------------------------------------------------------------------
     33
     34rem
     35rem Resolve the real path of the wrapper.exe
     36rem  For non NT systems, the _REALPATH and _WRAPPER_CONF values
     37rem  can be hard-coded below and the following test removed.
     38rem
    839if "%OS%"=="Windows_NT" goto nt
    940echo This script only works with NT-based versions of Windows.
     
    1647rem %~dp0 is location of current script under NT
    1748set _REALPATH=%~dp0
    18 set _WRAPPER_EXE=%_REALPATH%I2Psvc.exe
    19 call "%_REALPATH%"\set_config_dir_for_nt_service.bat uninstall
     49
     50rem
     51rem Decide on the specific Wrapper binary to use (See delta-pack)
     52rem
     53if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto amd64
     54if "%PROCESSOR_ARCHITECTURE%"=="IA64" goto ia64
     55set _WRAPPER_L_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-x86-32.exe
     56goto search
     57:amd64
     58set _WRAPPER_L_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-x86-64.exe
     59goto search
     60:ia64
     61set _WRAPPER_L_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-ia-64.exe
     62goto search
     63:search
     64set _WRAPPER_EXE=%_WRAPPER_L_EXE%
     65if exist "%_WRAPPER_EXE%" goto conf
     66set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%.exe
     67if exist "%_WRAPPER_EXE%" goto conf
     68echo Unable to locate a Wrapper executable using any of the following names:
     69echo %_WRAPPER_L_EXE%
     70echo %_WRAPPER_EXE%
     71pause
     72goto :eof
    2073
    2174rem
     
    2477:conf
    2578set _WRAPPER_CONF="%~f1"
    26 if not %_WRAPPER_CONF%=="" goto startup
    27 set _WRAPPER_CONF="%_REALPATH%wrapper.config"
     79if not [%_WRAPPER_CONF%]==[""] (
     80    shift
     81    goto :startup
     82)
     83set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT%"
    2884
     85call "%_REALPATH%"\set_config_dir_for_nt_service.bat uninstall
    2986rem
    3087rem Uninstall the Wrapper as an NT service.
Note: See TracChangeset for help on using the changeset viewer.