Don't require Windows Boot Manager entry if it's not needed

This commit is contained in:
Lauri Kenttä
2025-02-22 13:28:02 +02:00
parent 1946765680
commit 734ea21308

View File

@@ -206,9 +206,6 @@ public class EfiBootEntries {
*/
public void MakeOwnEntry(bool alwaysCopyFromMS, bool dryRun = false) {
var (msNum, msVar, msEntry) = WindowsEntry;
if (msEntry == null) {
throw new Exception("MakeOwnEntry: Windows Boot Manager not found.");
}
var (ownNum, ownVar, ownEntry) = OwnEntry;
if (ownVar == null) {
(ownNum, ownVar, ownEntry) = FreeEntry;
@@ -236,6 +233,9 @@ public class EfiBootEntries {
ownEntry.Arguments = new byte[0];
}
} else {
if (msEntry == null) {
throw new Exception("MakeOwnEntry: Windows Boot Manager not found.");
}
ownEntry = msEntry;
ownEntry.Arguments = new byte[0];
ownEntry.Label = "HackBGRT";