I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 03c24ef1 authored by kytv's avatar kytv
Browse files

query the status of the service before doing anything

parent 93d3710f
No related branches found
No related tags found
No related merge requests found
......@@ -83,6 +83,20 @@ if not [%_WRAPPER_CONF%]==[""] (
)
set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT%"
:: Query status of service.
:: We remove an existing service to
:: 1) force the service to stop (this will stop the "can't upgrade
:: because file is in use" forum posts from people re-running the
:: installer to get the new version.
:: 2) update service configuration in case wrapper.config was edited
:: 3) prevent hanging the installer if 'install as service' is selected
:: and it's already enabled as a service.
"%_WRAPPER_EXE%" -qs %_WRAPPER_CONF%
if not %errorlevel%==0 (
"%_WRAPPER_EXE%" -r %_WRAPPER_CONF%
call "%~dp0set_config_dir_for_nt_service.bat" uninstall
)
:: Add service path to wrapper.config
call "%_REALPATH%"\set_config_dir_for_nt_service.bat install
......@@ -97,20 +111,12 @@ set _PARAMETERS=%_PARAMETERS% %1
shift
if not [%1]==[] goto :parameters
:: We remove the existing service to
:: 1) force the service to stop
:: 2) update service configuration in case wrapper.config was edited
:: 3) prevent hanging the installer if 'install as service' is selected
:: and it's already enabled as a service.
if [%_PASS_THROUGH%]==[] (
"%_WRAPPER_EXE%" -r %_WRAPPER_CONF%
"%_WRAPPER_EXE%" -i %_WRAPPER_CONF%
) else (
"%_WRAPPER_EXE%" -r %_WRAPPER_CONF% -- %_PARAMETERS%
"%_WRAPPER_EXE%" -i %_WRAPPER_CONF% -- %_PARAMETERS%
)
if not errorlevel 1 goto :eof
if "%2"=="--nopause" goto :eof
pause
:eof
......@@ -82,6 +82,16 @@ if not [%_WRAPPER_CONF%]==[""] (
)
set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT%"
:: check status of the service. If %errorlevel% is 0
:: the service is not installed. If the service
:: isn't installed there isn't anything for us to do
:: other than exit.
"%_WRAPPER_EXE%" -qs %_WRAPPER_CONF%
if %errorlevel%==0 (
echo The I2P Service service was not installed.
goto eof
)
call "%_REALPATH%"\set_config_dir_for_nt_service.bat uninstall
rem
rem Uninstall the Wrapper as an NT service.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment