Make it possible to optionally generate jpackage which can be added to a Linux tar.gzipped firefox profile+script. If a Firefox is added to this .tar.gz in a directory called ./firefox/, and that Firefox is configured to be portable and avoid the disk, the launching script will favor the local Firefox and it *should* never need to touch anything outside the directory it's unpacked in, making it usable from a flash drive without touching the disk on a host, for instance. More generally, forming the basis of a TBB-like package

This commit is contained in:
idk
2021-05-25 13:46:37 -04:00
parent c66d08d9d8
commit 10f02140a3
6 changed files with 38 additions and 13 deletions

View File

@ -3,6 +3,7 @@ package net.i2p.router;
import java.io.*;
import java.util.*;
import net.i2p.router.RouterLaunch;
import net.i2p.util.SystemVersion;
/**
* Launches a router from %PROGRAMFILES%/I2P using configuration data in
@ -48,18 +49,30 @@ public class WinLauncher {
}
private static File selectHome() throws Exception {
File home = new File(System.getProperty("user.home"));
File i2p;
File appData = new File(home, "AppData");
File local = new File(appData, "Local");
i2p = new File(local, "I2P");
return i2p.getAbsoluteFile();
if (SystemVersion.isWindows()) {
File home = new File(System.getProperty("user.home"));
File i2p;
File appData = new File(home, "AppData");
File local = new File(appData, "Local");
i2p = new File(local, "I2P");
return i2p.getAbsoluteFile();
} else {
File jrehome = new File(System.getProperty("java.home"));
File programs = new File(jrehome.getParentFile().getParentFile(), ".i2p");
return programs.getAbsoluteFile();
}
}
private static File selectProgramFile() throws Exception {
File jrehome = new File(System.getProperty("java.home"));
File programs = jrehome.getParentFile();
return programs.getAbsoluteFile();
if (SystemVersion.isWindows()) {
File jrehome = new File(System.getProperty("java.home"));
File programs = jrehome.getParentFile();
return programs.getAbsoluteFile();
} else {
File jrehome = new File(System.getProperty("java.home"));
File programs = new File(jrehome.getParentFile().getParentFile(), "i2p");
return programs.getAbsoluteFile();
}
}
}