JAL-3631 Add a new launcher in install4j to pass new system properties to getdown...
authorBen Soares <b.soares@dundee.ac.uk>
Wed, 12 Jun 2024 22:18:43 +0000 (23:18 +0100)
committerBen Soares <b.soares@dundee.ac.uk>
Wed, 12 Jun 2024 22:18:43 +0000 (23:18 +0100)
build.gradle
gradle.properties
utils/install4j/install4j10_template.install4j

index d057994..7a14a67 100644 (file)
@@ -241,6 +241,7 @@ ext {
   install4jDMGBackgroundImageFile = "${install4j_dmg_background}"
   install4jmacOSArchiveName = "${jalview_name} Non-Release ${JALVIEW_VERSION} Installer"
   install4jExecutableName = install4j_executable_name
+  install4jUserExecutableName = install4j_user_executable_name
   install4jExtraScheme = "jalviewextra"
   install4jMacIconsFile = string("${install4j_images_dir}/${install4j_mac_icons_file}")
   install4jWindowsIconsFile = string("${install4j_images_dir}/${install4j_windows_icons_file}")
@@ -2280,6 +2281,7 @@ task getdownWebsiteBuild() {
   }
 
   def getdownWebsiteResourceFilenames = []
+  def getdownWebsitePResourceFilenames = []
   def getdownResourceDir = getdownResourceDir
   def getdownResourceFilenames = []
 
@@ -2354,7 +2356,11 @@ task getdownWebsiteBuild() {
             }
             if (r.exists()) {
               val = "${getdown_resource_dir}/" + r.getName()
-              getdownWebsiteResourceFilenames += val
+              if (prop.startsWith("getdown_txt_ui.")) {
+                getdownWebsitePResourceFilenames += val
+              } else {
+                getdownWebsiteResourceFilenames += val
+              }
               getdownResourceFilenames += r.getPath()
             }
           }
@@ -2366,6 +2372,9 @@ task getdownWebsiteBuild() {
       }
     }
 
+    getdownWebsitePResourceFilenames.each{ filename ->
+      getdownTextLines += "presource = ${filename}"
+    }
     getdownWebsiteResourceFilenames.each{ filename ->
       getdownTextLines += "resource = ${filename}"
     }
