本帖最后由 howacter 于 2010-1-9 03:05 编辑
今天写了个autoit-v3-setup的自动安装脚本,望各位指正。
Run("autoit-v3-setup")
WinWaitActive("AutoIt v3.3.0.0 Setup","Setup Wizard")
ControlClick("AutoIt v3.3.0.0 Setup","Setup Wizard",1)
WinWaitActive("AutoIt v3.3.0.0 Setup","License Agreement")
ControlClick("AutoIt v3.3.0.0 Setup ","License Agreement",1)
;如果已经安装了,则会弹出下面这个对话框
;选择覆盖安装
;注意下面用的是WinActive()
If WinActive("AutoIt v3.3.0.0 Setup","Previous Installation Found") Then
ControlClick("AutoIt v3.3.0.0 Setup","Previous Installation Found",1202)
ControlClick("AutoIt v3.3.0.0 Setup","Previous Installation Found",1)
EndIf
WinWaitActive("AutoIt v3.3.0.0 Setup","What do you want to do")
Send("!n")
;ControlClick("AutoIt v3.3.0.0 Setup ","What do you want to do",1)
;这一句用在这里不知道为什么不行,只有改为上面的
WinWaitActive("AutoIt v3.3.0.0 Setup","Choose Components")
ControlClick("AutoIt v3.3.0.0 Setup ","Choose Components",1)
WinWaitActive("AutoIt v3.3.0.0 Setup","Choose Install Location")
ControlClick("AutoIt v3.3.0.0 Setup ","Choose Install Location",1)
WinWaitActive("AutoIt v3.3.0.0 Setup","Completing")
ControlClick("AutoIt v3.3.0.0 Setup","Completing",1203)
ControlClick("AutoIt v3.3.0.0 Setup","Completing",1)
FileCreateShortcut(@ProgramFilesDir&"\AutoIt3\SciTE\SciTE.exe",@DesktopDir&"\SciTE.lnk")
FileCreateShortcut(@ProgramFilesDir&"\AutoIt3\Au3Info.exe",@DesktopDir&"\Au3Info.lnk")
|