From 5ef2e9ac9664438c3ffd47762e83a296b2b3b01c Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Wed, 6 Nov 2024 00:52:50 +0000 Subject: [PATCH] JAL-4485 Fix the template path for Windows Chimera/X executable. Added more debugging for path finding. --- src/ext/edu/ucsf/rbvi/strucviz2/StructureManager.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/ext/edu/ucsf/rbvi/strucviz2/StructureManager.java b/src/ext/edu/ucsf/rbvi/strucviz2/StructureManager.java index 64b2573..974b493 100644 --- a/src/ext/edu/ucsf/rbvi/strucviz2/StructureManager.java +++ b/src/ext/edu/ucsf/rbvi/strucviz2/StructureManager.java @@ -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 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 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 -- 1.7.10.2