Compare commits

...

35 Commits

Author SHA1 Message Date
idk
2eeb2106fc shorten first-run checks timeout. 2022-09-07 16:19:21 -04:00
idk
26a7944470 add safety checks around Windows config stuff 2022-09-07 12:40:05 -04:00
idk
b97d581fcc add safety checks around Windows config stuff 2022-09-07 12:37:57 -04:00
idk
615818976a add safety checks around Windows config stuff 2022-09-07 12:34:19 -04:00
idk
e6fc5a349d when launching into a router console disable the proxy timeout 2022-09-07 12:29:54 -04:00
idk
3718d2edb9 when launching into a router console disable the proxy timeout 2022-09-07 12:26:11 -04:00
idk
4a55a8d4ab bump i2pfirefox version again 2022-09-07 04:36:50 -04:00
idk
a3a45b01e5 bump i2pfirefox version 2022-09-07 03:25:46 -04:00
idk
e07c43f1eb make sure args are of right type 2022-09-07 02:59:26 -04:00
idk
fd75a7e244 Fix parsing of arguments 2022-09-07 02:28:23 -04:00
idk
0e77d53c15 bump i2pfirefox version 2022-09-07 00:05:07 -04:00
idk
4dd9448752 bump version 2022-09-06 21:57:25 -04:00
idk
b220697af2 update i2pfirefox package, point release 2022-09-06 21:53:53 -04:00
idk
d9cffc9520 update version 2022-09-06 15:45:53 -04:00
idk
c8590e4fe5 fix redundant option 2022-09-06 01:31:55 -04:00
idk
3c8b1b6d28 try an experiment where I build an MSI 2022-09-06 01:29:30 -04:00
idk
460837d7f5 bump again 2022-09-05 14:19:35 -04:00
idk
2bd3abe6bb re-add self-run of I2P.exe to save users a click, this needs testing but since I've got 3 VM's and 3 laptops on my desk right now I'm going to do it right now 2022-09-05 14:12:00 -04:00
idk
5ef6118b91 bump version again 2022-09-05 10:42:24 -04:00
idk
394f58f90e bump launcher lib again 2022-09-05 10:23:17 -04:00
idk
5ee89f98a9 chnge tunnel nickname of HTTP proxy 2022-09-05 03:01:11 -04:00
idk
6736d527a2 setNotRunning must be called on browser launch too 2022-09-05 02:55:35 -04:00
idk
ef203ba935 setNotRunning before launching the router, counter-intuitively but this is for determining whether we should launch the browser only. The other checks will still work for determining if a router is there. It only needs to be there for the first 21 or so seconds. 2022-09-05 02:00:54 -04:00
idk
3749f49641 setNotRunning before launching the router, counter-intuitively but this is for determining whether we should launch the browser only. The other checks will still work for determining if a router is there. It only needs to be there for the first 21 or so seconds. 2022-09-05 01:58:53 -04:00
idk
d63128096c Bump browserlauncher version 2022-09-05 01:51:28 -04:00
idk
51cb4c608a enable faster router startup 2022-09-05 01:47:16 -04:00
idk
f920fa8090 further accelerate startups 2022-09-05 00:41:51 -04:00
idk
252a80eb72 further accelerate startups 2022-09-05 00:41:20 -04:00
idk
ed7814cd74 enable faster startups 2022-09-04 23:56:07 -04:00
idk
073ba01da6 Lessen startup delay/timeout 2022-09-04 23:50:58 -04:00
idk
7caf03d6e4 Bump again 2022-09-04 23:12:52 -04:00
idk
c3934ab4e4 switch i2p.exe to /bin/false 2022-09-04 22:40:25 -04:00
idk
54ffdc2352 bump version and extend timeout again 2022-09-04 21:37:25 -04:00
idk
ab2548ecd4 bump version and extend timeout again 2022-09-04 21:34:14 -04:00
idk
5cf5d56738 check for up to a whole 20 seconds to see if a router is running instead of just 2 2022-09-04 14:45:10 -04:00
11 changed files with 166 additions and 48 deletions

View File

@ -1,3 +1,6 @@
2022-10-06 idk
* Point release 1.9.5, fixes a bug which occurs more often on Windows 11, fixes a SusiDNS issue
2022-08-28 idk
* Migrate away from batch scripts and simply launch a browser if I2P is already running.
This is more flexible, stable, and simplet to install

View File

