From: Ben Soares Date: Tue, 6 Aug 2024 19:13:17 +0000 (+0100) Subject: JAL-3631 Added install4j installer command line options -a -u -U and -S to match... X-Git-Tag: Release_2_11_4_0~15^2^2~1 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=d2b2b24f81eaf1aac20a66012961bfe3aefc63dd;p=jalview.git JAL-3631 Added install4j installer command line options -a -u -U and -S to match the macos-install-jalview.sh script --- diff --git a/utils/install4j/install4j10_template.install4j b/utils/install4j/install4j10_template.install4j index b3bf0a9..774a318 100644 --- a/utils/install4j/install4j10_template.install4j +++ b/utils/install4j/install4j10_template.install4j @@ -789,6 +789,16 @@ return MacOSDir; allowInstallerAppdirUpdates + + + + + Boolean.FALSE + + + disableAllUpdates + + @@ -816,6 +826,50 @@ return context.getCompilerVariable("sys.platform"); osName + + + + + String[] args = context.getExtraCommandLineArguments(); + +for (int i = 0; i < args.length; i++) { + String arg = args[i]; + switch(arg) { + case "-a": + if (args.length - 1 < i + 1) { + System.out.println("Option " + arg + " requires a value. Ignoring."); + } + context.setInstallationDirectory(new File(args[i + 1])); + i++; + break; + case "-u": + if (args.length - 1 < i + 1) { + System.out.println("Option " + arg + " requires a value. Ignoring."); + } + context.setVariable("userAppdirPath", args[i + 1]); + context.setVariable("advancedOptions", true); + context.setVariable("allowSetUserAppdirPath", true); + i++; + break; + case "-U": + context.setVariable("allowUserDefaultAppdirUpdates", false); + context.setVariable("advancedOptions", true); + break; + case "-S": + context.setVariable("disableAllUpdates", true); + context.setVariable("advancedOptions", true); + break; + default: + System.out.println("Option " + arg + " not recognised. Ignoring."); + break; + } +} + +return true; + + + + @@ -1005,14 +1059,12 @@ for (com.install4j.api.actions.Action a : context.getActions(s2)) { boolean set = aid.endsWith("-true"); boolean got = aa.isSelected(); aa.setSelected(set); - System.err.println("##### Setting '"+aid+"' from "+got+" to "+set); + System.err.println("Setting '"+aid+"' from "+got+" to "+set); } } -//context.gotoScreen(s); -//boolean b = formEnvironment.saveFormComponents(); -//System.err.println("##### saveFormComponents was "+b); -formEnvironment.reinitializeFormComponents(); +context.gotoScreen(s); +//formEnvironment.reinitializeFormComponents(); Reset @@ -1897,9 +1949,7 @@ return context.getBooleanVariable("allowUserDefaultAppdirUpdates") && co String dir = (String)context.getVariable("sys.installationDir"); -System.out.println("##### sys.installationDir = " + dir); String hash = getCanonicalFullPathToDirectoryHash(dir); -System.out.println("##### sys.installationDir hash = " + dir); return (Object) hash; @@ -1979,8 +2029,9 @@ 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 ? !( allowUser || allowInstaller ) : false; +return advanced ? disableAllUpdates || !( allowUser || allowInstaller ) : false; disableUpdates