JAL-3577 Changed Windows internal ID to a new value which is backward compatible...
[jalview.git] / build.gradle
index 69a7fb6..6129170 100644 (file)
@@ -259,18 +259,23 @@ ext {
   // install4j application and folder names
   if (install4jSuffix == "") {
     install4jApplicationName = "${jalview_name}"
+    install4jBundleId = "${install4j_bundle_id}"
   } else {
     install4jApplicationName = "${jalview_name} ${install4jSuffix}"
+    install4jBundleId = "${install4j_bundle_id}-" + install4jSuffix.toLowerCase()
   }
-  // sanitise folder names
+  // sanitise folder and id names
+  // install4jApplicationFolder = e.g. "Jalview Build"
   install4jApplicationFolder = install4jApplicationName
-                                    .replaceAll("[\"'~:\\\\]+", "_") // replace all awkward filename chars
-  install4jUnixApplicationFolder = install4jApplicationFolder
-                                    .toLowerCase()
+                                    .replaceAll("[\"'~:/\\\\]", "_") // replace all awkward filename chars " ' ~ : / \
+                                    .replaceAll("_+", "_") // collapse __
+  install4jInternalId = install4jApplicationFolder
                                     .replaceAll(" ","_")
-                                    .replaceAll("[^\\w\\-\\.]+", "_") // replace other non [alphanumeric,_,-,.]
-                                    .replaceAll("_+", "_")
-                                    .replaceAll("_*-_*", "-")
+                                    .replaceAll("[^\\w\\-\\.]", "_") // replace other non [alphanumeric,_,-,.]
+                                    .replaceAll("_+", "_") // collapse __
+                                    .replaceAll("_*-_*", "-") // collapse _-_
+  install4jUnixApplicationFolder = install4jInternalId
+                                    .toLowerCase()
 
   getdownAppDir = string("${getdownWebsiteDir}/${getdownAppDistDir}")
   //getdownJ11libDir = "${getdownWebsiteDir}/${getdown_j11lib_dir}"
@@ -1407,7 +1412,8 @@ task installers(type: com.install4j.gradle.Install4jTask) {
   def install4jBuildDir = "${install4j_build_dir}/${JAVA_VERSION}"
 
   variables = [
-    'JALVIEW_NAME': install4jApplicationName,
+    'JALVIEW_NAME': jalview_name,
+    'JALVIEW_APPLICATION_NAME': install4jApplicationName,
     'JALVIEW_DIR': "../..",
     'OSX_KEYSTORE': OSX_KEYSTORE,
     'JSIGN_SH': JSIGN_SH,
@@ -1426,7 +1432,8 @@ task installers(type: com.install4j.gradle.Install4jTask) {
     'WINDOWS_JAVA_VM_TGZ': windowsJavaVMTgz,
     'LINUX_JAVA_VM_TGZ': linuxJavaVMTgz,
     'COPYRIGHT_MESSAGE': install4j_copyright_message,
-    'MACOS_BUNDLE_ID': install4j_macOS_bundle_id,
+    'BUNDLE_ID': install4jBundleId,
+    'INTERNAL_ID': install4jInternalId,
     'MACOS_DS_STORE': install4jDSStore,
     'MACOS_DMG_BG_IMAGE': install4jDMGBackgroundImage,
     'INSTALLER_NAME': install4jInstallerName,
@@ -1446,6 +1453,9 @@ task installers(type: com.install4j.gradle.Install4jTask) {
     'EXTRA_SCHEME': install4jExtraScheme,
   ]
 
+  println("INSTALL4J VARIABLES:")
+  variables.each{k,v->println("${k}=${v}")}
+
   destination = "${jalviewDir}/${install4jBuildDir}"
   buildSelected = true