|
楼主 |
发表于 2009-2-20 10:49:24
|
显示全部楼层
已解决问题,多谢楼上的朋友。我的源码附下,如果有更正统的解决方式,欢迎指正。
sleep(500);暂停500毫秒
dim $a;声明变量$a,存储自解压窗口状态值
fileinstall("0.exe","c:\ahphs\");将自解压文件装入EXE中,并设定临时解压文件夹
run("0.exe");运行自解压
winwaitactive("WinRAR 自解压文件","目标文件夹")
send("{enter}")
Do;检测自解压窗口是否完毕
$a=WinExists("WinRAR 自解压文件","安装进度")
sleep(1500)
until $a=1
run("WinRAR.exe");运行安装主程序
winwaitactive("WinRAR v3.51 简体中文版","目标文件夹")
send("{enter}")
winwaitactive("WinRAR 简体中文版安装","在桌面创建 WinRAR 快捷方式")
send("{enter}")
winwaitactive("WinRAR 简体中文版安装","成功地安装到文件夹")
send("{enter}")
winwaitactive("WinRAR","「开始」菜单\程序\WinRAR")
send("!{f4}")
ProcessWaitClose("WinRAR.exe");等待主程序完毕
FileDelete("c:\ahphs\" & "WinRAR.exe");删除主程序
dirremove("c:\ahphs",1);删除临时文件夹 |
|