JAL-3631 Allow override of appDataPath with property 'setuserappdirpath' substituting...
authorBen Soares <b.soares@dundee.ac.uk>
Thu, 18 Jul 2024 11:05:34 +0000 (12:05 +0100)
committerBen Soares <b.soares@dundee.ac.uk>
Thu, 18 Jul 2024 11:05:34 +0000 (12:05 +0100)
19 files changed:
getdown/lib/FJVL_VERSION
getdown/lib/JVL_VERSION
getdown/lib/getdown-core.jar
getdown/lib/getdown-launcher-local.jar
getdown/lib/getdown-launcher.jar
getdown/src/getdown/ant/pom.xml
getdown/src/getdown/core/pom.xml
getdown/src/getdown/core/src/main/java/com/threerings/getdown/data/EnvConfig.java
getdown/src/getdown/launcher/pom.xml
getdown/src/getdown/lib/SOURCE_HEADER [deleted file]
getdown/src/getdown/lib/jRegistryKey.dll [deleted file]
getdown/src/getdown/lib/jregistrykey/jregistrykey/1.0/jregistrykey-1.0.jar [deleted file]
getdown/src/getdown/lib/jregistrykey/jregistrykey/1.0/jregistrykey-1.0.pom [deleted file]
getdown/src/getdown/lib/jregistrykey/jregistrykey/maven-metadata-local.xml [deleted file]
getdown/src/getdown/lib/manifest.mf [deleted file]
getdown/src/getdown/mvn_cmd
getdown/src/getdown/pom.xml
j11lib/getdown-core.jar
j8lib/getdown-core.jar

index 9a27132..f17be91 100644 (file)
@@ -1 +1 @@
-1.8.3-1.5.0_FJVL
+1.8.3-1.5.1_FJVL
index 5446e8b..4f75493 100644 (file)
@@ -1 +1 @@
-1.8.3-1.5.0_JVL
+1.8.3-1.5.1_JVL
index 7322e08..8019dcc 100644 (file)
Binary files a/getdown/lib/getdown-core.jar and b/getdown/lib/getdown-core.jar differ
index c167e33..90129df 100644 (file)
Binary files a/getdown/lib/getdown-launcher-local.jar and b/getdown/lib/getdown-launcher-local.jar differ
index 476193c..dfd4529 100644 (file)
Binary files a/getdown/lib/getdown-launcher.jar and b/getdown/lib/getdown-launcher.jar differ
index 95aea5a..a234453 100644 (file)
@@ -4,7 +4,7 @@
   <parent>
     <groupId>com.threerings.getdown</groupId>
     <artifactId>getdown</artifactId>
-    <version>1.8.3-1.5.0_FJVL</version>
+    <version>1.8.3-1.5.1_FJVL</version>
   </parent>
 
   <artifactId>getdown-ant</artifactId>
index 6cd52f7..6a9543b 100644 (file)
@@ -4,7 +4,7 @@
   <parent>
     <groupId>com.threerings.getdown</groupId>
     <artifactId>getdown</artifactId>
-    <version>1.8.3-1.5.0_FJVL</version>
+    <version>1.8.3-1.5.1_FJVL</version>
   </parent>
 
   <artifactId>getdown-core</artifactId>
index 9dead81..0a0aeb5 100644 (file)
@@ -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<String,String> osAppDataPathMap;
     
index fbd20cf..b309163 100644 (file)
@@ -4,7 +4,7 @@
   <parent>
     <groupId>com.threerings.getdown</groupId>
     <artifactId>getdown</artifactId>
-    <version>1.8.3-1.5.0_FJVL</version>
+    <version>1.8.3-1.5.1_FJVL</version>
   </parent>
 
   <artifactId>getdown-launcher</artifactId>
diff --git a/getdown/src/getdown/lib/SOURCE_HEADER b/getdown/src/getdown/lib/SOURCE_HEADER
deleted file mode 100644 (file)
index 43271fe..0000000
+++ /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 (file)
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 (file)
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 (file)
index 226a7d7..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-  <modelVersion>4.0.0</modelVersion>
-  <groupId>jregistrykey</groupId>
-  <artifactId>jregistrykey</artifactId>
-  <version>1.0</version>
-  <description>POM was created from install:install-file</description>
-</project>
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 (file)
index 1a8a725..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<metadata>
-  <groupId>jregistrykey</groupId>
-  <artifactId>jregistrykey</artifactId>
-  <version>1.0</version>
-  <versioning>
-    <versions>
-      <version>1.0</version>
-    </versions>
-    <lastUpdated>20101118155146</lastUpdated>
-  </versioning>
-</metadata>
diff --git a/getdown/src/getdown/lib/manifest.mf b/getdown/src/getdown/lib/manifest.mf
deleted file mode 100644 (file)
index 3be50cc..0000000
+++ /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: *
index 41725cf..d1a6599 100755 (executable)
@@ -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
index 3eb0565..9b8140e 100644 (file)
@@ -10,7 +10,7 @@
   <groupId>com.threerings.getdown</groupId>
   <artifactId>getdown</artifactId>
   <packaging>pom</packaging>
-  <version>1.8.3-1.5.0_FJVL</version>
+  <version>1.8.3-1.5.1_FJVL</version>
 
   <name>getdown</name>
   <description>An application installer and updater.</description>
index 7322e08..8019dcc 100644 (file)
Binary files a/j11lib/getdown-core.jar and b/j11lib/getdown-core.jar differ
index 7322e08..8019dcc 100644 (file)
Binary files a/j8lib/getdown-core.jar and b/j8lib/getdown-core.jar differ