Contribute
Register

[HOW TO] Windows entry after macOS in the OpenCore menu

Joined
Dec 10, 2010
Messages
736
Motherboard
Gigabyte Z390 Aorus Elite
CPU
i9-9900K
Graphics
RX 580
Mobile Phone
  1. iOS
Sometimes a user says he doesn't like the Windows icon to be seen before macOS in the picker. Although I have responded to this question on previous occasions, I am writing it here as a separate post in case it can help someone with this concern.

The Windows system that is automatically detected by OpenCore is displayed before the macOS icons in the OpenCore menu. This is by default (for now).
To correct this behavior you have to:
  • create a custom entry for Windows in Misc> Entries, this entry is shown behind macOS.
  • set the Misc> Security> ScanPolicy key to a value that scans APFS and HFS file systems but not NTFS or EFI. In this way, autodetected Windows stops showing up before macOS.
Example: ScanPolicy value to show APFS and HFS file systems and SATA, NVMe and USB devices:
0x00000001 - OC_SCAN_FILE_SYSTEM_LOCK.
0x00000002 - OC_SCAN_DEVICE_LOCK.
0x00000100 - OC_SCAN_ALLOW_FS_APFS.
0x00000200 - OC_SCAN_ALLOW_FS_HFS.
0x00010000 - OC_SCAN_ALLOW_DEVICE_SATA.
0x00080000 - OC_SCAN_ALLOW_DEVICE_NVME.
0x00200000 - OC_SCAN_ALLOW_DEVICE_USB.
1 + 2 + 100 + 200 + 10000 + 80000 + 200000 = 0x290303 hexadecimal (2687747 in decimal). In config.plist it would look like this:
XML:
<key>ScanPolicy</key>
<integer>2687747</integer>
picker.png

Calculate the value of ScanPolicy: OpenCore ScanPolicy Generator.
 
Last edited:

msh

Joined
Oct 31, 2013
Messages
244
Motherboard
Gigabyte GA-Z97X-UD3H
CPU
i5-4690S
Graphics
HD 4600
Mobile Phone
  1. Android
Sometimes a user says he doesn't like the Windows icon to be seen before macOS in the picker. Although I have responded to this question on previous occasions, I am writing it here as a separate post in case it can help someone with this concern.

The Windows system that is automatically detected by OpenCore is displayed before the macOS icons in the OpenCore menu. This is by default (for now).
To correct this behavior you have to:
  • create a custom entry for Windows in Misc> Entries, this entry is shown behind macOS.
  • set the Misc> Security> ScanPolicy key to a value that scans APFS and HFS file systems but not NTFS or EFI. In this way, autodetected Windows stops showing up before macOS.
Example: ScanPolicy value to show APFS and HFS file systems and SATA, NVMe and USB devices:
0x00000001 - OC_SCAN_FILE_SYSTEM_LOCK.
0x00000002 - OC_SCAN_DEVICE_LOCK.
0x00000100 - OC_SCAN_ALLOW_FS_APFS.
0x00000200 - OC_SCAN_ALLOW_FS_HFS.
0x00010000 - OC_SCAN_ALLOW_DEVICE_SATA.
0x00080000 - OC_SCAN_ALLOW_DEVICE_NVME.
0x00200000 - OC_SCAN_ALLOW_DEVICE_USB.
1 + 2 + 100 + 200 + 10000 + 80000 + 200000 = 0x290303 hexadecimal (2687747 in decimal). In config.plist it would look like this:
XML:
<key>ScanPolicy</key>
<integer>2687747</integer>
View attachment 520293

Calculate the value of ScanPolicy: OpenCore ScanPolicy Generator.
Hi, I tried Windows entry. But something not working.
My picker with no change in Scanpolicy
31181412.png
and my picker with scanpolicy change.

Capture d’écran 2021-05-31 à 20.13.15.png
I lost Windows in picker
31180921.png

I don't know what I did rong?
 
Last edited:

Edhawk

Moderator
Joined
Aug 2, 2013
Messages
2,350
Motherboard
Gigabyte Z97X-UD5H
CPU
i7-4790K
Graphics
HD 4600 / RX 580
Mac
  1. iMac
  2. MacBook Air
  3. MacBook Pro
Mobile Phone
  1. iOS
@milicio when creating the Misc > Entries patch for the Windows 10 drive, what do you need to set as the path?

Is PciRoot(0x0)/Pci(0x1,0x1)/Pci(0x0,0x0) or PciRoot(0x0)/Pci(0x1,0x2)/Pci(0x0,0x0) (ACPI addresses for the two NVME drives in my system) good enough or do we need to add anything else?

