mirror of
https://github.com/Metabolix/HackBGRT.git
synced 2026-04-10 12:12:18 -07:00
Only install the weirdly named loader if shim 15 is used
This commit is contained in:
@@ -421,7 +421,11 @@ public class Setup {
|
||||
if (!SkipShim) {
|
||||
InstallFile(shimSource, loaderDest);
|
||||
InstallFile(mmSource, $"mm{EfiArch}.efi");
|
||||
InstallFile(loaderSource, "\u4957\u444e\u574f\u0053\u0058"); // bytes "WINDOWS\0X\0" as UTF-16
|
||||
var shimContents = File.ReadAllBytes(shimSource);
|
||||
var shimContentsStr = System.Text.Encoding.ASCII.GetString(shimContents);
|
||||
if (shimContentsStr.IndexOf("Version: 15.") >= 0) {
|
||||
InstallFile(loaderSource, "\u4957\u444e\u574f\u0053\u0058"); // bytes "WINDOWS\0X\0" as UTF-16
|
||||
}
|
||||
loaderDest = $"grub{EfiArch}.efi";
|
||||
}
|
||||
InstallFile(loaderSource, loaderDest);
|
||||
|
||||
Reference in New Issue
Block a user