|
測試OK沒問題
順便幫你壓成EXE了
http://www.fileswap.com/dl/z8HLVsSCXf/
[code=autoit]#cs ----------------------------------------------------------------------------
AutoIt Version: 3.3.8.1
Author: Dang Wang
Script Function: Snort 2.9.4
Template AutoIt script.
#ce ----------------------------------------------------------------------------
#Region
#AutoIt3Wrapper_icon=C:\NewDang.ico
#AutoIt3Wrapper_Compression=5
#AutoIt3Wrapper_Res_Comment=Snort
#AutoIt3Wrapper_Res_Description=Snort
#AutoIt3Wrapper_Res_Fileversion=2.9.4
#AutoIt3Wrapper_Res_LegalCopyright=噹噹
#EndRegion
#NoTrayIcon
#RequireAdmin
#include <Misc.au3>
AutoItSetOption ( "WinTitleMatchMode", 4)
Dim Const $FileName= "Snort_2_9_4_Installer.exe"
Dim Const $FormName1 = "Snort 2.9.4 Setup "
Dim Const $FormName2 = "Snort 2.9.4 Setup"
_Singleton ($FormName2)
;------- (1 Click;2 Check;3 UnCheck;4 SetText )-------
Dim $Text[5][5] = [ [ $FormName1, "Please review the license terms before installing Snort 2.9.4.", "Button2", 1, ""], _
[ $FormName1, "Choose which features of Snort 2.9.4 you want to install.", "Button2", 1, ""], _
[ $FormName1, "Choose the folder in which to install Snort 2.9.4.", "Button2", 1, ""], _
[ $FormName1, "Show &details", "Button2", 1, ""], _
[ $FormName2, "Snort has successfully been installed.", "Button1", 1, ""] ]
$begin = TimerInit()
FileInstall ( "Snort_2_9_4_Installer.exe", @TempDir&"\"&$FileName)
ShellExecute (@TempDir&"\"&$FileName)
While 1
For $i = 0 To UBound ( $Text, 1)-1
Select
Case WinExists ( $Text[$i][0], $Text[$i][1])
If $Text[$i][3] = 1 Then
ControlClick ( $Text[$i][0], $Text[$i][1], $Text[$i][2])
ElseIf $Text[$i][3] = 2 Then
ControlCommand ( $Text[$i][0], $Text[$i][1], $Text[$i][2], "Check", "")
ElseIf $Text[$i][3] = 3 Then
ControlCommand ( $Text[$i][0], $Text[$i][1], $Text[$i][2], "UnCheck", "")
ElseIf $Text[$i][3] = 4 Then
ControlSetText ( $Text[$i][0], $Text[$i][1], $Text[$i][2], $Text[$i][4])
EndIf
If $i = (UBound ( $Text, 1)-1) Then ExitLoop(2)
EndSelect
Next
WEnd
$dif = TimerDiff ($begin)
MsgBox ( 0, "安裝完成", StringFormat ( "總安裝時間:%s秒", $dif/1000))[/code]
|
|