#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Global $time = 8
$Form1 = GUICreate("系统可选组件更新和优化设置", 250, 150,300,300,$WS_POPUP)
GUISetBkColor(0xE0FFFF)
WinSetTrans("系统可选组件更新和优化设置","",170)
GUICtrlCreateGroup("",5,5,160,130)
$Checkbox1 = GUICtrlCreateCheckbox("安装IE8.0和更新补丁", 10, 15, 150, 15)
GUICtrlSetState(-1,$GUI_CHECKED)
$Checkbox2 = GUICtrlCreateCheckbox("建立宽带连接", 10, 35, 150, 15)
GUICtrlSetState(-1,$GUI_CHECKED)
$Checkbox3 = GUICtrlCreateCheckbox("安装微软msxml解释器", 10, 55, 150, 15)
GUICtrlSetState(-1,$GUI_CHECKED)
$Checkbox4 = GUICtrlCreateCheckbox("安装Framework2.0和3.0", 10, 75, 150, 15)
$Checkbox5 = GUICtrlCreateCheckbox("注册表优化", 10, 95, 150, 15)
GUICtrlSetState(-1,$GUI_CHECKED)
$Checkbox6 = GUICtrlCreateCheckbox("重启调用软件安装管理器", 10, 115, 150, 15)
GUICtrlSetState(-1,$GUI_CHECKED)
GUICtrlCreateGroup("",170,5,75,130)
$Button1 = GUICtrlCreateButton("默认安装",175,15,70,30)
$Button2 = GUICtrlCreateButton("手动安装",175,45,70,30)
GUISetFont(20,"","","宋体")
$Label1 = GUICtrlCreateLabel($time,200,90,70,30)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Checkbox1,$Checkbox2,$Checkbox3,$Checkbox4,$Checkbox5,$Checkbox6
AdlibUnRegister()
Case $Button1
AdlibRegister("times",1000)
Case $Button2
If GUICtrlRead($Checkbox1)=1 Then
RunWait(@ScriptDir&"\IE8.EXE")
EndIf
If GUICtrlRead($Checkbox2)=1 Then
RunWait(@ScriptDir&"\ADSL.EXE")
EndIf
If GUICtrlRead($Checkbox3)=1 Then
RunWait(@ScriptDir&"\msxml.exe")
EndIf
If GUICtrlRead($Checkbox4)=1 Then
RunWait(@ScriptDir&"\net .exe")
EndIf
If GUICtrlRead($Checkbox5)=1 Then
RunWait(@WindowsDir&"\REGEDIT.exe /S "&@ScriptDir&"\anti.reg")
EndIf
If GUICtrlRead($Checkbox6)=1 Then
RunWait(@ScriptDir&"\chongqi.exe")
EndIf
Exit
EndSwitch
WEnd
Func Times()
$time -=1
GUICtrlSetData($Label1,$time)
If $time <= 0 Then
MsgBox(64,"OK","倒数完毕,开始安装。")
;RunWait(@WindowsDir&"\notepad.exe")
;RunWait(@ScriptDir&"\IE8.EXE")
;RunWait(@ScriptDir&"\ADSL.EXE")
;RunWait(@ScriptDir&"\msxml.exe")
;RunWait(@WindowsDir&"\REGEDIT.exe /S "&@ScriptDir&"\anti.reg")
;RunWait(@ScriptDir&"\chongqi.exe")
Exit
EndIf
EndFunc