diff --git a/CHANGELOG.md b/CHANGELOG.md index 74eb7708a..3d5494467 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,7 +48,7 @@ - Resolve exception handler not logging to file - Display raised exceptions from main thread to users - Increment Binaries: - - PatcherSupportPkg 1.0.2 - release + - PatcherSupportPkg 1.1.0 - release - OpenCorePkg 0.9.2 - release - Lilu 1.6.6 - rolling (d8f3782) - RestrictEvents 1.1.1 - release diff --git a/resources/constants.py b/resources/constants.py index fd800a3a2..ad2d12e61 100644 --- a/resources/constants.py +++ b/resources/constants.py @@ -13,7 +13,7 @@ class Constants: def __init__(self) -> None: # Patcher Versioning self.patcher_version: str = "0.6.6" # OpenCore-Legacy-Patcher - self.patcher_support_pkg_version: str = "1.0.2" # PatcherSupportPkg + self.patcher_support_pkg_version: str = "1.1.0" # PatcherSupportPkg self.copyright_date: str = "Copyright © 2020-2023 Dortania" self.patcher_name: str = "OpenCore Legacy Patcher" @@ -117,7 +117,7 @@ class Constants: ## Internal settings self.allow_oc_everywhere: bool = False # Set whether Patcher can be run on unsupported Macs self.gui_mode: bool = False # Determine whether running in a GUI or TUI - self.cli_mode: bool = False # Determine if running in CLI mode + self.cli_mode: bool = True # Determine if running in CLI mode self.validate: bool = False # Enable validation testing for CI self.recovery_status: bool = False # Detect if booted into RecoveryOS self.ignore_updates: bool = False # Ignore OCLP updates diff --git a/resources/logging_handler.py b/resources/logging_handler.py index cddaa85e0..88cdc2022 100644 --- a/resources/logging_handler.py +++ b/resources/logging_handler.py @@ -159,6 +159,9 @@ class InitializeLoggingSupport: """ logging.error("Uncaught exception in main thread", exc_info=(type, value, tb)) + if self.constants.cli_mode is True: + return + error_msg = f"OpenCore Legacy Patcher encountered the following internal error:\n\n" error_msg += f"{type.__name__}: {value}" if tb: diff --git a/resources/main.py b/resources/main.py index f2ab0dc38..770a68729 100644 --- a/resources/main.py +++ b/resources/main.py @@ -93,6 +93,7 @@ class OpenCoreLegacyPatcher: threading.Thread(target=analytics_handler.Analytics, args=(self.constants,)).start() if utilities.check_cli_args() is None: + self.constants.cli_mode = False logging.info(f"- No arguments present, loading {'GUI' if self.constants.wxpython_variant is True else 'TUI'} mode") return @@ -102,7 +103,6 @@ class OpenCoreLegacyPatcher: ignore_args = ["--auto_patch", "--gui_patch", "--gui_unpatch", "--update_installed"] if not any(x in sys.argv for x in ignore_args): self.constants.current_path = Path.cwd() - self.constants.cli_mode = True if getattr(sys, "frozen", False) and hasattr(sys, "_MEIPASS"): logging.info("- Rerouting payloads location") self.constants.payload_path = sys._MEIPASS / Path("payloads") diff --git a/resources/validation.py b/resources/validation.py index 8ef0b6aca..b0b8fee7c 100644 --- a/resources/validation.py +++ b/resources/validation.py @@ -4,7 +4,7 @@ from pathlib import Path from resources.sys_patch import sys_patch_helpers from resources.build import build -from resources import constants +from resources import constants, network_handler from data import example_data, model_array, sys_patch_dict, os_data @@ -134,8 +134,11 @@ class PatcherValidation: """ if not Path(self.constants.payload_local_binaries_root_path_dmg).exists(): - logging.info("- Skipping Root Patch File integrity validation") - return + dl_obj = network_handler.DownloadObject(f"https://github.com/dortania/PatcherSupportPkg/releases/download/{self.constants.patcher_support_pkg_version}/Universal-Binaries.dmg", self.constants.payload_local_binaries_root_path_dmg) + dl_obj.download(spawn_thread=False) + if dl_obj.download_complete is False: + logging.info("Failed to download Universal-Binaries.dmg") + raise Exception("Failed to download Universal-Binaries.dmg") logging.info("Validating Root Patch File integrity") output = subprocess.run( diff --git a/resources/wx_gui/gui_settings.py b/resources/wx_gui/gui_settings.py index 1fff6e03c..97fd75167 100644 --- a/resources/wx_gui/gui_settings.py +++ b/resources/wx_gui/gui_settings.py @@ -229,7 +229,8 @@ class SettingsFrame(wx.Frame): """ models = [model for model in smbios_data.smbios_dictionary if "_" not in model and " " not in model and smbios_data.smbios_dictionary[model]["Board ID"] is not None] - socketed_gpu_models = ["iMac9,1", "iMac10,1", "iMac11,1", "iMac11,2", "iMac11,3", "iMac12,1", "iMac12,2", "MacPro3,1", "MacPro4,1", "MacPro5,1", "Xserve2,1", "Xserve3,1"] + socketed_imac_models = ["iMac9,1", "iMac10,1", "iMac11,1", "iMac11,2", "iMac11,3", "iMac12,1", "iMac12,2"] + socketed_gpu_models = socketed_imac_models + ["MacPro3,1", "MacPro4,1", "MacPro5,1", "Xserve2,1", "Xserve3,1"] settings = { "Build": { @@ -541,6 +542,7 @@ class SettingsFrame(wx.Frame): "Override detected/assumed GPU on", "socketed MXM-based iMacs.", ], + "condition": bool((not self.constants.custom_model and self.constants.computer.real_model in socketed_imac_models) or (self.constants.custom_model and self.constants.custom_model in socketed_imac_models)) }, "Populate Graphics Override": { "type": "populate", @@ -713,6 +715,16 @@ class SettingsFrame(wx.Frame): "condition": gui_support.CheckProperties(self.constants).host_is_non_metal(general_check=True) }, + "Beach Ball Cursor Workaround": { + "type": "checkbox", + "value": self._get_system_settings("Moraea.EnableSpinHack"), + "variable": "Moraea.EnableSpinHack", + "description": [ + "Note: May be more CPU intensive.", + ], + "override_function": self._update_system_defaults, + "condition": gui_support.CheckProperties(self.constants).host_is_non_metal(general_check=True) + }, "wrap_around 2": { "type": "wrap_around", },