风一样的男孩 发表于 2010-1-14 19:47:28

AU3源码万象2004客户端自动安装工具

使用万象2004用户市场比例不少,今天为“万象2004”用户做了个自动安装程序。
使用说明
自动安装程序同目录下 放置“Clt2K.exe”万象标准版客户端。
并且注意同目录下的 REG类型文件 将自动导入,可用于预先配置万象客户机环境。



#Region ;**** 参数创建于 AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=2004.ico
#AutoIt3Wrapper_outfile=万象2004自动安装器V1.0.exe
#AutoIt3Wrapper_UseAnsi=y
#AutoIt3Wrapper_Res_Comment=万象网管2004自动安装器
#AutoIt3Wrapper_Res_Description=万象网管2004 For 2000/XP 客户端
#AutoIt3Wrapper_Res_Fileversion=1.0.0.0
#AutoIt3Wrapper_Res_LegalCopyright=TVZML作品
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
$title = \"安装 - 万象网管2004 For 2000/XP 客户端\"
$file = \"Clt2K.exe\"
if not FileExists($file) Then
MsgBox (16,\"错误\",\"当前目录没有找到万象2004客户端 \"&$file&\"\")
Exit
EndIf
if ProcessExists(\"Clsmn.exe\") Then
MsgBox (49,\"安装\",\"安装程序发现 万象网管2004 For 2000/XP 客户端 当前正在运行。\"&@CRLF&@CRLF&\"请先关闭所有运行的窗口。\")
Exit
EndIf
hotkeyset(\"{esc}\", \"captureesc\")
progresson($title, \"按ESC取消安装...\", \"0 % \")
for $i = 1 to 100 step 1
sleep(30)
progressset( $i, $i & \" % \")
next
progressoff()
Run($file)
$search = FileFindFirstFile(\"*.reg\")
While 1
$regfile = FileFindNextFile($search)
If $regfile = \"\" Then ExitLoop
RunWait(@ComSpec & \" /c \" & \"regedit /s \"&$regfile)
If @error Then ExitLoop
WEnd
FileClose($search)
winwaitactive($title, \"推荐您在继续安装前关闭所有其它应用程序\")
controlclick($title, \"推荐您在继续安装前关闭所有其它应用程序\",\"TButton1\")
winwaitactive($title, \"许可协议\")
controlcommand($title, \"许可协议\",\"TRadioButton1\",\"check\")
controlclick($title, \"许可协议\",\"TButton2\")
winwaitactive($title, \"请在继续安装前阅读下列重要信息\")
controlclick($title, \"请在继续安装前阅读下列重要信息\",\"TButton2\")
winwaitactive($title, \"你想要使用什么协议和端口号\")
controlclick($title, \"你想要使用什么协议和端口号\",\"TButton2\")
winwaitactive($title, \"您想在哪里放置程序的快捷方式\")
controlclick($title, \"您想在哪里放置程序的快捷方式\",\"TButton3\")
BlockInput(1)
winwaitactive($title, \"您想要安装程序执行哪些附加任务\")
Sleep(500)
send (\"{SPACE}\")
send (\"{TAB}\")
send (\"{SPACE}\")
send (\"{TAB}\")
send (\"{SPACE}\")
Sleep(500)
controlclick($title, \"您想要安装程序执行哪些附加任务\",\"TButton3\")
BlockInput(0)
winwaitactive($title, \"安装程序现在准备开始安装\")
controlclick($title, \"安装程序现在准备开始安装\",\"TButton3\")
winwaitactive($title, \"稍后重新启动电脑\")
controlcommand($title, \"稍后重新启动电脑\",\"TRadioButton2\",\"check\")
controlclick($title, \"稍后重新启动电脑\",\"TButton3\")
func captureesc()
progressoff()
exit
endfunc

chenfnu 发表于 2011-3-23 10:54:01

有人测试过了吗?
页: [1]
查看完整版本: AU3源码万象2004客户端自动安装工具