@ -3,16 +3,28 @@
## If you need to use a different JVM, JDK, or other utility from
# build.sh, set it in this file, for example:
uname=$(uname)
#export PATH="$PATH:/c/Program Files/Java/jdk-17.0.3/bin/"
#export JAVA_HOME="/c/Program Files/Java/jdk-17.0.3"
# to use it for Oracle OpenJDK17
## Other potential values(NOT exhaustive):
PATH="/c/Program Files/Java/jdk-18.0.2/bin/:$PATH:/c/Program Files/Java/jdk-18.0.2/bin/"
export PATH="/c/Program Files/Java/jdk-18.0.2/bin/:$PATH:/c/Program Files/Java/jdk-18.0.2/bin/"
JAVA_HOME="/c/Program Files/Java/jdk-18.0.2"
export JAVA_HOME="/c/Program Files/Java/jdk-18.0.2"
if [[ -n "$IS_WSL" || -n "$WSL_DISTRO_NAME" ]]; then
PATH="/c/Program Files/Java/jdk-18.0.2/bin/:$PATH:/c/Program Files/Java/jdk-18.0.2/bin/"
export PATH="/c/Program Files/Java/jdk-18.0.2/bin/:$PATH:/c/Program Files/Java/jdk-18.0.2/bin/"
JAVA_HOME="/c/Program Files/Java/jdk-18.0.2"
export JAVA_HOME="/c/Program Files/Java/jdk-18.0.2"
fi
if [ "${uname}" != "Linux" ]; then
PATH="/c/Program Files/Java/jdk-18.0.2/bin/:$PATH:/c/Program Files/Java/jdk-18.0.2/bin/"
export PATH="/c/Program Files/Java/jdk-18.0.2/bin/:$PATH:/c/Program Files/Java/jdk-18.0.2/bin/"
JAVA_HOME="/c/Program Files/Java/jdk-18.0.2"
export JAVA_HOME="/c/Program Files/Java/jdk-18.0.2"
fi
#export PATH="$PATH:/c/Program Files/Eclipse Adoptium/jdk-17.0.3/bin/"
#export JAVA_HOME="/c/Program Files/Eclipse Adoptium/jdk-17.0.3"
#export PATH="$PATH:/c/Program Files/OpenJDK/jdk-17.0.3/bin/"
@ -49,6 +61,12 @@ export JAVA_HOME="/c/Program Files/Java/jdk-18.0.2"
#export ANT_HOME="/c/apache-ant-1.10.9"
#export PATH="$PATH:$ANT_HOME/bin/"
# Uncomment this to add signtool to the path so you don't have to fight with Visual Studio.
PATH="$PATH:/c/Program Files (x86)/Windows Kits/10/App Certification Kit/"
export PATH="$PATH:/c/Program Files (x86)/Windows Kits/10/App Certification Kit/"
if [[ -n "$IS_WSL" || -n "$WSL_DISTRO_NAME" ]]; then
PATH="$PATH:/c/Program Files (x86)/Windows Kits/10/App Certification Kit/"
export PATH="$PATH:/c/Program Files (x86)/Windows Kits/10/App Certification Kit/"
fi
if [ "${uname}" != "Linux" ]; then
PATH="$PATH:/c/Program Files (x86)/Windows Kits/10/App Certification Kit/"
export PATH="$PATH:/c/Program Files (x86)/Windows Kits/10/App Certification Kit/"
fi

View File

@ -24,8 +24,8 @@ tunnel.0.listenPort=4444
tunnel.0.proxyList=false.i2p
tunnel.0.i2cpHost=127.0.0.1
tunnel.0.i2cpPort=7654
tunnel.0.option.inbound.nickname=shared clients
tunnel.0.option.outbound.nickname=shared clients
tunnel.0.option.inbound.nickname=HTTP Proxy
tunnel.0.option.outbound.nickname=HTTP Proxy
tunnel.0.option.i2cp.leaseSetEncType=4,0
tunnel.0.option.i2cp.reduceIdleTime=900000
tunnel.0.option.i2cp.reduceOnIdle=true

View File

