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.
This commit is contained in:
kytv
2011-06-14 22:00:42 +00:00
parent 336ecda7e6
commit 1a52363218

View File

@@ -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