JAL-3631 Report getCanonicalPath for installer appdir
authorBen Soares <b.soares@dundee.ac.uk>
Mon, 24 Jun 2024 23:23:37 +0000 (00:23 +0100)
committerBen Soares <b.soares@dundee.ac.uk>
Mon, 24 Jun 2024 23:23:37 +0000 (00:23 +0100)
src/jalview/bin/Cache.java

index 28d5179..9d76cd2 100755 (executable)
@@ -1276,10 +1276,28 @@ public class Cache
             System.getProperty("sys.install4jVersion"), "\n", null);
     if (extra)
     {
+      String installerAppdir = System.getProperty("installer.appdir");
+      if (installerAppdir != null)
+      {
+        try
+        {
+          String temp = new File(installerAppdir).getCanonicalPath();
+          installerAppdir = temp;
+        } catch (IOException e)
+        {
+          installerAppdir = "(non-canonical) " + installerAppdir;
+          Console.warn(
+                  "Could not get canonical path for installer appdir, leaving as is.");
+        }
+      }
+      else
+      {
+        installerAppdir = "null: " + installerAppdir;
+      }
       appendIfNotNull(sb, "Installer template version: ",
               System.getProperty("installer.template_version"), "\n", null);
-      appendIfNotNull(sb, "Installer appdir: ",
-              System.getProperty("installer.appdir"), "\n", null);
+      appendIfNotNull(sb, "Installer appdir: ", installerAppdir, "\n",
+              null);
       appendIfNotNull(sb, "Installer extrainfo: ",
               System.getProperty("installer.extrainfo"), "\n", null);
     }