From: Ben Soares Date: Thu, 18 Jul 2024 11:05:34 +0000 (+0100) Subject: JAL-3631 Allow override of appDataPath with property 'setuserappdirpath' substituting... X-Git-Tag: Release_2_11_4_0~20^2~13 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=abced7b41cb779a8f6a93f680c3b087f77b86df3;p=jalview.git JAL-3631 Allow override of appDataPath with property 'setuserappdirpath' substituting %h, %u and a leading ~/ --- diff --git a/getdown/lib/FJVL_VERSION b/getdown/lib/FJVL_VERSION index 9a27132..f17be91 100644 --- a/getdown/lib/FJVL_VERSION +++ b/getdown/lib/FJVL_VERSION @@ -1 +1 @@ -1.8.3-1.5.0_FJVL +1.8.3-1.5.1_FJVL diff --git a/getdown/lib/JVL_VERSION b/getdown/lib/JVL_VERSION index 5446e8b..4f75493 100644 --- a/getdown/lib/JVL_VERSION +++ b/getdown/lib/JVL_VERSION @@ -1 +1 @@ -1.8.3-1.5.0_JVL +1.8.3-1.5.1_JVL diff --git a/getdown/lib/getdown-core.jar b/getdown/lib/getdown-core.jar index 7322e08..8019dcc 100644 Binary files a/getdown/lib/getdown-core.jar and b/getdown/lib/getdown-core.jar differ diff --git a/getdown/lib/getdown-launcher-local.jar b/getdown/lib/getdown-launcher-local.jar index c167e33..90129df 100644 Binary files a/getdown/lib/getdown-launcher-local.jar and b/getdown/lib/getdown-launcher-local.jar differ diff --git a/getdown/lib/getdown-launcher.jar b/getdown/lib/getdown-launcher.jar index 476193c..dfd4529 100644 Binary files a/getdown/lib/getdown-launcher.jar and b/getdown/lib/getdown-launcher.jar differ diff --git a/getdown/src/getdown/ant/pom.xml b/getdown/src/getdown/ant/pom.xml index 95aea5a..a234453 100644 --- a/getdown/src/getdown/ant/pom.xml +++ b/getdown/src/getdown/ant/pom.xml @@ -4,7 +4,7 @@ com.threerings.getdown getdown - 1.8.3-1.5.0_FJVL + 1.8.3-1.5.1_FJVL getdown-ant diff --git a/getdown/src/getdown/core/pom.xml b/getdown/src/getdown/core/pom.xml index 6cd52f7..6a9543b 100644 --- a/getdown/src/getdown/core/pom.xml +++ b/getdown/src/getdown/core/pom.xml @@ -4,7 +4,7 @@ com.threerings.getdown getdown - 1.8.3-1.5.0_FJVL + 1.8.3-1.5.1_FJVL getdown-core diff --git a/getdown/src/getdown/core/src/main/java/com/threerings/getdown/data/EnvConfig.java b/getdown/src/getdown/core/src/main/java/com/threerings/getdown/data/EnvConfig.java index 9dead81..0a0aeb5 100644 --- a/getdown/src/getdown/core/src/main/java/com/threerings/getdown/data/EnvConfig.java +++ b/getdown/src/getdown/core/src/main/java/com/threerings/getdown/data/EnvConfig.java @@ -386,6 +386,7 @@ public final class EnvConfig { String appDataPath; String append; + boolean addHome = true; if (LaunchUtil.isMacOS()) { appDataPath = osAppDataPathMap.get("macos"); append = appname; @@ -399,8 +400,25 @@ public final class EnvConfig { appDataPath = osAppDataPathMap.get("other"); append = appdirname.toLowerCase(Locale.ROOT); } - String returnString = home + FS + appDataPath + FS + append + FS+ appDirHash + FS + "app"; - return returnString; + String setUserAppDirPath = System.getProperty(SET_USER_APPDIR_PATH); + // do not use a setUserAppDirPath with ".." in it + if (!StringUtil.isBlank(setUserAppDirPath) && setUserAppDirPath.indexOf("..") == -1) { + if (setUserAppDirPath.startsWith("~" + FS)) { + setUserAppDirPath = home + setUserAppDirPath.substring(1); + } + appDataPath = setUserAppDirPath.replaceAll("%u", System.getProperty("user.name")).replaceAll("%h", home); + addHome = false; + } + + StringBuilder sb = new StringBuilder(); + if (addHome) { + sb.append(home).append(FS); + } + sb.append(appDataPath).append(FS); + sb.append(append).append(FS); + sb.append(appDirHash).append(FS); + sb.append("app"); + return sb.toString(); } public static void setRelaunched(boolean b) { @@ -439,7 +457,9 @@ public final class EnvConfig { protected static final String APPLICATION_APPDIR_PROPERTY = "installer.appdir"; - protected static final String POPULATE_DEFAULT_APPDIR_PROPERTY= "populatedefaultappdir"; + protected static final String POPULATE_DEFAULT_APPDIR_PROPERTY = "populatedefaultappdir"; + + protected static final String SET_USER_APPDIR_PATH = "setuserappdirpath"; private static final Map osAppDataPathMap; diff --git a/getdown/src/getdown/launcher/pom.xml b/getdown/src/getdown/launcher/pom.xml index fbd20cf..b309163 100644 --- a/getdown/src/getdown/launcher/pom.xml +++ b/getdown/src/getdown/launcher/pom.xml @@ -4,7 +4,7 @@ com.threerings.getdown getdown - 1.8.3-1.5.0_FJVL + 1.8.3-1.5.1_FJVL getdown-launcher diff --git a/getdown/src/getdown/lib/SOURCE_HEADER b/getdown/src/getdown/lib/SOURCE_HEADER deleted file mode 100644 index 43271fe..0000000 --- a/getdown/src/getdown/lib/SOURCE_HEADER +++ /dev/null @@ -1,5 +0,0 @@ -// -// Getdown - application installer, patcher and launcher -// Copyright (C) 2004-2018 Getdown authors -// https://github.com/threerings/getdown/blob/master/LICENSE - diff --git a/getdown/src/getdown/lib/jRegistryKey.dll b/getdown/src/getdown/lib/jRegistryKey.dll deleted file mode 100644 index 5746728..0000000 Binary files a/getdown/src/getdown/lib/jRegistryKey.dll and /dev/null differ diff --git a/getdown/src/getdown/lib/jregistrykey/jregistrykey/1.0/jregistrykey-1.0.jar b/getdown/src/getdown/lib/jregistrykey/jregistrykey/1.0/jregistrykey-1.0.jar deleted file mode 100644 index 5100795..0000000 Binary files a/getdown/src/getdown/lib/jregistrykey/jregistrykey/1.0/jregistrykey-1.0.jar and /dev/null differ diff --git a/getdown/src/getdown/lib/jregistrykey/jregistrykey/1.0/jregistrykey-1.0.pom b/getdown/src/getdown/lib/jregistrykey/jregistrykey/1.0/jregistrykey-1.0.pom deleted file mode 100644 index 226a7d7..0000000 --- a/getdown/src/getdown/lib/jregistrykey/jregistrykey/1.0/jregistrykey-1.0.pom +++ /dev/null @@ -1,9 +0,0 @@ - - - 4.0.0 - jregistrykey - jregistrykey - 1.0 - POM was created from install:install-file - diff --git a/getdown/src/getdown/lib/jregistrykey/jregistrykey/maven-metadata-local.xml b/getdown/src/getdown/lib/jregistrykey/jregistrykey/maven-metadata-local.xml deleted file mode 100644 index 1a8a725..0000000 --- a/getdown/src/getdown/lib/jregistrykey/jregistrykey/maven-metadata-local.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - jregistrykey - jregistrykey - 1.0 - - - 1.0 - - 20101118155146 - - diff --git a/getdown/src/getdown/lib/manifest.mf b/getdown/src/getdown/lib/manifest.mf deleted file mode 100644 index 3be50cc..0000000 --- a/getdown/src/getdown/lib/manifest.mf +++ /dev/null @@ -1,6 +0,0 @@ -Main-Class: com.threerings.getdown.launcher.Getdown -Permissions: all-permissions -Application-Name: Getdown -Codebase: * -Application-Library-Allowable-Codebase: * -Caller-Allowable-Codebase: * diff --git a/getdown/src/getdown/mvn_cmd b/getdown/src/getdown/mvn_cmd index 41725cf..d1a6599 100755 --- a/getdown/src/getdown/mvn_cmd +++ b/getdown/src/getdown/mvn_cmd @@ -3,7 +3,7 @@ if [ x$JVLVERSION != x ]; then export VERSION=$JVLVERSION else - export VERSION=1.8.3-1.5.0_JVL + export VERSION=1.8.3-1.5.1_JVL fi if [ x${VERSION%_JVL} = x$VERSION ]; then diff --git a/getdown/src/getdown/pom.xml b/getdown/src/getdown/pom.xml index 3eb0565..9b8140e 100644 --- a/getdown/src/getdown/pom.xml +++ b/getdown/src/getdown/pom.xml @@ -10,7 +10,7 @@ com.threerings.getdown getdown pom - 1.8.3-1.5.0_FJVL + 1.8.3-1.5.1_FJVL getdown An application installer and updater. diff --git a/j11lib/getdown-core.jar b/j11lib/getdown-core.jar index 7322e08..8019dcc 100644 Binary files a/j11lib/getdown-core.jar and b/j11lib/getdown-core.jar differ diff --git a/j8lib/getdown-core.jar b/j8lib/getdown-core.jar index 7322e08..8019dcc 100644 Binary files a/j8lib/getdown-core.jar and b/j8lib/getdown-core.jar differ