mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-06-18 21:30:00 +10:00
Remove Online Binaries
This commit is contained in:
@@ -15,7 +15,7 @@ class Constants:
|
||||
def __init__(self):
|
||||
# Patcher Versioning
|
||||
self.patcher_version = "0.4.4" # OpenCore-Legacy-Patcher
|
||||
self.patcher_support_pkg_version = "0.3.8" # PatcherSupportPkg
|
||||
self.patcher_support_pkg_version = "0.3.9" # PatcherSupportPkg
|
||||
self.url_patcher_support_pkg = "https://github.com/dortania/PatcherSupportPkg/releases/download/"
|
||||
self.nightly_url_patcher_support_pkg = "https://nightly.link/dortania/PatcherSupportPkg/workflows/build/master/"
|
||||
self.discord_link = "https://discord.gg/rqdPgH8xSN"
|
||||
@@ -575,6 +575,10 @@ class Constants:
|
||||
@property
|
||||
def payload_apple_root_path_zip(self):
|
||||
return self.payload_path / Path("Apple.zip")
|
||||
|
||||
@property
|
||||
def payload_universal_extensions_zip_path(self):
|
||||
return self.payload_path / Path("Universal-Extensions.zip")
|
||||
|
||||
@property
|
||||
def payload_apple_root_path(self):
|
||||
@@ -582,7 +586,7 @@ class Constants:
|
||||
|
||||
@property
|
||||
def payload_apple_kexts_path(self):
|
||||
return self.payload_apple_root_path / Path("Extensions")
|
||||
return self.payload_path / Path("Universal-Extensions")
|
||||
|
||||
@property
|
||||
def payload_apple_coreservices_path(self):
|
||||
|
||||
@@ -628,19 +628,21 @@ class PatchSysVolume:
|
||||
|
||||
def download_files(self):
|
||||
if self.constants.gui_mode is False or "Library/InstallerSandboxes/" in str(self.constants.payload_path):
|
||||
download_result, os_ver, link = sys_patch_download.grab_patcher_support_pkg(self.constants).download_files()
|
||||
download_result, os_ver, extensions_link, framework_link = sys_patch_download.grab_patcher_support_pkg(self.constants).download_files()
|
||||
else:
|
||||
download_result = True
|
||||
os_ver, link = sys_patch_download.grab_patcher_support_pkg(self.constants).generate_pkg_link()
|
||||
os_ver, extensions_link, framework_link = sys_patch_download.grab_patcher_support_pkg(self.constants).generate_pkg_link()
|
||||
|
||||
if download_result and self.constants.payload_apple_root_path_zip.exists():
|
||||
if download_result and self.constants.payload_apple_root_path_zip.exists() and self.constants.payload_universal_extensions_zip_path.exists():
|
||||
print("- Download completed")
|
||||
print("- Unzipping download...")
|
||||
try:
|
||||
utilities.process_status(subprocess.run(["unzip", self.constants.payload_apple_root_path_zip], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, cwd=self.constants.payload_path))
|
||||
utilities.process_status(subprocess.run(["unzip", self.constants.payload_universal_extensions_zip_path], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, cwd=self.constants.payload_path))
|
||||
print("- Renaming folder")
|
||||
os.rename(self.constants.payload_path / Path(os_ver), self.constants.payload_apple_root_path)
|
||||
Path(self.constants.payload_apple_root_path_zip).unlink()
|
||||
Path(self.constants.payload_universal_extensions_zip_path).unlink()
|
||||
print("- Binaries downloaded to:")
|
||||
print(self.constants.payload_path)
|
||||
return self.constants.payload_apple_root_path
|
||||
@@ -649,8 +651,9 @@ class PatchSysVolume:
|
||||
return None
|
||||
else:
|
||||
if self.constants.gui_mode is True:
|
||||
print("- Download failed, please verify the below link works:")
|
||||
print(link)
|
||||
print("- Download failed, please verify the below links work:")
|
||||
print(framework_link)
|
||||
print(extensions_link)
|
||||
print("\nIf you continue to have issues, try using the Offline builds")
|
||||
print("located on Github next to the other builds")
|
||||
else:
|
||||
|
||||
@@ -22,11 +22,12 @@ class grab_patcher_support_pkg:
|
||||
os_ver = "10.14-Mojave"
|
||||
else:
|
||||
raise Exception(f"Unsupported OS: {self.constants.detected_os}")
|
||||
link = f"{self.constants.url_patcher_support_pkg}{self.constants.patcher_support_pkg_version}/{os_ver}.zip"
|
||||
return os_ver, link
|
||||
framework_link = f"{self.constants.url_patcher_support_pkg}{self.constants.patcher_support_pkg_version}/{os_ver}.zip"
|
||||
extensions_link = f"{self.constants.url_patcher_support_pkg}{self.constants.patcher_support_pkg_version}/Universal-Extensions.zip"
|
||||
return os_ver, extensions_link, framework_link
|
||||
|
||||
def download_files(self):
|
||||
os_ver, link = self.generate_pkg_link()
|
||||
os_ver, extensions_link, framework_link = self.generate_pkg_link()
|
||||
if Path(self.constants.payload_apple_root_path).exists():
|
||||
print("- Removing old Apple Binaries folder")
|
||||
# Delete folder
|
||||
@@ -36,13 +37,16 @@ class grab_patcher_support_pkg:
|
||||
Path(self.constants.payload_apple_root_path_zip).unlink()
|
||||
|
||||
download_result = None
|
||||
local_zip = Path(self.constants.payload_path) / f"{os_ver}.zip"
|
||||
if Path(local_zip).exists():
|
||||
local_framework_zip = Path(self.constants.payload_path) / f"{os_ver}.zip"
|
||||
local_extensions_zip = Path(self.constants.payload_path) / f"Universal-Extensions.zip"
|
||||
if Path(local_framework_zip).exists() and Path(local_extensions_zip).exists():
|
||||
print(f"- Found local {os_ver} zip, skipping download")
|
||||
print(f"- Duplicating into Apple.zip")
|
||||
shutil.copy(local_zip, self.constants.payload_apple_root_path_zip)
|
||||
shutil.copy(local_framework_zip, self.constants.payload_apple_root_path_zip)
|
||||
download_result = True
|
||||
else:
|
||||
download_result = utilities.download_file(link, self.constants.payload_apple_root_path_zip)
|
||||
print(f"- No local version found, donwloading...")
|
||||
if utilities.download_file(extensions_link, self.constants.payload_universal_extensions_zip_path):
|
||||
download_result = utilities.download_file(framework_link, self.constants.payload_apple_root_path_zip)
|
||||
|
||||
return download_result, os_ver, link
|
||||
return download_result, os_ver, extensions_link, framework_link
|
||||
@@ -50,7 +50,7 @@ class check_binary_updates:
|
||||
return "TUI"
|
||||
|
||||
def determine_local_build_type_offline(self):
|
||||
if (Path(self.constants.payload_path) / f"12-Monterey.zip").exists():
|
||||
if (Path(self.constants.payload_path) / "Universal-Extensions.zip").exists():
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user