I assume these options in the Misc >Entries section need to be set as follows for the patch:
  • Arguments - Boolean - True
  • Enabled - Boolean - True
  • Name - String - Windows 10
  • TextMode - Boolean - True
As well as the ScanPolicy entry changing from '0' to '2687747'

Screenshot 2021-05-31 at 21.15.01.png
Misc > Entries > Windows 10
ScanPolicy changed in Misc > Security
 

msh

Joined
Oct 31, 2013
Messages
244
Motherboard
Gigabyte GA-Z97X-UD3H
CPU
i5-4690S
Graphics
HD 4600
Mobile Phone
  1. Android
@milicio when creating the Misc > Entries patch for the Windows 10 drive, what do you need to set as the path?

Is PciRoot(0x0)/Pci(0x1,0x1)/Pci(0x0,0x0) or PciRoot(0x0)/Pci(0x1,0x2)/Pci(0x0,0x0) (ACPI addresses for the two NVME drives in my system) good enough or do we need to add anything else?

I assume these options in the Misc >Entries section need to be set as follows for the patch:
  • Arguments - Boolean - True
  • Enabled - Boolean - True
  • Name - String - Windows 10
  • TextMode - Boolean - True
As well as the ScanPolicy entry changing from '0' to '2687747'

View attachment 520334
Misc > Entries > Windows 10
ScanPolicy changed in Misc > Security
Thanks, thanks. I made the patch you suggested and know it works.
31203320.png
 
Joined
Dec 10, 2010
Messages
736
Motherboard
Gigabyte Z390 Aorus Elite
CPU
i9-9900K
Graphics
RX 580
Mobile Phone
  1. iOS
@milicio when creating the Misc > Entries patch for the Windows 10 drive, what do you need to set as the path?

Is PciRoot(0x0)/Pci(0x1,0x1)/Pci(0x0,0x0) or PciRoot(0x0)/Pci(0x1,0x2)/Pci(0x0,0x0) (ACPI addresses for the two NVME drives in my system) good enough or do we need to add anything else?

I assume these options in the Misc >Entries section need to be set as follows for the patch:
  • Arguments - Boolean - True
  • Enabled - Boolean - True
  • Name - String - Windows 10
  • TextMode - Boolean - True
As well as the ScanPolicy entry changing from '0' to '2687747'
Misc > Entries > Windows 10
ScanPolicy changed in Misc > Security
Its' @miliuco :)

The path to the Windows bootloader consists of 2 parts, an EFI path to the partition with the EFI folder + a path to the bootloader within the EFI folder.
We already know that the path to the boot loader is EFI\Microsoft\Boot\bootmgfw.efi.
The EFI path is taken from map_table.txt by copying the line that corresponds to the Windows EFI folder (you already have this data).

The line with the EFI path looks like this (example):
Code:
PciRoot(0x0)/Pci(0x1D,0x0)/Pci(0x0,0x0)/NVMe(0x1,18-CC-1C-49-8B-44-1B-00)/HD(1,GPT,DF3F0348-A4F8- 4A34-9C86-963B0E98F2BE,0x800,0x54747)

The path to the bootloader is like this:
Code:
EFI\Microsoft\Boot\bootmgfw.efi

You have to join the two paths by inserting a forward slash / and a backslash \ between the 2 strings:
Code:
PciRoot(0x0)/Pci(0x1D,0x0)/Pci(0x0,0x0)/NVMe(0x1,18-CC-1C-49-8B-44-1B-00)/HD(1,GPT,DF3F0348-A4F8- 4A34-9C86-963B0E98F2BE,0x800,0x54747)/\EFI\Microsoft\Boot\bootmgfw.efi

Note: There are no spaces anywhere in the string.

Note: TextMode=False and Arguments empty in the Windows entry. Important!
 
Last edited:
Joined
Dec 10, 2010
Messages
736
Motherboard
Gigabyte Z390 Aorus Elite
CPU
i9-9900K
Graphics
RX 580
Mobile Phone
  1. iOS
It can work because, if data, is 4 bits (02687747) and decimal is without the leading zero. But if you read in the OpenCore configuration PDF you will see that the type must be number.
scanpolicy.png

I think it's a good idea to follow authors' guidelines.
 

msh

Joined
Oct 31, 2013
Messages
244
Motherboard
Gigabyte GA-Z97X-UD3H
CPU
i5-4690S
Graphics
HD 4600
Mobile Phone
  1. Android
It can work because, if data, is 4 bits (02687747) and decimal is without the leading zero. But if you read in the OpenCore configuration PDF you will see that the type must be number.
View attachment 520378
I think it's a good idea to follow authors' guidelines.
Ok, thanks and I will make the change.
 
Top