Improve output and README for BCDEdit errors

This commit is contained in:
Lauri Kenttä
2025-04-11 20:44:20 +03:00
parent a1f6297759
commit ffa3e335ea
2 changed files with 8 additions and 4 deletions

View File

@@ -85,6 +85,10 @@ If you copy an image file to ESP manually, note that the image must be a 24-bit
## Troubleshooting
### BCDEdit failed
You can first try the other installation option in the menu. If it doesn't work either, your computer might have a problem. Open Command Prompt and figure out why `bcdedit /enum firmware` fails. In some cases, disabling antivirus, checking the hard disk or searching for 'how to fix 0x800703EE' may help.
### Verification failed, Security violation
This is part of the setup on first boot. Make sure you have read and understood [shim.md](shim.md).

View File

@@ -455,12 +455,12 @@ public class Setup {
}
var bcdeditEnum = Execute("bcdedit", "/enum firmware");
if (bcdeditEnum.ExitCode != 0) {
WriteLine("BCDEdit is not working. Fix it or try another method.");
if (bcdeditEnum.Output != null) {
var lastLine = bcdeditEnum.Output.Split("\n".ToCharArray()).Last();
WriteLine($"BCDEdit output: {lastLine}");
WriteLine("Disable antivirus, check your hard disk, or search 'how to fix 0x800703EE'.");
var lines = bcdeditEnum.Output.Split("\n".ToCharArray());
var lastLine = lines.Select(s => s != "").Last();
WriteLine($"BCDEdit failed with: {lastLine}");
}
WriteLine("BCDEdit failed. See README for further information.");
throw new SetupException("Failed to enable HackBGRT with BCDEdit!");
}
try {