From 5e5139855bd472b96572584daebf266d52b1ccfd Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Wed, 4 May 2022 15:31:30 -0600 Subject: [PATCH] Fix AutoPkg download --- CHANGELOG.md | 4 ++++ gui/gui_main.py | 14 ++++++++++---- resources/build.py | 13 ++++++------- resources/constants.py | 2 +- 4 files changed, 21 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c2cb57a7..584e0cbf2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # OpenCore Legacy Patcher changelog ## 0.4.5 +- Fix AutoPatcher.pkg download on releases + - Fix backported to 0.4.4 release binaries +- Add Macmini8,1 FeatureUnlock support + - Drops CPU check, supports all machines ## 0.4.4 - Lower SIP requirement for Root Patching diff --git a/gui/gui_main.py b/gui/gui_main.py index c2790e01b..b5fc206c5 100644 --- a/gui/gui_main.py +++ b/gui/gui_main.py @@ -1581,10 +1581,16 @@ class wx_python_gui: print("- Nightly Install.pkg is missing on Github, exiting") return - if utilities.download_file(link, self.constants.installer_pkg_zip_path): - if Path(self.constants.installer_pkg_path).exists(): - subprocess.run(["rm", self.constants.installer_pkg_path]) - subprocess.run(["ditto", "-V", "-x", "-k", "--sequesterRsrc", "--rsrc", self.constants.installer_pkg_zip_path, self.constants.payload_path]) + if link.endswith(".zip"): + path = self.constants.installer_pkg_zip_path + else: + path = self.constants.installer_pkg_path + + if utilities.download_file(link, path): + if str(path).endswith(".zip"): + if Path(self.constants.installer_pkg_path).exists(): + subprocess.run(["rm", self.constants.installer_pkg_path]) + subprocess.run(["ditto", "-V", "-x", "-k", "--sequesterRsrc", "--rsrc", self.constants.installer_pkg_zip_path, self.constants.payload_path]) def install_installer_pkg(self, disk): disk = disk + "s2" # ESP sits at 1, and we know macOS will have created the main partition at 2 diff --git a/resources/build.py b/resources/build.py index 123c8593a..ccac79472 100644 --- a/resources/build.py +++ b/resources/build.py @@ -166,13 +166,12 @@ class BuildOpenCore: # Required for Lilu in 11.0+ self.config["Kernel"]["Quirks"]["DisableLinkeditJettison"] = True - if smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.kaby_lake.value: - if self.constants.fu_status is True: - # Enable FeatureUnlock.kext - self.enable_kext("FeatureUnlock.kext", self.constants.featureunlock_version, self.constants.featureunlock_path) - if self.constants.fu_arguments is not None: - print(f"- Adding additional FeatureUnlock args: {self.constants.fu_arguments}") - self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += self.constants.fu_arguments + if self.constants.fu_status is True: + # Enable FeatureUnlock.kext + self.enable_kext("FeatureUnlock.kext", self.constants.featureunlock_version, self.constants.featureunlock_path) + if self.constants.fu_arguments is not None: + print(f"- Adding additional FeatureUnlock args: {self.constants.fu_arguments}") + self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += self.constants.fu_arguments if smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.sandy_bridge.value or self.constants.disable_xcpm is True: # With macOS 12.3 Beta 1, Apple dropped the 'plugin-type' check within X86PlatformPlugin diff --git a/resources/constants.py b/resources/constants.py index 80f71b765..1e797822a 100644 --- a/resources/constants.py +++ b/resources/constants.py @@ -23,7 +23,7 @@ class Constants: self.repo_link = "https://github.com/dortania/OpenCore-Legacy-Patcher" self.repo_link_latest = f"{self.repo_link}/releases/tag/{self.patcher_version}" self.copyright_date = "Copyright © 2020-2022 Dortania" - self.installer_pkg_url = f"{self.repo_link_latest}/AutoPkg-Assets.pkg.zip" + self.installer_pkg_url = f"{self.repo_link}/releases/download/{self.patcher_version}/AutoPkg-Assets.pkg" self.installer_pkg_url_nightly = "http://nightly.link/dortania/OpenCore-Legacy-Patcher/workflows/build-app-wxpython/main/AutoPkg-Assets.pkg.zip" # OpenCore Versioning