+ // sanitise file name for jalview launcher file for this channel
+ jvlChannelName = jvlChannelName.replaceAll("[^\\w\\-]+", "_")
+ // install4j application and folder names
+ 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("[\"'~:/\\\\\\s]", "_") // replace all awkward filename chars " ' ~ : / \
+ .replaceAll("_+", "_") // collapse __
+ install4jInternalId = install4jApplicationName
+ .replaceAll(" ","_")
+ .replaceAll("[^\\w\\-\\.]", "_") // replace other non [alphanumeric,_,-,.]
+ .replaceAll("_+", "") // collapse __
+ //.replaceAll("_*-_*", "-") // collapse _-_
+ install4jUnixApplicationFolder = install4jApplicationName
+ .replaceAll(" ","_")
+ .replaceAll("[^\\w\\-\\.]", "_") // replace other non [alphanumeric,_,-,.]
+ .replaceAll("_+", "_") // collapse __
+ .replaceAll("_*-_*", "-") // collapse _-_
+ .toLowerCase()