JAL-3631 Made both Advanced options into a group. Changed visibility scripts to...
authorBen Soares <b.soares@dundee.ac.uk>
Mon, 22 Jul 2024 17:08:36 +0000 (18:08 +0100)
committerBen Soares <b.soares@dundee.ac.uk>
Mon, 22 Jul 2024 17:08:36 +0000 (18:08 +0100)
utils/install4j/install4j10_template.install4j

index 927dd4a..5e8bb2a 100644 (file)
@@ -696,51 +696,103 @@ return console.askOkCancel(message, true);
                   <property name="selectionScript">
                     <object class="com.install4j.api.beans.ScriptProperty">
                       <property name="value" type="string">FormComponent fc_advancedOptions = formEnvironment.getFormComponentById("US_ADVANCED_OPTIONS");
-Class&lt;?&gt; 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() &amp;&amp; jcb_advancedOptions.isSelected();
+boolean advancedOptions = jcb_advancedOptions.isSelected();
 
-FormComponent fc_userUpdates = formEnvironment.getFormComponentById("US_ALLOW_USER_APPDIR_UPDATES_ADVANCEDITEM");
-Class&lt;?&gt; 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() &amp;&amp; jcb_user.isSelected();
+
+
+
+
+JCheckBox jcb_userUpdates = (JCheckBox) fc_userUpdates.getConfigurationObject();
+boolean userUpdates = fc_userUpdates.isEnabled() &amp;&amp; jcb_userUpdates.isSelected();
 
 boolean showWarning = advancedOptions &amp;&amp; (!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);
-  }
-}
 </property>
                     </object>
                   </property>
                   <property name="variableName" type="string">advancedOptions</property>
                 </serializedBean>
               </formComponent>
-              <formComponent name="Strongly recommended text" id="2980" customizedId="US_LABEL_ADVANCEDITEM" beanClass="com.install4j.runtime.beans.formcomponents.MultilineHtmlLabelComponent" insetLeft="16">
+              <formComponent name="Advanced options not used label" id="3036" customizedId="US_NOT_USED" beanClass="com.install4j.runtime.beans.formcomponents.LabelComponent" insetLeft="20">
                 <serializedBean>
-                  <property name="labelHtml" type="string">&lt;html&gt;The following option is &lt;strong&gt;strongly recommended&lt;/strong&gt;
-to be left as default unless there is a particular
-reason to change it.&lt;/html&gt;</property>
+                  <property name="labelColor">
+                    <object class="java.awt.Color">
+                      <int>128</int>
+                      <int>128</int>
+                      <int>128</int>
+                      <int>255</int>
+                    </object>
+                  </property>
+                  <property name="labelFontSizePercent" type="int" value="80" />
+                  <property name="labelFontType" type="enum" class="com.install4j.runtime.beans.formcomponents.FontType" value="DERIVED" />
+                  <property name="labelText" type="string">Advanced options will not be used</property>
                 </serializedBean>
-                <visibilityScript>context.getBooleanVariable("advancedOptions")
+                <visibilityScript>!context.getBooleanVariable("advancedOptions")
 </visibilityScript>
               </formComponent>
-              <formComponent id="3014" customizedId="US_VSPACE_ADVANCEDITEM" beanClass="com.install4j.runtime.beans.formcomponents.SpacerComponent" insetLeft="16" />
-              <formComponent name="BOTHSPACE: Allow automatic updates in user's home directory" id="2975" customizedId="US_ALLOW_USER_APPDIR_UPDATES_ADVANCEDITEM" beanClass="com.install4j.runtime.beans.formcomponents.CheckboxComponent" insetLeft="16">
+              <group name="Advanced options (outer) group" id="3035" customizedId="US_ADVANCED_OPTIONS_GROUP" beanClass="com.install4j.runtime.beans.groups.VerticalFormComponentGroup">
                 <serializedBean>
