From: Ben Soares Date: Mon, 6 Apr 2020 21:34:06 +0000 (+0100) Subject: JAL-3577 Fixed Jalview Programme Group in Windows menu. Added examples folder for... X-Git-Tag: Develop-2_11_2_0-d20201215~43^2~1 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=332905c3ae5771f1221dd9604c4316a7c3aa01da;p=jalview.git JAL-3577 Fixed Jalview Programme Group in Windows menu. Added examples folder for RELEASE channel only and Examples folder in Jalview Programme Group in Windows. --- diff --git a/build.gradle b/build.gradle index 3080ed8..dba3fd3 100644 --- a/build.gradle +++ b/build.gradle @@ -1347,6 +1347,7 @@ task copyInstall4jTemplate { def install4jFileAssociationsFile = file("${install4jDir}/${install4j_installer_file_associations}") inputs.file(install4jTemplateFile) inputs.file(install4jFileAssociationsFile) + inputs.property("CHANNEL", { CHANNEL }) outputs.file(install4jConfFile) doLast { @@ -1373,7 +1374,7 @@ task copyInstall4jTemplate { // put file association actions where placeholder action is def install4jFileAssociationsText = install4jFileAssociationsFile.text def fileAssociationActions = new XmlParser().parseText("${install4jFileAssociationsText}") - install4jConfigXml.'**'.action.any { a -> + install4jConfigXml.'**'.action.any { a -> // .any{} stops after the first one that returns true if (a.'@name' == 'EXTENSIONS_REPLACED_BY_GRADLE') { def parent = a.parent() parent.remove(a) @@ -1385,6 +1386,35 @@ task copyInstall4jTemplate { } } + // use Windows Program Group with Examples folder for RELEASE, and Program Group without Examples for everything else + // NB we're deleting the /other/ one! + // Also remove the examples subdir from non-release versions + def customizedIdToDelete = "PROGRAM_GROUP_RELEASE" + if (CHANNEL=="RELEASE") { + customizedIdToDelete = "PROGRAM_GROUP_NON_RELEASE" + } else { + // remove the examples subdir from Full File Set + def files = install4jConfigXml.files[0] + def fileset = files.filesets.fileset.find { fs -> fs.'@customizedId' == "FULL_FILE_SET" } + def root = files.roots.root.find { r -> r.'@fileset' == fileset.'@id' } + def mountPoint = files.mountPoints.mountPoint.find { mp -> mp.'@root' == root.'@id' } + def dirEntry = files.entries.dirEntry.find { de -> de.'@mountPoint' == mountPoint.'@id' && de.'@subDirectory' == "examples" } + dirEntry.parent().remove(dirEntry) + } + install4jConfigXml.'**'.action.any { a -> + if (a.'@customizedId' == customizedIdToDelete) { + def parent = a.parent() + parent.remove(a) + return true + } + } + + // remove the "Uninstall Old Jalview (optional)" symlink from DMG for non-release DS_Stores + if (! (CHANNEL == "RELEASE" || CHANNEL == "TEST-RELEASE" ) ) { + def symlink = install4jConfigXml.'**'.topLevelFiles.symlink.find { sl -> sl.'@name' == "Uninstall Old Jalview (optional).app" } + symlink.parent().remove(symlink) + } + // write install4j file install4jConfFile.text = XmlUtil.serialize(install4jConfigXml) } diff --git a/utils/install4j/install4j8_template.install4j b/utils/install4j/install4j8_template.install4j index 2252a91..545b0b9 100644 --- a/utils/install4j/install4j8_template.install4j +++ b/utils/install4j/install4j8_template.install4j @@ -1,6 +1,6 @@ - + @@ -53,7 +53,7 @@ - + @@ -77,6 +77,7 @@ + @@ -116,7 +117,7 @@ - + @@ -387,7 +388,28 @@ return console.askOkCancel(message, true); - + + + + ${compiler:APPLICATION_CATEGORIES} + + + + Examples + + + examples + + + + + + ${compiler:JALVIEW_NAME} + ${i18n:UninstallerMenuEntry(${compiler:sys.fullName})} + + !context.getBooleanVariable("sys.programGroupDisabled") + + ${compiler:APPLICATION_CATEGORIES} @@ -1099,7 +1121,7 @@ return console.askYesNo(message, true); - +