#include #include #include #include #include #include #include #include #Region ### START Koda GUI section ### Form=E:\AutoIT\Bootpack Installer.kxf $Form1 = GUICreate("BOOTPACK UPDATER v1.0 Administrador", 433, 285, 571, 339, -1, BitOR($WS_EX_TOPMOST,$WS_EX_WINDOWEDGE)) $Label1 = GUICtrlCreateLabel("Dispositivo BOOTPACK", 15, 40, 324, 24) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") Global $ourDrive = "" Global $number_of_bootpack_drives = 0 Global $aArray = DriveGetDrive("REMOVABLE") If ($aArray = "") Then $Combo1 = GUICtrlCreateCombo("Dispositivo BOOTPACK não encontrado", 16, 64, 249, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) Else For $i = $aArray[0] To 1 Step -1 If DriveGetLabel($aArray[$i]) = "BOOTPACK_V4" then $letter = StringUpper($aArray[$i]) if $number_of_bootpack_drives = 0 then ;we create the combo since it doesn't exists $Combo1 = GUICtrlCreateCombo(StringUpper($letter), 16, 64, 249, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) $number_of_bootpack_drives = $number_of_bootpack_drives + 1 else ;if the combo already exists we update it to add the other drives letters GUICtrlSetData($Combo1, $letter) ; this will ADD $letter to the existing list of letters in the combo (it wont delete the existing letters in the list) $number_of_bootpack_drives = $number_of_bootpack_drives + 1 Endif EndIf Next Endif $Label2 = GUICtrlCreateLabel("Disco de Destino", 15, 128, 324, 24) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") $BUTTON1 = GUICtrlCreateButton("Começar", 16, 224, 129, 25) $Button2 = GUICtrlCreateButton("Atualizar", 282, 62, 129, 25) $Button3 = GUICtrlCreateButton("Sair", 282, 224, 129, 25) Global $ourDrive = "" Global $number_drives = 0 Global $bArray = DriveGetDrive("ALL") If ($bArray = "") Then $Combo2 = GUICtrlCreateCombo("", 16, 152, 249, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) Else For $i = $bArray[0] To 1 Step -1 $letter1 = StringUpper($bArray[$i]) $label = DriveGetLabel($bArray[$i]) if $number_drives = 0 then ;we create the combo since it doesn't exists $Combo2 = GUICtrlCreateCombo(StringUpper($letter1) & Consolewrite($label), 16, 152, 249, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) $number_drives = $number_drives + 1 else ;if the combo already exists we update it to add the other drives letters GUICtrlSetData($Combo2, $letter1 & Consolewrite($label)) ; this will ADD $letter to the existing list of letters in the combo (it wont delete the existing letters in the list) $number_drives = $number_drives + 1 Endif Next Endif GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### Dim $options, $dest, $source, $what, $prog, $runner $options = '/R:1 /W:1' $what = '/COPY:DAT /XJ /V /TEE /ETA /E /MIR' $prog = 'RoboCopy.exe' WHILE 1 $MSG=GUIGETMSG() SWITCH $MSG CASE $GUI_EVENT_CLOSE EXIT CASE $BUTTON1 $letter = GUICtrlRead($combo1,1) $letter1 = GUICtrlRead($combo2,1) $source = $letter & "\" & "boot" $dest = $letter1 & "\" & "BOOTPACK_V4\Bootpack Base\boot" $runner = $prog & ' "' & $source & '" "' & $dest & '" ' & $what & ' ' & $options RunWait(@ComSpec & " /c" & $runner, "", @SW_MINIMIZE) $source = $letter & "\" & "BootPack" $dest = $letter1 & "\" & "BOOTPACK_V4\Bootpack Base\BootPack" $runner = $prog & ' "' & $source & '" "' & $dest & '" ' & $what & ' ' & $options RunWait(@ComSpec & " /c" & $runner, "", @SW_MINIMIZE) $source = $letter & "\" & "EFI" $dest = $letter1 & "\" & "BOOTPACK_V4\Bootpack Base\EFI" $runner = $prog & ' "' & $source & '" "' & $dest & '" ' & $what & ' ' & $options RunWait(@ComSpec & " /c" & $runner, "", @SW_MINIMIZE) FileCopy($letter & "\" & "g2ldr.*", $letter1 & "BOOTPACK_V4\Bootpack Base", $FC_OVERWRITE) $source = $letter & "\" & "Winsetup\DRVS" $dest = $letter1 & "BOOTPACK_V4\SO's Base\DRVS" $runner = $prog & ' "' & $source & '" "' & $dest & '" ' & $what & ' ' & $options RunWait(@ComSpec & " /c" & $runner, "", @SW_MINIMIZE) $source = $letter & "\" & "Winsetup\OEM BRAND" $dest = $letter1 & "BOOTPACK_V4\SO's Base\OEM BRAND" $runner = $prog & ' "' & $source & '" "' & $dest & '" ' & $what & ' ' & $options RunWait(@ComSpec & " /c" & $runner, "", @SW_MINIMIZE) $source = $letter & "\" & "Winsetup\PROGS" $dest = $letter1 & "BOOTPACK_V4\SO's Base\PROGS" $runner = $prog & ' "' & $source & '" "' & $dest & '" ' & $what & ' ' & $options RunWait(@ComSpec & " /c" & $runner, "", @SW_MINIMIZE) $source = $letter & "\" & "Winsetup\UPDTS" $dest = $letter1 & "BOOTPACK_V4\SO's Base\UPDTS" $runner = $prog & ' "' & $source & '" "' & $dest & '" ' & $what & ' ' & $options RunWait(@ComSpec & " /c" & $runner, "", @SW_MINIMIZE) $source = $letter & "Winsetup\Vista" $dest = $letter1 & "BOOTPACK_V4\Vista" $runner = $prog & ' "' & $source & '" "' & $dest & '" ' & $what & ' ' & $options RunWait(@ComSpec & " /c" & $runner, "", @SW_MINIMIZE) $source = $letter & "Winsetup\Vista64" $dest = $letter1 & "BOOTPACK_V4\Vista64" $runner = $prog & ' "' & $source & '" "' & $dest & '" ' & $what & ' ' & $options RunWait(@ComSpec & " /c" & $runner, "", @SW_MINIMIZE) $source = $letter & "Winsetup\WIN7" $dest = $letter1 & "BOOTPACK_V4\WIN7" $runner = $prog & ' "' & $source & '" "' & $dest & '" ' & $what & ' ' & $options RunWait(@ComSpec & " /c" & $runner, "", @SW_MINIMIZE) $source = $letter & "Winsetup\WIN81" $dest = $letter1 & "BOOTPACK_V4\WIN81" $runner = $prog & ' "' & $source & '" "' & $dest & '" ' & $what & ' ' & $options RunWait(@ComSpec & " /c" & $runner, "", @SW_MINIMIZE) $source = $letter & "Winsetup\W10" $dest = $letter1 & "BOOTPACK_V4\W10" $runner = $prog & ' "' & $source & '" "' & $dest & '" ' & $what & ' ' & $options RunWait(@ComSpec & " /c" & $runner, "", @SW_MINIMIZE) $source = $letter & "Winsetup\W11" $dest = $letter1 & "BOOTPACK_V4\W11" $runner = $prog & ' "' & $source & '" "' & $dest & '" ' & $what & ' ' & $options RunWait(@ComSpec & " /c" & $runner, "", @SW_MINIMIZE) MsgBox($MB_SYSTEMMODAL, "", "Atualização concluida") CASE $BUTTON2 GUIDelete ($Form1) #Region ### START Koda GUI section ### Form=E:\AutoIT\Bootpack Installer.kxf $Form1 = GUICreate("BOOTPACK UPDATER v1.0 Administrador", 433, 285, 571, 339, -1, BitOR($WS_EX_TOPMOST,$WS_EX_WINDOWEDGE)) $Label1 = GUICtrlCreateLabel("Dispositivo BOOTPACK", 15, 40, 324, 24) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") Global $ourDrive = "" Global $number_of_bootpack_drives = 0 Global $aArray = DriveGetDrive("REMOVABLE") If ($aArray = "") Then $Combo1 = GUICtrlCreateCombo("Dispositivo BOOTPACK não encontrado", 16, 64, 249, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) Else For $i = $aArray[0] To 1 Step -1 If DriveGetLabel($aArray[$i]) = "BOOTPACK_V4" then $letter = StringUpper($aArray[$i]) if $number_of_bootpack_drives = 0 then ;we create the combo since it doesn't exists $Combo1 = GUICtrlCreateCombo(StringUpper($letter), 16, 64, 249, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) $number_of_bootpack_drives = $number_of_bootpack_drives + 1 else ;if the combo already exists we update it to add the other drives letters GUICtrlSetData($Combo1, $letter) ; this will ADD $letter to the existing list of letters in the combo (it wont delete the existing letters in the list) $number_of_bootpack_drives = $number_of_bootpack_drives + 1 Endif EndIf Next Endif $Label2 = GUICtrlCreateLabel("Disco de Destino", 15, 128, 324, 24) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") $BUTTON1 = GUICtrlCreateButton("Começar", 16, 224, 129, 25) $Button2 = GUICtrlCreateButton("Atualizar", 282, 62, 129, 25) $Button3 = GUICtrlCreateButton("Sair", 282, 224, 129, 25) Global $ourDrive = "" Global $number_drives = 0 Global $bArray = DriveGetDrive("ALL") If ($bArray = "") Then $Combo2 = GUICtrlCreateCombo("", 16, 152, 249, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) Else For $i = $bArray[0] To 1 Step -1 $letter1 = StringUpper($bArray[$i]) if $number_drives = 0 then ;we create the combo since it doesn't exists $Combo2 = GUICtrlCreateCombo(StringUpper($letter1), 16, 152, 249, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) $number_drives = $number_drives + 1 else ;if the combo already exists we update it to add the other drives letters GUICtrlSetData($Combo2, $letter1) ; this will ADD $letter to the existing list of letters in the combo (it wont delete the existing letters in the list) $number_drives = $number_drives + 1 Endif Next Endif GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### CASE $BUTTON3 Exit ENDSWITCH WEnd Exit