JAL-3830 polished setup app for macos
authorBen Soares <bsoares@dundee.ac.uk>
Thu, 28 Oct 2021 17:35:33 +0000 (18:35 +0100)
committerBen Soares <bsoares@dundee.ac.uk>
Thu, 28 Oct 2021 17:35:33 +0000 (18:35 +0100)
utils/dev_macos_install.sh
utils/install4j/install4j9_template.install4j

index 6f17315..e46f524 100755 (executable)
@@ -1,12 +1,13 @@
 #!/usr/bin/env bash
 
 # perform a dev build and install on local macOS machine
-INSTALLERVOL="Jalview Installer"
-APP=Jalview.app
+INSTALLERVOL="Jalview Non-Release Installer"
+APP="Jalview Local.app"
 
-APPLICATIONS=$HOME/Applications
+APPLICATIONS=/Applications
 CHANNEL=NOCHANNEL
-DMG=build/install4j/11/Jalview-OFFLINE_macos-app_DEVELOPMENT-j11.dmg
+DMG=build/install4j/11/Jalview_Local-TEST-macos-java_11.dmg
+
 
 if [ x$1 != "xnogradle" ]; then
   gradle installers -PCHANNEL=LOCAL -Pinstall4j_media_types=macosArchive
@@ -33,7 +34,10 @@ if [ $? = 0 ]; then
   echo ""
 fi
 if [ -e "/Volumes/$INSTALLERVOL/$APP" ]; then
+  echo "Removing '$APPLICATIONS/$APP'"
   /bin/rm -r "$APPLICATIONS/$APP"
+  echo "Syncing '/Volumes/$INSTALLERVOL/$APP' to '$APPLICATIONS/'"
   rsync -avh "/Volumes/$INSTALLERVOL/$APP" "$APPLICATIONS/"
+  echo "Unmounting '/Volumes/$INSTALLERVOL'"
   umount "/Volumes/$INSTALLERVOL"
 fi
index f01ed8e..f1726f3 100644 (file)
@@ -704,7 +704,7 @@ return console.askOkCancel(message, true);
                     </object>
                   </property>
                 </serializedBean>
-                <condition>context.getBooleanVariable("makeSymbolicLink") &amp;&amp; ( Util.isLinux() || Util.isUnixInstaller() ) &amp;&amp; ( context.getVariable("unixUserBinDir") != null )</condition>
+                <condition>context.getBooleanVariable("makeSymbolicLinkAction") &amp;&amp; ( Util.isLinux() || Util.isUnixInstaller() ) &amp;&amp; ( context.getVariable("unixUserBinDir") != null )</condition>
               </action>
               <action name="Create macOS symbolic link to jalview in user's local bin" id="2743" beanClass="com.install4j.runtime.beans.actions.files.CreateSymlinkAction" actionElevationType="elevated" rollbackBarrierExitCode="0" errorMessage="Could not make a ${compiler:WRAPPER_LINK} symbolic link in ~/${installer:unixUserBinDir}">
                 <serializedBean>
@@ -719,7 +719,7 @@ return console.askOkCancel(message, true);
                     </object>
                   </property>
                 </serializedBean>
-                <condition>context.getBooleanVariable("makeSymbolicLink") &amp;&amp; ( Util.isMacOS() ) &amp;&amp; ( context.getVariable("unixUserBinDir") != null ) &amp;&amp; ( context.getVariable("macWrapperLinkLocation") != null )</condition>
+                <condition>context.getBooleanVariable("makeSymbolicLinkAction") &amp;&amp; Util.isMacOS() &amp;&amp; ( context.getVariable("unixUserBinDir") != null ) &amp;&amp; ( context.getVariable("macWrapperLinkLocation") != null )</condition>
               </action>
             </actions>
             <formComponents>
@@ -734,6 +734,7 @@ return console.askOkCancel(message, true);
                   <property name="initiallySelected" type="boolean" value="true" />
                   <property name="variableName" type="string">createDesktopLinkAction</property>
                 </serializedBean>
+                <visibilityScript>!Util.isMacOS()</visibilityScript>
               </formComponent>
               <formComponent name="Add an executable to the dock" id="577" beanClass="com.install4j.runtime.beans.formcomponents.CheckboxComponent">
                 <serializedBean>
@@ -755,9 +756,9 @@ return console.askOkCancel(message, true);
                 <serializedBean>
                   <property name="checkboxText" type="string">Make a ${compiler:WRAPPER_LINK} symbolic link in ${installer:unixUserBinDir}</property>
                   <property name="initiallySelected" type="boolean" value="true" />
-                  <property name="variableName" type="string">makeSymbolicLink</property>
+                  <property name="variableName" type="string">makeSymbolicLinkAction</property>
                 </serializedBean>
