From: Ben Soares Date: Thu, 27 Jun 2024 21:15:41 +0000 (+0100) Subject: JAL-3631 Installers with separate actions for user/administrator installation X-Git-Tag: Release_2_11_4_0~24^2~12 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=e9899166c9af58f552caf24a06e54ab4c106e2f9;p=jalview.git JAL-3631 Installers with separate actions for user/administrator installation --- diff --git a/utils/install4j/install4j10_template.install4j b/utils/install4j/install4j10_template.install4j index 59d5079..8600f75 100644 --- a/utils/install4j/install4j10_template.install4j +++ b/utils/install4j/install4j10_template.install4j @@ -327,7 +327,7 @@ - + @@ -339,14 +339,40 @@ tryPaths.add(userHome + File.separator + "local" + File.separator + "bin"); tryPaths.add(userHome + File.separator + ".local" + File.separator + "bin"); tryPaths.add(userHome + File.separator + "opt" + File.separator + "bin"); -if (Util.isMacOS()) { // && root permission? - tryPaths.add(File.separator + "usr" + File.separator + "local" + File.separator + "bin"); +for (int i = 0; i < tryPaths.size(); i++) { + String tryPath = tryPaths.get(i); + File unixBinDir = new File(tryPath); + if (unixBinDir.exists()) { + return tryPath; + } } +return null; + + + + unixBinDir + + !Util.hasFullAdminRights() +&& +( + Util.isLinux() + || Util.isUnixInstaller() + || Util.isMacOS() +) + + + + + + ArrayList<String> tryPaths = new ArrayList<> (); +tryPaths.add(File.separator + "opt" + File.separator + "bin"); +tryPaths.add(File.separator + "usr" + File.separator + "local" + File.separator + "bin"); + for (int i = 0; i < tryPaths.size(); i++) { String tryPath = tryPaths.get(i); - File unixUserBinDir = new File(tryPath); - if (unixUserBinDir.exists()) { + File unixBinDir = new File(tryPath); + if (unixBinDir.exists()) { return tryPath; } } @@ -355,9 +381,9 @@ return null; - unixUserBinDir + unixBinDir - !Util.hasFullAdminRights() + Util.hasFullAdminRights() && ( Util.isLinux() @@ -704,7 +730,7 @@ return console.askOkCancel(message, true); - + @@ -713,14 +739,14 @@ return console.askOkCancel(message, true); - ${compiler:JRE_DIR}/bin/${compiler:JALVIEW_APPLICATION_NAME} + ${compiler:JRE_DIR}/bin/${compiler:JALVIEW_NAME} - Util.isLinux() + Util.isLinux() || Util.isMacOS() - + @@ -729,12 +755,13 @@ return console.askOkCancel(message, true); - ${compiler:JRE_DIR}/bin/${compiler:JALVIEW_NAME} + ${compiler:JRE_DIR}/bin/${compiler:JALVIEW_APPLICATION_NAME} - Util.isLinux() + (Util.isLinux() || Util.isMacOS()) +&& !((String)context.getCompilerVariable("JALVIEW_APPLICATION_NAME")).equals((String)context.getCompilerVariable("JALVIEW_NAME")) @@ -809,69 +836,45 @@ context.getBooleanVariable("addToDockAction") && context.getBooleanVariable("appendToPathAction") - + - ${compiler:WRAPPER_SCRIPT_BIN_DIR}/${compiler:BASH_WRAPPER_SCRIPT} - - - - - ${compiler:WRAPPER_SCRIPT_BIN_DIR}/${compiler:WRAPPER_LINK} - - - - ( - Util.isLinux() - || Util.isUnixInstaller() - || Util.isMacOS() -) - - - - - - ${installer:sys.contentDir}/${compiler:WRAPPER_SCRIPT_BIN_DIR}/${compiler:BASH_WRAPPER_SCRIPT} + ${installer:macWrapperLinkLocation} - ${installer:unixUserBinDir}/${compiler:WRAPPER_LINK} + ${installer:unixBinDir}/${compiler:WRAPPER_LINK} !Util.hasFullAdminRights() && ( - context.getBooleanVariable("makeUserSymbolicLinkAction") - && ( - Util.isLinux() - || Util.isUnixInstaller() - ) - && context.getVariable("unixUserBinDir") != null + Util.isMacOS() + && context.getBooleanVariable("makeUserSymbolicLinkAction") + && context.getVariable("unixBinDir") != null + && context.getVariable("macWrapperLinkLocation") != null ) - + - ${installer:macWrapperLinkLocation} + ${compiler:WRAPPER_SCRIPT_BIN_DIR}/${compiler:BASH_WRAPPER_SCRIPT} - ${installer:unixUserBinDir}/${compiler:WRAPPER_LINK} + ${compiler:WRAPPER_SCRIPT_BIN_DIR}/${compiler:WRAPPER_LINK} - !Util.hasFullAdminRights() -&& -( - Util.isMacOS() - && context.getBooleanVariable("makeUserSymbolicLinkAction") - && context.getVariable("unixUserBinDir") != null - && context.getVariable("macWrapperLinkLocation") != null + ( + Util.isLinux() + || Util.isUnixInstaller() + || Util.isMacOS() ) @@ -908,6 +911,102 @@ context.getBooleanVariable("appendToPathAction") Util.isWindows() && !(((String)context.getCompilerVariable("WRAPPER_LINK")+".ps1").equals((String)context.getCompilerVariable("POWERSHELL_WRAPPER_SCRIPT"))) + + + ${compiler:APPLICATION_CATEGORIES} + ${compiler:JALVIEW_APPLICATION_NAME} + + + ${installer:sys.contentDir}/${compiler:EXECUTABLE_NAME} + + + + + ${compiler:JALVIEW_DIR}/${compiler:ICONS_DIR}/${compiler:WINDOWS_ICONS_FILE} + + + ${compiler:JALVIEW_NAME} + + + + ${compiler:JALVIEW_DIR}/${compiler:ICONS_DIR}/${compiler:PNG_ICON_FILE} + + + + Util.hasFullAdminRights() +&& +!context.getBooleanVariable("sys.programGroupDisabled") + + + + ${compiler:JALVIEW_APPLICATION_NAME} + + + ${installer:sys.contentDir}/${compiler:EXECUTABLE_NAME} + + + ${compiler:JALVIEW_APPLICATION_NAME} + + + + ${compiler:JALVIEW_DIR}/${compiler:ICONS_DIR}/${compiler:PNG_ICON_FILE} + + + + + ${compiler:JALVIEW_DIR}/${compiler:ICONS_DIR}/${compiler:WINDOWS_ICONS_FILE} + + + + Util.hasFullAdminRights() +&& +context.getBooleanVariable("createDesktopLinkAction") + + + + + + ${installer:sys.contentDir}\${compiler:WRAPPER_SCRIPT_BIN_DIR} + Path + + Util.hasFullAdminRights() +&& +context.getBooleanVariable("appendToPathAction") + + + + + + /etc/paths.d/${compiler:APPLICATION_FOLDER} + + + /Applications/${compiler:JALVIEW_APPLICATION_NAME}.app/Contents/MacOS + + Util.hasFullAdminRights() +&& Util.isMacOS() + + + + + + ${installer:sys.contentDir}/${compiler:WRAPPER_SCRIPT_BIN_DIR}/${compiler:BASH_WRAPPER_SCRIPT} + + + + + ${installer:unixBinDir}/${compiler:WRAPPER_LINK} + + + + ( + context.getBooleanVariable("makeUserSymbolicLinkAction") + && ( + Util.isLinux() + || Util.isUnixInstaller() + ) + && context.getVariable("unixBinDir") != null +) + @@ -915,12 +1014,14 @@ context.getBooleanVariable("appendToPathAction") ${form:finishedMessage} - + ${i18n:CreateDesktopIcon} createDesktopLinkAction - !Util.isMacOS() + !Util.isMacOS() +&& !Util.hasFullAdminRights() + @@ -928,7 +1029,9 @@ context.getBooleanVariable("appendToPathAction") addToDockAction - Util.isMacOS() + Util.isMacOS() +&& !Util.hasFullAdminRights() + @@ -938,15 +1041,13 @@ context.getBooleanVariable("appendToPathAction") Util.isWindows() - + - Make a ${compiler:WRAPPER_LINK} symbolic link in ${installer:unixUserBinDir} + Make a ${compiler:WRAPPER_LINK} symbolic link in ${installer:unixBinDir} makeUserSymbolicLinkAction - !Util.hasFullAdminRights() -&& -( + ( Util.isLinux() || Util.isUnixInstaller() || ( @@ -954,7 +1055,7 @@ context.getBooleanVariable("appendToPathAction") && context.getVariable("macWrapperLinkLocation") != null ) ) - && context.getVariable("unixUserBinDir") != null + && context.getVariable("unixBinDir") != null @@ -1341,7 +1442,7 @@ return console.askYesNo(message, true); - Make a ${compiler:WRAPPER_LINK} symbolic link in ${installer:unixUserBinDir} + Make a ${compiler:WRAPPER_LINK} symbolic link in ${installer:unixBinDir} makeUserSymbolicLinkAction @@ -1353,7 +1454,7 @@ return console.askYesNo(message, true); && context.getVariable("macWrapperLinkLocation") != null ) ) - && context.getVariable("unixUserBinDir") != null + && context.getVariable("unixBinDir") != null