From 1a523632182d30160a3844b6d1686966b052f93b Mon Sep 17 00:00:00 2001 From: kytv Date: Tue, 14 Jun 2011 22:00:42 +0000 Subject: [PATCH] Attempt to remove the service before trying to install it. My rationale for this: 1) in case someone is installing I2P on top of an already existing installation this will cause I2P to be shutdown 2) no hangs during the installation if i2p is already installed as a service 3) in case the NT service settings are changed in wrapper.config by us, this will force the service settings to be updated. 4) versions of I2P < 0.8.7 did not remove the service when uninstalling. If someone removed I2P in the past and reinstalls I2P--opting to run as a service--the installation process will hang. --- installer/resources/install_i2p_service_winnt.bat | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/installer/resources/install_i2p_service_winnt.bat b/installer/resources/install_i2p_service_winnt.bat index b24527e0c..5fe310680 100644 --- a/installer/resources/install_i2p_service_winnt.bat +++ b/installer/resources/install_i2p_service_winnt.bat @@ -29,6 +29,12 @@ rem rem Install the Wrapper as an NT service. rem :startup +:: 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. +"%_WRAPPER_EXE%" -r %_WRAPPER_CONF% "%_WRAPPER_EXE%" -i %_WRAPPER_CONF% if not errorlevel 1 goto :eof if %2=="--nopause" goto :eof