From: Ben Soares Date: Tue, 6 Aug 2024 23:50:30 +0000 (+0100) Subject: JAL-3631 Made bespoke command line arguments for console or unattended installs only... X-Git-Tag: Release_2_11_4_0~15^2^2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=517f3b0fe55f619fa02db7021c6622cfea37e1f3;p=jalview.git JAL-3631 Made bespoke command line arguments for console or unattended installs only (i.e. not GUI install mode), and work consistently with macos-install-jalview.sh --- diff --git a/utils/install4j/install4j10_template.install4j b/utils/install4j/install4j10_template.install4j index 774a318..8dcd9ac 100644 --- a/utils/install4j/install4j10_template.install4j +++ b/utils/install4j/install4j10_template.install4j @@ -789,16 +789,6 @@ return MacOSDir; allowInstallerAppdirUpdates - - - - - Boolean.FALSE - - - disableAllUpdates - - @@ -826,6 +816,36 @@ return context.getCompilerVariable("sys.platform"); osName + + + + + Boolean.FALSE + + + consoleDisableUserAppdir + + + + + + + Boolean.FALSE + + + consoleDisableAllUpdates + + + + + + + Boolean.FALSE + + + consoleAllowUserAppdirPath + + @@ -847,17 +867,14 @@ for (int i = 0; i < args.length; i++) { System.out.println("Option " + arg + " requires a value. Ignoring."); } context.setVariable("userAppdirPath", args[i + 1]); - context.setVariable("advancedOptions", true); - context.setVariable("allowSetUserAppdirPath", true); + context.setVariable("consoleAllowUserAppdirPath", true); i++; break; case "-U": - context.setVariable("allowUserDefaultAppdirUpdates", false); - context.setVariable("advancedOptions", true); + context.setVariable("consoleDisableUserAppdir", true); break; case "-S": - context.setVariable("disableAllUpdates", true); - context.setVariable("advancedOptions", true); + context.setVariable("consoleDisableAllUpdates", true); break; default: System.out.println("Option " + arg + " not recognised. Ignoring."); @@ -869,6 +886,7 @@ return true; + context.isConsole() || context.isUnattended() @@ -1999,7 +2017,10 @@ return (Object) hash; boolean advanced = context.getBooleanVariable("advancedOptions"); boolean allowUser = context.getBooleanVariable("allowUserDefaultAppdirUpdates"); - +boolean consoleDisableUserAppdir = context.getBooleanVariable("consoleDisableUserAppdir"); +if (consoleDisableUserAppdir) { + return true; +} return advanced ? !allowUser : false; @@ -2015,7 +2036,10 @@ boolean allowUser = context.getBooleanVariable("allowUserDefaultAppdirUpdates"); boolean allowSetUserAppdirPath = context.getBooleanVariable("allowSetUserAppdirPath"); String userAppdirPath = (String)context.getVariable("userAppdirPath"); boolean saneValue = userAppdirPath != null && userAppdirPath.length() > 0; - +boolean consoleAllowUserAppdirPath = context.getBooleanVariable("consoleAllowUserAppdirPath"); +if (consoleAllowUserAppdirPath && saneValue) { + return userAppdirPath; +} return advanced && allowUser && allowSetUserAppdirPath && saneValue ? userAppdirPath : null; @@ -2029,9 +2053,11 @@ return advanced && allowUser && allowSetUserAppdirPath && boolean advanced = context.getBooleanVariable("advancedOptions"); boolean allowUser = context.getBooleanVariable("allowUserDefaultAppdirUpdates"); boolean allowInstaller = context.getBooleanVariable("allowInstallerAppdirUpdates"); -boolean disableAllUpdates = context.getBooleanVariable("disableAllUpdates"); - -return advanced ? disableAllUpdates || !( allowUser || allowInstaller ) : false; +boolean consoleDisableAllUpdates = context.getBooleanVariable("consoleDisableAllUpdates"); +if (consoleDisableAllUpdates) { + return true; +} +return advanced ? !( allowUser || allowInstaller ) : false; disableUpdates