From ebef82d10b52468c96e2f1354ea2548ccc189d6e Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 12 Sep 2023 13:04:26 -0500 Subject: [PATCH] Tools - Fix make.py failing when pboProject\Settings folder missing (#9393) --- tools/make.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/make.py b/tools/make.py index 59bf68ef01..5e768ac37e 100644 --- a/tools/make.py +++ b/tools/make.py @@ -282,13 +282,22 @@ def pboproject_settings(): value_exclude = "thumbs.db,*.txt,*.h,*.dep,*.cpp,*.bak,*.png,*.log,*.pew,source,*.tga" try: - k = mikero_windows_registry(r"pboProject\Settings", access=winreg.KEY_SET_VALUE) + pbok = mikero_windows_registry(r"pboProject") + try: + k = winreg.OpenKey(pbok, "Settings", access=winreg.KEY_SET_VALUE) + except: + print_yellow("WARNING: creating pboProject\Settings reg manually") + print_yellow("This should have happened before running make.py") + k = winreg.CreateKeyEx(pbok, "Settings", access=winreg.KEY_SET_VALUE) winreg.SetValueEx(k, "m_exclude", 0, winreg.REG_SZ, value_exclude) winreg.SetValueEx(k, "m_exclude2", 0, winreg.REG_SZ, value_exclude) winreg.SetValueEx(k, "wildcard_exclude_from_pbo_normal", 0, winreg.REG_SZ, value_exclude) winreg.SetValueEx(k, "wildcard_exclude_from_pbo_unbinarised_missions", 0, winreg.REG_SZ, value_exclude) except: raise Exception("BadDePBO", "pboProject not installed correctly, make sure to run it at least once") + finally: + winreg.CloseKey(k) + winreg.CloseKey(pbok) def color(color):