From 5a96852ea5cbfdad5fddd786f284acc3f0c2cf66 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Tue, 28 Jun 2022 10:34:18 -0600 Subject: [PATCH] install.py: Avoid OC icon if Windows detected --- CHANGELOG.md | 1 + resources/install.py | 26 +++++++++++++++----------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 369c157f5..f57f8113c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## 0.4.8 - Ensure Apple Silicon-specific installers are not listed - ie. M2 specific build (21F2092) +- Avoid adding OpenCore icon in boot picker if Windows bootloader on same partition ## 0.4.7 - Fix crashing on defaults parsing diff --git a/resources/install.py b/resources/install.py index d02134a07..06e9c8c9a 100644 --- a/resources/install.py +++ b/resources/install.py @@ -229,18 +229,22 @@ Please build OpenCore first!""" Path(mount_path / Path("EFI/BOOT")).mkdir() shutil.move(mount_path / Path("System/Library/CoreServices/boot.efi"), mount_path / Path("EFI/BOOT/BOOTx64.efi")) shutil.rmtree(mount_path / Path("System"), onerror=rmtree_handler) - if determine_sd_card(sd_type) is True: - print("- Adding SD Card icon") - shutil.copy(self.constants.icon_path_sd, mount_path) - elif ssd_type is True: - print("- Adding SSD icon") - shutil.copy(self.constants.icon_path_ssd, mount_path) - elif disk_type == "USB": - print("- Adding External USB Drive icon") - shutil.copy(self.constants.icon_path_external, mount_path) + # Due to how OpenCore processes on-volume icons, Windows may appear as OC's icon + if (mount_path / Path("EFI/Microsoft")).exists(): + print("- Windows Boot Loader detected, skipping volume icon") else: - print("- Adding Internal Drive icon") - shutil.copy(self.constants.icon_path_internal, mount_path) + if determine_sd_card(sd_type) is True: + print("- Adding SD Card icon") + shutil.copy(self.constants.icon_path_sd, mount_path) + elif ssd_type is True: + print("- Adding SSD icon") + shutil.copy(self.constants.icon_path_ssd, mount_path) + elif disk_type == "USB": + print("- Adding External USB Drive icon") + shutil.copy(self.constants.icon_path_external, mount_path) + else: + print("- Adding Internal Drive icon") + shutil.copy(self.constants.icon_path_internal, mount_path) print("- Cleaning install location") if not self.constants.recovery_status: