mirror of
https://github.com/Metabolix/HackBGRT.git
synced 2026-04-10 20:22:12 -07:00
Suggest booting to FW to enable HackBGRT
This commit is contained in:
27
src/Setup.cs
27
src/Setup.cs
@@ -71,6 +71,7 @@ public class Setup {
|
|||||||
"disable",
|
"disable",
|
||||||
"uninstall",
|
"uninstall",
|
||||||
"boot-to-fw",
|
"boot-to-fw",
|
||||||
|
"ask-to-boot-to-fw",
|
||||||
"show-boot-log",
|
"show-boot-log",
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -813,6 +814,26 @@ public class Setup {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ask if the user wants to boot to the UEFI setup.
|
||||||
|
*/
|
||||||
|
protected void AskToBootToFW() {
|
||||||
|
WriteLine();
|
||||||
|
WriteLine("Sometimes HackBGRT needs to be enabled manually in the UEFI setup.");
|
||||||
|
WriteLine("You can do that now, or later if you notice that HackBGRT isn't working.");
|
||||||
|
WriteLine("Find 'Boot options' or something similar and move HackBGRT before Windows.");
|
||||||
|
if (!Efi.CanBootToFW()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
WriteLine("Do you want to reboot and enter the UEFI setup now? (Y/N)");
|
||||||
|
var k = Console.ReadKey().Key;
|
||||||
|
Log($"User input: {k}");
|
||||||
|
WriteLine();
|
||||||
|
if (k == ConsoleKey.Y) {
|
||||||
|
BootToFW();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Detect the EFI architecture.
|
* Detect the EFI architecture.
|
||||||
*/
|
*/
|
||||||
@@ -935,9 +956,9 @@ public class Setup {
|
|||||||
Configure();
|
Configure();
|
||||||
}
|
}
|
||||||
if (k == ConsoleKey.I) {
|
if (k == ConsoleKey.I) {
|
||||||
RunPrivilegedActions(new string[] { "disable", "install", "enable-bcdedit" });
|
RunPrivilegedActions(new string[] { "disable", "install", "enable-bcdedit", "ask-to-boot-to-fw" });
|
||||||
} else if (k == ConsoleKey.J) {
|
} else if (k == ConsoleKey.J) {
|
||||||
RunPrivilegedActions(new string[] { "disable", "install", "enable-entry" });
|
RunPrivilegedActions(new string[] { "disable", "install", "enable-entry", "ask-to-boot-to-fw" });
|
||||||
} else if (k == ConsoleKey.O) {
|
} else if (k == ConsoleKey.O) {
|
||||||
RunPrivilegedActions(new string[] { "disable", "install", "enable-overwrite" });
|
RunPrivilegedActions(new string[] { "disable", "install", "enable-overwrite" });
|
||||||
} else if (k == ConsoleKey.F) {
|
} else if (k == ConsoleKey.F) {
|
||||||
@@ -1050,6 +1071,8 @@ public class Setup {
|
|||||||
Disable();
|
Disable();
|
||||||
} else if (arg == "uninstall") {
|
} else if (arg == "uninstall") {
|
||||||
Uninstall();
|
Uninstall();
|
||||||
|
} else if (arg == "ask-to-boot-to-fw") {
|
||||||
|
AskToBootToFW();
|
||||||
} else if (arg == "boot-to-fw") {
|
} else if (arg == "boot-to-fw") {
|
||||||
BootToFW();
|
BootToFW();
|
||||||
} else if (arg == "show-boot-log") {
|
} else if (arg == "show-boot-log") {
|
||||||
|
|||||||
Reference in New Issue
Block a user