-                  <property name="checkboxText" type="string">Allow user-space updates for ${compiler:JALVIEW_APPLICATION_NAME} components</property>
-                  <property name="helpText" type="string">&lt;html&gt;This option allows updates to ${compiler:JALVIEW_APPLICATION_NAME}
+                  <property name="visibilityScript">
+                    <object class="com.install4j.api.beans.ScriptProperty">
+                      <property name="value" type="string">FormComponent fc_advancedOptions = formEnvironment.getFormComponentById("US_ADVANCED_OPTIONS");
+
+JCheckBox jcb_advancedOptions = (JCheckBox) fc_advancedOptions.getConfigurationObject();
+boolean advancedOptions = jcb_advancedOptions.isSelected();
+
+return advancedOptions;</property>
+                    </object>
+                  </property>
+                </serializedBean>
+                <beans>
+                  <group name="Advanced options (boxed) group" id="3034" beanClass="com.install4j.runtime.beans.groups.VerticalFormComponentGroup">
+                    <serializedBean>
+                      <property name="borderSides">
+                        <object class="com.install4j.runtime.beans.formcomponents.BorderSides">
+                          <property name="bottom" type="boolean" value="true" />
+                          <property name="left" type="boolean" value="true" />
+                          <property name="right" type="boolean" value="true" />
+                          <property name="top" type="boolean" value="true" />
+                        </object>
+                      </property>
+                      <property name="insets">
+                        <object class="java.awt.Insets">
+                          <int>4</int>
+                          <int>4</int>
+                          <int>4</int>
+                          <int>4</int>
+                        </object>
+                      </property>
+                    </serializedBean>
+                    <beans>
+                      <formComponent name="Strongly recommended text" id="2980" customizedId="US_LABEL" beanClass="com.install4j.runtime.beans.formcomponents.MultilineHtmlLabelComponent" insetLeft="16">
+                        <serializedBean>
+                          <property name="labelHtml" type="string">&lt;html&gt;The following option is &lt;strong&gt;strongly recommended&lt;/strong&gt;
+to be left as default unless there is a particular
+reason to change it.&lt;/html&gt;</property>
+                        </serializedBean>
+                      </formComponent>
+                      <formComponent id="3014" customizedId="US_VSPACE" beanClass="com.install4j.runtime.beans.formcomponents.SpacerComponent" insetLeft="16" />
+                      <formComponent name="BOTHSPACE: Allow automatic updates in user's home directory" id="2975" customizedId="US_ALLOW_USER_APPDIR_UPDATES" beanClass="com.install4j.runtime.beans.formcomponents.CheckboxComponent" insetLeft="16">
+                        <serializedBean>
+                          <property name="checkboxText" type="string">Allow user-space updates for ${compiler:JALVIEW_APPLICATION_NAME} components</property>
+                          <property name="helpText" type="string">&lt;html&gt;This option allows updates to ${compiler:JALVIEW_APPLICATION_NAME}
 &lt;br&gt;
 components to be automatically downloaded
 &lt;br&gt;
@@ -755,51 +807,48 @@ On ${installer:osName}, user updates will be installed under
 &lt;br&gt;
 &lt;pre&gt;${installer:userDefaultAppdirBase}&lt;/pre&gt;
 &lt;/html&gt;</property>
-                  <property name="initiallySelected" type="boolean" value="true" />
-                  <property name="selectionScript">
-                    <object class="com.install4j.api.beans.ScriptProperty">
-                      <property name="value" type="string">FormComponent fc_advancedOptions = formEnvironment.getFormComponentById("US_ADVANCED_OPTIONS");
-Class&lt;?&gt; cl_advancedOptions = fc_advancedOptions.getConfigurationObjectClass();
-if (!JCheckBox.class.equals(cl_advancedOptions)) {
-    return;
-}
+                          <property name="initiallySelected" type="boolean" value="true" />
+                          <property name="selectionScript">
+                            <object class="com.install4j.api.beans.ScriptProperty">
+                              <property name="value" type="string">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() &amp;&amp; jcb_advancedOptions.isSelected();
+boolean advancedOptions = jcb_advancedOptions.isSelected();
 
-FormComponent fc_userUpdates = formEnvironment.getFormComponentById("US_ALLOW_USER_APPDIR_UPDATES_ADVANCEDITEM");
-Class&lt;?&gt; 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() &amp;&amp; jcb_user.isSelected();
 
-boolean showWarning = advancedOptions &amp;&amp; (!userUpdates);
+JCheckBox jcb_userUpdates = (JCheckBox) fc_userUpdates.getConfigurationObject();
+boolean userUpdates = fc_userUpdates.isEnabled() &amp;&amp; jcb_userUpdates.isSelected();
 
