<property name="selectionScript">
<object class="com.install4j.api.beans.ScriptProperty">
<property name="value" type="string">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);
- }
-}
</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"><html>The following option is <strong>strongly recommended</strong>
-to be left as default unless there is a particular
-reason to change it.</html></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"><html>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"><html>The following option is <strong>strongly recommended</strong>
+to be left as default unless there is a particular
+reason to change it.</html></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"><html>This option allows updates to ${compiler:JALVIEW_APPLICATION_NAME}
<br>
components to be automatically downloaded
<br>
<br>
<pre>${installer:userDefaultAppdirBase}</pre>
</html></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<?> 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() && 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);</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")
-&&
-!(
- context.getBooleanVariable("allowUserDefaultAppdirUpdates")
- || context.getBooleanVariable("allowInstallerAppdirUpdates")
-)</visibilityScript>
- </formComponent>
+boolean showWarning = advancedOptions && (!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">
<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");
// 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);</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">
</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"><html>The following options are <strong>strongly recommended</strong> to be left as default unless there is a particular reason to change them.</html></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">
<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");
// 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);</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");
// 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);</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>
<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");
// 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);
</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>
</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 && allowUserAppdirPath);</initScript>
+ <initScript>component.setEnabled( context.getBooleanVariable("allowUserDefaultAppdirUpdates") && 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"><html>This option allows updates to ${compiler:JALVIEW_APPLICATION_NAME}
<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");
// 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);</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");
// 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);</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();
// 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);</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>
</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>
</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") && context.getBooleanVariable("allowSetUserAppdirPath") && showInvalidPathWarning;</visibilityScript>
</formComponent>
</beans>
</group>
</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>