JAL-3631 Allow icon file name to be passed to launcher by install4j
authorBen Soares <b.soares@dundee.ac.uk>
Tue, 25 Jun 2024 10:30:38 +0000 (11:30 +0100)
committerBen Soares <b.soares@dundee.ac.uk>
Tue, 25 Jun 2024 10:30:38 +0000 (11:30 +0100)
build.gradle
utils/install4j/install4j10_template.install4j

index 23c5447..9738981 100644 (file)
@@ -242,9 +242,6 @@ ext {
   install4jmacOSArchiveName = "${jalview_name} Non-Release ${JALVIEW_VERSION} Installer"
   install4jExecutableName = install4j_executable_name
   install4jExtraScheme = "jalviewextra"
-  install4jMacIconsFile = string("${install4j_images_dir}/${install4j_mac_icons_file}")
-  install4jWindowsIconsFile = string("${install4j_images_dir}/${install4j_windows_icons_file}")
-  install4jPngIconFile = string("${install4j_images_dir}/${install4j_png_icon_file}")
   install4jBackground = string("${install4j_images_dir}/${install4j_background}")
   install4jBuildDir = "${install4j_build_dir}/${JAVA_VERSION}"
   install4jDMGFixedDSStoreX64 = "build/macos_dmg/${install4j_dmg_ds_store}-x64"
@@ -3002,9 +2999,10 @@ task installerFiles(type: com.install4j.gradle.Install4jTask) {
     'UNIX_APPLICATION_FOLDER': install4jUnixApplicationFolder,
     'EXECUTABLE_NAME': install4jExecutableName,
     'EXTRA_SCHEME': install4jExtraScheme,
-    'MAC_ICONS_FILE': install4jMacIconsFile,
-    'WINDOWS_ICONS_FILE': install4jWindowsIconsFile,
-    'PNG_ICON_FILE': install4jPngIconFile,
+    'ICONS_DIR': install4j_images_dir,
+    'MAC_ICONS_FILE': install4j_mac_icons_file,
+    'WINDOWS_ICONS_FILE': install4j_windows_icons_file,
+    'PNG_ICON_FILE': install4j_png_icon_file,
     'BACKGROUND': install4jBackground,
     'MACOSARCHIVE_X64_DMG_FILENAME': install4jmacOSArchiveX64DMGFilename,
     'MACOSARCHIVE_AARCH64_DMG_FILENAME': install4jmacOSArchiveAarch64DMGFilename,
index f24478c..e20aca9 100644 (file)
       <variable name="UNIX_APPLICATION_FOLDER" value="jalview" />
       <variable name="EXECUTABLE_NAME" value="jalviewg" />
       <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" />
-      <variable name="PNG_ICON_FILE" value="utils/channels/release/images/jalview_logo.png" />
+      <variable name="ICONS_DIR" value="utils/channels/release/images" />
+      <variable name="MAC_ICONS_FILE" value="jalview_logo.icns" />
+      <variable name="WINDOWS_ICONS_FILE" value="jalview_logo.ico" />
+      <variable name="PNG_ICON_FILE" value="jalview_logo.png" />
       <variable name="BACKGROUND" value="utils/channels/release/images/jalview_logo_background_fade-640x480.png" />
       <variable name="BATCH_WRAPPER_SCRIPT" value="jalview.bat" />
       <variable name="POWERSHELL_WRAPPER_SCRIPT" value="jalview.ps1" />
     </components>
   </files>
   <launchers>
-    <launcher name="Jalview User Launcher" id="2823" customizedId="JALVIEW" menuName="${compiler:JALVIEW_APPLICATION_NAME}" icnsFile="${compiler:JALVIEW_DIR}/${compiler:MAC_ICONS_FILE}" customMacBundleIdentifier="true" macBundleIdentifier="${compiler:BUNDLE_ID}" fileset="734" addMacApplicationCategory="true" macApplicationCategory="public.app-category.education" useCustomMacosExecutableName="true" customMacosExecutableName="${compiler:JALVIEW_APPLICATION_NAME}">
-      <executable name="${compiler:EXECUTABLE_NAME}" iconSet="true" iconFile="${compiler:JALVIEW_DIR}/${compiler:WINDOWS_ICONS_FILE}" stderrFile="~/.${compiler:UNIX_APPLICATION_FOLDER}-launcher.log" redirectStdout="true" stdoutFile="~/.${compiler:UNIX_APPLICATION_FOLDER}-launcher.log" executableMode="gui" changeWorkingDirectory="false" singleInstance="true" executionLevel="highestAvailable" checkConsoleParameter="true">
+    <launcher name="Jalview User Launcher" id="2823" customizedId="JALVIEW" menuName="${compiler:JALVIEW_APPLICATION_NAME}" icnsFile="${compiler:JALVIEW_DIR}/${compiler:ICONS_DIR}/${compiler:MAC_ICONS_FILE}" customMacBundleIdentifier="true" macBundleIdentifier="${compiler:BUNDLE_ID}" fileset="734" addMacApplicationCategory="true" macApplicationCategory="public.app-category.education" useCustomMacosExecutableName="true" customMacosExecutableName="${compiler:JALVIEW_APPLICATION_NAME}">
+      <executable name="${compiler:EXECUTABLE_NAME}" iconSet="true" iconFile="${compiler:JALVIEW_DIR}/${compiler:ICONS_DIR}/${compiler:WINDOWS_ICONS_FILE}" stderrFile="~/.${compiler:UNIX_APPLICATION_FOLDER}-launcher.log" redirectStdout="true" stdoutFile="~/.${compiler:UNIX_APPLICATION_FOLDER}-launcher.log" executableMode="gui" changeWorkingDirectory="false" singleInstance="true" executionLevel="highestAvailable" 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">
           <versionLine x="85" y="109" text="version ${compiler:sys.version}" />
         </text>
       </splashScreen>
-      <java mainClass="com.threerings.getdown.launcher.GetdownApp" vmParameters="-Duserdefaultappdir=true -Dpopulatedefaultappdir=true -Dappid=jalview -Dinstaller.template_version=${compiler:INSTALLER_TEMPLATE_VERSION} -Dinstaller.appdir=&quot;${launcher:sys.launcherDirectory}&quot; -Dinstaller.application_folder=&quot;${compiler:APPLICATION_FOLDER}&quot; -Dchannel.app_name=&quot;${compiler:JALVIEW_APPLICATION_NAME}&quot;" arguments="&quot;&quot; &quot;&quot;">
+      <java mainClass="com.threerings.getdown.launcher.GetdownApp" vmParameters="-Duserdefaultappdir=true -Dpopulatedefaultappdir=true -Dappid=jalview -Dinstaller.template_version=${compiler:INSTALLER_TEMPLATE_VERSION} -Dinstaller.appdir=&quot;${launcher:sys.launcherDirectory}&quot; -Dinstaller.application_folder=&quot;${compiler:APPLICATION_FOLDER}&quot; -Dchannel.app_name=&quot;${compiler:JALVIEW_APPLICATION_NAME}&quot; -Dinstaller.icon=&quot;${compiler:PNG_ICON_FILE}&quot; -Dinstaller.mac_icons=&quot;${compiler:MAC_ICONS_FILE}&quot;" arguments="&quot;&quot; &quot;&quot;">
         <classPath>
           <archive location="getdown-launcher.jar" failOnError="false" />
           <archive location="${compiler:GETDOWN_INSTALL_DIR}/getdown-launcher.jar" failOnError="false" />
       </vmOptionsFile>
       <infoPlist>${compiler:file("${compiler:INFO_PLIST_FILE_ASSOCIATIONS_FILE}")}</infoPlist>
       <iconImageFiles>
-        <file path="${compiler:JALVIEW_DIR}/${compiler:PNG_ICON_FILE}" />
+        <file path="${compiler:JALVIEW_DIR}/${compiler:ICONS_DIR}/${compiler:PNG_ICON_FILE}" />
       </iconImageFiles>
       <macStaticAssociations>
         <urlHandler scheme="jalview" />
@@ -746,13 +747,13 @@ return console.askOkCancel(message, true);
                   </property>
                   <property name="icon">
                     <object class="com.install4j.api.beans.ExternalFile">
-                      <string>${compiler:JALVIEW_DIR}/${compiler:WINDOWS_ICONS_FILE}</string>
+                      <string>${compiler:JALVIEW_DIR}/${compiler:ICONS_DIR}/${compiler:WINDOWS_ICONS_FILE}</string>
                     </object>
                   </property>
                   <property name="programGroupName" type="string">${compiler:JALVIEW_NAME}</property>
                   <property name="unixIconFile">
                     <object class="com.install4j.api.beans.ExternalFile">
-                      <string>${compiler:JALVIEW_DIR}/${compiler:PNG_ICON_FILE}</string>
+                      <string>${compiler:JALVIEW_DIR}/${compiler:ICONS_DIR}/${compiler:PNG_ICON_FILE}</string>
                     </object>
                   </property>
                 </serializedBean>
@@ -772,12 +773,12 @@ return console.askOkCancel(message, true);
                   <property name="name" type="string">${compiler:JALVIEW_APPLICATION_NAME}</property>
                   <property name="unixIconFile">
                     <object class="com.install4j.api.beans.ExternalFile">
-                      <string>${compiler:JALVIEW_DIR}/${compiler:PNG_ICON_FILE}</string>
+                      <string>${compiler:JALVIEW_DIR}/${compiler:ICONS_DIR}/${compiler:PNG_ICON_FILE}</string>
                     </object>
                   </property>
                   <property name="winIconFile">
                     <object class="com.install4j.api.beans.ExternalFile">
-                      <string>${compiler:JALVIEW_DIR}/${compiler:WINDOWS_ICONS_FILE}</string>
+                      <string>${compiler:JALVIEW_DIR}/${compiler:ICONS_DIR}/${compiler:WINDOWS_ICONS_FILE}</string>
                     </object>
                   </property>
                 </serializedBean>