@ -2,20 +2,15 @@
JNA_VERSION=5.11.0
export JNA_VERSION=5.11.0
I2PFIREFOX_VERSION=0.0.22
export I2PFIREFOX_VERSION=0.0.22
#Comment this out to build from an alternate branch or
I2PFIREFOX_VERSION=0.0.34
export I2PFIREFOX_VERSION=0.0.34
# Comment this out to build from an alternate branch or
# the tip of the master branch.
VERSIONMAJOR=1
VERSIONMINOR=9
VERSIONBUILD=1
VERSIONBUILD=5
I2P_VERSION="$VERSIONMAJOR.$VERSIONMINOR.$VERSIONBUILD"
export I2P_VERSION="$VERSIONMAJOR.$VERSIONMINOR.$VERSIONBUILD"
VERSION=i2p-jpackage-1.9.1
export VERSION=i2p-jpackage-1.9.1
VERSION=i2p-jpackage-1.9.4
export VERSION=i2p-jpackage-1.9.4
#Uncomment this to build from the tip of the master.
#I2P_VERSION=1.8.0
#export I2P_VERSION=1.8.0
#VERSION=master
#export VERSION="$VERSION"

View File

@ -51,23 +51,48 @@ public class WinLauncher {
boolean privateBrowsing = false;
boolean usabilityMode = false;
boolean chromiumFirst = false;
int proxyTimeoutTime = 200;
ArrayList<String> newArgsList = new ArrayList<String>();
if (args != null) {
if (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.");
}
if (args[0].equals("-chromium")) {
chromiumFirst = true;
logger.info("Chromium will be selected before Firefox.");
}
if (args[0].equals("-usability")) {
usabilityMode = true;
logger.info(
"Usability mode is true, using alternate extensions loadout.");
for (String arg : args) {
if (arg.equals("-private")) {
privateBrowsing = true;
logger.info(
"Private browsing is true, profile will be discarded at end of session.");
} else if (arg.equals("-chromium")) {
chromiumFirst = true;
logger.info("Chromium will be selected before Firefox.");
} else if (arg.equals("-usability")) {
usabilityMode = true;
logger.info(
"Usability mode is true, using alternate extensions loadout.");
} else if (arg.equals("-noproxycheck")) {
proxyTimeoutTime = 0;
logger.info("Proxy timeout time set to zero");
} else {
// make an effort to not let people launch into sites if the proxy
// isn't quite ready yet, but also disable the proxy timeout if
// they're reaching a router console
if (arg.startsWith("http://localhost:76")) {
newArgsList.add(arg);
proxyTimeoutTime = 0;
} else if (arg.startsWith("http://127.0.0.1:76")) {
newArgsList.add(arg);
proxyTimeoutTime = 0;
} else if (arg.startsWith("https://localhost:76")) {
newArgsList.add(arg);
proxyTimeoutTime = 0;
} else if (arg.startsWith("https://127.0.0.1:76")) {
newArgsList.add(arg);
proxyTimeoutTime = 0;
} else if (proxyTimeoutTime > 0) {
newArgsList.add(arg);
} else if (!isAvailable(4444)) {
newArgsList.add(arg);
}
}
}
}
}
@ -91,16 +116,18 @@ public class WinLauncher {
" exists but is not a directory. Please get it out of the way");
System.exit(1);
}
if (i2pIsRunning()) {
setNotRunning();
logger.warning("I2P is already running");
I2PBrowser i2pBrowser = new I2PBrowser();
i2pBrowser.usability = usabilityMode;
i2pBrowser.chromiumFirst = chromiumFirst;
i2pBrowser.firefox = !chromiumFirst;
i2pBrowser.chromium = chromiumFirst;
i2pBrowser.setProxyTimeoutTime(proxyTimeoutTime);
System.out.println("I2PBrowser");
i2pBrowser.launch(privateBrowsing);
String[] newArgs = newArgsList.toArray(new String[newArgsList.size()]);
i2pBrowser.launch(privateBrowsing, newArgs);
return;
}
@ -111,7 +138,7 @@ public class WinLauncher {
logger.info("\t" + System.getProperty("i2p.dir.base") + "\n\t" +
System.getProperty("i2p.dir.config") + "\n\t" +
System.getProperty("router.pid"));
/**
/**
* IMPORTANT: You must set user.dir to the same directory where the
* jpackage is intstalled, or when the launcher tries to re-run itself
* to start the browser, it will start in the wrong directory and fail
@ -127,6 +154,7 @@ public class WinLauncher {
registrationThread.setDaemon(true);
registrationThread.start();
setNotRunning();
// wupp.i2pRouter.runRouter();
RouterLaunch.main(args);
}
@ -143,8 +171,7 @@ public class WinLauncher {
return portFree;
}
private static boolean i2pIsRunning() {
sleep(2000);
private static boolean i2pIsRunningCheck() {
// check if there's something listening on port 7657(Router Console)
if (!isAvailable(7657)) {
return true;
@ -153,8 +180,8 @@ public class WinLauncher {
if (!isAvailable(7654)) {
return true;
}
// check for the existence of router.ping file, if it's less then 2 minutes
// old, exit
// 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()) {
@ -169,6 +196,52 @@ public class WinLauncher {
return false;
}
private static void setNotRunning() {
File home = selectHome();
File running = new File(home, "running");
if (running.exists()) {
running.delete();
}
}
private static void setRunning() {
File home = selectHome();
File running = new File(home, "running");
if (!running.exists()) {
try {
running.createNewFile();
} catch (IOException e) {
logger.info(e.toString());
}
}
}
private static boolean i2pIsRunning() {
File home = selectHome();
File running = new File(home, "running");
if (running.exists()) {
return true;
}
setRunning();
File ping = new File(home, "router.ping");
if (ping.exists()) {
long diff = System.currentTimeMillis() - ping.lastModified();
if (diff > 60 * 1000) {
logger.info(
"router.ping exists and is more than 1 minute old, I2P does not appear to be running.");
logger.info("If I2P is running, report this as a bug.");
return false;
}
}
if (i2pIsRunningCheck())
return true;
for (int i = 0; i < 10; i++) {
if (i2pIsRunningCheck())
return true;
sleep(1000);
}
return false;
}
private static final Runnable REGISTER_UPP = () -> {
// first wait for the RouterContext to appear
@ -221,13 +294,13 @@ public class WinLauncher {
File local = new File(appData, "Local");
File i2p;
i2p = new File(local, "I2P");
logger.info("Windows jpackage wrapper started, using: " + i2p +
logger.info("Windows jpackage wrapper starting up, using: " + i2p +
" as base config");
return i2p.getAbsoluteFile();
} else {
File jrehome = new File(System.getProperty("java.home"));
File programs = new File(jrehome.getParentFile().getParentFile(), ".i2p");
logger.info("Linux portable jpackage wrapper started, using: " +
logger.info("Linux portable jpackage wrapper starting up, using: " +
programs + " as base config");
return programs.getAbsoluteFile();
}

29
msi.sh Executable file
View File

@ -0,0 +1,29 @@
#! /usr/bin/env sh
## EXPERIMENTAL. PROBABLY WON'T SEE THE LIGHT OF DAY BUT MAYBE I GET LUCKY.
. ./config.sh
. ./i2pversion
jpackage --type app-image --name I2P --app-version "$I2P_VERSION" \
--verbose \
--java-options "-Xmx512m" \
--java-options "--add-opens java.base/java.lang=ALL-UNNAMED" \
--java-options "--add-opens java.base/sun.nio.fs=ALL-UNNAMED" \
--java-options "--add-opens java.base/java.nio=ALL-UNNAMED" \
--java-options "--add-opens java.base/java.util.Properties=ALL-UNNAMED" \
--java-options "--add-opens java.base/java.util.Properties.defaults=ALL-UNNAMED" \
$JPACKAGE_OPTS \
--resource-dir build \
--input build \
--verbose \
--type msi \
--win-dir-chooser \
--win-help-url "https://geti2p.net" \
--win-menu \
--win-menu-group "I2P Easy-Install Bundle" \
--win-shortcut \
--win-shortcut-prompt \
--win-per-user-install \
--license-file LICENSE.md \
--main-jar launcher.jar \
--main-class net.i2p.router.WinLauncher

View File

@ -1,5 +1,5 @@
router.updateURL=http://ekm3fu6fr5pxudhwjmdiea5dovc3jdi66hjgop4c7z7dfaw7spca.b32.i2p/i2pwinupdate.su3
router.newsURL=http://dn3tvalnjz432qkqsvpfdqrwpqkw3ye4n4i2uyfr4jexvo3sp5ka.b32.i2p/news/win/beta/news.su3
router.backupNewsURL=http://tc73n4kivdroccekirco7rhgxdg5f3cjvbaapabupeyzrqwv5guq.b32.i2p/win/beta/news.su3
routerconsole.browser=I2P.exe
routerconsole.browser=I2P.exe -noproxycheck
router.disableTunnelTesting=false

View File

@ -1 +1 @@
1.9.1
1.9.5

View File

@ -1 +1 @@
!define I2P_VERSION 1.9.1
!define I2P_VERSION 1.9.5

View File

@ -1,3 +1,3 @@
!define VERSIONMAJOR 1
!define VERSIONMINOR 9
!define VERSIONBUILD 1
!define VERSIONBUILD 5

View File

@ -1 +1 @@
1.9.1
1.9.5