mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Improved usage of the registry for path to CfgConvert.exe and MikeRo Tools
This commit is contained in:
parent
ed3ac637d2
commit
ca1bafcc79
@ -188,10 +188,16 @@ def find_bi_tools(work_drive):
|
|||||||
else:
|
else:
|
||||||
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():
|
def find_depbo_tools(regKey):
|
||||||
"""Use registry entries to find DePBO-based tools."""
|
"""Use registry entries to find DePBO-based tools."""
|
||||||
|
stop = False
|
||||||
|
|
||||||
|
if regKey == "HKCU":
|
||||||
|
reg = winreg.ConnectRegistry(None, winreg.HKEY_CURRENT_USER)
|
||||||
|
stop = True
|
||||||
|
else:
|
||||||
|
reg = winreg.ConnectRegistry(None, winreg.HKEY_LOCAL_MACHINE)
|
||||||
|
|
||||||
reg = winreg.ConnectRegistry(None, winreg.HKEY_CURRENT_USER)
|
|
||||||
try:
|
try:
|
||||||
k = winreg.OpenKey(reg, r"Software\Mikero\pboProject")
|
k = winreg.OpenKey(reg, r"Software\Mikero\pboProject")
|
||||||
try:
|
try:
|
||||||
@ -217,7 +223,10 @@ def find_depbo_tools():
|
|||||||
except:
|
except:
|
||||||
print_error("Could not find makepbo.")
|
print_error("Could not find makepbo.")
|
||||||
except:
|
except:
|
||||||
raise Exception("BadDePBO", "DePBO tools not installed correctly")
|
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('"')]
|
return [pboproject_path.strip('"'),rapify_path.strip('"'),makepbo_path.strip('"')]
|
||||||
@ -439,7 +448,9 @@ See the make.cfg file for additional build options.
|
|||||||
|
|
||||||
if build_tool == "pboproject":
|
if build_tool == "pboproject":
|
||||||
try:
|
try:
|
||||||
depbo_tools = find_depbo_tools()
|
depbo_tools = find_depbo_tools("HKLM")
|
||||||
|
if depbo_tools == -1:
|
||||||
|
depbo_tools = find_depbo_tools("HKCU")
|
||||||
pboproject = depbo_tools[0]
|
pboproject = depbo_tools[0]
|
||||||
rapifyTool = depbo_tools[1]
|
rapifyTool = depbo_tools[1]
|
||||||
makepboTool = depbo_tools[2]
|
makepboTool = depbo_tools[2]
|
||||||
@ -580,7 +591,7 @@ See the make.cfg file for additional build options.
|
|||||||
|
|
||||||
os.chdir("P:\\")
|
os.chdir("P:\\")
|
||||||
|
|
||||||
cmd = [os.path.join(work_drive, "CfgConvert", "CfgConvert.exe"), "-bin", "-dst", os.path.join(work_drive, prefix, module, "config.bin"), os.path.join(work_drive, prefix, module, "config.cpp")]
|
cmd = [os.path.join(arma3tools_path, "CfgConvert", "CfgConvert.exe"), "-bin", "-dst", os.path.join(work_drive, prefix, module, "config.bin"), os.path.join(work_drive, prefix, module, "config.cpp")]
|
||||||
ret = subprocess.call(cmd)
|
ret = subprocess.call(cmd)
|
||||||
#ret = subprocess.call(["cfgConvertGUI.exe", os.path.join(work_drive, prefix, module, "config.cpp")])
|
#ret = subprocess.call(["cfgConvertGUI.exe", os.path.join(work_drive, prefix, module, "config.cpp")])
|
||||||
|
|
||||||
@ -589,7 +600,7 @@ See the make.cfg file for additional build options.
|
|||||||
input("Press Enter to continue...")
|
input("Press Enter to continue...")
|
||||||
|
|
||||||
|
|
||||||
cmd = [os.path.join(work_drive, "CfgConvert", "CfgConvert.exe"), "-txt", "-dst", os.path.join(work_drive, prefix, module, "config.cpp"), os.path.join(work_drive, prefix, module, "config.bin")]
|
cmd = [os.path.join(arma3tools_path, "CfgConvert", "CfgConvert.exe"), "-txt", "-dst", os.path.join(work_drive, prefix, module, "config.cpp"), os.path.join(work_drive, prefix, module, "config.bin")]
|
||||||
ret = subprocess.call(cmd)
|
ret = subprocess.call(cmd)
|
||||||
if ret != 0:
|
if ret != 0:
|
||||||
print_error("CfgConvert -txt) return code == " + str(ret))
|
print_error("CfgConvert -txt) return code == " + str(ret))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user