-formEnvironment.getFormComponentById("US_NO_UPDATES_WARNING").setVisible(showWarning);</property>
-                    </object>
-                  </property>
-                  <property name="variableName" type="string">allowUserDefaultAppdirUpdates</property>
-                </serializedBean>
-                <visibilityScript>context.getBooleanVariable("advancedOptions")
-</visibilityScript>
-              </formComponent>
-              <formComponent name="BOTHSPACE: No updates warning" id="2989" customizedId="US_NO_UPDATES_WARNING" beanClass="com.install4j.runtime.beans.formcomponents.LabelComponent" insetLeft="16">
-                <serializedBean>
-                  <property name="labelIconFile">
-                    <object class="com.install4j.api.beans.ExternalFile">
-                      <string>${compiler:JALVIEW_DIR}/${compiler:INSTALL4J_UTILS_DIR}/warning.png</string>
-                    </object>
-                  </property>
-                  <property name="labelText" type="string">No automatic updates will occur when Jalview is launched</property>
-                </serializedBean>
-                <visibilityScript>context.getBooleanVariable("advancedOptions")
-&amp;&amp;
-!(
-  context.getBooleanVariable("allowUserDefaultAppdirUpdates")
-  || context.getBooleanVariable("allowInstallerAppdirUpdates")
-)</visibilityScript>
-              </formComponent>
+boolean showWarning = advancedOptions &amp;&amp; (!userUpdates);
+fc_warning.setVisible(showWarning);
+</property>
+                            </object>
+                          </property>
+                          <property name="variableName" type="string">allowUserDefaultAppdirUpdates</property>
+                        </serializedBean>
+                      </formComponent>
+                      <formComponent name="BOTHSPACE: No updates warning" id="2989" customizedId="US_NO_UPDATES_WARNING" beanClass="com.install4j.runtime.beans.formcomponents.LabelComponent" insetLeft="16">
+                        <serializedBean>
+                          <property name="labelIconFile">
+                            <object class="com.install4j.api.beans.ExternalFile">
+                              <string>${compiler:JALVIEW_DIR}/${compiler:INSTALL4J_UTILS_DIR}/warning.png</string>
+                            </object>
+                          </property>
+                          <property name="labelText" type="string">No automatic updates will occur when Jalview is launched</property>
+                        </serializedBean>
+                        <visibilityScript>!( context.getBooleanVariable("allowUserDefaultAppdirUpdates") || context.getBooleanVariable("allowInstallerAppdirUpdates") )</visibilityScript>
+                      </formComponent>
+                    </beans>
+                  </group>
+                </beans>
+              </group>
             </formComponents>
           </screen>
           <screen name="SYSTEMSPACE: Additional checkboxes" id="2903" beanClass="com.install4j.runtime.beans.screens.FormScreen" rollbackBarrierExitCode="0">
@@ -856,8 +905,8 @@ formEnvironment.getFormComponentById("US_NO_UPDATES_WARNING").setVisible(showWar
                     <object class="com.install4j.api.beans.ScriptProperty">
                       <property name="value" type="string">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 &amp;&amp; userUpdates &amp;&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 &amp;&amp; !allowUserAppdirPath &amp;&amp; userAppdirPath.length() == 0 &amp;&amp; !installerUpdates );
 jb_setDefaults.setEnabled(enableSetDefaults);</property>
@@ -963,7 +1012,7 @@ jb_setDefaults.setEnabled(enableSetDefaults);</property>
                   </property>
                 </serializedBean>
                 <beans>
-                  <group name="Advanced options boxed group" id="3030" beanClass="com.install4j.runtime.beans.groups.VerticalFormComponentGroup">
+                  <group name="Advanced options (boxed) group" id="3030" beanClass="com.install4j.runtime.beans.groups.VerticalFormComponentGroup">
                     <serializedBean>
                       <property name="borderSides">
                         <object class="com.install4j.runtime.beans.formcomponents.BorderSides">
@@ -988,13 +1037,13 @@ jb_setDefaults.setEnabled(enableSetDefaults);</property>
                       </property>
                     </serializedBean>
                     <beans>
-                      <formComponent name="Strongly recommended text" id="2985" customizedId="SS_LABEL_ADVANCEDITEM" beanClass="com.install4j.runtime.beans.formcomponents.MultilineHtmlLabelComponent" insetLeft="16">
+                      <formComponent name="Strongly recommended text" id="2985" customizedId="SS_LABEL" beanClass="com.install4j.runtime.beans.formcomponents.MultilineHtmlLabelComponent" insetLeft="16">
                         <serializedBean>
                           <property name="labelHtml" type="string">&lt;html&gt;The following options are &lt;strong&gt;strongly recommended&lt;/strong&gt; to be left as default unless there is a particular reason to change them.&lt;/html&gt;</property>
                         </serializedBean>
                       </formComponent>
