gui_main.py: Add non-zip handling

This commit is contained in:
Mykola Grymalyuk
2022-04-16 12:40:16 -06:00
parent 3e8f28a2db
commit 26bc5fa4c5

View File

@@ -1478,9 +1478,14 @@ class wx_python_gui:
if not utilities.validate_link(link):
print("- Manual backup is missing on Github, no more fallbacks remaining. Quitting")
return
if utilities.download_file(link, self.constants.installer_pkg_zip_path):
subprocess.run(["unzip", "-o", self.constants.installer_pkg_zip_path, "-d", self.constants.installer_pkg_path])
if link.endswith("zip"):
if utilities.download_file(link, self.constants.installer_pkg_zip_path):
if Path(self.constants.installer_pkg_path).exists():
os.remove(self.constants.installer_pkg_path)
subprocess.run(["unzip", "-o", self.constants.installer_pkg_zip_path, "-d", self.constants.installer_pkg_path])
else:
utilities.download_file(link, self.constants.installer_pkg_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