JAL-4485 Fix the template path for Windows Chimera/X executable. Added more debugging...
authorBen Soares <b.soares@dundee.ac.uk>
Wed, 6 Nov 2024 00:52:50 +0000 (00:52 +0000)
committerBen Soares <b.soares@dundee.ac.uk>
Wed, 6 Nov 2024 00:52:50 +0000 (00:52 +0000)
src/ext/edu/ucsf/rbvi/strucviz2/StructureManager.java

index 64b2573..974b493 100644 (file)
@@ -49,6 +49,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import jalview.bin.Cache;
+import jalview.bin.Console;
 import jalview.gui.Preferences;
 import jalview.util.FileUtils;
 import jalview.util.Platform;
@@ -1027,21 +1028,27 @@ public class StructureManager
     else if (Platform.isWin())
     {
       Set<File> installedChimera = new HashSet<>();
-      String[] templates = new String[] { "%s\\%s %s\\bin\\%s" };
+      String[] templates = new String[] { "%s\\%s %s\\bin\\%s.exe" };
       String[] roots = new String[] { "\\Program Files",
           "C:\\Program Files", "\\Program Files (x86)",
           "C:\\Program Files (x86)", String.format("%s\\AppData\\Local",
                   System.getProperty("user.home")) };
+      Console.debug("Starting search for " + chimera);
       for (String root : roots)
       {
+        Console.debug("Looking under '" + root + "'");
         for (String template : templates)
         {
+          Console.debug("Using template '" + template + "'");
           String globMatch = String.format(template, root, chimera, "*",
                   chimeraExe);
+          Console.debug("Looking for installed versions of " + chimera
+                  + " using '" + globMatch + "'");
           List<File> foundInstalls = FileUtils.getFilesFromGlob(globMatch,
                   false);
           for (File found : foundInstalls)
           {
+            Console.debug("Checking " + found.getPath() + " is okay");
             boolean add = true;
             for (String notVersion : versionsBlacklist)
             {
@@ -1054,8 +1061,14 @@ public class StructureManager
             }
             if (add)
             {
+              Console.debug("Adding " + found.getPath());
               installedChimera.add(found);
             }
+            else
+            {
+              Console.debug(
+                      "Not adding " + found.getPath() + ", not valid");
+            }
           }
         }
         // try without a version number too