-                <visibilityScript>( Util.isLinux() || Util.isUnixInstaller() ) &amp;&amp; ( context.getVariable("unixUserBinDir") != null )</visibilityScript>
+                <visibilityScript>( Util.isLinux() || Util.isUnixInstaller() || ( Util.isMacOS() &amp;&amp; ( context.getVariable("macWrapperLinkLocation") != null ) ) ) &amp;&amp; ( context.getVariable("unixUserBinDir") != null )</visibilityScript>
               </formComponent>
             </formComponents>
           </screen>
@@ -1100,8 +1101,13 @@ return console.askYesNo(message, true);
           </screen>
         </screens>
       </application>
-      <application name="Setup" id="2746" beanClass="com.install4j.runtime.beans.applications.CustomApplication">
+      <application name="MacOS Setup" id="2746" beanClass="com.install4j.runtime.beans.applications.CustomApplication" fileset="734">
         <serializedBean>
+          <property name="executableDirectory">
+            <object class="java.io.File">
+              <string>.</string>
+            </object>
+          </property>
           <property name="executableName" type="string">${compiler:WRAPPER_LINK}_setup</property>
           <property name="windowTitle" type="string">${compiler:sys.fullName}</property>
         </serializedBean>
@@ -1115,7 +1121,46 @@ return console.askYesNo(message, true);
           </screen>
         </startup>
         <screens>
-          <link id="2752" targetId="20" />
+          <screen id="2772" beanClass="com.install4j.runtime.beans.screens.FormScreen" rollbackBarrierExitCode="0" backButton="hidden" finishScreen="true">
+            <serializedBean>
+              <property name="title" type="string">Running ${i18n:SetupAppTitle}</property>
+            </serializedBean>
+            <actions>
+              <link id="2778" targetId="576" />
+              <link id="2779" targetId="2743" />
+            </actions>
+            <formComponents>
+              <formComponent id="2773" beanClass="com.install4j.runtime.beans.formcomponents.MultilineLabelComponent" insetBottom="10">
+                <serializedBean>
+                  <property name="labelText" type="string">${i18n:FinishedLabel(${compiler:JALVIEW_APPLICATION_NAME})}</property>
+                </serializedBean>
+              </formComponent>
+              <formComponent name="Add an executable to the dock" id="2775" beanClass="com.install4j.runtime.beans.formcomponents.CheckboxComponent">
+                <serializedBean>
+                  <property name="checkboxText" type="string">${i18n:AddToDock}</property>
+                  <property name="initiallySelected" type="boolean" value="true" />
+                  <property name="variableName" type="string">addToDockAction</property>
+                </serializedBean>
+                <visibilityScript>Util.isMacOS()</visibilityScript>
+              </formComponent>
+              <formComponent name="Make a symbolic link to jalview.sh bash script in the user's local bin (Linux or Unix)" id="2777" beanClass="com.install4j.runtime.beans.formcomponents.CheckboxComponent">
+                <serializedBean>
+                  <property name="checkboxText" type="string">Make a ${compiler:WRAPPER_LINK} symbolic link in ${installer:unixUserBinDir}</property>
+                  <property name="initiallySelected" type="boolean" value="true" />
+                  <property name="variableName" type="string">makeSymbolicLinkAction</property>
+                </serializedBean>
+                <visibilityScript>( Util.isLinux() || Util.isUnixInstaller() || ( Util.isMacOS() &amp;&amp; ( context.getVariable("macWrapperLinkLocation") != null ) ) ) &amp;&amp; ( context.getVariable("unixUserBinDir") != null )</visibilityScript>
+              </formComponent>
+              <formComponent id="2780" beanClass="com.install4j.runtime.beans.formcomponents.MultilineLabelComponent">
+                <serializedBean>
+                  <property name="labelText" type="string">
+${i18n:ClickFinish}
+
+${compiler:JALVIEW_APPLICATION_NAME} will now launch.</property>
+                </serializedBean>
+              </formComponent>
+            </formComponents>
+          </screen>
         </screens>
       </application>
     </applications>
@@ -1387,7 +1432,7 @@ return console.askYesNo(message, true);
       </exclude>
       <jreBundle jreBundleSource="preCreated" includedJre="${compiler:WINDOWS_JAVA_VM_TGZ}" manualJreEntry="true" />
     </windows>
-    <macosArchive name="macOS Disk Image" id="878" customizedId="MACOS_DISK_IMAGE" mediaFileName="${compiler:APPLICATION_FOLDER}-${compiler:JALVIEW_VERSION}-${compiler:sys.platform}-java_${compiler:JAVA_INTEGER_VERSION}" volumeName="${compiler:INSTALLER_NAME}" launcherId="737" executeSetupApp="true" setupAppId="2746">
+    <macosArchive name="macOS Disk Image" id="878" customizedId="MACOS_DISK_IMAGE" mediaFileName="${compiler:APPLICATION_FOLDER}-${compiler:JALVIEW_VERSION}-${compiler:sys.platform}-java_${compiler:JAVA_INTEGER_VERSION}" volumeName="${compiler:INSTALLER_NAME}" launcherId="737" executeSetupApp="true" setupAppId="2746" setupLaunchInNewProcess="true">
       <excludedComponents>
         <component id="1156" />
         <component id="1276" />