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.
This commit is contained in:
kytv
2011-08-31 17:11:23 +00:00
parent b328b47bf4
commit 9e6f993af5
6 changed files with 33 additions and 6 deletions

View File

@ -237,7 +237,7 @@
<pack name="Windows Service" required="no"> <pack name="Windows Service" required="no">
<description>Automatically start I2P in the background</description> <description>Automatically start I2P in the background</description>
<os family="windows" /> <os family="windows" />
<!-- <executable targetfile="$INSTALL_PATH/set_config_dir_for_nt_service.bat" stage="postinstall" failure="warn" keep="false" /> --> <executable targetfile="$INSTALL_PATH/set_config_dir_for_nt_service.bat" stage="postinstall" failure="warn" keep="true" />
<executable targetfile="$INSTALL_PATH/install_i2p_service_winnt.bat" stage="postinstall" failure="warn" keep="true"> <executable targetfile="$INSTALL_PATH/install_i2p_service_winnt.bat" stage="postinstall" failure="warn" keep="true">
<args> <args>
<arg value="$INSTALL_PATH\wrapper.config" /> <arg value="$INSTALL_PATH\wrapper.config" />

View File

@ -25,6 +25,8 @@ set _WRAPPER_CONF="%~f1"
if not %_WRAPPER_CONF%=="" goto startup if not %_WRAPPER_CONF%=="" goto startup
set _WRAPPER_CONF="%_REALPATH%wrapper.config" set _WRAPPER_CONF="%_REALPATH%wrapper.config"
call "%_REALPATH%"\set_config_dir_for_nt_service.bat install
rem rem
rem Install the Wrapper as an NT service. rem Install the Wrapper as an NT service.
rem rem

View File

@ -1,4 +1,18 @@
@echo off @echo off
rem %~dp0 is location of current script under NT
set _REALPATH=%~dp0
set _WRAPPER_CONF="%_REALPATH%wrapper.config"
cd /d %~dp0 cd /d %~dp0
echo. if "%1"=="uninstall" (
echo wrapper.java.additional.5=-Di2p.dir.config="%APPDATA%\i2p">>wrapper.config FINDSTR /I /v "^wrapper.java.additional.5=-Di2p.dir.config=" %_WRAPPER_CONF% >> %_WRAPPER_CONF%.new
move %_WRAPPER_CONF%.new %_WRAPPER_CONF%
goto end
) else (
FINDSTR /I "^wrapper.java.additional.5=-Di2p.dir.config=" %_WRAPPER_CONF%
if not errorlevel 1 goto end
echo wrapper.java.additional.5=-Di2p.dir.config="%ALLUSERSPROFILE%\Application Data\i2p" >> %_WRAPPER_CONF%
goto end
)
:end

View File

@ -1,6 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<shortcuts> <shortcuts>
<programGroup defaultName="I2P" location="startMenu" /> <programGroup defaultName="I2P" location="startMenu" />
<shortcut name="Open I2P Profile Folder (service)"
target="explorer"
commandLine="&quot;%allusersprofile%\Application Data\i2p&quot;"
iconFile="%systemroot%\system32\shell32.dll"
iconIndex="3"
initialState="normal"
startMenu="no"
programGroup="yes"
desktop="no"
startup="no" />
<shortcut name="Start I2P (no window)" <shortcut name="Start I2P (no window)"
target="$INSTALL_PATH\I2P.exe" target="$INSTALL_PATH\I2P.exe"
commandLine="" commandLine=""

View File

@ -16,6 +16,7 @@ rem
rem %~dp0 is location of current script under NT rem %~dp0 is location of current script under NT
set _REALPATH=%~dp0 set _REALPATH=%~dp0
set _WRAPPER_EXE=%_REALPATH%I2Psvc.exe set _WRAPPER_EXE=%_REALPATH%I2Psvc.exe
call "%_REALPATH%"\set_config_dir_for_nt_service.bat uninstall
rem rem
rem Find the wrapper.conf rem Find the wrapper.conf

View File

@ -18,7 +18,7 @@ public class RouterVersion {
/** deprecated */ /** deprecated */
public final static String ID = "Monotone"; public final static String ID = "Monotone";
public final static String VERSION = CoreVersion.VERSION; public final static String VERSION = CoreVersion.VERSION;
public final static long BUILD = 6; public final static long BUILD = 7;
/** for example "-test" */ /** for example "-test" */
public final static String EXTRA = ""; public final static String EXTRA = "";