@@ -2986,6 +2995,7 @@ task installerFiles(type: com.install4j.gradle.Install4jTask) {
     'APPLICATION_FOLDER': install4jApplicationFolder,
     'UNIX_APPLICATION_FOLDER': install4jUnixApplicationFolder,
     'EXECUTABLE_NAME': install4jExecutableName,
+    'USER_EXECUTABLE_NAME': install4jUserExecutableName,
     'EXTRA_SCHEME': install4jExtraScheme,
     'MAC_ICONS_FILE': install4jMacIconsFile,
     'WINDOWS_ICONS_FILE': install4jWindowsIconsFile,
index e5b2f12..8891190 100644 (file)
@@ -142,6 +142,7 @@ install4j_installer_file_associations = file_associations_auto-install4j10.xml
 #install4j_DMG_uninstaller_app_files = uninstall_old_jalview_files.xml
 install4j_build_dir = build/install4j
 install4j_executable_name = jalviewg
+install4j_user_executable_name = jalviewu
 install4j_media_types = windows,macosArchive,unixArchive,unixInstaller
 install4j_faster = false
 install4j_application_categories = Science;Biology;Java;
index 04e3cab..3a33039 100644 (file)
@@ -60,6 +60,7 @@
       <variable name="APPLICATION_FOLDER" value="Jalview" />
       <variable name="UNIX_APPLICATION_FOLDER" value="jalview" />
       <variable name="EXECUTABLE_NAME" value="jalviewg" />
+      <variable name="USER_EXECUTABLE_NAME" value="jalviewu" />
       <variable name="EXTRA_SCHEME" value="jalviewx" />
       <variable name="MAC_ICONS_FILE" value="utils/channels/release/images/jalview_logo.icns" />
       <variable name="WINDOWS_ICONS_FILE" value="utils/channels/release/images/jalview_logo.ico" />
           <versionLine x="85" y="109" text="version ${compiler:sys.version}" />
         </text>
       </splashScreen>
-      <java mainClass="com.threerings.getdown.launcher.GetdownApp" vmParameters="-Dinstaller_template_version=${compiler:INSTALLER_TEMPLATE_VERSION} -Dchannel.app_name=&quot;${compiler:JALVIEW_APPLICATION_NAME}&quot;" arguments="&quot;${launcher:sys.launcherDirectory}&quot; jalview">
+      <java mainClass="com.threerings.getdown.launcher.GetdownApp" vmParameters="-Dinstaller_template_version=${compiler:INSTALLER_TEMPLATE_VERSION} -Dchannel.app_name=&quot;${compiler:JALVIEW_APPLICATION_NAME}&quot; -Dinstaller_appdir=&quot;${launcher:sys.launcherDirectory}&quot; -Dinstaller.application_folder=&quot;${compiler:APPLICATION_FOLDER}&quot;" arguments="&quot;${launcher:sys.launcherDirectory}&quot; jalview">
         <classPath>
           <archive location="getdown-launcher.jar" />
           <archive location="${compiler:GETDOWN_INSTALL_DIR}/getdown-launcher.jar" failOnError="false" />
         <urlHandler scheme="${compiler:EXTRA_SCHEME}" />
       </macStaticAssociations>
     </launcher>
+    <launcher name="Jalview User Launcher" id="2823" menuName="${compiler:JALVIEW_APPLICATION_NAME}" icnsFile="${compiler:JALVIEW_DIR}/${compiler:MAC_ICONS_FILE}" customMacBundleIdentifier="true" macBundleIdentifier="${compiler:BUNDLE_ID}" fileset="734" useCustomMacosExecutableName="true" customMacosExecutableName="${compiler:JALVIEW_APPLICATION_NAME}">
+      <executable name="${compiler:USER_EXECUTABLE_NAME}" iconSet="true" iconFile="${compiler:JALVIEW_DIR}/${compiler:WINDOWS_ICONS_FILE}" redirectStdout="true" executableMode="gui" changeWorkingDirectory="false" singleInstance="true" checkConsoleParameter="true">
+        <versionInfo include="true" fileDescription="${compiler:sys.fullName}" legalCopyright="${compiler:COPYRIGHT_MESSAGE}" internalName="${compiler:INTERNAL_ID}" productName="${compiler:sys.fullName}" />
+      </executable>
+      <splashScreen width="640" height="480" bitmapFile="${compiler:JALVIEW_DIR}/${compiler:BACKGROUND}" textOverlay="true">
+        <text>
+          <statusLine x="85" y="81" text="${compiler:sys.shortName}" fontSize="18" />
+          <versionLine x="85" y="109" text="version ${compiler:sys.version}" />
+        </text>
+      </splashScreen>
+      <java mainClass="com.threerings.getdown.launcher.GetdownApp" vmParameters="-Dusedefaultappdir=true -Dpopulatedefaultappdir=true -Dapplicationappdir=&quot;${launcher:sys.launcherDirectory}&quot; -Dappid=jalview -Dinstaller_template_version=${compiler:INSTALLER_TEMPLATE_VERSION} -Dchannel.app_name=&quot;${compiler:JALVIEW_APPLICATION_NAME}&quot; -Dinstaller_appdir=&quot;${launcher:sys.launcherDirectory}&quot; -Dinstaller.application_folder=&quot;${compiler:APPLICATION_FOLDER}&quot;">
+        <classPath>
+          <archive location="getdown-launcher.jar" failOnError="false" />
+          <archive location="${compiler:GETDOWN_INSTALL_DIR}/getdown-launcher.jar" failOnError="false" />
+        </classPath>
+        <nativeLibraryDirectories>
+          <directory name="${compiler:JRE_DIR}/bin" />
+          <directory name="${compiler:GETDOWN_DIST_DIR}" />
+        </nativeLibraryDirectories>
+      </java>
+      <infoPlist>${compiler:file("${compiler:INFO_PLIST_FILE_ASSOCIATIONS_FILE}")}</infoPlist>
+      <iconImageFiles>
+        <file path="${compiler:JALVIEW_DIR}/${compiler:PNG_ICON_FILE}" />
+      </iconImageFiles>
+      <macStaticAssociations>
+        <urlHandler scheme="jalview" />
+        <urlHandler scheme="jalviews" />
+        <urlHandler scheme="jalviewhttp" />
+        <urlHandler scheme="jalviewhttps" />
+        <urlHandler scheme="${compiler:EXTRA_SCHEME}" />
+      </macStaticAssociations>
+    </launcher>
   </launchers>
   <installerGui autoUpdateDescriptorUrl="https://www.jalview.org/install4j/updates.xml">
     <applications>
@@ -1492,6 +1525,9 @@ ${compiler:JALVIEW_APPLICATION_NAME} will now launch.</property>
   </installerGui>
   <mediaSets>
     <windows name="Windows x64 EXE Installer" id="743" customizedId="WINDOWS-X64-EXE" mediaFileName="${compiler:APPLICATION_FOLDER}-${compiler:JALVIEW_VERSION}-${compiler:sys.platform}-java_${compiler:JAVA_INTEGER_VERSION}" installDir="${compiler:APPLICATION_FOLDER}" runPostProcessor="true" postProcessor="${compiler:JSIGN_SH} $EXECUTABLE" customInstallBaseDir="~/AppData/Local" architecture="64">
+      <excludedLaunchers>
+        <launcher id="737" />
+      </excludedLaunchers>
       <excludedBeans>
         <bean refId="2746" />
       </excludedBeans>
@@ -1502,7 +1538,7 @@ ${compiler:JALVIEW_APPLICATION_NAME} will now launch.</property>
       </exclude>
       <jreBundle jreBundleSource="preCreated" includedJre="${compiler:WINDOWS_X64_JAVA_VM_TGZ}" manualJreEntry="true" />
     </windows>
-    <macosArchive name="macOS (Intel) Disk Image" id="878" customizedId="MACOS-X64-DMG" mediaFileName="${compiler:MACOSARCHIVE_X64_DMG_FILENAME}" volumeName="${compiler:MACOSARCHIVE_X64_NAME}" launcherId="737" setupAppId="2746">
+    <macosArchive name="macOS (Intel) Disk Image" id="878" customizedId="MACOS-X64-DMG" mediaFileName="${compiler:MACOSARCHIVE_X64_DMG_FILENAME}" volumeName="${compiler:MACOSARCHIVE_X64_NAME}" launcherId="2823" setupAppId="2746">
       <exclude>
         <entry defaultFileset="true" />
         <entry filesetId="2803" />
@@ -1520,7 +1556,7 @@ ${compiler:JALVIEW_APPLICATION_NAME} will now launch.</property>
         <file name=".VolumeIcon.icns" file="${compiler:JALVIEW_DIR}/${compiler:MACOSARCHIVE_VOLUMEICON}" />
       </topLevelFiles>
     </macosArchive>
-    <macosArchive name="macOS (Apple Silicon) Disk Image" id="2796" customizedId="MACOS-AARCH64-DMG" mediaFileName="${compiler:MACOSARCHIVE_AARCH64_DMG_FILENAME}" volumeName="${compiler:MACOSARCHIVE_AARCH64_NAME}" architecture="aarch64" launcherId="737" setupAppId="2746">
+    <macosArchive name="macOS (Apple Silicon) Disk Image" id="2796" customizedId="MACOS-AARCH64-DMG" mediaFileName="${compiler:MACOSARCHIVE_AARCH64_DMG_FILENAME}" volumeName="${compiler:MACOSARCHIVE_AARCH64_NAME}" architecture="aarch64" launcherId="2823" setupAppId="2746">
       <exclude>
         <entry defaultFileset="true" />
         <entry filesetId="2801" />
@@ -1539,6 +1575,9 @@ ${compiler:JALVIEW_APPLICATION_NAME} will now launch.</property>
       </topLevelFiles>
     </macosArchive>
     <unixInstaller name="Linux x64 Shell Installer" id="1595" customizedId="LINUX-X64-SH" mediaFileName="${compiler:UNIX_APPLICATION_FOLDER}-${compiler:JALVIEW_VERSION}-linux-x64-java_${compiler:JAVA_INTEGER_VERSION}" installDir="${compiler:UNIX_APPLICATION_FOLDER}" customInstallBaseDir="~/opt/">
+      <excludedLaunchers>
+        <launcher id="737" />
+      </excludedLaunchers>
       <excludedBeans>
         <bean refId="2746" />
       </excludedBeans>
@@ -1554,6 +1593,9 @@ ${compiler:JALVIEW_APPLICATION_NAME} will now launch.</property>
       <jreBundle jreBundleSource="preCreated" includedJre="${compiler:LINUX_X64_JAVA_VM_TGZ}" manualJreEntry="true" />
     </unixInstaller>
     <unixInstaller name="Linux aarch64 Shell Installer" id="2782" customizedId="LINUX-AARCH64-SH" mediaFileName="${compiler:UNIX_APPLICATION_FOLDER}-${compiler:JALVIEW_VERSION}-linux-aarch64-java_${compiler:JAVA_INTEGER_VERSION}" installDir="${compiler:UNIX_APPLICATION_FOLDER}" customInstallBaseDir="~/opt/">
+      <excludedLaunchers>
+        <launcher id="737" />
+      </excludedLaunchers>
       <excludedBeans>
         <bean refId="2746" />
       </excludedBeans>
@@ -1569,6 +1611,9 @@ ${compiler:JALVIEW_APPLICATION_NAME} will now launch.</property>
       <jreBundle jreBundleSource="preCreated" includedJre="${compiler:LINUX_AARCH64_JAVA_VM_TGZ}" manualJreEntry="true" />
     </unixInstaller>
     <unixArchive name="Unix .tar.gz Archive" id="1596" customizedId="UNIX--TGZ" mediaFileName="${compiler:UNIX_APPLICATION_FOLDER}-${compiler:JALVIEW_VERSION}-${compiler:sys.platform}-java_${compiler:JAVA_INTEGER_VERSION}" installDir="${compiler:UNIX_APPLICATION_FOLDER}">
+      <excludedLaunchers>
+        <launcher id="737" />
+      </excludedLaunchers>
       <excludedBeans>
         <bean refId="2746" />
       </excludedBeans>
@@ -1580,6 +1625,9 @@ ${compiler:JALVIEW_APPLICATION_NAME} will now launch.</property>
       <jreBundle jreBundleSource="none" includedJre="${compiler:LINUX_X64_JAVA_VM_TGZ}" manualJreEntry="true" />
     </unixArchive>
     <unixInstaller name="Unix Shell Installer" id="2639" customizedId="UNIX--SH" mediaFileName="${compiler:UNIX_APPLICATION_FOLDER}-${compiler:JALVIEW_VERSION}-${compiler:sys.platform}-java_${compiler:JAVA_INTEGER_VERSION}" installDir="${compiler:UNIX_APPLICATION_FOLDER}" customInstallBaseDir="~/opt/">
+      <excludedLaunchers>
+        <launcher id="737" />
+      </excludedLaunchers>
       <excludedBeans>
         <bean refId="2746" />
       </excludedBeans>