mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-06-20 14:10:51 +10:00
install.py: Resolve error handling in GUI
This commit is contained in:
+11
-4
@@ -168,9 +168,13 @@ Please build OpenCore first!"""
|
|||||||
# cancelled prompt
|
# cancelled prompt
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
utilities.TUIOnlyPrint(
|
if self.constants.gui_mode is False:
|
||||||
["Copying OpenCore"], "Press [Enter] to go back.\n", ["An error occurred!"] + result.stderr.decode().split("\n") + ["", "Please report this to the devs at GitHub."]
|
utilities.TUIOnlyPrint(
|
||||||
).start()
|
["Copying OpenCore"], "Press [Enter] to go back.\n", ["An error occurred!"] + result.stderr.decode().split("\n") + [""]
|
||||||
|
).start()
|
||||||
|
else:
|
||||||
|
print("An error occurred!")
|
||||||
|
print(result.stderr.decode().split("\n") + [""])
|
||||||
return
|
return
|
||||||
partition_info = plistlib.loads(subprocess.run(f"diskutil info -plist {full_disk_identifier}".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode())
|
partition_info = plistlib.loads(subprocess.run(f"diskutil info -plist {full_disk_identifier}".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode())
|
||||||
parent_disk = partition_info["ParentWholeDisk"]
|
parent_disk = partition_info["ParentWholeDisk"]
|
||||||
@@ -242,7 +246,10 @@ Please build OpenCore first!"""
|
|||||||
print("\nPress [Enter] to continue.\n")
|
print("\nPress [Enter] to continue.\n")
|
||||||
input()
|
input()
|
||||||
else:
|
else:
|
||||||
utilities.TUIOnlyPrint(["Copying OpenCore"], "Press [Enter] to go back.\n", ["EFI failed to mount!", "Please report this to the devs at GitHub."]).start()
|
if self.constants.gui_mode is False:
|
||||||
|
utilities.TUIOnlyPrint(["Copying OpenCore"], "Press [Enter] to go back.\n", ["EFI failed to mount!"]).start()
|
||||||
|
else:
|
||||||
|
print("EFI failed to mount!")
|
||||||
|
|
||||||
def rmtree_handler(func, path, exc_info):
|
def rmtree_handler(func, path, exc_info):
|
||||||
if exc_info[0] == FileNotFoundError:
|
if exc_info[0] == FileNotFoundError:
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ class OpenCoreLegacyPatcher:
|
|||||||
self.generate_base_data()
|
self.generate_base_data()
|
||||||
if utilities.check_cli_args() is None:
|
if utilities.check_cli_args() is None:
|
||||||
if launch_gui is True:
|
if launch_gui is True:
|
||||||
|
utilities.disable_cls()
|
||||||
from gui import gui_main
|
from gui import gui_main
|
||||||
gui_main.wx_python_gui(self.constants)
|
gui_main.wx_python_gui(self.constants)
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user