From: Ben Soares Date: Mon, 13 May 2019 14:17:24 +0000 (+0100) Subject: JAL-3247 JAL-3254 JAL-3260 Fixed: JVL file jalview.apparg args. File association... X-Git-Tag: Release_2_11_0~11^2^2~2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=f82b6b6251f9cc35180881d4e5d7e48ca1783783;p=jalview.git JAL-3247 JAL-3254 JAL-3260 Fixed: JVL file jalview.apparg args. File association problem in Windows NETWORK installer. --- diff --git a/build.gradle b/build.gradle index 2e51f15..07a4095 100644 --- a/build.gradle +++ b/build.gradle @@ -800,7 +800,7 @@ install4j { } installDir = file(install4jHomeDir) mediaTypes = Arrays.asList(install4jMediaTypes.split(",")) - if (dev.equals("true")) { + if (install4jFaster.equals("true")) { faster = true } } diff --git a/getdown/lib/getdown-core-1.8.3-SNAPSHOT.jar b/getdown/lib/getdown-core-1.8.3-SNAPSHOT.jar index 67434e8..7230883 100644 Binary files a/getdown/lib/getdown-core-1.8.3-SNAPSHOT.jar and b/getdown/lib/getdown-core-1.8.3-SNAPSHOT.jar differ diff --git a/getdown/lib/getdown-launcher.jar b/getdown/lib/getdown-launcher.jar index 43a9fb6..cb5f670 100644 Binary files a/getdown/lib/getdown-launcher.jar and b/getdown/lib/getdown-launcher.jar differ diff --git a/getdown/src/getdown/core/pom.xml b/getdown/src/getdown/core/pom.xml index e564bf6..efec8b6 100644 --- a/getdown/src/getdown/core/pom.xml +++ b/getdown/src/getdown/core/pom.xml @@ -34,7 +34,7 @@ Wildcards can be used (*.mycompany.com) and multiple values can be separated by commas (app1.foo.com,app2.bar.com,app3.baz.com). --> - + jalview.org,*.jalview.org diff --git a/getdown/src/getdown/core/src/main/java/com/threerings/getdown/data/Application.java b/getdown/src/getdown/core/src/main/java/com/threerings/getdown/data/Application.java index 17e98f8..25cd109 100644 --- a/getdown/src/getdown/core/src/main/java/com/threerings/getdown/data/Application.java +++ b/getdown/src/getdown/core/src/main/java/com/threerings/getdown/data/Application.java @@ -597,6 +597,11 @@ public class Application // process, our caller can use the appbase to download a new configuration file _appbase = config.getString("appbase"); + // see if locatorConfig override + if (locatorConfig != null && !StringUtil.isBlank(locatorConfig.getString("appbase"))) { + _appbase = locatorConfig.getString("appbase"); + } + if (_appbase == null) { throw new RuntimeException("m.missing_appbase"); } @@ -1844,7 +1849,6 @@ public class Application public static void addStartupFile(String filename) { _startupFiles.add(new File(filename)); } - private Config createLocatorConfig(Config.ParseOpts opts) { if (_locatorFile == null) { @@ -1861,19 +1865,24 @@ public class Application log.warning("Given locator file does not exist", "file", _locatorFile); } - // appbase is sanitised in HostWhitelist and here! - Map tmpdata = new HashMap<>(); - tmpdata.put("appbase", tmpConfig.getString("appbase")); - tmpdata.put("appargs", tmpConfig.getString("appargs")); - tmpdata.put("jvmargs", tmpConfig.getString("jvmargs")); - tmpdata.put(LOCATOR_FILE_EXTENSION+"replace", tmpConfig.getString(LOCATOR_FILE_EXTENSION+"replace")); - tmpdata.put(LOCATOR_FILE_EXTENSION+"merge", tmpConfig.getString(LOCATOR_FILE_EXTENSION+"merge")); - locatorConfig = new Config(tmpdata); + // appbase is sanitised in HostWhitelist + Map tmpData = new HashMap<>(); + for (Map.Entry entry : tmpConfig.getData().entrySet()) { + String key = entry.getKey(); + Object value = entry.getValue(); + String mkey = key.indexOf('.') > -1 ? key.substring(key.indexOf('.') + 1) : key; + if (Config.allowedReplaceKeys.contains(mkey) || Config.allowedMergeKeys.contains(mkey)) { + tmpData.put(key, value); + } + } + locatorConfig = new Config(tmpData); } catch (Exception e) { log.warning("Failure reading locator file", "file", _locatorFile, e); } + log.info("Returning locatorConfig", locatorConfig); + return locatorConfig; } diff --git a/getdown/src/getdown/core/src/main/java/com/threerings/getdown/util/Config.java b/getdown/src/getdown/core/src/main/java/com/threerings/getdown/util/Config.java index 6f99fa6..e20bae2 100644 --- a/getdown/src/getdown/core/src/main/java/com/threerings/getdown/util/Config.java +++ b/getdown/src/getdown/core/src/main/java/com/threerings/getdown/util/Config.java @@ -14,6 +14,7 @@ import java.net.MalformedURLException; import java.net.URL; import java.nio.charset.StandardCharsets; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Locale; @@ -254,6 +255,9 @@ public class Config public String[] getMultiValue (String name) { Object value = _data.get(name); + if (value == null) { + return new String[] {}; + } if (value instanceof String) { return new String[] { (String)value }; } else { @@ -381,11 +385,10 @@ public class Config String key = entry.getKey(); Object nvalue = entry.getValue(); - if (!merge || key.equals("appbase")) { - _data.put(key, nvalue); - } else { + String mkey = key.indexOf('.') > -1 ? key.substring(key.indexOf('.') + 1) : key; + if (merge && allowedMergeKeys.contains(mkey)) { - // merge + // merge multi values Object value = _data.get(key); @@ -430,15 +433,45 @@ public class Config } } + } else if (allowedReplaceKeys.contains(mkey)){ + + // replace value + + _data.put(key, nvalue); + } else { + log.warning("Not merging key '"+key+"' into config"); } } } + public String toString() { + StringBuilder sb = new StringBuilder(); + for (Map.Entry entry : getData().entrySet()) { + String key = entry.getKey(); + Object val = entry.getValue(); + sb.append(key); + sb.append("="); + if (val instanceof String) { + sb.append((String)val); + } else if (val instanceof String[]) { + sb.append(Arrays.toString((String[])val)); + } else { + sb.append("Value not String or String[]"); + } + sb.append("\n"); + } + return sb.toString(); + } + public Map getData() { return _data; } private final Map _data; + + public static final List allowedReplaceKeys = Arrays.asList("appbase","apparg","jvmarg"); // these are the ones we might use + public static final List allowedMergeKeys = Arrays.asList("apparg","jvmarg"); // these are the ones we might use + //private final List allowedMergeKeys = Arrays.asList("apparg","jvmarg","resource","code","java_location"); // (not exhaustive list here) } diff --git a/getdown/src/getdown/mvn_cmd b/getdown/src/getdown/mvn_cmd index db10789..d984902 100644 --- a/getdown/src/getdown/mvn_cmd +++ b/getdown/src/getdown/mvn_cmd @@ -1 +1 @@ -mv clean package -Dgetdown.host.whitelist=jalview.org,*.jalview.org && cp launcher/target/getdown-launcher-1.8.3-SNAPSHOT.jar ../../../getdown/lib/getdown-launcher.jar && cp core/target/getdown-core-1.8.3-SNAPSHOT.jar ../../../getdown/lib/getdown-core-1.8.3-SNAPSHOT.jar && cp core/target/getdown-core-1.8.3-SNAPSHOT.jar ../../../j8lib/getdown-core.jar && cp core/target/getdown-core-1.8.3-SNAPSHOT.jar ../../../j11lib/getdown-core.jar +mvn clean package -Dgetdown.host.whitelist=jalview.org,*.jalview.org && cp launcher/target/getdown-launcher-1.8.3-SNAPSHOT.jar ../../../getdown/lib/getdown-launcher.jar && cp core/target/getdown-core-1.8.3-SNAPSHOT.jar ../../../getdown/lib/getdown-core-1.8.3-SNAPSHOT.jar && cp core/target/getdown-core-1.8.3-SNAPSHOT.jar ../../../j8lib/getdown-core.jar && cp core/target/getdown-core-1.8.3-SNAPSHOT.jar ../../../j11lib/getdown-core.jar diff --git a/gradle.properties b/gradle.properties index 0bc3280..294ac23 100644 --- a/gradle.properties +++ b/gradle.properties @@ -102,6 +102,8 @@ install4jInfoPlistFileAssociations = file_associations_auto-Info_plist.xml install4jInstallerFileAssociations = file_associations_auto-install4j.xml install4jBuildDir = build/install4j install4jMediaTypes = windows,macosArchive,linuxRPM,linuxDeb,unixArchive +install4jFaster = false + OSX_KEYSTORE = OSX_KEYPASS = JSIGN_SH = echo diff --git a/j11lib/getdown-core.jar b/j11lib/getdown-core.jar index 67434e8..7230883 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 67434e8..7230883 100644 Binary files a/j8lib/getdown-core.jar and b/j8lib/getdown-core.jar differ diff --git a/resources/images/jalview_logo_background_getdown-progress-TEST2.png b/resources/images/jalview_logo_background_getdown-progress-TEST2.png new file mode 100755 index 0000000..1a9bf34 Binary files /dev/null and b/resources/images/jalview_logo_background_getdown-progress-TEST2.png differ diff --git a/utils/install4j/install4j_template.install4j b/utils/install4j/install4j_template.install4j index 4b05d18..7a924e2 100644 --- a/utils/install4j/install4j_template.install4j +++ b/utils/install4j/install4j_template.install4j @@ -93,7 +93,7 @@ - + @@ -126,7 +126,7 @@ - + @@ -1858,9 +1858,7 @@ return console.askYesNo(message, true); - - - +