From 5a4c439c22784703c4178c8b434c74502984ce55 Mon Sep 17 00:00:00 2001 From: Daniel Jupp Date: Mon, 4 Dec 2017 13:15:24 -0600 Subject: [PATCH] Fix Mikero tools dupe key issue (#5853) Mikero tools seams to not cleanup regkeys properly and leaves a key with no value behind making. Making find_depbo_tools break --- tools/make.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) 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)