From 5a23a634fcad9c8b0f9fb7f68176d6f65a48b48f Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Mon, 22 Jul 2024 18:08:36 +0100 Subject: [PATCH] JAL-3631 Made both Advanced options into a group. Changed visibility scripts to minimum required. Added a Don't setUserAppdirPath comment. --- utils/install4j/install4j10_template.install4j | 320 ++++++++++++++---------- 1 file changed, 186 insertions(+), 134 deletions(-) diff --git a/utils/install4j/install4j10_template.install4j b/utils/install4j/install4j10_template.install4j index 927dd4a..5e8bb2a 100644 --- a/utils/install4j/install4j10_template.install4j +++ b/utils/install4j/install4j10_template.install4j @@ -696,51 +696,103 @@ return console.askOkCancel(message, true); FormComponent fc_advancedOptions = formEnvironment.getFormComponentById("US_ADVANCED_OPTIONS"); -Class<?> cl_advancedOptions = fc_advancedOptions.getConfigurationObjectClass(); -if (!JCheckBox.class.equals(cl_advancedOptions)) { - return; -} +FormComponent fc_notUsed = formEnvironment.getFormComponentById("US_NOT_USED"); +FormComponent fc_userUpdates = formEnvironment.getFormComponentById("US_ALLOW_USER_APPDIR_UPDATES"); +FormComponent fc_warning = formEnvironment.getFormComponentById("US_NO_UPDATES_WARNING"); +LayoutGroup lg_advancedOptions = formEnvironment.getLayoutGroupById("US_ADVANCED_OPTIONS_GROUP"); + + + +// get boolean status of "Enable advanced options" checkbox JCheckBox jcb_advancedOptions = (JCheckBox) fc_advancedOptions.getConfigurationObject(); -boolean advancedOptions = fc_advancedOptions.isEnabled() && jcb_advancedOptions.isSelected(); +boolean advancedOptions = jcb_advancedOptions.isSelected(); -FormComponent fc_userUpdates = formEnvironment.getFormComponentById("US_ALLOW_USER_APPDIR_UPDATES_ADVANCEDITEM"); -Class<?> cl_user = fc_userUpdates.getConfigurationObjectClass(); -if (!JCheckBox.class.equals(cl_user)) { - return; +// set visibility of Advanced options layout group +lg_advancedOptions.setVisible(advancedOptions); +fc_notUsed.setVisible(!advancedOptions); + +if (!advancedOptions) { + return; } -JCheckBox jcb_user = (JCheckBox) fc_userUpdates.getConfigurationObject(); -boolean userUpdates = fc_userUpdates.isEnabled() && jcb_user.isSelected(); + + + + +JCheckBox jcb_userUpdates = (JCheckBox) fc_userUpdates.getConfigurationObject(); +boolean userUpdates = fc_userUpdates.isEnabled() && jcb_userUpdates.isSelected(); boolean showWarning = advancedOptions && (!userUpdates); -FormComponent fc_warning = formEnvironment.getFormComponentById("US_NO_UPDATES_WARNING"); fc_warning.setVisible(showWarning); - -for (FormComponent fc: formEnvironment.getFormComponents()) { - if (formEnvironment.getId(fc).contains("ADVANCEDITEM")) { - fc.setVisible(advancedOptions); - } -} advancedOptions - + - <html>The following option is <strong>strongly recommended</strong> -to be left as default unless there is a particular -reason to change it.</html> + + + 128 + 128 + 128 + 255 + + + + + Advanced options will not be used - context.getBooleanVariable("advancedOptions") + !context.getBooleanVariable("advancedOptions") - - + - Allow user-space updates for ${compiler:JALVIEW_APPLICATION_NAME} components - <html>This option allows updates to ${compiler:JALVIEW_APPLICATION_NAME} + + + FormComponent fc_advancedOptions = formEnvironment.getFormComponentById("US_ADVANCED_OPTIONS"); + +JCheckBox jcb_advancedOptions = (JCheckBox) fc_advancedOptions.getConfigurationObject(); +boolean advancedOptions = jcb_advancedOptions.isSelected(); + +return advancedOptions; + + + + + + + + + + + + + + + + + 4 + 4 + 4 + 4 + + + + + + + <html>The following option is <strong>strongly recommended</strong> +to be left as default unless there is a particular +reason to change it.</html> + + + + + + Allow user-space updates for ${compiler:JALVIEW_APPLICATION_NAME} components + <html>This option allows updates to ${compiler:JALVIEW_APPLICATION_NAME} <br> components to be automatically downloaded <br> @@ -755,51 +807,48 @@ On ${installer:osName}, user updates will be installed under <br> <pre>${installer:userDefaultAppdirBase}</pre> </html> - - - - FormComponent fc_advancedOptions = formEnvironment.getFormComponentById("US_ADVANCED_OPTIONS"); -Class<?> cl_advancedOptions = fc_advancedOptions.getConfigurationObjectClass(); -if (!JCheckBox.class.equals(cl_advancedOptions)) { - return; -} + + + + FormComponent fc_advancedOptions = formEnvironment.getFormComponentById("US_ADVANCED_OPTIONS"); +FormComponent fc_userUpdates = formEnvironment.getFormComponentById("US_ALLOW_USER_APPDIR_UPDATES"); +FormComponent fc_warning = formEnvironment.getFormComponentById("US_NO_UPDATES_WARNING"); +LayoutGroup lg_advancedOptions = formEnvironment.getLayoutGroupById("US_ADVANCED_OPTIONS_GROUP"); + JCheckBox jcb_advancedOptions = (JCheckBox) fc_advancedOptions.getConfigurationObject(); -boolean advancedOptions = fc_advancedOptions.isEnabled() && jcb_advancedOptions.isSelected(); +boolean advancedOptions = jcb_advancedOptions.isSelected(); -FormComponent fc_userUpdates = formEnvironment.getFormComponentById("US_ALLOW_USER_APPDIR_UPDATES_ADVANCEDITEM"); -Class<?> cl_user = fc_userUpdates.getConfigurationObjectClass(); -if (!JCheckBox.class.equals(cl_user)) { - return; +lg_advancedOptions.setVisible(advancedOptions); +if (!advancedOptions) { + return; } -JCheckBox jcb_user = (JCheckBox) fc_userUpdates.getConfigurationObject(); -boolean userUpdates = fc_userUpdates.isEnabled() && jcb_user.isSelected(); -boolean showWarning = advancedOptions && (!userUpdates); +JCheckBox jcb_userUpdates = (JCheckBox) fc_userUpdates.getConfigurationObject(); +boolean userUpdates = fc_userUpdates.isEnabled() && jcb_userUpdates.isSelected(); -formEnvironment.getFormComponentById("US_NO_UPDATES_WARNING").setVisible(showWarning); - - - allowUserDefaultAppdirUpdates - - context.getBooleanVariable("advancedOptions") - - - - - - - ${compiler:JALVIEW_DIR}/${compiler:INSTALL4J_UTILS_DIR}/warning.png - - - No automatic updates will occur when Jalview is launched - - context.getBooleanVariable("advancedOptions") -&& -!( - context.getBooleanVariable("allowUserDefaultAppdirUpdates") - || context.getBooleanVariable("allowInstallerAppdirUpdates") -) - +boolean showWarning = advancedOptions && (!userUpdates); +fc_warning.setVisible(showWarning); + + + + allowUserDefaultAppdirUpdates + + + + + + + ${compiler:JALVIEW_DIR}/${compiler:INSTALL4J_UTILS_DIR}/warning.png + + + No automatic updates will occur when Jalview is launched + + !( context.getBooleanVariable("allowUserDefaultAppdirUpdates") || context.getBooleanVariable("allowInstallerAppdirUpdates") ) + + + + + @@ -856,8 +905,8 @@ formEnvironment.getFormComponentById("US_NO_UPDATES_WARNING").setVisible(showWar FormComponent fc_advancedOptions = formEnvironment.getFormComponentById("SS_ADVANCED_OPTIONS"); FormComponent fc_notUsed = formEnvironment.getFormComponentById("SS_NOT_USED"); -FormComponent fc_userUpdates = formEnvironment.getFormComponentById("SS_ALLOW_USER_APPDIR_UPDATES_ADVANCEDITEM"); -FormComponent fc_installerUpdates = formEnvironment.getFormComponentById("SS_ALLOW_INSTALLER_APPDIR_UPDATES_ADVANCEDITEM"); +FormComponent fc_userUpdates = formEnvironment.getFormComponentById("SS_ALLOW_USER_APPDIR_UPDATES"); +FormComponent fc_installerUpdates = formEnvironment.getFormComponentById("SS_ALLOW_INSTALLER_APPDIR_UPDATES"); FormComponent fc_allowUserAppdirPath = formEnvironment.getFormComponentById("SS_ALLOW_USER_APPDIR_PATH"); FormComponent fc_userAppdirPath = formEnvironment.getFormComponentById("SS_USER_APPDIR_PATH"); LayoutGroup lg_advancedGroup = formEnvironment.getLayoutGroupById("SS_ADVANCED_OPTIONS_GROUP"); @@ -927,7 +976,7 @@ fc_invalidPathWarning.setVisible(advancedOptions && userUpdates &&am // set whether "Set defaults" button should be enabled -FormComponent fc_setDefaults = formEnvironment.getFormComponentById("SS_SET_DEFAULTS_ADVANCEDITEM"); +FormComponent fc_setDefaults = formEnvironment.getFormComponentById("SS_SET_DEFAULTS"); JButton jb_setDefaults = (JButton) fc_setDefaults.getConfigurationObject(); boolean enableSetDefaults = !( userUpdates && !allowUserAppdirPath && userAppdirPath.length() == 0 && !installerUpdates ); jb_setDefaults.setEnabled(enableSetDefaults); @@ -963,7 +1012,7 @@ jb_setDefaults.setEnabled(enableSetDefaults); - + @@ -988,13 +1037,13 @@ jb_setDefaults.setEnabled(enableSetDefaults); - + <html>The following options are <strong>strongly recommended</strong> to be left as default unless there is a particular reason to change them.</html> - - + + Allow user-space updates for ${compiler:JALVIEW_APPLICATION_NAME} components @@ -1019,8 +1068,8 @@ unless customised below. FormComponent fc_advancedOptions = formEnvironment.getFormComponentById("SS_ADVANCED_OPTIONS"); -FormComponent fc_userUpdates = formEnvironment.getFormComponentById("SS_ALLOW_USER_APPDIR_UPDATES_ADVANCEDITEM"); -FormComponent fc_installerUpdates = formEnvironment.getFormComponentById("SS_ALLOW_INSTALLER_APPDIR_UPDATES_ADVANCEDITEM"); +FormComponent fc_userUpdates = formEnvironment.getFormComponentById("SS_ALLOW_USER_APPDIR_UPDATES"); +FormComponent fc_installerUpdates = formEnvironment.getFormComponentById("SS_ALLOW_INSTALLER_APPDIR_UPDATES"); FormComponent fc_allowUserAppdirPath = formEnvironment.getFormComponentById("SS_ALLOW_USER_APPDIR_PATH"); FormComponent fc_userAppdirPath = formEnvironment.getFormComponentById("SS_USER_APPDIR_PATH"); LayoutGroup lg_advancedGroup = formEnvironment.getLayoutGroupById("SS_ADVANCED_OPTIONS_GROUP"); @@ -1089,7 +1138,7 @@ fc_invalidPathWarning.setVisible(advancedOptions && userUpdates &&am // set whether "Set defaults" button should be enabled -FormComponent fc_setDefaults = formEnvironment.getFormComponentById("SS_SET_DEFAULTS_ADVANCEDITEM"); +FormComponent fc_setDefaults = formEnvironment.getFormComponentById("SS_SET_DEFAULTS"); JButton jb_setDefaults = (JButton) fc_setDefaults.getConfigurationObject(); boolean enableSetDefaults = !( userUpdates && !allowUserAppdirPath && userAppdirPath.length() == 0 && !installerUpdates ); jb_setDefaults.setEnabled(enableSetDefaults); @@ -1121,8 +1170,8 @@ jb_setDefaults.setEnabled(enableSetDefaults); FormComponent fc_advancedOptions = formEnvironment.getFormComponentById("SS_ADVANCED_OPTIONS"); -FormComponent fc_userUpdates = formEnvironment.getFormComponentById("SS_ALLOW_USER_APPDIR_UPDATES_ADVANCEDITEM"); -FormComponent fc_installerUpdates = formEnvironment.getFormComponentById("SS_ALLOW_INSTALLER_APPDIR_UPDATES_ADVANCEDITEM"); +FormComponent fc_userUpdates = formEnvironment.getFormComponentById("SS_ALLOW_USER_APPDIR_UPDATES"); +FormComponent fc_installerUpdates = formEnvironment.getFormComponentById("SS_ALLOW_INSTALLER_APPDIR_UPDATES"); FormComponent fc_allowUserAppdirPath = formEnvironment.getFormComponentById("SS_ALLOW_USER_APPDIR_PATH"); FormComponent fc_userAppdirPath = formEnvironment.getFormComponentById("SS_USER_APPDIR_PATH"); LayoutGroup lg_advancedGroup = formEnvironment.getLayoutGroupById("SS_ADVANCED_OPTIONS_GROUP"); @@ -1191,7 +1240,7 @@ fc_invalidPathWarning.setVisible(advancedOptions && userUpdates &&am // set whether "Set defaults" button should be enabled -FormComponent fc_setDefaults = formEnvironment.getFormComponentById("SS_SET_DEFAULTS_ADVANCEDITEM"); +FormComponent fc_setDefaults = formEnvironment.getFormComponentById("SS_SET_DEFAULTS"); JButton jb_setDefaults = (JButton) fc_setDefaults.getConfigurationObject(); boolean enableSetDefaults = !( userUpdates && !allowUserAppdirPath && userAppdirPath.length() == 0 && !installerUpdates ); jb_setDefaults.setEnabled(enableSetDefaults); @@ -1199,6 +1248,7 @@ jb_setDefaults.setEnabled(enableSetDefaults); allowSetUserAppdirPath + component.setEnabled( context.getBooleanVariable("allowUserDefaultAppdirUpdates") ) @@ -1225,8 +1275,8 @@ The default value on ${installer:osName} is FormComponent fc_advancedOptions = formEnvironment.getFormComponentById("SS_ADVANCED_OPTIONS"); -FormComponent fc_userUpdates = formEnvironment.getFormComponentById("SS_ALLOW_USER_APPDIR_UPDATES_ADVANCEDITEM"); -FormComponent fc_installerUpdates = formEnvironment.getFormComponentById("SS_ALLOW_INSTALLER_APPDIR_UPDATES_ADVANCEDITEM"); +FormComponent fc_userUpdates = formEnvironment.getFormComponentById("SS_ALLOW_USER_APPDIR_UPDATES"); +FormComponent fc_installerUpdates = formEnvironment.getFormComponentById("SS_ALLOW_INSTALLER_APPDIR_UPDATES"); FormComponent fc_allowUserAppdirPath = formEnvironment.getFormComponentById("SS_ALLOW_USER_APPDIR_PATH"); FormComponent fc_userAppdirPath = formEnvironment.getFormComponentById("SS_USER_APPDIR_PATH"); LayoutGroup lg_advancedGroup = formEnvironment.getLayoutGroupById("SS_ADVANCED_OPTIONS_GROUP"); @@ -1295,7 +1345,7 @@ fc_invalidPathWarning.setVisible(advancedOptions && userUpdates &&am // set whether "Set defaults" button should be enabled -FormComponent fc_setDefaults = formEnvironment.getFormComponentById("SS_SET_DEFAULTS_ADVANCEDITEM"); +FormComponent fc_setDefaults = formEnvironment.getFormComponentById("SS_SET_DEFAULTS"); JButton jb_setDefaults = (JButton) fc_setDefaults.getConfigurationObject(); boolean enableSetDefaults = !( userUpdates && !allowUserAppdirPath && userAppdirPath.length() == 0 && !installerUpdates ); jb_setDefaults.setEnabled(enableSetDefaults); @@ -1307,15 +1357,11 @@ return true; - // get String value of userAppdirPath text field -FormComponent fc_userAppdirPath = formEnvironment.getFormComponentById("SS_USER_APPDIR_PATH"); -JTextField jtf_userAppdirPath = (JTextField) fc_userAppdirPath.getConfigurationObject(); -String userAppdirPath = jtf_userAppdirPath.getText(); -boolean u = userAppdirPath.contains("%u"); -boolean h = userAppdirPath.contains("%h"); -boolean t = userAppdirPath.startsWith("~" + (String)context.getVariable("sys.fileSeparator")); + boolean u = text.contains("%u"); +boolean h = text.contains("%h"); +boolean t = text.startsWith("~" + (String)context.getVariable("sys.fileSeparator")); -boolean showInvalidPathWarning = !( userAppdirPath.length() == 0 || u || h || t ); +boolean showInvalidPathWarning = !( text.length() == 0 || u || h || t ); FormComponent fc_invalidPathWarning = formEnvironment.getFormComponentById("SS_INVALID_USER_APPDIR_PATH_WARNING"); fc_invalidPathWarning.setVisible(showInvalidPathWarning); @@ -1328,23 +1374,11 @@ fc_invalidPathWarning.setVisible(showInvalidPathWarning); userAppdirPath - FormComponent fc_advancedOptions = formEnvironment.getFormComponentById("SS_ADVANCED_OPTIONS"); -FormComponent fc_userUpdates = formEnvironment.getFormComponentById("SS_ALLOW_USER_APPDIR_UPDATES_ADVANCEDITEM"); -FormComponent fc_userAppdirPath = formEnvironment.getFormComponentById("SS_USER_APPDIR_PATH"); -FormComponent fc_installerUpdates = formEnvironment.getFormComponentById("SS_ALLOW_INSTALLER_APPDIR_UPDATES_ADVANCEDITEM"); -FormComponent fc_allowUserAppdirPath = formEnvironment.getFormComponentById("SS_ALLOW_USER_APPDIR_PATH"); - -JCheckBox jcb_user = (JCheckBox) fc_userUpdates.getConfigurationObject(); -boolean userUpdates = jcb_user.isSelected(); - -JCheckBox jcb_allowUserAppdirPath = (JCheckBox) fc_allowUserAppdirPath.getConfigurationObject(); -boolean allowUserAppdirPath = jcb_allowUserAppdirPath.isSelected(); - -configurationObject.setEnabled(userUpdates && allowUserAppdirPath); + component.setEnabled( context.getBooleanVariable("allowUserDefaultAppdirUpdates") && context.getBooleanVariable("allowSetUserAppdirPath") ) - + Allow installation updates for ${compiler:JALVIEW_APPLICATION_NAME} components <html>This option allows updates to ${compiler:JALVIEW_APPLICATION_NAME} @@ -1373,8 +1407,8 @@ Installation updates will be installed into FormComponent fc_advancedOptions = formEnvironment.getFormComponentById("SS_ADVANCED_OPTIONS"); -FormComponent fc_userUpdates = formEnvironment.getFormComponentById("SS_ALLOW_USER_APPDIR_UPDATES_ADVANCEDITEM"); -FormComponent fc_installerUpdates = formEnvironment.getFormComponentById("SS_ALLOW_INSTALLER_APPDIR_UPDATES_ADVANCEDITEM"); +FormComponent fc_userUpdates = formEnvironment.getFormComponentById("SS_ALLOW_USER_APPDIR_UPDATES"); +FormComponent fc_installerUpdates = formEnvironment.getFormComponentById("SS_ALLOW_INSTALLER_APPDIR_UPDATES"); FormComponent fc_allowUserAppdirPath = formEnvironment.getFormComponentById("SS_ALLOW_USER_APPDIR_PATH"); FormComponent fc_userAppdirPath = formEnvironment.getFormComponentById("SS_USER_APPDIR_PATH"); LayoutGroup lg_advancedGroup = formEnvironment.getLayoutGroupById("SS_ADVANCED_OPTIONS_GROUP"); @@ -1443,7 +1477,7 @@ fc_invalidPathWarning.setVisible(advancedOptions && userUpdates &&am // set whether "Set defaults" button should be enabled -FormComponent fc_setDefaults = formEnvironment.getFormComponentById("SS_SET_DEFAULTS_ADVANCEDITEM"); +FormComponent fc_setDefaults = formEnvironment.getFormComponentById("SS_SET_DEFAULTS"); JButton jb_setDefaults = (JButton) fc_setDefaults.getConfigurationObject(); boolean enableSetDefaults = !( userUpdates && !allowUserAppdirPath && userAppdirPath.length() == 0 && !installerUpdates ); jb_setDefaults.setEnabled(enableSetDefaults); @@ -1451,14 +1485,15 @@ jb_setDefaults.setEnabled(enableSetDefaults); allowInstallerAppdirUpdates + component.setEnabled( !context.getBooleanVariable("allowUserDefaultAppdirUpdates") ) - + FormComponent fc_advancedOptions = formEnvironment.getFormComponentById("SS_ADVANCED_OPTIONS"); -FormComponent fc_userUpdates = formEnvironment.getFormComponentById("SS_ALLOW_USER_APPDIR_UPDATES_ADVANCEDITEM"); -FormComponent fc_installerUpdates = formEnvironment.getFormComponentById("SS_ALLOW_INSTALLER_APPDIR_UPDATES_ADVANCEDITEM"); +FormComponent fc_userUpdates = formEnvironment.getFormComponentById("SS_ALLOW_USER_APPDIR_UPDATES"); +FormComponent fc_installerUpdates = formEnvironment.getFormComponentById("SS_ALLOW_INSTALLER_APPDIR_UPDATES"); FormComponent fc_allowUserAppdirPath = formEnvironment.getFormComponentById("SS_ALLOW_USER_APPDIR_PATH"); FormComponent fc_userAppdirPath = formEnvironment.getFormComponentById("SS_USER_APPDIR_PATH"); LayoutGroup lg_advancedGroup = formEnvironment.getLayoutGroupById("SS_ADVANCED_OPTIONS_GROUP"); @@ -1537,7 +1572,7 @@ fc_invalidPathWarning.setVisible(advancedOptions && userUpdates &&am // set whether "Set defaults" button should be enabled -FormComponent fc_setDefaults = formEnvironment.getFormComponentById("SS_SET_DEFAULTS_ADVANCEDITEM"); +FormComponent fc_setDefaults = formEnvironment.getFormComponentById("SS_SET_DEFAULTS"); JButton jb_setDefaults = (JButton) fc_setDefaults.getConfigurationObject(); boolean enableSetDefaults = !( userUpdates && !allowUserAppdirPath && userAppdirPath.length() == 0 && !installerUpdates ); jb_setDefaults.setEnabled(enableSetDefaults); @@ -1546,9 +1581,9 @@ jb_setDefaults.setEnabled(enableSetDefaults); Reset advanced options to defaults FormComponent fc_advancedOptions = formEnvironment.getFormComponentById("SS_ADVANCED_OPTIONS"); -FormComponent fc_userUpdates = formEnvironment.getFormComponentById("SS_ALLOW_USER_APPDIR_UPDATES_ADVANCEDITEM"); +FormComponent fc_userUpdates = formEnvironment.getFormComponentById("SS_ALLOW_USER_APPDIR_UPDATES"); FormComponent fc_userAppdirPath = formEnvironment.getFormComponentById("SS_USER_APPDIR_PATH"); -FormComponent fc_installerUpdates = formEnvironment.getFormComponentById("SS_ALLOW_INSTALLER_APPDIR_UPDATES_ADVANCEDITEM"); +FormComponent fc_installerUpdates = formEnvironment.getFormComponentById("SS_ALLOW_INSTALLER_APPDIR_UPDATES"); FormComponent fc_allowUserAppdirPath = formEnvironment.getFormComponentById("SS_ALLOW_USER_APPDIR_PATH"); JCheckBox jcb_user = (JCheckBox) fc_userUpdates.getConfigurationObject(); @@ -1565,10 +1600,8 @@ boolean installerUpdates = jcb_installer.isSelected(); // set whether "Set defaults" button should be enabled -FormComponent fc_setDefaults = formEnvironment.getFormComponentById("SS_SET_DEFAULTS_ADVANCEDITEM"); -JButton jb_setDefaults = (JButton) fc_setDefaults.getConfigurationObject(); boolean enableSetDefaults = !( userUpdates && !allowUserAppdirPath && userAppdirPath.length() == 0 && !installerUpdates ); -jb_setDefaults.setEnabled(enableSetDefaults); +component.setEnabled(enableSetDefaults); @@ -1579,10 +1612,7 @@ jb_setDefaults.setEnabled(enableSetDefaults); No automatic updates will occur when ${compiler:JALVIEW_APPLICATION_NAME} is launched - !( - context.getBooleanVariable("allowUserDefaultAppdirUpdates") - || context.getBooleanVariable("allowInstallerAppdirUpdates") -) + !( context.getBooleanVariable("allowUserDefaultAppdirUpdates") || context.getBooleanVariable("allowInstallerAppdirUpdates") ) @@ -1593,10 +1623,19 @@ jb_setDefaults.setEnabled(enableSetDefaults); The user-space path should contain one of "~" (at the start), "%u" or "%h" - !( - context.getBooleanVariable("allowUserDefaultAppdirUpdates") - || context.getBooleanVariable("allowInstallerAppdirUpdates") -) + String userAppdirPath = (String) context.getVariable("userAppdirPath"); + +if (userAppdirPath == null) { + return false; +} + +boolean u = userAppdirPath.contains("%u"); +boolean h = userAppdirPath.contains("%h"); +boolean t = userAppdirPath.startsWith("~" + (String)context.getVariable("sys.fileSeparator")); + +boolean showInvalidPathWarning = !( userAppdirPath.length() == 0 || u || h || t ); + +return context.getBooleanVariable("allowUserDefaultAppdirUpdates") && context.getBooleanVariable("allowSetUserAppdirPath") && showInvalidPathWarning; @@ -1988,26 +2027,39 @@ return advanced ? !( allowUser || allowInstaller ) : false; !context.getBooleanVariable("disableUserDefaultAppdirUpdates") + + + 2823 + + # Comment out the following line to allow user-space updates + -Dnouserdefaultappdir=true + + + context.getBooleanVariable("disableUserDefaultAppdirUpdates") + 2823 - - # The following line sets a custom path for user-space updates -- use with caution. - # If unset, the default is ${installer:userDefaultAppdirBase} for ${installer:osName} - -Dsetuserappdirpath=${installer:setUserAppdirPath} + + # The below line sets a custom path for user-space updates -- use with caution. + # A leading ~/ or %h anywhere will be sustituted with the user's home path, and %u by the username. + # If unset, the default is ${installer:userDefaultAppdirBase} for ${installer:osName} + -Dsetuserappdirpath=${installer:setUserAppdirPath} (String)context.getVariable("setUserAppdirPath") != null - + 2823 - - # Comment out the following line to allow user-space updates - -Dnouserdefaultappdir=true + + # Uncomment the below line to set a custom path for user-space updates -- use with caution. + # A leading ~/ or %h anywhere will be sustituted with the user's home path, and %u by the username. + # If not set, the default is ${installer:userDefaultAppdirBase} for ${installer:osName} + # -Dsetuserappdirpath=${installer:setUserAppdirPath} - context.getBooleanVariable("disableUserDefaultAppdirUpdates") + (String)context.getVariable("setUserAppdirPath") == null -- 1.7.10.2