mirror of
https://github.com/Metabolix/HackBGRT.git
synced 2025-12-07 09:36:10 -08:00
Check for HackBGRT string when disabling old version
This commit is contained in:
@@ -120,7 +120,7 @@ public class Setup: SetupHelper {
|
|||||||
byte[] data = File.ReadAllBytes(Path);
|
byte[] data = File.ReadAllBytes(Path);
|
||||||
Exists = true;
|
Exists = true;
|
||||||
string tmp = System.Text.Encoding.ASCII.GetString(data);
|
string tmp = System.Text.Encoding.ASCII.GetString(data);
|
||||||
if (tmp.IndexOf("HackBGRT") >= 0) {
|
if (tmp.IndexOf("HackBGRT") >= 0 || tmp.IndexOf("HackBgrt") >= 0) {
|
||||||
Type = BootLoaderType.Own;
|
Type = BootLoaderType.Own;
|
||||||
} else if (tmp.IndexOf("Microsoft Corporation") >= 0) {
|
} else if (tmp.IndexOf("Microsoft Corporation") >= 0) {
|
||||||
Type = BootLoaderType.MS;
|
Type = BootLoaderType.MS;
|
||||||
@@ -240,7 +240,7 @@ public class Setup: SetupHelper {
|
|||||||
*/
|
*/
|
||||||
protected void RestoreMsLoader() {
|
protected void RestoreMsLoader() {
|
||||||
var MsLoader = new BootLoaderInfo(Esp.MsLoaderPath);
|
var MsLoader = new BootLoaderInfo(Esp.MsLoaderPath);
|
||||||
if (MsLoader.Type != BootLoaderType.MS) {
|
if (MsLoader.Type == BootLoaderType.Own) {
|
||||||
var MsLoaderBackup = new BootLoaderInfo(BackupLoaderPath);
|
var MsLoaderBackup = new BootLoaderInfo(BackupLoaderPath);
|
||||||
if (!MsLoader.ReplaceWith(MsLoaderBackup)) {
|
if (!MsLoader.ReplaceWith(MsLoaderBackup)) {
|
||||||
throw new SetupException("Couldn't restore the old MS loader.");
|
throw new SetupException("Couldn't restore the old MS loader.");
|
||||||
|
|||||||
Reference in New Issue
Block a user