JAL-3577 Added existing and new Application IDs for Windows. Fixed Desktop shortcut...
authorBen Soares <bsoares@dundee.ac.uk>
Mon, 6 Apr 2020 12:27:56 +0000 (13:27 +0100)
committerBen Soares <bsoares@dundee.ac.uk>
Mon, 6 Apr 2020 12:27:56 +0000 (13:27 +0100)
build.gradle
gradle.properties
utils/install4j/install4j8_template.install4j

index e9c9da4..227e59a 100644 (file)
@@ -260,20 +260,26 @@ ext {
   if (install4jSuffix == "") {
     install4jApplicationName = "${jalview_name}"
     install4jBundleId = "${install4j_bundle_id}"
+    install4jWinApplicationId = install4j_release_win_application_id
   } else {
     install4jApplicationName = "${jalview_name} ${install4jSuffix}"
     install4jBundleId = "${install4j_bundle_id}-" + install4jSuffix.toLowerCase()
+    // add int hash of install4jSuffix to the last part of the application_id
+    def id = install4j_release_win_application_id
+    def idsplitreverse = id.split("-").reverse()
+    idsplitreverse[0] = idsplitreverse[0].toInteger() + install4jSuffix.hashCode()
+    install4jWinApplicationId = idsplitreverse.reverse().join("-")
   }
   // sanitise folder and id names
   // install4jApplicationFolder = e.g. "Jalview Build"
   install4jApplicationFolder = install4jApplicationName
-                                    .replaceAll("[\"'~:/\\\\]", "_") // replace all awkward filename chars " ' ~ : / \
+                                    .replaceAll("[\"'~:/\\\\\\s]", "_") // replace all awkward filename chars " ' ~ : / \
                                     .replaceAll("_+", "_") // collapse __
-  install4jInternalId = install4jApplicationFolder
+  install4jInternalId = install4jApplicationName
                                     .replaceAll(" ","_")
                                     .replaceAll("[^\\w\\-\\.]", "_") // replace other non [alphanumeric,_,-,.]
-                                    .replaceAll("_+", "_") // collapse __
-                                    .replaceAll("_*-_*", "-") // collapse _-_
+                                    .replaceAll("_+", "") // collapse __
+                                    //.replaceAll("_*-_*", "-") // collapse _-_
   install4jUnixApplicationFolder = install4jInternalId
                                     .toLowerCase()
 
@@ -1434,6 +1440,7 @@ task installers(type: com.install4j.gradle.Install4jTask) {
     'COPYRIGHT_MESSAGE': install4j_copyright_message,
     'BUNDLE_ID': install4jBundleId,
     'INTERNAL_ID': install4jInternalId,
+    'WINDOWS_APPLICATION_ID': install4jWinApplicationId,
     'MACOS_DS_STORE': install4jDSStore,
     'MACOS_DMG_BG_IMAGE': install4jDMGBackgroundImage,
     'INSTALLER_NAME': install4jInstallerName,
@@ -1453,8 +1460,8 @@ task installers(type: com.install4j.gradle.Install4jTask) {
     'EXTRA_SCHEME': install4jExtraScheme,
   ]
 
-  //println("INSTALL4J VARIABLES:")
-  //variables.each{k,v->println("${k}=${v}")}
+  println("INSTALL4J VARIABLES:")
+  variables.each{k,v->println("${k}=${v}")}
 
   destination = "${jalviewDir}/${install4jBuildDir}"
   buildSelected = true
index 832026c..c31a59b 100644 (file)
@@ -123,6 +123,7 @@ install4j_build_dir = build/install4j
 install4j_media_types = windows,macosArchive,unixArchive,unixInstaller
 install4j_faster = false
 install4j_unix_desktop_additions = Categories=Science;Biology;Java;
+install4j_release_win_application_id = 6595-2347-1923-0725
 
 OSX_KEYSTORE =
 OSX_KEYPASS =
index 9d71fc4..9788523 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<install4j version="8.0.4" transformSequenceNumber="8">
+<install4j version="8.0.5" transformSequenceNumber="8">
   <directoryPresets config="." />
-  <application name="${compiler:JALVIEW_APPLICATION_NAME}" applicationId="6595-2347-1923-0725" mediaDir="${compiler:BUILD_DIR}" lzmaCompression="true" shortName="${compiler:INTERNAL_ID}" publisher="University of Dundee" publisherWeb="https://www.jalview.org/" version="${compiler:JALVIEW_VERSION}" allPathsRelative="true" macVolumeId="5aac4968c304f65" javaMinVersion="${compiler:JAVA_MIN_VERSION}" javaMaxVersion="9999999999${compiler:JAVA_MAX_VERSION}" allowBetaVM="true" jdkMode="jdk" jdkName="JDK 11.0">
+  <application name="${compiler:JALVIEW_APPLICATION_NAME}" applicationId="${compiler:WINDOWS_APPLICATION_ID}" mediaDir="${compiler:BUILD_DIR}" lzmaCompression="true" shortName="${compiler:INTERNAL_ID}" publisher="University of Dundee" publisherWeb="https://www.jalview.org/" version="${compiler:JALVIEW_VERSION}" allPathsRelative="true" macVolumeId="5aac4968c304f65" javaMinVersion="${compiler:JAVA_MIN_VERSION}" javaMaxVersion="9999999999${compiler:JAVA_MAX_VERSION}" allowBetaVM="true" jdkMode="jdk" jdkName="JDK 11.0">
     <searchSequence>
       <directory location="${compiler:JRE_DIR}" />
       <registry />
@@ -31,6 +31,7 @@
       <variable name="COPYRIGHT_MESSAGE" value="..." />
       <variable name="BUNDLE_ID" value="org.jalview.jalview-desktop" />
       <variable name="INTERNAL_ID" value="Jalview" />
+      <variable name="WINDOWS_APPLICATION_ID" value="6595-2347-1923-0725" />
       <variable name="MACOS_DS_STORE" value="DS_Store" />
       <variable name="MACOS_DMG_BG_IMAGE" />
       <variable name="INSTALLER_NAME" value="Jalview Installer" />
     </components>
   </files>
   <launchers>
-    <launcher name="Offline Jalview Launcher" id="737" menuName="${compiler:JALVIEW_APPLICATION_NAME}" icnsFile="${compiler:JALVIEW_DIR}/resources/images/jalview_logos.icns" customMacBundleIdentifier="true" macBundleIdentifier="${compiler:BUNDLE_ID}" fileset="734" useCustomMacosExecutableName="true" customMacosExecutableName="${compiler:JALVIEW_APPLICATION_NAME}">
+    <launcher name="Offline Jalview Launcher" id="737" excludeFromMenu="true" menuName="${compiler:JALVIEW_APPLICATION_NAME}" icnsFile="${compiler:JALVIEW_DIR}/resources/images/jalview_logos.icns" customMacBundleIdentifier="true" macBundleIdentifier="${compiler:BUNDLE_ID}" fileset="734" useCustomMacosExecutableName="true" customMacosExecutableName="${compiler:JALVIEW_APPLICATION_NAME}">
       <executable name="${compiler:EXECUTABLE_NAME}" iconSet="true" iconFile="${compiler:JALVIEW_DIR}/resources/images/jalview_logos.ico" 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>
@@ -389,6 +390,8 @@ return console.askOkCancel(message, true);
               <action id="17" beanClass="com.install4j.runtime.beans.actions.InstallFilesAction" actionElevationType="elevated" rollbackBarrierExitCode="0" failureStrategy="quit" errorMessage="${i18n:FileCorrupted}" />
               <action id="18" beanClass="com.install4j.runtime.beans.actions.desktop.CreateProgramGroupAction" actionElevationType="elevated" rollbackBarrierExitCode="0">
                 <serializedBean>
+                  <property name="allUsers" type="boolean" value="false" />
+                  <property name="programGroupName" type="string">${compiler:JALVIEW_NAME}</property>
                   <property name="uninstallerMenuName" type="string">${i18n:UninstallerMenuEntry(${compiler:sys.fullName})}</property>
                 </serializedBean>
                 <condition>!context.getBooleanVariable("sys.programGroupDisabled")</condition>
@@ -481,10 +484,10 @@ return console.askOkCancel(message, true);
               <action id="2012" beanClass="com.install4j.runtime.beans.actions.desktop.CreateStartMenuEntryAction" actionElevationType="elevated" rollbackBarrierExitCode="0">
                 <serializedBean>
                   <property name="allUsers" type="boolean" value="false" />
-                  <property name="entryName" type="string">${compiler:sys.shortName}</property>
+                  <property name="entryName" type="string">${compiler:JALVIEW_APPLICATION_NAME}</property>
                   <property name="file">
                     <object class="java.io.File">
-                      <string>${compiler:sys.shortName}</string>
+                      <string>${installer:sys.contentDir}/${compiler:EXECUTABLE_NAME}</string>
                     </object>
                   </property>
                   <property name="icon">
@@ -492,6 +495,7 @@ return console.askOkCancel(message, true);
                       <string>${compiler:JALVIEW_DIR}/resources/images/jalview_logos.ico</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}/resources/images/JalviewLogo_Huge.png</string>
@@ -503,13 +507,13 @@ return console.askOkCancel(message, true);
               <action id="573" beanClass="com.install4j.runtime.beans.actions.desktop.CreateDesktopLinkAction" actionElevationType="elevated" rollbackBarrierExitCode="0" errorMessage="Could not make desktop link">
                 <serializedBean>
                   <property name="allUsers" type="boolean" value="false" />
-                  <property name="description" type="string">${compiler:sys.shortName}</property>
+                  <property name="description" type="string">${compiler:JALVIEW_APPLICATION_NAME}</property>
                   <property name="file">
                     <object class="java.io.File">
-                      <string>${compiler:sys.shortName}</string>
+                      <string>${installer:sys.contentDir}/${compiler:EXECUTABLE_NAME}</string>
                     </object>
                   </property>
-                  <property name="name" type="string">${compiler:sys.fullName}</property>
+                  <property name="name" type="string">${compiler:JALVIEW_APPLICATION_NAME}</property>
                   <property name="unixIconFile">
                     <object class="com.install4j.api.beans.ExternalFile">
                       <string>${compiler:JALVIEW_DIR}/resources/images/JalviewLogo_Huge.png</string>
@@ -527,7 +531,7 @@ return console.askOkCancel(message, true);
                 <serializedBean>
                   <property name="executable">
                     <object class="java.io.File">
-                      <string>${compiler:APPLICATION_FOLDER}.app</string>
+                      <string>${compiler:JALVIEW_APPLICATION_NAME}.app</string>
                     </object>
                   </property>
                 </serializedBean>
@@ -1109,9 +1113,9 @@ return console.askYesNo(message, true);
         <symlink name="&quot; &quot;" target="/Applications" />
         <file name=".background/${compiler:MACOS_DMG_BG_IMAGE}" file="${compiler:JALVIEW_DIR}/${compiler:INSTALL4J_UTILS_DIR}/${compiler:MACOS_DMG_BG_IMAGE}" />
         <file name=".DS_Store" file="${compiler:JALVIEW_DIR}/${compiler:INSTALL4J_UTILS_DIR}/${compiler:MACOS_DS_STORE}" />
-        <file name="${compiler:APPLICATION_FOLDER}.app/Contents/Resources/Jalview-File.icns" file="${compiler:JALVIEW_DIR}/${compiler:INSTALL4J_UTILS_DIR}/Jalview-File.icns" />
-        <file name="${compiler:APPLICATION_FOLDER}.app/Contents/Resources/Jalview-Launch.icns" file="${compiler:JALVIEW_DIR}/${compiler:INSTALL4J_UTILS_DIR}/Jalview-Launch.icns" />
-        <symlink name="Uninstall Old Jalview (optional).app" target="${compiler:APPLICATION_FOLDER}.app/Contents/Resources/app/Uninstall Old Jalview.app" />
+        <file name="${compiler:JALVIEW_APPLICATION_NAME}.app/Contents/Resources/Jalview-File.icns" file="${compiler:JALVIEW_DIR}/${compiler:INSTALL4J_UTILS_DIR}/Jalview-File.icns" />
+        <file name="${compiler:JALVIEW_APPLICATION_NAME}.app/Contents/Resources/Jalview-Launch.icns" file="${compiler:JALVIEW_DIR}/${compiler:INSTALL4J_UTILS_DIR}/Jalview-Launch.icns" />
+        <symlink name="Uninstall Old Jalview (optional).app" target="${compiler:JALVIEW_APPLICATION_NAME}.app/Contents/Resources/app/Uninstall Old Jalview.app" />
       </topLevelFiles>
     </macosArchive>
     <unixInstaller name="Linux x64 Shell Installer" id="1595" mediaFileName="${compiler:UNIX_APPLICATION_FOLDER}-${compiler:JALVIEW_VERSION}-linux_x64-java_${compiler:JAVA_INTEGER_VERSION}" installDir="${compiler:UNIX_APPLICATION_FOLDER}" customInstallBaseDir="~/opt/">