Initial Commit

This commit is contained in:
Mykola Grymalyuk
2022-05-02 13:19:36 -06:00
parent 754a6c2a87
commit 4e1254c31e
8 changed files with 608 additions and 906 deletions
+11 -19
View File
@@ -22,31 +22,23 @@ class grab_patcher_support_pkg:
os_ver = "10.14-Mojave"
else:
raise Exception(f"Unsupported OS: {self.constants.detected_os}")
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
link = f"{self.constants.url_patcher_support_pkg}{self.constants.patcher_support_pkg_version}/Universal-Binaries.zip"
return os_ver, link
def download_files(self):
os_ver, extensions_link, framework_link = self.generate_pkg_link()
if Path(self.constants.payload_apple_root_path).exists():
os_ver, link = self.generate_pkg_link()
if Path(self.constants.payload_local_binaries_root_path).exists():
print("- Removing old Apple Binaries folder")
# Delete folder
shutil.rmtree(self.constants.payload_apple_root_path)
if Path(self.constants.payload_apple_root_path_zip).exists():
print("- Removing old Apple Binaries zip")
Path(self.constants.payload_apple_root_path_zip).unlink()
shutil.rmtree(self.constants.payload_local_binaries_root_path)
download_result = None
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_framework_zip, self.constants.payload_apple_root_path_zip)
local_zip = Path(self.constants.payload_path) / f"Universal-Binaries.zip"
if Path(local_zip).exists():
print(f"- Found local {local_zip} zip, skipping download")
download_result = True
else:
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)
print(f"- No local version found, downloading...")
download_result = utilities.download_file(link, self.constants.payload_local_binaries_root_path_zip)
return download_result, os_ver, extensions_link, framework_link
return download_result, os_ver, link