本帖最后由 zldfsz 于 2012-3-21 19:33 编辑
回复 user3000
我只要没选中一个的时候提示没选种但如果我选种相应的软件就安装该软件
怎么 ...
srhack 发表于 2012-3-21 15:50
将2楼改了下
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#region ### START Koda GUI section ### Form=
$Form1 = GUICreate("软件自动安装网吧版--by.IeAnDgvt QQ:12079110", 483, 410, 192, 114)
$Pic1 = GUICtrlCreatePic("D:\Personal\桌面\124.jpg", 0, 0, 481, 129)
$Checkbox1 = GUICtrlCreateCheckbox("Microsoft .NET Framework2.0", 48, 144, 185, 25)
$Checkbox2 = GUICtrlCreateCheckbox("搜狗拼音网吧版", 291, 144, 113, 25)
$Checkbox3 = GUICtrlCreateCheckbox("OFFICE 2003 简化版", 48, 200, 137, 25)
$Checkbox4 = GUICtrlCreateCheckbox("Realplay10.6经典版", 291, 196, 129, 25)
$Checkbox5 = GUICtrlCreateCheckbox("远古播放器2010网吧版", 48, 248, 145, 25)
$Checkbox6 = GUICtrlCreateCheckbox("迅雷无广告版", 291, 247, 97, 25)
$Button1 = GUICtrlCreateButton("安装", 88, 296, 65, 25)
$Button2 = GUICtrlCreateButton("退出", 279, 296, 65, 25)
$Label1 = GUICtrlCreateLabel("请在你将要安装的软件上打钩,然后点击安装即可", 16, 360, 268, 17)
$Label2 = GUICtrlCreateLabel("请根据需要安装,附加软件可以不选!", 16, 384, 208, 17)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###
Local $Checkbox
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE, $Button2
Exit
Case $Button1
GUICtrlSetState($Button1,$GUI_DISABLE)
Local $bool = False
For $i = 1 To 6
$t = "checkbox" & $i
If GUICtrlRead(Eval($t)) = $GUI_CHECKED Then
$bool = True
setup($i)
EndIf
Next
If Not $bool Then
MsgBox(48, '', '一个也没有选中')
EndIf
GUICtrlSetState($Button1,$GUI_ENABLE)
EndSwitch
WEnd
Func setup($i)
Switch $i
Case 1
TrayTip("","正在安装Microsoft .NET Framework2.0,请勿动鼠标键盘",3)
Sleep(6000);延时表示安装过程,具体用RunWait("D:\Microsoft .NET Framework2.0.exe"),修改为对应路径
MsgBox(48, '', 'Microsoft .NET Framework2.0安装结束',2)
Case 2
TrayTip("","正在安装搜狗拼音网吧版,请勿动鼠标键盘",3)
Sleep(6000);延时表示安装过程,具体用RunWait("D:\搜狗拼音网吧版.exe"),修改为对应路径
MsgBox(48, '', '搜狗拼音网吧版安装结束',2)
Case 3
TrayTip("","正在安装OFFICE 2003 简化版,请勿动鼠标键盘",3)
Sleep(6000);延时表示安装过程,具体用RunWait("D:\OFFICE 2003 简化版.exe"),修改为对应路径
MsgBox(48, '', 'OFFICE 2003 简化版安装结束',2)
Case 4
TrayTip("","正在安装Realplay10.6经典版,请勿动鼠标键盘",3)
Sleep(6000);延时表示安装过程,具体用RunWait("D:\Realplay10.6经典版.exe"),修改为对应路径
MsgBox(48, '', 'Realplay10.6经典版安装结束',2)
Case 5
TrayTip("","正在安装远古播放器2010网吧版,请勿动鼠标键盘",3)
Sleep(6000);延时表示安装过程,具体用RunWait("D:\远古播放器2010网吧版.exe"),修改为对应路径
MsgBox(48, '', '远古播放器2010网吧版安装结束',2)
Case 6
TrayTip("","正在安装迅雷无广告版,请勿动鼠标键盘",3)
Sleep(6000);延时表示安装过程,具体用RunWait("D:\迅雷无广告版.exe"),修改为对应路径
MsgBox(48, '', '迅雷无广告版安装结束',2)
EndSwitch
EndFunc
|