forked from I2P_Developers/i2p.i2p
Since service installs always have an i2p.dir.config set, they don't need to have a default in WorkingDir.java around line 110. However, since user installs do not have an i2p.dir.config set, at around line 80-110 we have to determine whether to use the legacy config in AppData/Roaming or the new default in AppData/Local. Use programdata environment variable becaue it is consistent with the actual path that we should be using.
This commit is contained in:
@@ -11,7 +11,7 @@ if "%1"=="uninstall" (
|
||||
) 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%\i2p" >> %_WRAPPER_CONF%
|
||||
echo wrapper.java.additional.5=-Di2p.dir.config="%PROGRAMDATA%\i2p" >> %_WRAPPER_CONF%
|
||||
goto end
|
||||
)
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<programGroup defaultName="I2P" location="startMenu" />
|
||||
<shortcut name="Open I2P Profile Folder (service)"
|
||||
target="explorer"
|
||||
commandLine=""%allusersprofile%\i2p""
|
||||
commandLine=""%programdata%\i2p""
|
||||
iconFile="%systemroot%\system32\shell32.dll"
|
||||
iconIndex="3"
|
||||
initialState="normal"
|
||||
|
||||
@@ -109,21 +109,6 @@ public class WorkingDir {
|
||||
System.err.println("System is Windows: " + home);
|
||||
}
|
||||
}
|
||||
String programData = System.getenv("PROGRAMDATA");
|
||||
String winDirSystem32 = System.getenv("WINDIR");
|
||||
if (winDirSystem32 != null) {
|
||||
winDirSystem32 = new File(winDirSystem32, "system32").getAbsolutePath();
|
||||
}
|
||||
if (winDirSystem32 != null) {
|
||||
if (home.toLowerCase().startsWith(winDirSystem32.toLowerCase())) {
|
||||
home = programData;
|
||||
}
|
||||
}
|
||||
if (programData != null) {
|
||||
if (home.toLowerCase().startsWith(programData.toLowerCase())) {
|
||||
home = programData;
|
||||
}
|
||||
}
|
||||
dirf = new SecureDirectory(home, WORKING_DIR_DEFAULT_WINDOWS);
|
||||
} else if (SystemVersion.isMac()) {
|
||||
String appdata = "/Library/Application Support/";
|
||||
|
||||
Reference in New Issue
Block a user