Files
i2p.i2p/installer/resources/install_i2p_service_winnt.bat
kytv 9e6f993af5 De-fuglify the service path in Windows
The default service path in Windows is fugly and not very convenient. I2P uses
the correct path, but if you want to access snark or eepsite data, one must go to
%SYSTEMROOT%\config\systemprofile\AppData\Roaming\I2P\ (Vista/7) or
%SYSTEMROOT%\system32\config\systemprofile\Application Data\I2P (XP/2003). If
this wasn't bad enough, in some cases one must take ownership of this path and
grant permission to him- or herself to access the folder.

With this changeset, I'm setting the path to %ALLUSERSPROFILE%\Application
Data\I2P as well as adding a shortcut to the I2P folder in the Start menu.
2011-08-31 17:11:23 +00:00

46 lines
1.0 KiB
Batchfile

@echo off
setlocal
rem
rem Java Service Wrapper general NT service install script
rem
if "%OS%"=="Windows_NT" goto nt
echo This script only works with NT-based versions of Windows.
goto :eof
:nt
rem
rem Find the application home.
rem
rem %~dp0 is location of current script under NT
set _REALPATH=%~dp0
set _WRAPPER_EXE=%_REALPATH%I2Psvc.exe
rem
rem Find the wrapper.conf
rem
:conf
set _WRAPPER_CONF="%~f1"
if not %_WRAPPER_CONF%=="" goto startup
set _WRAPPER_CONF="%_REALPATH%wrapper.config"
call "%_REALPATH%"\set_config_dir_for_nt_service.bat install
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
pause
:eof