Compare commits

...

11 Commits

3 changed files with 40 additions and 18 deletions

View File

@ -66,7 +66,7 @@ if [ ! -f "$HERE/build/jna-platform.jar" ]; then
fi
if [ ! -f "$HERE/build/i2pfirefox.jar" ]; then
wget -O "$HERE/build/i2pfirefox.jar" https://github.com/eyedeekay/i2p.plugins.firefox/releases/download/0.0.8/i2pfirefox.jar
wget -O "$HERE/build/i2pfirefox.jar" https://github.com/eyedeekay/i2p.plugins.firefox/releases/download/0.0.13/i2pfirefox.jar
fi
cd java

View File

@ -50,6 +50,14 @@ public class WinLauncher {
} catch (IOException e) {
e.printStackTrace();
}
boolean privateBrowsing = false;
if (args != null && args.length > 0) {
logger.info("checking for private browsing");
if (args[0].equals("-private")) {
privateBrowsing = true;
logger.info("private browsing is true, profile will be discarded at end of session");
}
}
File programs = selectProgramFile();
if (!programs.exists())
@ -71,7 +79,7 @@ public class WinLauncher {
logger.warning("I2P is already running");
I2PFirefox i2pFirefox = new I2PFirefox();
System.out.println("I2PFirefox");
i2pFirefox.launch();
i2pFirefox.launch(privateBrowsing);
return;
}
@ -105,18 +113,24 @@ public class WinLauncher {
}
private static boolean i2pIsRunning() {
// check if there's something listening on port 7657
sleep(2000);
// check if there's something listening on port 7657(Router Console)
if (!isAvailable(7657)) {
return true;
}
// check if there's something listening on port 7654(I2CP)
if (!isAvailable(7654)) {
return true;
}
// check for the existence of router.ping file, if it's less then 2 minutes old,
// exit
File home = selectHome();
File ping = new File(home, "router.ping");
if (ping.exists()) {
long diff = System.currentTimeMillis() - ping.lastModified();
if (diff < 2 * 60 * 1000) {
logger.info("router.ping exists and is less than 2 minutes old, I2P appears to be running already.");
if (diff < 60 * 1000) {
logger.info("router.ping exists and is less than 1 minute old, I2P appears to be running already.");
logger.info("If I2P is not running, wait 60 seconds and try again.");
return true;
}
}

View File

@ -190,21 +190,29 @@ Function firefoxDetect
FunctionEnd
Function routerDetect
${If} ${FileExists} "$I2PINSTEXE"
Abort directory
${Else}
createDirectory $I2PINSTEXE
SetOutPath $I2PINSTEXE
File /nonfatal /a /r "I2P\"
File /nonfatal /a /r "I2P\I2P.exe"
File /nonfatal "I2P\config\jpackaged"
createDirectory $I2PINSTEXE
SetOutPath $I2PINSTEXE
File /nonfatal /a /r "I2P\"
File /nonfatal /a /r "I2P\I2P.exe"
File /nonfatal "I2P\config\jpackaged"
createDirectory "$I2PINSTEXE\"
SetOutPath "$I2PINSTEXE\"
File /nonfatal /a /r "I2P/config/*"
createDirectory "$I2PINSTEXE\"
SetOutPath "$I2PINSTEXE\"
IfFileExists $I2PINSTEXE\router.config +2 0
File /nonfatal /a /r "I2P/config/router.config"
IfFileExists $I2PINSTEXE\clients.config +2 0
File /nonfatal /a /r "I2P/config/clients.config"
IfFileExists $I2PINSTEXE\wrapper.config +2 0
File /nonfatal /a /r "I2P/config/wrapper.config"
IfFileExists $I2PINSTEXE\eepsite +2 0
File /nonfatal /a /r "I2P/config/eepsite"
IfFileExists $I2PINSTEXE\webapps +2 0
File /nonfatal /a /r "I2P/config/webapps"
File /nonfatal /a /r "I2P/config/certificates"
File /nonfatal /a /r "I2P/config/geoip"
File /nonfatal /a /r "I2P/config/i2ptunnel.config"
Abort directory
${EndIf}
Abort directory
FunctionEnd
Function installerFunction