JAL-3631 Adjustments to allow setting the Advanced options in the response.varfile...
authorBen Soares <b.soares@dundee.ac.uk>
Wed, 28 Aug 2024 10:53:00 +0000 (11:53 +0100)
committerBen Soares <b.soares@dundee.ac.uk>
Wed, 28 Aug 2024 10:53:00 +0000 (11:53 +0100)
utils/install4j/install4j10_template.install4j

index 6369d95..39f5b4a 100644 (file)
@@ -679,6 +679,8 @@ public static final String getCanonicalFullPathToDirectoryHash(String installerA
               </action>
               <action name="BOTHSPACE: Set makeSymbolicLink boolean variable?" id="2853" beanClass="com.install4j.runtime.beans.actions.control.SetVariableAction" rollbackBarrierExitCode="0">
                 <serializedBean>
+                  <property name="onlyIfUndefined" type="boolean" value="true" />
+                  <property name="responseFileVariable" type="boolean" value="true" />
                   <property name="script">
                     <object class="com.install4j.api.beans.ScriptProperty">
                       <property name="value" type="string">Util.isLinux() || Util.isUnixInstaller() || ( Util.isMacosInstaller() &amp;&amp; context.getBooleanVariable("isAdmin") )</property>
@@ -741,6 +743,8 @@ return MacOSDir;
               </action>
               <action name="BOTHSPACE: Set advancedOptions" id="3040" beanClass="com.install4j.runtime.beans.actions.control.SetVariableAction" rollbackBarrierExitCode="0">
                 <serializedBean>
+                  <property name="onlyIfUndefined" type="boolean" value="true" />
+                  <property name="responseFileVariable" type="boolean" value="true" />
                   <property name="script">
                     <object class="com.install4j.api.beans.ScriptProperty">
                       <property name="value" type="string">Boolean.FALSE</property>
@@ -751,6 +755,8 @@ return MacOSDir;
               </action>
               <action name="BOTHSPACE: Set allowUserDefaultAppdirUpdates" id="2976" beanClass="com.install4j.runtime.beans.actions.control.SetVariableAction" rollbackBarrierExitCode="0">
                 <serializedBean>
+                  <property name="onlyIfUndefined" type="boolean" value="true" />
+                  <property name="responseFileVariable" type="boolean" value="true" />
                   <property name="script">
                     <object class="com.install4j.api.beans.ScriptProperty">
                       <property name="value" type="string">Boolean.TRUE</property>
@@ -761,6 +767,8 @@ return MacOSDir;
               </action>
               <action name="BOTHSPACE: Set allowSetUserAppdirPath" id="3039" beanClass="com.install4j.runtime.beans.actions.control.SetVariableAction" rollbackBarrierExitCode="0">
                 <serializedBean>
+                  <property name="onlyIfUndefined" type="boolean" value="true" />
+                  <property name="responseFileVariable" type="boolean" value="true" />
                   <property name="script">
                     <object class="com.install4j.api.beans.ScriptProperty">
                       <property name="value" type="string">Boolean.FALSE</property>
@@ -771,6 +779,8 @@ return MacOSDir;
               </action>
               <action name="BOTHSPACE: Set userAppdirPath" id="3038" beanClass="com.install4j.runtime.beans.actions.control.SetVariableAction" rollbackBarrierExitCode="0">
                 <serializedBean>
+                  <property name="onlyIfUndefined" type="boolean" value="true" />
+                  <property name="responseFileVariable" type="boolean" value="true" />
                   <property name="script">
                     <object class="com.install4j.api.beans.ScriptProperty">
                       <property name="value" type="string">""</property>
@@ -781,6 +791,8 @@ return MacOSDir;
               </action>
               <action name="BOTHSPACE: Set allowInstallerAppdirUpdates" id="2977" beanClass="com.install4j.runtime.beans.actions.control.SetVariableAction" rollbackBarrierExitCode="0">
                 <serializedBean>
+                  <property name="onlyIfUndefined" type="boolean" value="true" />
+                  <property name="responseFileVariable" type="boolean" value="true" />
                   <property name="script">
                     <object class="com.install4j.api.beans.ScriptProperty">
                       <property name="value" type="string">Boolean.FALSE</property>
@@ -888,6 +900,25 @@ return true;</property>
                 </serializedBean>
                 <condition>context.isConsole() || context.isUnattended()</condition>
               </action>
+              <action name="Set sys.fileAssociation.launchers correctly" id="3080" beanClass="com.install4j.runtime.beans.actions.control.RunScriptAction" rollbackBarrierExitCode="0">
+                <serializedBean>
+                  <property name="script">
+                    <object class="com.install4j.api.beans.ScriptProperty">
+                      <property name="value" type="string">String[] extensions = (String[]) context.getVariable("sys.fileAssociation.extensions");
+if (extensions == null) {
+    return false;
+}
+int num = extensions.length;
+String[] launchers = new String[num];
+for (int i = 0; i &lt; num; i++) {
+    launchers[i] = "JALVIEW";
+}
+context.setVariable("sys.fileAssociation.launchers", launchers);
+return true;</property>
+                    </object>
+                  </property>
+                </serializedBean>
+              </action>
             </actions>
           </screen>
         </startup>