From 1a5f7cbd4317ce285a94f064c23ce982fccd2a85 Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Thu, 13 Jun 2024 21:20:54 +0100 Subject: [PATCH] JAL-3845 Add a popup error message, with instructions, when Jalview launched from the Installer Volume --- src/jalview/bin/Jalview.java | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/src/jalview/bin/Jalview.java b/src/jalview/bin/Jalview.java index 92ac5fc..148f9c0 100755 --- a/src/jalview/bin/Jalview.java +++ b/src/jalview/bin/Jalview.java @@ -706,6 +706,8 @@ public class Jalview implements JalviewObjectI */ { + String appName = ChannelProperties.getProperty("app_name"); + /** * Check to see that the JVM version being run is suitable for the Java * version this Jalview was compiled for. Popup a warning if not. @@ -714,7 +716,8 @@ public class Jalview implements JalviewObjectI { Console.warn("The Java version being used (Java " + LaunchUtils.getJavaVersion() - + ") may lead to problems. This installation of Jalview should be used with Java " + + ") may lead to problems. This installation of " + + appName + " should be used with Java " + LaunchUtils.getJavaCompileVersion() + "."); if (!LaunchUtils @@ -734,6 +737,29 @@ public class Jalview implements JalviewObjectI } } + /** + * Check to see if we've been launched from the installer volume + * (macOS). + */ + String installerappdirString = System + .getProperty("installer.appdir"); + if (Platform.isMac() && installerappdirString != null + && installerappdirString.startsWith("/Volumes/")) + { + Console.warn("You appear to be running " + appName + + " from the Installer volume. Please drag and drop the " + + appName + " icon into the Applications folder."); + + Object[] options = { MessageManager.getString("action.quit") }; + JOptionPane.showOptionDialog(null, MessageManager.formatMessage( + "warning.running_from_installer_volume_message", appName), + MessageManager.getString( + "warning.running_from_installer_volume_title"), + JOptionPane.DEFAULT_OPTION, JOptionPane.WARNING_MESSAGE, + null, options, options[0]); + quit(); + } + boolean webservicediscovery = bootstrapArgs .getBoolean(Arg.WEBSERVICEDISCOVERY); if (aparser.contains("nowebservicediscovery")) -- 1.7.10.2