本帖最后由 wwcbjs 于 2009-9-21 02:08 编辑 Run ("setup.exe")
Dim $AQ="360安全卫士"
$WS=" 360安全卫士"
If Winwait($AQ,"检测到已安装",5) Then
ControlCommand($AQ,"检测到已安装","Button2","Check")
EndIf
WinWaitActive($WS,"欢迎使用",5)
ControlCommand($WS,"欢迎使用","Button2","Check")
WinWaitActive($WS,"最终用户授权协议")
ControlCommand($WS,"最终用户授权协议","Button2","Check")
WinWaitActive($WS,"请选择安装位置")
$ver = DriveGetDrive("FIXED")
Select
Case $ver[0] >= 2
ControlSetText($WS,"请选择安装位置","Edit1","D:\Program Files\360\360Safe")
ControlCommand($WS,"请选择安装位置","Button2","Check")
Case $ver[0] < 2
ControlCommand($WS,"请选择安装位置","Button2","Check")
Case $ver[0] = 0
MsgBox(0, "硬盘检测", "您的硬盘还没有分区")
ProcessClose("setup.exe")
EndSelect
WinWaitActive($WS,"正在完成",10)
ControlCommand($WS,"正在完成","Button2","Check")
If WinWaitActive($WS,"你的系统需要重新启动",5) Then
ControlCommand($WS,"你的系统需要重新启动","Button2","Check")
EndIf
亲自测试,由于我的系统为widnows 7所以360保险箱无法安装故此请自己写一下!这个是由于我是重新安装360写的代码!绝对可行!
其中有检测分区,从而选择安装地点,意思是如果有分区大于或者等于2就安装到D盘,如果硬盘未分区则提示,且关闭安装!如果硬盘有一个分区则安装到原目录!部分代码还没写完,我是安装过360的 肯定和没安装过360的机器不一样! |