Add Windows detection to disk install

This commit is contained in:
Mykola Grymalyuk
2021-06-18 19:23:18 -06:00
parent 292e09a0d7
commit 84abbb7c11
2 changed files with 14 additions and 0 deletions
+1
View File
@@ -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
+13
View File
@@ -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)