JAL-2994 restrict search to \Program Files\Chimera*
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Mon, 28 May 2018 14:22:54 +0000 (15:22 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Mon, 28 May 2018 14:22:54 +0000 (15:22 +0100)
src/ext/edu/ucsf/rbvi/strucviz2/StructureManager.java

index a52adc5..c278db5 100644 (file)
@@ -946,10 +946,15 @@ public class StructureManager
       {
         /*
          * match a path ending in \bin\chimera or \bin\chimera.exe
-         * back-slash is double escaped - for Java String, and regex pattern
+         * back-slashes are double escaped - for Java String, and for regex
          */
-        pathList.addAll(FileUtils.findMatchingPaths(
-                ".*\\\\bin\\\\chimera(\\\\.exe)?$", Paths.get(root)));
+        for (String version : FileUtils
+                .findMatchingPaths(".*\\\\Chimera.*$", Paths.get(root)))
+        {
+          pathList.addAll(FileUtils.findMatchingPaths(
+                  ".*\\\\bin\\\\chimera(\\\\.exe)?$",
+                  Paths.get(version)));
+        }
       }
     }
     else if (os.startsWith("Mac"))