-                      <formComponent id="3013" customizedId="SS_VSPACE_ADVANCEDITEM" beanClass="com.install4j.runtime.beans.formcomponents.SpacerComponent" insetLeft="16" />
-                      <formComponent name="BOTHSPACE: Allow automatic updates in user's home directory" id="2986" customizedId="SS_ALLOW_USER_APPDIR_UPDATES_ADVANCEDITEM" beanClass="com.install4j.runtime.beans.formcomponents.CheckboxComponent" insetLeft="16">
+                      <formComponent id="3013" customizedId="SS_VSPACE" beanClass="com.install4j.runtime.beans.formcomponents.SpacerComponent" insetLeft="16" />
+                      <formComponent name="BOTHSPACE: Allow automatic updates in user's home directory" id="2986" customizedId="SS_ALLOW_USER_APPDIR_UPDATES" beanClass="com.install4j.runtime.beans.formcomponents.CheckboxComponent" insetLeft="16">
                         <serializedBean>
                           <property name="checkboxText" type="string">Allow user-space updates for ${compiler:JALVIEW_APPLICATION_NAME} components</property>
                           <property name="coupledComponentIds">
@@ -1019,8 +1068,8 @@ unless customised below.
                           <property name="selectionScript">
                             <object class="com.install4j.api.beans.ScriptProperty">
                               <property name="value" type="string">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 &amp;&amp; userUpdates &amp;&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 &amp;&amp; !allowUserAppdirPath &amp;&amp; userAppdirPath.length() == 0 &amp;&amp; !installerUpdates );
 jb_setDefaults.setEnabled(enableSetDefaults);</property>
@@ -1121,8 +1170,8 @@ jb_setDefaults.setEnabled(enableSetDefaults);</property>
                               <property name="selectionScript">
                                 <object class="com.install4j.api.beans.ScriptProperty">
                                   <property name="value" type="string">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 &amp;&amp; userUpdates &amp;&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 &amp;&amp; !allowUserAppdirPath &amp;&amp; userAppdirPath.length() == 0 &amp;&amp; !installerUpdates );
 jb_setDefaults.setEnabled(enableSetDefaults);</property>
@@ -1199,6 +1248,7 @@ jb_setDefaults.setEnabled(enableSetDefaults);</property>
                               </property>
                               <property name="variableName" type="string">allowSetUserAppdirPath</property>
                             </serializedBean>
+                            <initScript>component.setEnabled( context.getBooleanVariable("allowUserDefaultAppdirUpdates") )</initScript>
                           </formComponent>
                           <formComponent name="SYSTEMSPACE: Set userAppdirPath" id="3024" customizedId="SS_USER_APPDIR_PATH" beanClass="com.install4j.runtime.beans.formcomponents.TextfieldComponent">
                             <serializedBean>
@@ -1225,8 +1275,8 @@ The default value on ${installer:osName} is
                               <property name="inputVerifier">
                                 <object class="com.install4j.api.beans.ScriptProperty">
                                   <property name="value" type="string">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 &amp;&amp; userUpdates &amp;&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 &amp;&amp; !allowUserAppdirPath &amp;&amp; userAppdirPath.length() == 0 &amp;&amp; !installerUpdates );
 jb_setDefaults.setEnabled(enableSetDefaults);
@@ -1307,15 +1357,11 @@ return true;</property>
                               </property>
                               <property name="keyListener">
                                 <object class="com.install4j.api.beans.ScriptProperty">
-                                  <property name="value" type="string">// 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"));
+                                  <property name="value" type="string">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);
 </property>
@@ -1328,23 +1374,11 @@ fc_invalidPathWarning.setVisible(showInvalidPathWarning);
                               </property>
                               <property name="variableName" type="string">userAppdirPath</property>
                             </serializedBean>
-                            <initScript>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 &amp;&amp; allowUserAppdirPath);</initScript>
+                            <initScript>component.setEnabled( context.getBooleanVariable("allowUserDefaultAppdirUpdates") &amp;&amp; context.getBooleanVariable("allowSetUserAppdirPath") )</initScript>
                           </formComponent>
                         </beans>
                       </group>
