From cb821a72adfb22001eefdb55de862d07140b0ba9 Mon Sep 17 00:00:00 2001 From: idk Date: Sat, 3 Apr 2021 18:24:59 -0400 Subject: [PATCH] set i2p.dir.base to PROGRAMFILES/i2p --- build.sh | 2 +- java/net/i2p/router/WinLauncher.java | 13 ++----------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/build.sh b/build.sh index 915478b..4d03e8f 100755 --- a/build.sh +++ b/build.sh @@ -35,7 +35,7 @@ cd build cd .. if [ -z $I2P_VERSION ]; then - I2P_VERSION=$("$JAVA_HOME"/bin/java -cp build/router.jar net.i2p.router.RouterVersion | sed "s/.*: //" | head -n 1) + I2P_VERSION=$("$JAVA_HOME"/bin/java -cp build/router.jar net.i2p.router.RouterVersion | sed "s/.*: //" | head -n 1 | sed 's|-|.|g') fi echo "preparing to invoke jpackage for I2P version $I2P_VERSION" diff --git a/java/net/i2p/router/WinLauncher.java b/java/net/i2p/router/WinLauncher.java index 736b8c2..24e17bc 100644 --- a/java/net/i2p/router/WinLauncher.java +++ b/java/net/i2p/router/WinLauncher.java @@ -20,13 +20,8 @@ public class WinLauncher { private static final String LOCALAPPDATA = System.getenv("LOCALAPPDATA"); public static void main(String[] args) throws Exception { - for (int i = 0; i < args.length; i++){ - System.out.println("arguments" + i + args[i]); - } -// String path = System.getProperty(APP_PATH, "unknown"); - File f = selectProgramFile(); - File contents = f.getParentFile().getParentFile(); + File programs = selectProgramFile(); File home = selectHome(); if (!home.exists()) @@ -36,11 +31,7 @@ public class WinLauncher { System.exit(1); } - - File resources = new File(contents, "Resources"); - File bundleLocation = contents.getParentFile().getParentFile(); - - System.setProperty("i2p.dir.base", resources.getAbsolutePath()); + System.setProperty("i2p.dir.base", programs.getAbsolutePath()); System.setProperty("i2p.dir.config", home.getAbsolutePath()); System.setProperty("router.pid", String.valueOf(ProcessHandle.current().pid()));