forked from I2P_Developers/i2p.i2p
leave roaming appdir installs that already exist alone
This commit is contained in:
@ -15,7 +15,7 @@ If you're having trouble, check the
|
||||
website at https://geti2p.net/, or get on irc://irc.freenode.net/#i2p
|
||||
|
||||
I2P will create and store files and configuration data in the user directory
|
||||
~/.i2p/ on Linux and %APPDATA%\I2P\ on Windows. This directory is created
|
||||
~/.i2p/ on Linux and %LOCALAPPDATA%\I2P\ on Windows. This directory is created
|
||||
when I2P is run for the first time. It also creates files in the system
|
||||
temporary directory specified by the Java Virtual Machine.
|
||||
To change the location of these directories, or to configure I2P to
|
||||
|
@ -85,7 +85,7 @@
|
||||
<h3><%=intl._t("Hints")%></h3>
|
||||
<ol>
|
||||
<li>
|
||||
<%=intl._t("File and directory paths here are relative to the addressbook's working directory, which is normally ~/.i2p/addressbook/ (Linux) or %APPDATA%\\I2P\\addressbook\\ (Windows).")%>
|
||||
<%=intl._t("File and directory paths here are relative to the addressbook's working directory, which is normally ~/.i2p/addressbook/ (Linux) or %LOCALAPPDATA%\\I2P\\addressbook\\ (Windows).")%>
|
||||
</li>
|
||||
<li>
|
||||
<%=intl._t("If you want to manually add lines to an addressbook, add them to the private or master addressbooks.")%>
|
||||
|
@ -50,11 +50,11 @@ public class FixWinPaths{
|
||||
String line;
|
||||
while ((line = br.readLine()) != null) {
|
||||
if (line.startsWith("wrapper.logfile="))
|
||||
line = "wrapper.logfile=%appdata%\\i2p\\wrapper.log";
|
||||
line = "wrapper.logfile=%localappdata%\\i2p\\wrapper.log";
|
||||
else if (line.startsWith("#wrapper.java.pidfile="))
|
||||
line = "#wrapper.java.pidfile=%appdata%\\i2p\\routerjvm.pid";
|
||||
line = "#wrapper.java.pidfile=%localappdata%\\i2p\\routerjvm.pid";
|
||||
else if (line.startsWith("#wrapper.pidfile="))
|
||||
line = "#wrapper.pidfile=%appdata%\\i2p\\i2p.pid";
|
||||
line = "#wrapper.pidfile=%localappdata%\\i2p\\i2p.pid";
|
||||
if (line.contains("\\i2p/"))
|
||||
line = line.replace("\\i2p/", "\\i2p\\");
|
||||
if (line.contains("lib/"))
|
||||
|
@ -83,6 +83,15 @@ public class WorkingDir {
|
||||
String appdata = System.getenv("LOCALAPPDATA");
|
||||
if (appdata != null)
|
||||
home = appdata;
|
||||
// Don't mess with existing Roaming Application Data installs,
|
||||
// in case somebody is using roaming appdata for a reason
|
||||
// already. In new installs, use local appdata by default. -idk
|
||||
String oldappdata = System.getenv("APPDATA");
|
||||
if (oldappdata != null) {
|
||||
File checkOld = new File(oldappdata, WORKING_DIR_DEFAULT_WINDOWS);
|
||||
if (checkOld.exists() && checkOld.isDirectory())
|
||||
home = appdata;
|
||||
}
|
||||
dirf = new SecureDirectory(home, WORKING_DIR_DEFAULT_WINDOWS);
|
||||
} else if (SystemVersion.isMac()) {
|
||||
String appdata = "/Library/Application Support/";
|
||||
|
Reference in New Issue
Block a user