| Index: telemetry/telemetry/internal/util/path.py
|
| diff --git a/telemetry/telemetry/internal/util/path.py b/telemetry/telemetry/internal/util/path.py
|
| index 3f454c09d197b0c05fa7e9a4d15a3a275f31dc6c..5c3616fead085ee1fb02dfaff9e5e1fa74d9fc83 100644
|
| --- a/telemetry/telemetry/internal/util/path.py
|
| +++ b/telemetry/telemetry/internal/util/path.py
|
| @@ -2,6 +2,7 @@
|
| # Use of this source code is governed by a BSD-style license that can be
|
| # found in the LICENSE file.
|
|
|
| +import glob
|
| import os
|
|
|
| from telemetry.core import util
|
| @@ -17,6 +18,11 @@ GetBuildDirectories = util.GetBuildDirectories
|
| IsExecutable = catapult_util.IsExecutable
|
|
|
|
|
| +def _HasWildcardCharacters(input_string):
|
| + # Could make this more precise.
|
| + return '*' in input_string or '+' in input_string
|
| +
|
| +
|
| def FindInstalledWindowsApplication(application_path):
|
| """Search common Windows installation directories for an application.
|
|
|
| @@ -29,14 +35,17 @@ def FindInstalledWindowsApplication(application_path):
|
| os.getenv('PROGRAMFILES'),
|
| os.getenv('LOCALAPPDATA')]
|
| search_paths += os.getenv('PATH', '').split(os.pathsep)
|
| -
|
| for search_path in search_paths:
|
| if not search_path:
|
| continue
|
| path = os.path.join(search_path, application_path)
|
| - if IsExecutable(path):
|
| - return path
|
| -
|
| + if _HasWildcardCharacters(path):
|
| + paths = glob.glob(path)
|
| + else:
|
| + paths = [path]
|
| + for p in paths:
|
| + if IsExecutable(p):
|
| + return p
|
| return None
|
|
|
|
|
|
|