#include <GUIConstants.au3>
#include <ProgressConstants.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
$soft_ini = FileOpen("Soft.ini", 0)
If $soft_ini = -1 Then
MsgBox(16, "错误", '请检查配置文件' & @ScriptDir & '"Soft.ini"是否存在!')
EndIf
FileClose($soft_ini)
Const $N = 13, $s = 4
Dim $softname[$N], $softPath[$N], $soft[$N], $radio[$s], $InstallPath
For $i = 0 To $N - 1
$softname[$i] = IniRead("soft.ini", $i, "softname", "空")
$softPath[$i] = IniRead("soft.ini", $i, "softpath", "空")
Next
$form = GUICreate("", 630, 420, -1, -1)
$Label1 = GUICtrlCreateLabel("软件 - 安装助理", 22, 33, 300, 26)
$Group1 = GUICtrlCreateGroup("", 22, 80, 588, 256)
$soft[1] = GUICtrlCreateCheckbox($softname[1], 60, 110, 150, 20)
$soft[2] = GUICtrlCreateCheckbox($softname[2], 60, 166, 150, 20)
$soft[3] = GUICtrlCreateCheckbox($softname[3], 60, 216, 150, 20)
$soft[4] = GUICtrlCreateCheckbox($softname[4], 60, 266, 150, 20)
$soft[5] = GUICtrlCreateCheckbox($softname[5], 243, 110, 150, 20)
$soft[6] = GUICtrlCreateCheckbox($softname[6], 243, 166, 150, 20)
$soft[7] = GUICtrlCreateCheckbox($softname[7], 243, 216, 150, 20)
$soft[8] = GUICtrlCreateCheckbox($softname[8], 243, 266, 150, 20)
$soft[09] = GUICtrlCreateCheckbox($softname[9], 426, 110, 150, 20)
$soft[10] = GUICtrlCreateCheckbox($softname[10], 426, 166, 150, 20)
$soft[11] = GUICtrlCreateCheckbox($softname[11], 426, 216, 150, 20)
$soft[12] = GUICtrlCreateCheckbox($softname[12], 426, 266, 150, 20)
$setA = IniRead("soft.ini", "select", "A", "")
$chooseA = IniRead("soft.ini", "select", "ChooseA", "")
$setB = IniRead("soft.ini", "select", "B", "")
$chooseB = IniRead("soft.ini", "select", "ChooseB", "")
$radio[1] = GUICtrlCreateRadio($setA & "(&A)", 140, 327, 60, 17)
$radio[2] = GUICtrlCreateRadio($setB & "(&B)", 210, 327, 61, 17)
$Button3 = GUICtrlCreateButton("自动安装", 406, 360, 82, 33)
$Button4 = GUICtrlCreateButton("退 出", 498, 360, 82, 33)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Select
Case $nMsg = $GUI_EVENT_CLOSE
AdlibUnRegister()
ExitLoop
Case $nMsg = $radio[1] And BitAND(GUICtrlRead($radio[1]), $GUI_CHECKED) = $GUI_CHECKED
$all = all()
Case $nMsg = $radio[2] And BitAND(GUICtrlRead($radio[2]), $GUI_CHECKED) = $GUI_CHECKED
$none = none()
Case $nMsg = $Button3
$AZ = AZ()
Case $nMsg = $Button4
Exit
EndSelect
WEnd
Func all()
AdlibUnRegister()
For $i = 0 To $N - 1
If $softname[$i] And $softPath[$i] <> "" Then
GUICtrlSetState($soft[$i], $GUI_CHECKED)
Else
GUICtrlSetState($soft[$i], $GUI_UNCHECKED)
EndIf
Next
EndFunc ;==>all
Func none()
AdlibUnRegister()
For $i = 0 To $N - 1
If $softname[$i] And $softPath[$i] <> "" Then
GUICtrlSetState($soft[$i], $GUI_UNCHECKED)
Else
GUICtrlSetState($soft[$i], $GUI_UNCHECKED)
EndIf
Next
EndFunc ;==>none
Func AZ()
AdlibUnRegister()
For $i = 0 To $N - 1
If $softPath[$i] <> "" And GUICtrlRead($soft[$i]) = $GUI_CHECKED Then
RunWait(@ScriptDir & "" & $softPath[$i] & " " & $InstallPath)
EndIf
Next
If Not $softPath Then MsgBox(48, '温馨提示:', '您所选软件:现以安装完成,是否退?')
EndFunc ;==>AZ
[/code]附:配置文件