Browse Source

Переделано под новые реалии сборки

master
paravis 2 years ago
parent
commit
bbcacfda2f
  1. 76
      Change_bootloader.au3

76
Change_bootloader.au3

@ -13,7 +13,8 @@
Opt("ExpandEnvStrings", 1)
$sDisk = StringLeft(@ScriptDir, 3)
$sDisk = StringLeft(@ScriptDir, 2)
$boot = ($sDisk & "efi\Paravis\Boot")
$kitchen = ($sDisk & "efi\Paravis\Boot\kitchen")
$bootice = ($sDisk & "efi\Paravis\Boot\kitchen\bootice.exe")
$main = GUICreate("Change BootLoader", 390, 125, 318, 213)
@ -59,66 +60,61 @@ While 1
_hide()
FileDelete($sDisk & "\bootmgr")
FileDelete($sDisk & "\grldr")
FileCopy($kitchen & "\13", $sDisk & "efi\Paravis\boot\13", 1)
FileCopy($kitchen & "\1313", $sDisk & "efi\Paravis\boot\1313", 1)
FileCopy($kitchen & "\xbt.bin", $sDisk & "efi\Paravis\boot\Paravis", 1)
RunWait($bootice & " /DEVICE=" & $sDisk & " /mbr /restore /file=xbt.bin /keep_dpt /quiet")
RunWait($bootice & " /DEVICE=" & $sDisk & " /pbr /restore /file=xbt_p.bin /keep_bpb /quiet")
RunWait($bootice & " /DEVICE=" & $sDisk & " /mbr /restore /file=" & $boot & "\xor\xmbr.bin /keep_dpt /quiet")
RunWait($bootice & " /DEVICE=" & $sDisk & " /pbr /restore /file=" & $boot & "\xor\xpbr.bin /keep_bpb /quiet")
MsgBox(0 + 64 + 262144, "Xorboot", "bootloader successfully changed!")
_show()
Case $bmgr
_hide()
FileDelete(@ScriptDir & "Paravis")
FileDelete($sDisk & "bootmgr")
FileDelete($sDisk & "grldr")
FileCopy($kitchen & "\bootmgr", $sDisk & "bootmgr")
FileCopy($kitchen & "\bootmgr", $sDisk & "efi\Paravis\boot\Paravis", 1)
FileDelete($sDisk & "\bootmgr")
FileDelete($sDisk & "\grldr")
FileCopy($boot & "\mgr\bootmgr", $sDisk & "bootmgr")
RunWait($bootice & " /DEVICE=" & $sDisk & " /mbr /install /type=nt60 /quiet")
RunWait($bootice & " /DEVICE=" & $sDisk & " /pbr /install /type=bootmgr /quiet")
MsgBox(0 + 64 + 262144, "Bootmgr", "bootloader successfully changed!")
_show()
Case $g4d
_hide()
FileDelete($sDisk & "bootmgr")
FileDelete($sDisk & "grldr")
FileCopy($kitchen & "\grldr", $sDisk & "grldr")
FileCopy($kitchen & "\grldr", $sDisk & "efi\Paravis\boot\Paravis", 1)
FileDelete($sDisk & "\bootmgr")
FileDelete($sDisk & "\grldr")
FileCopy($boot & "\g4d\grldr", $sDisk & "grldr")
RunWait($bootice & " /DEVICE=" & $sDisk & " /mbr /install /type=GRUB4DOS /quiet")
RunWait($bootice & " /DEVICE=" & $sDisk & " /pbr /install /type=GRUB4DOS /quiet")
MsgBox(0 + 64 + 262144, "Grub4Dos", "Bootloader successfully changed!")
_show()
Case $bmgru
_hide()
FileDelete($sDisk & "efi\boot\bootx64.efi")
FileDelete($sDisk & "efi\boot\bootia32.efi")
FileDelete($sDisk & "efi\boot\bx86.pf")
FileDelete($sDisk & "efi\boot\hx86.pf")
FileDelete($sDisk & "efi\boot\x86.pf")
FileDelete($sDisk & "efi\boot\bx64.pf")
FileDelete($sDisk & "efi\boot\hx64.pf")
FileDelete($sDisk & "efi\boot\x64.pf")
FileCopy($kitchen & "\UEFIx64\mgrx64.efi", $sDisk & "efi\boot\bootx64.efi")
FileCopy($kitchen & "\UEFIx86\mgrx86.efi", $sDisk & "efi\boot\bootia32.efi")
FileDelete($sDisk & "\efi\boot\bootx64.efi")
FileDelete($sDisk & "\efi\boot\bootia32.efi")
FileDelete($sDisk & "\efi\boot\bx86.pf")
FileDelete($sDisk & "\efi\boot\hx86.pf")
FileDelete($sDisk & "\efi\boot\x86.pf")
FileDelete($sDisk & "\efi\boot\bx64.pf")
FileDelete($sDisk & "\efi\boot\hx64.pf")
FileDelete($sDisk & "\efi\boot\x64.pf")
FileCopy($kitchen & "\UEFIx64\mgrx64.efi", $sDisk & "\efi\boot\bootx64.efi")
FileCopy($kitchen & "\UEFIx86\mgrx86.efi", $sDisk & "\efi\boot\bootia32.efi")
MsgBox(0 + 64 + 262144, "UEFI Bootmgr", "Bootloader successfully changed!")
_show()
Case $xoru
_hide()
FileDelete($sDisk & "efi\boot\bootx64.efi")
FileDelete($sDisk & "efi\boot\bootia32.efi")
FileDelete($sDisk & "efi\boot\bx86.pf")
FileDelete($sDisk & "efi\boot\hx86.pf")
FileDelete($sDisk & "efi\boot\x86.pf")
FileDelete($sDisk & "efi\boot\bx64.pf")
FileDelete($sDisk & "efi\boot\hx64.pf")
FileDelete($sDisk & "efi\boot\x64.pf")
FileCopy($kitchen & "\UEFIx64\bootx64.efi", $sDisk & "efi\boot\bootx64.efi")
FileCopy($kitchen & "\UEFIx86\bootia32.efi", $sDisk & "efi\boot\bootia32.efi")
FileCopy($kitchen & "\UEFIx86\bx86.pf", $sDisk & "efi\boot\bx86.pf")
FileCopy($kitchen & "\UEFIx86\hx86.pf", $sDisk & "efi\boot\hx86.pf")
FileCopy($kitchen & "\UEFIx86\x86.pf", $sDisk & "efi\boot\x86.pf")
FileCopy($kitchen & "\UEFIx64\bx64.pf", $sDisk & "efi\boot\bx64.pf")
FileCopy($kitchen & "\UEFIx64\hx64.pf", $sDisk & "efi\boot\hx64.pf")
FileCopy($kitchen & "\UEFIx64\x64.pf", $sDisk & "efi\boot\x64.pf")
FileDelete($sDisk & "\efi\boot\bootx64.efi")
FileDelete($sDisk & "\efi\boot\bootia32.efi")
FileDelete($sDisk & "\efi\boot\bx86.pf")
FileDelete($sDisk & "\efi\boot\hx86.pf")
FileDelete($sDisk & "\efi\boot\x86.pf")
FileDelete($sDisk & "\efi\boot\bx64.pf")
FileDelete($sDisk & "\efi\boot\hx64.pf")
FileDelete($sDisk & "\efi\boot\x64.pf")
FileCopy($kitchen & "\UEFIx64\bootx64.efi", $sDisk & "\efi\boot\bootx64.efi")
FileCopy($kitchen & "\UEFIx86\bootia32.efi", $sDisk & "\efi\boot\bootia32.efi")
FileCopy($kitchen & "\UEFIx86\bx86.pf", $sDisk & "\efi\boot\bx86.pf")
FileCopy($kitchen & "\UEFIx86\hx86.pf", $sDisk & "\efi\boot\hx86.pf")
FileCopy($kitchen & "\UEFIx86\x86.pf", $sDisk & "\efi\boot\x86.pf")
FileCopy($kitchen & "\UEFIx64\bx64.pf", $sDisk & "\efi\boot\bx64.pf")
FileCopy($kitchen & "\UEFIx64\hx64.pf", $sDisk & "\efi\boot\hx64.pf")
FileCopy($kitchen & "\UEFIx64\x64.pf", $sDisk & "\efi\boot\x64.pf")
MsgBox(0 + 64 + 262144, "UEFI Xorboot", "Bootloader successfully changed!")
_show()
EndSwitch

Loading…
Cancel
Save