install.py: Avoid OC icon if Windows detected

This commit is contained in:
Mykola Grymalyuk
2022-06-28 10:34:18 -06:00
parent ddafb8a3ab
commit 5a96852ea5
2 changed files with 16 additions and 11 deletions
+1
View File
@@ -3,6 +3,7 @@
## 0.4.8 ## 0.4.8
- Ensure Apple Silicon-specific installers are not listed - Ensure Apple Silicon-specific installers are not listed
- ie. M2 specific build (21F2092) - ie. M2 specific build (21F2092)
- Avoid adding OpenCore icon in boot picker if Windows bootloader on same partition
## 0.4.7 ## 0.4.7
- Fix crashing on defaults parsing - Fix crashing on defaults parsing
+4
View File
@@ -229,6 +229,10 @@ Please build OpenCore first!"""
Path(mount_path / Path("EFI/BOOT")).mkdir() 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.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) shutil.rmtree(mount_path / Path("System"), onerror=rmtree_handler)
# 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:
if determine_sd_card(sd_type) is True: if determine_sd_card(sd_type) is True:
print("- Adding SD Card icon") print("- Adding SD Card icon")
shutil.copy(self.constants.icon_path_sd, mount_path) shutil.copy(self.constants.icon_path_sd, mount_path)