Changeset 03c24ef


Ignore:
Timestamp:
Sep 17, 2011 10:15:45 PM (8 years ago)
Author:
kytv <kytv@…>
Branches:
master
Children:
a48ed65
Parents:
93d3710f
Message:

query the status of the service before doing anything

Location:
installer/resources
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • installer/resources/install_i2p_service_winnt.bat

    r93d3710f r03c24ef  
    8484set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT%"
    8585
     86:: Query status of service.
     87:: We remove an existing service to
     88:: 1) force the service to stop (this will stop the "can't upgrade
     89::    because file is in use" forum posts from people re-running the
     90::    installer to get the new version.
     91:: 2) update service configuration in case wrapper.config was edited
     92:: 3) prevent hanging the installer if 'install as service' is selected
     93::    and it's already enabled as a service.
     94"%_WRAPPER_EXE%" -qs %_WRAPPER_CONF%
     95 if not %errorlevel%==0 (
     96     "%_WRAPPER_EXE%" -r %_WRAPPER_CONF%
     97     call "%~dp0set_config_dir_for_nt_service.bat" uninstall
     98)
     99
    86100:: Add service path to wrapper.config
    87101call "%_REALPATH%"\set_config_dir_for_nt_service.bat install
     
    98112if not [%1]==[] goto :parameters
    99113
    100 :: We remove the existing service to
    101 :: 1) force the service to stop
    102 :: 2) update service configuration in case wrapper.config was edited
    103 :: 3) prevent hanging the installer if 'install as service' is selected
    104 ::    and it's already enabled as a service.
    105114if [%_PASS_THROUGH%]==[] (
    106     "%_WRAPPER_EXE%" -r %_WRAPPER_CONF%
    107115    "%_WRAPPER_EXE%" -i %_WRAPPER_CONF%
    108116) else (
    109     "%_WRAPPER_EXE%" -r %_WRAPPER_CONF% -- %_PARAMETERS%
    110117    "%_WRAPPER_EXE%" -i %_WRAPPER_CONF% -- %_PARAMETERS%
    111118)
    112119if not errorlevel 1 goto :eof
    113 if "%2"=="--nopause" goto :eof
    114120pause
    115121
  • installer/resources/uninstall_i2p_service_winnt.bat

    r93d3710f r03c24ef  
    8383set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT%"
    8484
     85:: check status of the service. If %errorlevel% is 0
     86:: the service is not installed. If the service
     87:: isn't installed there isn't anything for us to do
     88:: other than exit.
     89"%_WRAPPER_EXE%" -qs %_WRAPPER_CONF%
     90if %errorlevel%==0 (
     91     echo The I2P Service service was not installed.
     92     goto eof
     93)
     94
    8595call "%_REALPATH%"\set_config_dir_for_nt_service.bat uninstall
    8696rem
Note: See TracChangeset for help on using the changeset viewer.