-                      <formComponent name="SYSTEMSPACE: Allow automatic updates in the installation directory" id="2974" customizedId="SS_ALLOW_INSTALLER_APPDIR_UPDATES_ADVANCEDITEM" beanClass="com.install4j.runtime.beans.formcomponents.CheckboxComponent" insetLeft="16">
+                      <formComponent name="SYSTEMSPACE: Allow automatic updates in the installation directory" id="2974" customizedId="SS_ALLOW_INSTALLER_APPDIR_UPDATES" beanClass="com.install4j.runtime.beans.formcomponents.CheckboxComponent" insetLeft="16">
                         <serializedBean>
                           <property name="checkboxText" type="string">Allow installation updates for ${compiler:JALVIEW_APPLICATION_NAME} components</property>
                           <property name="helpText" type="string">&lt;html&gt;This option allows updates to ${compiler:JALVIEW_APPLICATION_NAME}
@@ -1373,8 +1407,8 @@ Installation updates will be installed into
                           <property name="selectionScript">
                             <object class="com.install4j.api.beans.ScriptProperty">
                               <property name="value" type="string">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 &amp;&amp; userUpdates &amp;&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 &amp;&amp; !allowUserAppdirPath &amp;&amp; userAppdirPath.length() == 0 &amp;&amp; !installerUpdates );
 jb_setDefaults.setEnabled(enableSetDefaults);</property>
@@ -1451,14 +1485,15 @@ jb_setDefaults.setEnabled(enableSetDefaults);</property>
                           </property>
                           <property name="variableName" type="string">allowInstallerAppdirUpdates</property>
                         </serializedBean>
+                        <initScript>component.setEnabled( !context.getBooleanVariable("allowUserDefaultAppdirUpdates") )</initScript>
                       </formComponent>
-                      <formComponent name="Set defaults" id="3029" customizedId="SS_SET_DEFAULTS_ADVANCEDITEM" beanClass="com.install4j.runtime.beans.formcomponents.ButtonComponent" insetTop="8" insetLeft="16">
+                      <formComponent name="Set defaults" id="3029" customizedId="SS_SET_DEFAULTS" beanClass="com.install4j.runtime.beans.formcomponents.ButtonComponent" insetTop="8" insetLeft="16">
                         <serializedBean>
                           <property name="actionScript">
                             <object class="com.install4j.api.beans.ScriptProperty">
                               <property name="value" type="string">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 &amp;&amp; userUpdates &amp;&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 &amp;&amp; !allowUserAppdirPath &amp;&amp; userAppdirPath.length() == 0 &amp;&amp; !installerUpdates );
 jb_setDefaults.setEnabled(enableSetDefaults);</property>
@@ -1546,9 +1581,9 @@ jb_setDefaults.setEnabled(enableSetDefaults);</property>
                           <property name="buttonText" type="string">Reset advanced options to defaults</property>
                         </serializedBean>
                         <initScript>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 &amp;&amp; !allowUserAppdirPath &amp;&amp; userAppdirPath.length() == 0 &amp;&amp; !installerUpdates );
-jb_setDefaults.setEnabled(enableSetDefaults);</initScript>
+component.setEnabled(enableSetDefaults);</initScript>
                       </formComponent>
                       <formComponent name="BOTHSPACE: No updates warning" id="2988" customizedId="SS_NO_UPDATES_WARNING" beanClass="com.install4j.runtime.beans.formcomponents.LabelComponent" insetLeft="16">
                         <serializedBean>
@@ -1579,10 +1612,7 @@ jb_setDefaults.setEnabled(enableSetDefaults);</initScript>
                           </property>
                           <property name="labelText" type="string">No automatic updates will occur when ${compiler:JALVIEW_APPLICATION_NAME} is launched</property>
                         </serializedBean>
-                        <visibilityScript>!(
-  context.getBooleanVariable("allowUserDefaultAppdirUpdates")
-  || context.getBooleanVariable("allowInstallerAppdirUpdates")
-)</visibilityScript>
+                        <visibilityScript>!( context.getBooleanVariable("allowUserDefaultAppdirUpdates") || context.getBooleanVariable("allowInstallerAppdirUpdates") )</visibilityScript>
                       </formComponent>
                       <formComponent name="SYSTEMSPACE: Invalid user-space path warning" id="3027" customizedId="SS_INVALID_USER_APPDIR_PATH_WARNING" beanClass="com.install4j.runtime.beans.formcomponents.LabelComponent" insetLeft="16">
                         <serializedBean>
@@ -1593,10 +1623,19 @@ jb_setDefaults.setEnabled(enableSetDefaults);</initScript>
                           </property>
                           <property name="labelText" type="string">The user-space path should contain one of "~" (at the start), "%u" or "%h"</property>
                         </serializedBean>
