mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Make.py Mikero tools detection fix (#5774)
* make.py mikero tools registry bug fix * Fixed missed change * Spaces after comma
This commit is contained in:
@ -228,57 +228,31 @@ def find_bi_tools(work_drive):
|
|||||||
raise Exception("BadTools","Arma 3 Tools are not installed correctly or the P: drive needs to be created.")
|
raise Exception("BadTools","Arma 3 Tools are not installed correctly or the P: drive needs to be created.")
|
||||||
|
|
||||||
|
|
||||||
def find_depbo_tools(regKey):
|
def find_depbo_tools():
|
||||||
"""Use registry entries to find DePBO-based tools."""
|
"""Use registry entries to find DePBO-based tools."""
|
||||||
stop = False
|
requiredToolPaths = {"pboProject": None, "rapify": None, "MakePbo": None}
|
||||||
|
failed = False
|
||||||
if regKey == "HKCU":
|
|
||||||
reg = winreg.ConnectRegistry(None, winreg.HKEY_CURRENT_USER)
|
|
||||||
stop = True
|
|
||||||
else:
|
|
||||||
reg = winreg.ConnectRegistry(None, winreg.HKEY_LOCAL_MACHINE)
|
|
||||||
|
|
||||||
|
for tool in requiredToolPaths:
|
||||||
try:
|
try:
|
||||||
try:
|
k = winreg.OpenKey(winreg.HKEY_CURRENT_USER, r"Software\Mikero\{}".format(tool))
|
||||||
k = winreg.OpenKey(reg, r"Software\Wow6432Node\Mikero\pboProject")
|
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
k = winreg.OpenKey(reg, r"Software\Mikero\pboProject")
|
k = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r"Software\Mikero\{}".format(tool))
|
||||||
try:
|
try:
|
||||||
pboproject_path = winreg.QueryValueEx(k, "exe")[0]
|
path = winreg.QueryValueEx(k, "exe")[0]
|
||||||
winreg.CloseKey(k)
|
|
||||||
print("Found pboproject.")
|
|
||||||
except:
|
|
||||||
print_error("Could not find pboProject.")
|
|
||||||
|
|
||||||
try:
|
|
||||||
k = winreg.OpenKey(reg, r"Software\Wow6432Node\Mikero\rapify")
|
|
||||||
except FileNotFoundError:
|
|
||||||
k = winreg.OpenKey(reg, r"Software\Mikero\rapify")
|
|
||||||
try:
|
|
||||||
rapify_path = winreg.QueryValueEx(k, "exe")[0]
|
|
||||||
winreg.CloseKey(k)
|
|
||||||
print("Found rapify.")
|
|
||||||
except:
|
|
||||||
print_error("Could not find rapify.")
|
|
||||||
|
|
||||||
try:
|
|
||||||
k = winreg.OpenKey(reg, r"Software\Wow6432Node\Mikero\MakePbo")
|
|
||||||
except FileNotFoundError:
|
|
||||||
k = winreg.OpenKey(reg, r"Software\Mikero\MakePbo")
|
|
||||||
try:
|
|
||||||
makepbo_path = winreg.QueryValueEx(k, "exe")[0]
|
|
||||||
winreg.CloseKey(k)
|
|
||||||
print("Found makepbo.")
|
|
||||||
except:
|
|
||||||
print_error("Could not find makepbo.")
|
|
||||||
except:
|
|
||||||
if stop == True:
|
|
||||||
raise Exception("BadDePBO", "DePBO tools not installed correctly")
|
|
||||||
return -1
|
|
||||||
|
|
||||||
|
|
||||||
#Strip any quotations from the path due to a MikeRo tool bug which leaves a trailing space in some of its registry paths.
|
#Strip any quotations from the path due to a MikeRo tool bug which leaves a trailing space in some of its registry paths.
|
||||||
return [pboproject_path.strip('"'),rapify_path.strip('"'),makepbo_path.strip('"')]
|
requiredToolPaths[tool] = path.strip('"')
|
||||||
|
print_green("Found {}.".format(tool))
|
||||||
|
except:
|
||||||
|
print_error("Could not find {}".format(tool))
|
||||||
|
failed = True
|
||||||
|
finally:
|
||||||
|
winreg.CloseKey(k)
|
||||||
|
|
||||||
|
if failed:
|
||||||
|
raise Exception("BadDePBO", "DePBO tools not installed correctly")
|
||||||
|
|
||||||
|
return requiredToolPaths
|
||||||
|
|
||||||
|
|
||||||
def color(color):
|
def color(color):
|
||||||
@ -1037,12 +1011,11 @@ See the make.cfg file for additional build options.
|
|||||||
|
|
||||||
if build_tool == "pboproject":
|
if build_tool == "pboproject":
|
||||||
try:
|
try:
|
||||||
depbo_tools = find_depbo_tools("HKLM")
|
depbo_tools = find_depbo_tools()
|
||||||
if depbo_tools == -1:
|
|
||||||
depbo_tools = find_depbo_tools("HKCU")
|
pboproject = depbo_tools["pboProject"]
|
||||||
pboproject = depbo_tools[0]
|
rapifyTool = depbo_tools["rapify"]
|
||||||
rapifyTool = depbo_tools[1]
|
makepboTool = depbo_tools["MakePbo"]
|
||||||
makepboTool = depbo_tools[2]
|
|
||||||
except:
|
except:
|
||||||
raise
|
raise
|
||||||
print_error("Could not find dePBO tools. Download the needed tools from: https://dev.withsix.com/projects/mikero-pbodll/files")
|
print_error("Could not find dePBO tools. Download the needed tools from: https://dev.withsix.com/projects/mikero-pbodll/files")
|
||||||
|
Reference in New Issue
Block a user