paravis
2 years ago
1 changed files with 232 additions and 0 deletions
@ -0,0 +1,232 @@ |
|||||||
|
#include <Array.au3> |
||||||
|
#include <File.au3> |
||||||
|
#include <GUIConstantsEx.au3> |
||||||
|
#include <WindowsConstants.au3> |
||||||
|
#include <WinAPI.au3> |
||||||
|
#NoTrayIcon |
||||||
|
|
||||||
|
Global $aArray = DriveGetDrive($DT_ALL), $sDisk, $iBtn11, $iBtn10, $iBtn7, $PathEr, $sDisk, $sDiskS, $UN11, $UN10x64, $UN10x86, $UN7x64, $UN7x86 |
||||||
|
|
||||||
|
For $i = 1 To $aArray[0] |
||||||
|
$aFileList = _FileListToArrayRec($aArray[$i] & "\WindowsESD", "NOT.DEL", $FLTAR_FILES, $FLTAR_RECUR, $FLTAR_NOSORT, $FLTAR_FULLPATH) |
||||||
|
If Not @error Then |
||||||
|
$sDisk = $aArray[$i] & "\WindowsESD\" |
||||||
|
$PathEr = 1 |
||||||
|
ExitLoop |
||||||
|
EndIf |
||||||
|
Next |
||||||
|
|
||||||
|
For $i = 1 To $aArray[0] |
||||||
|
$aFileList = _FileListToArrayRec($aArray[$i] & "\efi\Paravis\Windows", "NOT.DEL", $FLTAR_FILES, $FLTAR_RECUR, $FLTAR_NOSORT, $FLTAR_FULLPATH) |
||||||
|
If Not @error Then |
||||||
|
$sDisk = $aArray[$i] & "\efi\Paravis\Windows\" |
||||||
|
$PathEr += 1 |
||||||
|
ExitLoop |
||||||
|
EndIf |
||||||
|
Next |
||||||
|
|
||||||
|
If $PathEr > 1 Then |
||||||
|
MsgBox(48, 'Предупреждение!', 'В системе больше одной папки с образами. Проверьте и удалите лишние (читаем ReadMe.txt). Система будет перезагружена.') |
||||||
|
Exit |
||||||
|
EndIf |
||||||
|
|
||||||
|
For $i = 1 To $aArray[0] |
||||||
|
$aFileList = _FileListToArrayRec($aArray[$i] & "\efi\Paravis\Boot\kitchen", "NOT.DEL", $FLTAR_FILES, $FLTAR_RECUR, $FLTAR_NOSORT, $FLTAR_FULLPATH) |
||||||
|
If Not @error Then |
||||||
|
$sDiskS = $aArray[$i] & "\efi\Paravis\Boot\" |
||||||
|
ExitLoop |
||||||
|
EndIf |
||||||
|
Next |
||||||
|
|
||||||
|
$ESD11 = $sDisk & "install_11.esd" |
||||||
|
$ESD10x64 = $sDisk & "install_10_x64.esd" |
||||||
|
$ESD10x86 = $sDisk & "install_10_x86.esd" |
||||||
|
$ESD7x64 = $sDisk & "install_7_x64.esd" |
||||||
|
$ESD7x86 = $sDisk & "install_7_x86.esd" |
||||||
|
If FileExists ($sDisk & "autounattend\unattend11.xml") Then |
||||||
|
$UN11 = " /unattend:" & $sDisk & "autounattend\unattend11.xml" |
||||||
|
Else |
||||||
|
$UN11 = '' |
||||||
|
EndIf |
||||||
|
If FileExists ($sDisk & "autounattend\unattend10x64.xml") Then |
||||||
|
$UN10x64 = " /unattend:" & $sDisk & "autounattend\unattend10x64.xml" |
||||||
|
Else |
||||||
|
$UN10x64 = '' |
||||||
|
EndIf |
||||||
|
If FileExists ($sDisk & "autounattend\unattend10x86.xml") Then |
||||||
|
$UN10x86 = " /unattend:" & $sDisk & "autounattend\unattend10x86.xml" |
||||||
|
Else |
||||||
|
$UN10x86 = '' |
||||||
|
EndIf |
||||||
|
If FileExists ($sDisk & "autounattend\unattend7x64.xml") Then |
||||||
|
$UN7x64 = " /unattend:" & $sDisk & "autounattend\unattend7x64.xml" |
||||||
|
Else |
||||||
|
$UN7x64 = '' |
||||||
|
EndIf |
||||||
|
If FileExists ($sDisk & "autounattend\unattend7x86.xml") Then |
||||||
|
$UN7x86 = " /unattend:" & $sDisk & "autounattend\unattend7x86.xml" |
||||||
|
Else |
||||||
|
$UN7x86 = '' |
||||||
|
EndIf |
||||||
|
$OEM11 = " /m:" & $sDisk & "$OEM11$" |
||||||
|
$OEM10x64 = " /m:" & $sDisk & "$OEM10x64$" |
||||||
|
$OEM10x86 = " /m:" & $sDisk & "$OEM10x86$" |
||||||
|
$OEM7x64 = " /m:" & $sDisk & "$OEM7x64$" |
||||||
|
$OEM7x86 = " /m:" & $sDisk & "$OEM7x86$" |
||||||
|
$setup = "X:\sources\setup.exe /installfrom:" |
||||||
|
|
||||||
|
|
||||||
|
If FileExists(@WindowsDir & "\SYSWOW64") Then |
||||||
|
RunWait($sDiskS & "src_x64.exe auto2") |
||||||
|
_x64() |
||||||
|
Else |
||||||
|
RunWait($sDiskS & "src_x86.exe auto2") |
||||||
|
_x86() |
||||||
|
EndIf |
||||||
|
|
||||||
|
Func _x86() |
||||||
|
$detect_efi = EnvGet("firmware_type") |
||||||
|
If $detect_efi = "Legacy" Then |
||||||
|
$hGUI = GUICreate("Windows Setup by Paravis", 410, 250, -1, -1, $WS_POPUP, $WS_EX_LAYERED) |
||||||
|
GUISetBkColor(0xABCDEF) |
||||||
|
GUICtrlSetState(-1, $GUI_DISABLE) |
||||||
|
GUISetState() |
||||||
|
_WinAPI_SetLayeredWindowAttributes($hGUI, 0xABCDEF, 255) |
||||||
|
$font = "Segoe UI" |
||||||
|
$iBtn10 = GUICtrlCreateButton("Установить Windows 10", 5, 5, 350, 40) |
||||||
|
GUICtrlSetFont(-1, 16, 500, 0, $font) |
||||||
|
$iBtn7 = GUICtrlCreateButton("Установить Windows 7", 5, 45, 350, 40) |
||||||
|
GUICtrlSetFont(-1, 16, 500, 0, $font) |
||||||
|
$iBtnTC = GUICtrlCreateButton("Запустить Total Commander", 5, 105, 350, 40) |
||||||
|
GUICtrlSetFont(-1, 16, 500, 0, $font) |
||||||
|
$iBtnR = GUICtrlCreateButton("Перезагрузка", 5, 145, 350, 40) |
||||||
|
GUICtrlSetFont(-1, 16, 500, 0, $font) |
||||||
|
GUISetState() |
||||||
|
|
||||||
|
_checkesd86() |
||||||
|
|
||||||
|
While 1 |
||||||
|
Switch GUIGetMsg() |
||||||
|
Case $GUI_EVENT_CLOSE |
||||||
|
;~ exit |
||||||
|
Case $iBtn10 |
||||||
|
GUISetState(@SW_HIDE) |
||||||
|
RunWait($setup & $ESD10x86 & $OEM10x86 & $UN10x86) |
||||||
|
GUISetState(@SW_SHOW) |
||||||
|
Case $iBtn7 |
||||||
|
GUISetState(@SW_HIDE) |
||||||
|
RunWait($setup & $ESD7x86 & $OEM7x86 & $UN7x86) |
||||||
|
GUISetState(@SW_SHOW) |
||||||
|
Case $iBtnTC |
||||||
|
GUISetState(@SW_HIDE) |
||||||
|
RunWait($sDiskS & 'kitchen\TotalCommander\TOTALCMD.EXE /I="%%COMMANDER_PATH%%\tcmdmain.ini"') |
||||||
|
GUISetState(@SW_SHOW) |
||||||
|
Case $iBtnR |
||||||
|
Exit |
||||||
|
EndSwitch |
||||||
|
WEnd |
||||||
|
Else |
||||||
|
If Not FileExists($sDisk & "install_10_x86.esd") Then |
||||||
|
MsgBox(48, 'Предупреждение!', 'Не найден образ Windows 10 x86. Система будет перезагружена.') |
||||||
|
Exit |
||||||
|
EndIf |
||||||
|
$hGUI = GUICreate("Windows Setup by Paravis", 360, 190, -1, -1, $WS_POPUP, $WS_EX_LAYERED) |
||||||
|
GUISetBkColor(0xABCDEF) |
||||||
|
GUICtrlSetState(-1, $GUI_DISABLE) |
||||||
|
GUISetState() |
||||||
|
_WinAPI_SetLayeredWindowAttributes($hGUI, 0xABCDEF, 255) |
||||||
|
$font = "Segoe UI" |
||||||
|
$iBtn10 = GUICtrlCreateButton("Установить Windows 10", 5, 5, 350, 40) |
||||||
|
GUICtrlSetFont(-1, 16, 500, 0, $font) |
||||||
|
$iBtnTC = GUICtrlCreateButton("Запустить Total Commander", 5, 65, 350, 40) |
||||||
|
GUICtrlSetFont(-1, 16, 500, 0, $font) |
||||||
|
$iBtnR = GUICtrlCreateButton("Перезагрузка", 5, 105, 350, 40) |
||||||
|
GUICtrlSetFont(-1, 16, 500, 0, $font) |
||||||
|
GUISetState() |
||||||
|
|
||||||
|
While 1 |
||||||
|
Switch GUIGetMsg() |
||||||
|
Case $GUI_EVENT_CLOSE |
||||||
|
;~ exit |
||||||
|
Case $iBtn10 |
||||||
|
GUISetState(@SW_HIDE) |
||||||
|
RunWait($setup & $ESD10x86 & $OEM10x86 & $UN10x86) |
||||||
|
GUISetState(@SW_SHOW) |
||||||
|
Case $iBtnTC |
||||||
|
GUISetState(@SW_HIDE) |
||||||
|
RunWait($sDiskS & 'kitchen\TotalCommander\TOTALCMD.EXE /I="%%COMMANDER_PATH%%\tcmdmain.ini"') |
||||||
|
GUISetState(@SW_SHOW) |
||||||
|
Case $iBtnR |
||||||
|
Exit |
||||||
|
EndSwitch |
||||||
|
WEnd |
||||||
|
EndIf |
||||||
|
EndFunc |
||||||
|
|
||||||
|
Func _x64() |
||||||
|
$hGUI = GUICreate("Windows Setup by Paravis", 410, 250, -1, -1, $WS_POPUP, $WS_EX_LAYERED) |
||||||
|
GUISetBkColor(0xABCDEF) |
||||||
|
GUICtrlSetState(-1, $GUI_DISABLE) |
||||||
|
GUISetState() |
||||||
|
_WinAPI_SetLayeredWindowAttributes($hGUI, 0xABCDEF, 255) |
||||||
|
$font = "Segoe UI" |
||||||
|
$iBtn11 = GUICtrlCreateButton("Установить Windows 11", 5, 5, 350, 40) |
||||||
|
GUICtrlSetFont(-1, 16, 500, 0, $font) |
||||||
|
$iBtn10 = GUICtrlCreateButton("Установить Windows 10", 5, 45, 350, 40) |
||||||
|
GUICtrlSetFont(-1, 16, 500, 0, $font) |
||||||
|
$iBtn7 = GUICtrlCreateButton("Установить Windows 7", 5, 85, 350, 40) |
||||||
|
GUICtrlSetFont(-1, 16, 500, 0, $font) |
||||||
|
$iBtnTC = GUICtrlCreateButton("Запустить Total Commander", 5, 145, 350, 40) |
||||||
|
GUICtrlSetFont(-1, 16, 500, 0, $font) |
||||||
|
$iBtnR = GUICtrlCreateButton("Перезагрузка", 5, 185, 350, 40) |
||||||
|
GUICtrlSetFont(-1, 16, 500, 0, $font) |
||||||
|
GUISetState() |
||||||
|
|
||||||
|
_checkesd64() |
||||||
|
|
||||||
|
While 1 |
||||||
|
Switch GUIGetMsg() |
||||||
|
Case $GUI_EVENT_CLOSE |
||||||
|
;~ exit |
||||||
|
Case $iBtn11 |
||||||
|
GUISetState(@SW_HIDE) |
||||||
|
RunWait($setup & $ESD11 & $OEM11 & $UN11) |
||||||
|
GUISetState(@SW_SHOW) |
||||||
|
Case $iBtn10 |
||||||
|
GUISetState(@SW_HIDE) |
||||||
|
RunWait($setup & $ESD10x64 & $OEM10x64 & $UN10x64) |
||||||
|
GUISetState(@SW_SHOW) |
||||||
|
Case $iBtn7 |
||||||
|
GUISetState(@SW_HIDE) |
||||||
|
RunWait($setup & $ESD7x64 & $OEM7x64 & $UN7x64) |
||||||
|
GUISetState(@SW_SHOW) |
||||||
|
Case $iBtnTC |
||||||
|
GUISetState(@SW_HIDE) |
||||||
|
RunWait($sDiskS & 'kitchen\TotalCommander\TOTALCMD64.EXE /I="%%COMMANDER_PATH%%\tcmdmain.ini"') |
||||||
|
GUISetState(@SW_SHOW) |
||||||
|
Case $iBtnR |
||||||
|
Exit |
||||||
|
EndSwitch |
||||||
|
WEnd |
||||||
|
EndFunc |
||||||
|
|
||||||
|
Func _checkesd64() |
||||||
|
If Not FileExists($sDisk & "install_11.esd") Then |
||||||
|
GUICtrlSetState($iBtn11, $GUI_DISABLE) |
||||||
|
EndIf |
||||||
|
If Not FileExists($sDisk & "install_10_x64.esd") Then |
||||||
|
GUICtrlSetState($iBtn10, $GUI_DISABLE) |
||||||
|
EndIf |
||||||
|
If Not FileExists($sDisk & "install_7_x64.esd") Then |
||||||
|
GUICtrlSetState($iBtn7, $GUI_DISABLE) |
||||||
|
EndIf |
||||||
|
EndFunc |
||||||
|
|
||||||
|
Func _checkesd86() |
||||||
|
If Not FileExists($sDisk & "install_10_x86.esd") Then |
||||||
|
GUICtrlSetState($iBtn10, $GUI_DISABLE) |
||||||
|
EndIf |
||||||
|
If Not FileExists($sDisk & "install_7_x86.esd") Then |
||||||
|
GUICtrlSetState($iBtn7, $GUI_DISABLE) |
||||||
|
EndIf |
||||||
|
EndFunc |
Loading…
Reference in new issue