Tools - Fix make.py failing when pboProject\Settings folder missing (#9393)

This commit is contained in:
PabstMirror 2023-09-12 13:04:26 -05:00 committed by GitHub
parent ea783b6c7a
commit ebef82d10b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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):