diff --git a/tools/make.py b/tools/make.py index 5fc6b8bc39..f56c72fb8d 100644 --- a/tools/make.py +++ b/tools/make.py @@ -235,17 +235,19 @@ def find_depbo_tools(): for tool in requiredToolPaths: try: - k = winreg.OpenKey(winreg.HKEY_CURRENT_USER, r"Software\Mikero\{}".format(tool)) + try: + k = winreg.OpenKey(winreg.HKEY_CURRENT_USER, r"Software\Mikero\{}".format(tool)) + path = winreg.QueryValueEx(k, "exe")[0] + except FileNotFoundError: + k = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r"Software\Mikero\{}".format(tool)) + path = winreg.QueryValueEx(k, "exe")[0] except FileNotFoundError: - k = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r"Software\Mikero\{}".format(tool)) - try: - path = winreg.QueryValueEx(k, "exe")[0] + print_error("Could not find {}".format(tool)) + failed = True + else: #Strip any quotations from the path due to a MikeRo tool bug which leaves a trailing space in some of its registry paths. requiredToolPaths[tool] = path.strip('"') print_green("Found {}.".format(tool)) - except: - print_error("Could not find {}".format(tool)) - failed = True finally: winreg.CloseKey(k)