I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Verified Commit 335409f1 authored by idk's avatar idk
Browse files

Find and fix the bug which appears in...

Find and fix the bug which appears in 'https://old.reddit.com/r/i2p/search?q=console&restrict_sr=on&sort=relevance&t=all' a bunch of Reddit posts, due to a mistake in the Firefox Profile Installer which expected router.config to be in the (deprecated)Roaming application data, even though it was in the Local Application Data, and if it did not exist, created it. If the (deprecated)Roaming application data directory had a router.config file, then I2P attempted to use the Roaming application directory, and the user could end up with a router that had no client apps configured, resulting in a poor UX
parent d6edb9e9
No related branches found
No related tags found
No related merge requests found
......@@ -81,22 +81,33 @@ public class WorkingDir {
String home = System.getProperty("user.home");
if (isWindows) {
String appdata = System.getenv("LOCALAPPDATA");
if (appdata != null)
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
appdata = System.getenv("APPDATA");
if (appdata != null) {
File checkOld = new File(appdata, WORKING_DIR_DEFAULT_WINDOWS);
if (checkOld.exists() && checkOld.isDirectory())
home = appdata;
if (checkOld.exists() && checkOld.isDirectory()){
File routerConfig = new File(checkOld.getAbsolutePath(), "router.config");
// The Firefox profile installer was mistakenly using the Roaming application data
// which is synced between devices on some Windows machines using MS cloud services,
// instead of the local application data which is used by default.
// It would create the router.config file in an empty directory, which the router would
// then attempt to use, resulting in a router with no client applications. Checking
// for clients.config.d determines if the directory is "Real" or not.
File clientAppsConfig = new File(checkOld.getAbsolutePath(), "clients.config.d");
if (routerConfig.exists() && clientAppsConfig.exists() && clientAppsConfig.isDirectory())
home = appdata;
}
}
dirf = new SecureDirectory(home, WORKING_DIR_DEFAULT_WINDOWS);
} else if (SystemVersion.isMac()) {
String appdata = "/Library/Application Support/";
File old = new File(home,WORKING_DIR_DEFAULT);
if (old.exists() && old.isDirectory())
File old = new File(home,WORKING_DIR_DEFAULT);
if (old.exists() && old.isDirectory())
dirf = new SecureDirectory(home, WORKING_DIR_DEFAULT);
else {
home = home+appdata;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment