From cf67f6c476b02a28e454e0e859ee1857fe030468 Mon Sep 17 00:00:00 2001 From: idk Date: Sun, 11 Sep 2022 00:31:31 -0400 Subject: [PATCH] include config in app content --- java/net/i2p/router/WinLauncher.java | 42 ++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/java/net/i2p/router/WinLauncher.java b/java/net/i2p/router/WinLauncher.java index 8931b74..1bd674e 100644 --- a/java/net/i2p/router/WinLauncher.java +++ b/java/net/i2p/router/WinLauncher.java @@ -438,6 +438,48 @@ public class WinLauncher { return null; } + /** + * get the path to the libdir of the app-image by getting the path to + * java.home and the OS, and traversing up to the app-image root based on that + * information, then appending lib to the end. + * + * @return the app-image root + */ + private static File appImageLibDir() { + File aih = appImageHome(); + if (aih == null){ + return null; + } + File libDir = new File(aih, "lib"); + if (libDir !=null){ + if (libDir.exists()){ + return libDir; + } + } + return null; + } + + /** + * get the path to the default config of the app-image by getting the path to + * java.home and the OS, and traversing up to the app-image root based on that + * information, then appending lib/config to the end. + * + * @return the app-image root + */ + private static File appImageConfig() { + File aih = appImageLibDir(); + if (aih == null){ + return null; + } + File configDir = new File(aih, "config"); + if (configDir !=null){ + if (configDir.exists()){ + return configDir; + } + } + return null; + } + /** * set up the path to the log file *