You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
95 lines
3.8 KiB
95 lines
3.8 KiB
#include <GUIConstantsEx.au3> |
|
#include <GuiConstants.au3> |
|
#include <file.au3> |
|
#NoTrayIcon |
|
#RequireAdmin |
|
#pragma compile(Stripper, True) |
|
#pragma compile(ProductVersion, 3.0.1) |
|
#pragma compile(ProductName, "Change bootLoader") |
|
#pragma compile(FileDescription, CBL) |
|
#pragma compile(LegalCopyright, paravis.ru@2024) |
|
#pragma compile(CompanyName, paravis.ru@2024) |
|
Opt("ExpandEnvStrings", 1) |
|
$sDisk = StringLeft(@ScriptDir, 2) |
|
$boot = ($sDisk & "\efi\Paravis\Boot") |
|
$bootice = ($sDisk & "\efi\Paravis\Boot\bootice.exe") |
|
$main = GUICreate("Change BootLoader", 390, 125, 318, 213) |
|
GUICtrlCreateGroup("Legacy BIOS", 3, 3, 384, 61) |
|
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") |
|
$xor = GUICtrlCreateButton("Install XorBoot", 8, 20, 121, 33) |
|
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") |
|
$bmgr = GUICtrlCreateButton("Install Bootmgr", 134, 20, 121, 33) |
|
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") |
|
$g4d = GUICtrlCreateButton("Install Grub4Dos", 261, 20, 121, 33) |
|
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") |
|
GUICtrlCreateGroup("", -99, -99, 1, 1) |
|
GUICtrlCreateGroup("UEFI", 3, 62, 384, 61) |
|
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") |
|
$bmgru = GUICtrlCreateButton("Install Bootmgr (SecureBoot ON)", 8, 80, 180, 33) |
|
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") |
|
$xoru = GUICtrlCreateButton("Install Xorboot (SecureBoot OFF)", 200, 80, 180, 33) |
|
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma") |
|
GUISetState(@SW_SHOW, $main) |
|
Func _hide() |
|
GUICtrlSetState($xor, $gui_disable) |
|
GUICtrlSetState($bmgr, $gui_disable) |
|
GUICtrlSetState($g4d, $gui_disable) |
|
GUICtrlSetState($bmgru, $gui_disable) |
|
GUICtrlSetState($xoru, $gui_disable) |
|
EndFunc |
|
Func _show() |
|
GUICtrlSetState($xor, $gui_enable) |
|
GUICtrlSetState($bmgr, $gui_enable) |
|
GUICtrlSetState($g4d, $gui_enable) |
|
GUICtrlSetState($bmgru, $gui_enable) |
|
GUICtrlSetState($xoru, $gui_enable) |
|
EndFunc |
|
While 1 |
|
Switch GUIGetMsg() |
|
Case $gui_event_close |
|
ExitLoop |
|
Case $xor |
|
_hide() |
|
FileDelete($sDisk & "\bootmgr") |
|
FileDelete($sDisk & "\grldr") |
|
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($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($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") |
|
FileCopy($sDisk & "\efi\Paravis\Boot\mgr\UEFI\bootx64.efi", $sDisk & "\efi\boot\bootx64.efi") |
|
FileCopy($sDisk & "\efi\Paravis\Boot\mgr\UEFI\bootia32.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") |
|
FileCopy($sDisk & "\efi\Paravis\Boot\xor\UEFIx64\bootx64.efi", $sDisk & "\efi\boot\bootx64.efi") |
|
FileCopy($sDisk & "\efi\Paravis\Boot\xor\UEFIx86\bootia32.efi", $sDisk & "\efi\boot\bootia32.efi") |
|
MsgBox(0 + 64 + 262144, "UEFI Xorboot", "Bootloader successfully changed!") |
|
_show() |
|
EndSwitch |
|
WEnd |