Merge branch 'Jalview-JS/develop' into merge_js_develop
[jalview.git] / src / ext / edu / ucsf / rbvi / strucviz2 / StructureManager.java
index 4378457..c1d04c4 100644 (file)
@@ -34,6 +34,7 @@ package ext.edu.ucsf.rbvi.strucviz2;
 
 import jalview.bin.Cache;
 import jalview.gui.Preferences;
+import jalview.util.FileUtils;
 import jalview.util.Platform;
 
 import java.io.File;
@@ -936,18 +937,16 @@ public class StructureManager
     }
     else if (os.startsWith("Windows"))
     {
-      for (String root : new String[] { "\\Program Files",
-          "C:\\Program Files", "\\Program Files (x86)",
-          "C:\\Program Files (x86)" })
-      {
-        for (String version : new String[] { "1.11", "1.11.1", "1.11.2",
-            "1.12", "1.12.1", "1.12.2", "1.13" })
-        {
-          pathList.add(root + "\\Chimera " + version + "\\bin\\chimera");
-          pathList.add(
-                  root + "\\Chimera " + version + "\\bin\\chimera.exe");
-        }
-      }
+      /*
+       * typical Windows installation path is
+       * C:\Program Files\Chimera 1.12\bin\chimera.exe
+       */
+      // current drive:
+      pathList.addAll(FileUtils.findMatches("\\",
+              "Program Files*/Chimera*/bin/{chimera,chimera.exe}"));
+      // C: drive (note may add as duplicates)
+      pathList.addAll(FileUtils.findMatches("C:\\",
+              "Program Files*/Chimera*/bin/{chimera,chimera.exe}"));
     }
     else if (os.startsWith("Mac"))
     {