diff --git a/CHANGELOG.md b/CHANGELOG.md index fcca01543..1bb5154f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - Fix full screen and Airplay to Mac support for Intel HD4000 iGPUs - Automatically set `CMIO_Unit_Input_ASC.DoNotUseOpenCL` on TeraScale 2 GPUs - Fix Country Code detection on Wireless Cards +- Add Windows detection and prompt during installation ## 0.1.9 - Fix incorrect AMFI and SIP detection diff --git a/Resources/Build.py b/Resources/Build.py index 7598d20fc..1d6e7ad4b 100644 --- a/Resources/Build.py +++ b/Resources/Build.py @@ -975,6 +975,19 @@ Please build OpenCore first!""" Utilities.header(["Copying OpenCore"]) if mount_path.exists(): + if (mount_path / Path("EFI/Microsoft")).exists(): + print("- Found Windows Boot Loader") + print("\nWould you like to continue installing OpenCore?") + print("Installing OpenCore onto this drive may make Windows unbootable until OpenCore") + print("is removed from the partition") + print("We highly recommend users partition 200MB off their drive with Disk Utility") + print(" Name:\t\t OPENCORE") + print(" Format:\t FAT32") + print(" Size:\t\t 200MB") + choice = input("\nWould you like to still install OpenCore to this drive?(y/n): ") + if not choice in ["y", "Y", "Yes", "yes"]: + subprocess.run(["diskutil", "umount", mount_path], stdout=subprocess.PIPE).stdout.decode().strip().encode() + return if (mount_path / Path("EFI/OC")).exists(): print("- Removing preexisting EFI/OC folder") shutil.rmtree(mount_path / Path("EFI/OC"), onerror=rmtree_handler)