#RequireAdmin
#AutoIt3Wrapper_Res_Comment=Скрипт для автоматической установки минимального набора ПО
#include <GUIConstantsEx.au3>
#include <ButtonConstants.au3>
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListBoxConstants.au3>
#include <EditConstants.au3>
#NoTrayIcon
FileInstall("1.jpg","./",1)
Const $title= "ASI Script v0.2a"
$Window = GUICreate($title, 300, 300)
GUISetBkColor(0xE0FFFF)
GUICtrlCreatePic("1.jpg", 0, 0, 300, 250)
$OKButton = GUICtrlCreateButton("Запустить", 40, 250, 70)
$EXITButton = GUICtrlCreateButton("Закрыть", 190, 250, 70)
$BackButton = GUICtrlCreateButton("Назад", 115, 250, 70)
Local $FileMenu, $FileItem, $FileItem2
$ServerDir = "\\debian-server\FILES\SOFT\MINIMUM_INSTALL\Distr"
$x86 = "\\debian-server\FILES\SOFT\Office2010x32\Office2010x32"
$x64 = "\\debian-server\FILES\SOFT\Office2010x64\Office2010x64"
$OutDir = "D:\"
$InstDir = "D:\Distr\"
$Ping = ping("debian-server",1)
$files = "Files"
$font = "Comic Sans MS"
$FileMenu = GUICtrlCreateMenu("&Файл")
$FileItem = GUICtrlCreateMenuItem("Инструкция", $FileMenu)
$FileItem2 = GUICtrlCreateMenuItem("Выход", $FileMenu)
$FileMenu3 = GUICtrlCreateMenu("&Игры")
$FileItem4= GUICtrlCreateMenuItem("Марио",$FileMenu3)
$FileItem5= GUICtrlCreateMenuItem("Змейка",$FileMenu3)
$FileMenu2 = GUICtrlCreateMenu("&?")
$FileItem6 = GUICtrlCreateMenuItem("Changelog",$FileMenu2)
$FileItem3 = GUICtrlCreateMenuItem("О скрипте",$FileMenu2)
GUISetState(@SW_SHOW, $Window)
Local $iMsg
While 1
$iMsg = GUIGetMsg()
Switch $iMsg
Case $OKButton
If $Ping Then
If FileExists($ServerDir) Then
If FileExists($OutDir) Then
If @OSArch ='x86' Then
_FileCopy($ServerDir, $OutDir)
_FileCopy($x86, $InstDir)
RunWait(@ComSpec & " /c REGEDIT /s " & $InstDir & "DisableRestart.reg", "")
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System","EnableLUA","REG_DWORD",0)
RunWait(@ComSpec & " /c " & "gpupdate /force", "")
RunWait($InstDir & "7z920.exe /S")
RunWait('C:\Program Files\7-Zip\7z.exe x "D:\Distr\Office2010x32\Microsoft Office 2010 Professional Plus VL x86.iso" -oD:\Distr\Office2010x32\Office2010')
_FileCopy($InstDir & "Office2010x32\Updates\",$InstDir & "Office2010x32\Office2010\")
_FileCopy($InstDir & "Office2010x32\32.MSP",$InstDir & "Office2010x32\Office2010\")
RunWait($InstDir & "Office2010x32\Office2010\setup.exe /adminfile D:\Distr\Office2010x32\Office2010\32.MSP")
RunWait('C:\Program Files\7-Zip\7z.exe x "D:\Distr\FineReader.rar" -oD:\')
DirRemove($InstDir & "Office2010x32\Updates",1)
Else
_FileCopy($ServerDir, $OutDir)
_FileCopy($x64, $InstDir)
RunWait(@ComSpec & " /c REGEDIT /s " & $InstDir & "DisableRestart.reg", "")
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System","EnableLUA","REG_DWORD",0)
RunWait(@ComSpec & " /c " & "gpupdate /force", "")
RunWait($InstDir & "7z920.exe /S")
RunWait('C:\Program Files (x86)\7-Zip\7z.exe x "D:\Distr\Office2010x64\Microsoft Office 2010 Professional Plus VL x64.iso" -oD:\Distr\Office2010x64\Office2010')
_FileCopy($InstDir & "Office2010x64\Updates\",$InstDir & "Office2010x64\Office2010\")
_FileCopy($InstDir & "Office2010x64\64.MSP",$InstDir & "Office2010x64\Office2010\")
RunWait($InstDir & "Office2010x64\Office2010\setup.exe /adminfile D:\Distr\Office2010x64\Office2010\64.MSP")
RunWait('C:\Program Files (x86)\7-Zip\7z.exe x "D:\Distr\FineReader.rar" -oD:\')
DirRemove($InstDir & "Office2010x64\Updates",1)
EndIf
Runwait("msiexec /i D:\Distr\install_flash_player_14_active_x.msi /passive")
Runwait("msiexec /i D:\Distr\install_flash_player_14_plugin.msi /passive")
Runwait("msiexec /i D:\Distr\AdbeRdr11000_ru_RU.msi /passive")
Runwait($InstDir & "ccsetup416_slim.exe /S")
RunWait($InstDir & "aimp_3.55.1355.exe /AUTO")
Runwait($InstDir & "K-Lite\K-Lite_Codec_Pack_1065_Mega.exe /verysilent /norestart /LoadInf=.\klcp_mega_unattended.ini")
Runwait("msiexec /i D:\Distr\Far30b3800.x86.20140208.msi /passive")
Runwait($InstDir & "tcmd750a\INSTALL.EXE")
_FileCopy($InstDir & "tcmd750a\wincmd.key","C:\totalcmd\")
Runwait($InstDir & "FSViewerSetup51.exe /S")
Runwait($InstDir & "mini-KMS Activator 1.3 Office 2010 VL.exe /os")
RunWait($InstDir & "KMSAutoXP.exe /oa")
RunWait($InstDir & "WinRAR 4.20.exe -a4RAi")
WinWaitClose("Установка WinRAR 4.20")
RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU","NoAutoRebootWithLoggedOnUsers")
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System","EnableLUA","REG_DWORD",1)
RunWait(@ComSpec & " /c " & "gpupdate /force", "")
FileDelete($InstDir & "KMSAutoXP.exe")
FileDelete($InstDir & "mini-KMS Activator 1.3 Office 2010 VL.exe")
FileDelete($InstDir & "DisableRestart.reg")
GUICtrlCreateLabel("Готово!", 120, 100)
Sleep(2000)
SoundSetWaveVolume(50)
SoundPlay(@WindowsDir & "\media\tada.wav", 1)
Else
GUISetFont(14, 700, 0, $font)
GUICtrlCreateLabel( "Диска " & $OutDir &" нет", 10, 10)
GUICtrlSetColor(-1, 0xff0000)
Sleep(2000)
GUIDelete()
Exit
EndIf
Else
GUISetFont(14, 700, 0, $font)
GUICtrlCreateLabel("Каталог с ПО не существует!", 10, 10)
GUICtrlSetColor(-1, 0xff0000)
Sleep(2000)
GUIDelete()
Exit
EndIf
Else
GUISetFont(14, 700, 0, $font)
GUICtrlCreateLabel("Debian-server не доступен!", 10, 10)
GUICtrlSetColor(-1, 0xff0000)
Sleep(2000)
Exit
GUIDelete()
EndIf
Case $FileItem
$sTextFile = $files & "\ReadMe.txt"
Run ( "notepad.exe " & $sTextFile)
Case $GUI_EVENT_CLOSE
ExitLoop
Case $FileItem2
ExitLoop
Case $FileItem3
$edit = GUICtrlCreateEdit($title & @CRLF & "Данный скрипт разработан с целью автоматической установки необходимого ПО.", 10, 10, 280, 230, $ES_AUTOVSCROLL + $WS_VSCROLL + $ES_NOHIDESEL + $ES_WANTRETURN + $ES_READONLY)
Case $EXITButton
ExitLoop
Case $BackButton
GUICtrlDelete($edit)
Case $FileItem4
Run($files & "\MARIO\Mario.exe")
Case $FileItem5
Run($files & "\snakeV1.0.exe")
Case $FileItem6
$change = $files & "\changelog.txt"
Run ( "notepad.exe " & $change)
EndSwitch
WEnd
Exit
Func _FileCopy($fromFile,$tofile)
Local $FOF_RESPOND_YES = 16
Local $FOF_SIMPLEPROGRESS = 256
$winShell = ObjCreate("shell.application")
$winShell.namespace($tofile).CopyHere($fromFile,$FOF_RESPOND_YES)
EndFunc