-                        <visibilityScript>!(
-  context.getBooleanVariable("allowUserDefaultAppdirUpdates")
-  || context.getBooleanVariable("allowInstallerAppdirUpdates")
-)</visibilityScript>
+                        <visibilityScript>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") &amp;&amp; context.getBooleanVariable("allowSetUserAppdirPath") &amp;&amp; showInvalidPathWarning;</visibilityScript>
                       </formComponent>
                     </beans>
                   </group>
@@ -1988,26 +2027,39 @@ return advanced ? !( allowUser || allowInstaller ) : false;</property>
                     </serializedBean>
                     <condition>!context.getBooleanVariable("disableUserDefaultAppdirUpdates")</condition>
                   </action>
+                  <action name="Disable user-space updates" id="2997" beanClass="com.install4j.runtime.beans.actions.misc.AddVmOptionsAction" actionElevationType="elevated" rollbackBarrierExitCode="0">
+                    <serializedBean>
+                      <property name="launcherId" type="string">2823</property>
+                      <property name="vmOptions" type="array" elementType="string" length="2">
+                        <element index="0"># Comment out the following line to allow user-space updates</element>
+                        <element index="1">-Dnouserdefaultappdir=true</element>
+                      </property>
+                    </serializedBean>
+                    <condition>context.getBooleanVariable("disableUserDefaultAppdirUpdates")</condition>
+                  </action>
                   <action name="Set setUserAppdirPath property" id="3026" beanClass="com.install4j.runtime.beans.actions.misc.AddVmOptionsAction" actionElevationType="elevated" rollbackBarrierExitCode="0">
                     <serializedBean>
                       <property name="launcherId" type="string">2823</property>
-                      <property name="vmOptions" type="array" elementType="string" length="3">
-                        <element index="0"># The following line sets a custom path for user-space updates -- use with caution.</element>
-                        <element index="1"># If unset, the default is ${installer:userDefaultAppdirBase} for ${installer:osName}</element>
-                        <element index="2">-Dsetuserappdirpath=${installer:setUserAppdirPath}</element>
+                      <property name="vmOptions" type="array" elementType="string" length="4">
+                        <element index="0"># The below line sets a custom path for user-space updates -- use with caution.</element>
+                        <element index="1"># A leading ~/ or %h anywhere will be sustituted with the user's home path, and %u by the username.</element>
+                        <element index="2"># If unset, the default is ${installer:userDefaultAppdirBase} for ${installer:osName}</element>
+                        <element index="3">-Dsetuserappdirpath=${installer:setUserAppdirPath}</element>
                       </property>
                     </serializedBean>
                     <condition>(String)context.getVariable("setUserAppdirPath") != null</condition>
                   </action>
-                  <action name="Disable user-space updates" id="2997" beanClass="com.install4j.runtime.beans.actions.misc.AddVmOptionsAction" actionElevationType="elevated" rollbackBarrierExitCode="0">
+                  <action name="Don't set setUserAppdirPath property" id="3037" beanClass="com.install4j.runtime.beans.actions.misc.AddVmOptionsAction" actionElevationType="elevated" rollbackBarrierExitCode="0">
                     <serializedBean>
                       <property name="launcherId" type="string">2823</property>
-                      <property name="vmOptions" type="array" elementType="string" length="2">
-                        <element index="0"># Comment out the following line to allow user-space updates</element>
-                        <element index="1">-Dnouserdefaultappdir=true</element>
+                      <property name="vmOptions" type="array" elementType="string" length="4">
+                        <element index="0"># Uncomment the below line to set a custom path for user-space updates -- use with caution.</element>
+                        <element index="1"># A leading ~/ or %h anywhere will be sustituted with the user's home path, and %u by the username.</element>
+                        <element index="2"># If not set, the default is ${installer:userDefaultAppdirBase} for ${installer:osName}</element>
+                        <element index="3"># -Dsetuserappdirpath=${installer:setUserAppdirPath}</element>
                       </property>
                     </serializedBean>
-                    <condition>context.getBooleanVariable("disableUserDefaultAppdirUpdates")</condition>
+                    <condition>(String)context.getVariable("setUserAppdirPath") == null</condition>
                   </action>
                   <action name="Allow updates" id="2998" beanClass="com.install4j.runtime.beans.actions.misc.AddVmOptionsAction" actionElevationType="elevated" rollbackBarrierExitCode="0">
                     <serializedBean>