找回密码
 加入
搜索
查看: 29406|回复: 22

[原创] 酷狗2012自动安装脚本 给点意见

  [复制链接]
发表于 2012-8-3 10:17:31 | 显示全部楼层 |阅读模式
#RequireAdmin
Run("酷狗2012.exe")
$Hwnd = WinWaitActive("安装向导 - 酷狗音乐2012")
$handle = WinWait("[class:TWizardForm]")
WinWaitShow($handle)
ControlSend($Hwnd,"",$handle,"{enter}")
WinWaitShow($handle)
ControlSetText($handle, "", "TEdit1", "D:\Program Files\KuGou2012")
$pos = WinGetPos($handle)
MouseMove($pos[0]+56,$pos[1]+170,1)
ControlClick($hWnd,"",$handle,"left",1,56,170)

MouseMove($pos[0]+95,$pos[1]+253,1)
ControlClick($hWnd,"",$handle,"left",1,95,253)

MouseMove($pos[0]+40,$pos[1]+278,1)
ControlClick($hWnd,"",$handle,"left",1,40,278)

ControlSend($Hwnd,"",$handle,"{enter}")
WinWaitShow($handle)

ProcessWait("KuGou.exe")
ProcessWaitClose("KuGou.exe")
Sleep(100)
ProcessClose("kugou_1182.tmp")
ProcessClose("kugou_1182.exe")

FileDelete(@DesktopDir&"\酷狗音乐文件夹.lnk")
FileDelete(@DesktopCommonDir&"\酷狗音乐文件夹.lnk")
exit

Func WinWaitShow($tHandle)
        Do
                Sleep(100)
        Until BitAND(WinGetState($tHandle),2)
        EndFunc
 楼主| 发表于 2012-8-3 10:21:06 | 显示全部楼层
沙发自己坐
 楼主| 发表于 2012-8-3 10:31:30 | 显示全部楼层
qq2012beta3 自动安装 可失去焦点 即后台
#RequireAdmin
Run("QQ2012.exe")
WinWait("腾讯QQ2012 安装向导","")
If WinExists("腾讯QQ2012 安装向导","检测到QQ正在运行") Then
        ControlClick("腾讯QQ2012 安装向导","检测到QQ正在运行","Button2")
EndIf

WinWait("腾讯QQ2012 安装向导","我已阅读并同意软件许可协议和青少年上网安全指引")
if 0 = ControlCommand("腾讯QQ2012 安装向导","在安装软件前, 请仔细阅读下面的软件许可协议和青少年上网安全指引。","Button1","IsChecked") Then
ControlClick("腾讯QQ2012 安装向导","在安装软件前, 请仔细阅读下面的软件许可协议和青少年上网安全指引。","Button1")
EndIf

Do
        $wer = ControlCommand("腾讯QQ2012 安装向导","在安装软件前, 请仔细阅读下面的软件许可协议和青少年上网安全指引。","Button3","IsEnabled")
Until $wer = 1

ControlClick("腾讯QQ2012 安装向导","在安装软件前, 请仔细阅读下面的软件许可协议和青少年上网安全指引。","Button3")
WinWait("腾讯QQ2012 安装向导","安装QQ工具栏及中文搜搜")
ControlCommand("腾讯QQ2012 安装向导","安装QQ工具栏及中文搜搜","Button9","UnCheck")
ControlCommand("腾讯QQ2012 安装向导","安装QQ工具栏及中文搜搜","Button12","UnCheck")
ControlCommand("腾讯QQ2012 安装向导","安装QQ工具栏及中文搜搜","Button17","UnCheck")
ControlCommand("腾讯QQ2012 安装向导","安装QQ工具栏及中文搜搜","Button18","UnCheck")
ControlCommand("腾讯QQ2012 安装向导","安装QQ工具栏及中文搜搜","Button7","UnCheck")
ControlClick("腾讯QQ2012 安装向导","安装QQ工具栏及中文搜搜","Button2")
WinWait("腾讯QQ2012 安装向导","程序安装目录")
ControlSetText("腾讯QQ2012 安装向导","程序安装目录","Edit1","d:\Program Files\Tencent\QQ")
ControlClick("腾讯QQ2012 安装向导","程序安装目录","Button2")
WinWait("腾讯QQ2012 安装向导","安装完成")
ControlCommand("腾讯QQ2012 安装向导","安装完成","Button8","UnCheck")
ControlCommand("腾讯QQ2012 安装向导","安装完成","Button6","UnCheck")
ControlCommand("腾讯QQ2012 安装向导","安装完成","Button7","UnCheck")
ControlCommand("腾讯QQ2012 安装向导","安装完成","Button9","UnCheck")
ControlClick("腾讯QQ2012 安装向导","安装完成","Button2")
Exit
 楼主| 发表于 2012-8-3 10:32:12 | 显示全部楼层
ppsV2.7.0.1491 正式版 自动安装代码 去除插件
#RequireAdmin
Run("PPS影音.exe")
WinWait("PPS影音 V2.7.0.1491 正式版","下一步(&N) >")
$array = WinGetPos("PPS影音 V2.7.0.1491 正式版")
ControlSend("PPS影音 V2.7.0.1491 正式版","下一步(&N) >","","!n")
WinWait("PPS影音 V2.7.0.1491 正式版","所需空间")
ControlSetText("PPS影音 V2.7.0.1491 正式版","所需空间","Edit2","d:\Program Files\PPStream")
MouseClick("left",$array[0]+119,$array[1]+216,1,1)
MouseClick("left",$array[0]+267,$array[1]+193,1,1)
MouseClick("left",$array[0]+270,$array[1]+220,1,1)
Sleep(200)
ControlSend("PPS影音 V2.7.0.1491 正式版","所需空间","","!n")
WinWait("PPS影音 V2.7.0.1491 正式版","安装(&I)")
ControlSend("PPS影音 V2.7.0.1491 正式版","安装(&I)","","!i")
WinWait("PPS影音 V2.7.0.1491 正式版","关闭(&L)")
ProcessClose("PPS影音.exe")
Exit
 楼主| 发表于 2012-8-3 10:33:08 | 显示全部楼层
qq拼音纯净版 自动安装可后台版
Run("QQ拼音.exe")
WinWait("QQ输入法纯净版1.0安装向导")
If WinExists("QQ输入法纯净版1.0安装向导","是否继续安装?") Then
        ControlClick("QQ输入法纯净版1.0安装向导","是否继续安装?","Button1")
        endIf
WinWait("QQ输入法纯净版1.0安装向导","在开始安装之前,建议您关闭所有其他应用程序")
ControlClick("QQ输入法纯净版1.0安装向导","在开始安装之前,建议您关闭所有其他应用程序","Button2")
WinWait("QQ输入法纯净版1.0安装向导"," 重要须知: 腾讯在此特别提醒用户认真")
ControlClick("QQ输入法纯净版1.0安装向导"," 重要须知: 腾讯在此特别提醒用户认真","Button2")
WinWait("QQ输入法纯净版1.0安装向导","选择安装位置")
ControlSetText("QQ输入法纯净版1.0安装向导","选择安装位置","Edit1","D:\Program Files\Tencent\QQPinyin")
ControlClick("QQ输入法纯净版1.0安装向导","选择安装位置","Button2")
WinWait("QQ输入法纯净版1.0安装向导","正在安装,请稍候")
WinWaitClose("QQ输入法纯净版1.0安装向导","正在安装,请稍候")
Sleep(200)
If WinExists("QQ输入法纯净版1.0安装向导","以下应用程序将继续使用之前版本的QQ拼音") Then
        ControlClick("QQ输入法纯净版1.0安装向导","以下应用程序将继续使用之前版本的QQ拼音","Button2")
EndIf

WinWait("QQ输入法纯净版1.0安装向导","感谢您使用QQ输入法纯净版!")
ProcessClose("QQ拼音.exe")
 楼主| 发表于 2012-8-3 10:33:54 | 显示全部楼层
#RequireAdmin
Run("ThunderMini1.5.3.288.exe")
WinWait("迅雷精简版","选择安装位置")
ControlSetText("迅雷精简版","选择安装位置","Edit1","D:\Program Files\Thunder Network\MiniThunder")
ControlClick("迅雷精简版","选择安装位置","Button2")
WinWait("迅雷精简版","启用多浏览器支持")
ControlClick("迅雷精简版","启用多浏览器支持","Button2")
ProcessWait("ThunderMini.exe")
ProcessClose("ThunderMini.exe")
 楼主| 发表于 2012-8-3 10:34:33 | 显示全部楼层
qq影音3.6自动安装可后台去插件
#RequireAdmin
Run("QQPlayer_Setup_36_883.exe","")
ProcessWait("QQPCDetector.exe")
ProcessClose("QQPCDetector.exe")
WinWait("QQ影音3.6安装","在开始安装之前,建议先关闭其他所有应用程序")
WinActivate("QQ影音3.6安装","在开始安装之前,建议先关闭其他所有应用程序")
ControlClick("QQ影音3.6安装","在开始安装之前,建议先关闭其他所有应用程序","Button2")
WinWait("QQ影音3.6安装","之前,请阅读授权协议。")
ControlClick("QQ影音3.6安装","之前,请阅读授权协议。","Button2")
WinWait("QQ影音3.6安装","选定安装的组件")
ControlClick("QQ影音3.6安装","选定安装的组件","Button2")
WinWait("QQ影音3.6安装","选择安装位置")
ControlSetText("QQ影音3.6安装","选择安装位置","Edit1","D:\Program Files\Tencent\QQPlayer")
ControlClick("QQ影音3.6安装","选择安装位置","Button2")
ProcessWait("QQPlayer.exe")
ProcessWaitClose("QQPlayer.exe")
ProcessClose("QQPlayer_Setup_36_883.exe")
 楼主| 发表于 2012-8-3 10:35:17 | 显示全部楼层
星空极速3.3自动安装可后台
#RequireAdmin
Run("HNClientV3.3.090319.exe")
If WinWait("星空极速客户端安装程序","请阅读下面的许可协议",5) = 0 Then 
 ControlClick("卸载向导","检测到本计算机已经安装有星空极速客户端软件","Button1") 
EndIf
WinWait("星空极速客户端安装程序","请阅读下面的许可协议")
ControlClick("星空极速客户端安装程序","请阅读下面的许可协议","Button1")
ControlCommand("星空极速客户端安装程序","请阅读下面的许可协议","Button3","UnCheck")
ControlClick("星空极速客户端安装程序","请阅读下面的许可协议","Button5")
WinWait("选择目的位置","目的文件夹")
ControlSetText("选择目的位置","目的文件夹","Edit1","D:\Program Files\ChinaNet")
ControlClick("选择目的位置","目的文件夹","Button7")
WinWait("请选择程序文件夹","安装将添加程序图标至下面列出的文件夹中")
ControlClick("请选择程序文件夹","安装将添加程序图标至下面列出的文件夹中","Button7")
WinWait("安装已完成","在Windows启动时自动运行此程序。")
ControlClick("安装已完成","在Windows启动时自动运行此程序。","Button9")
ProcessWait("VnetClient.exe")
ProcessClose("VnetClient.exe")
exit
 楼主| 发表于 2012-8-3 10:36:09 | 显示全部楼层
office 2007兼容包
Run("office2007兼容包.exe")
WinWait("2007 Office system 兼容包","若要继续安装")
ControlClick("2007 Office system 兼容包","若要继续安装","Button1")
Do
        $wer = ControlCommand("2007 Office system 兼容包","若要继续安装","Button2","IsEnabled")
Until $wer = 1
ControlClick("2007 Office system 兼容包","若要继续安装","Button2")
WinWait("2007 Office system 兼容包","安装已完成")
ControlClick("2007 Office system 兼容包","安装已完成","Button1")
Exit
 楼主| 发表于 2012-8-3 10:36:44 | 显示全部楼层
酷狗2012去插件自动安装
#RequireAdmin
Run("酷狗2012.exe")
$Hwnd = WinWaitActive("安装向导 - 酷狗音乐2012") 
$handle = WinWait("[class:TWizardForm]")
WinWaitShow($handle)
ControlSend($Hwnd,"",$handle,"{enter}")
WinWaitShow($handle)
ControlSetText($handle, "", "TEdit1", "D:\Program Files\KuGou2012")
$pos = WinGetPos($handle)
MouseMove($pos[0]+56,$pos[1]+170,1)
ControlClick($hWnd,"",$handle,"left",1,56,170) 

MouseMove($pos[0]+95,$pos[1]+253,1)
ControlClick($hWnd,"",$handle,"left",1,95,253)

MouseMove($pos[0]+40,$pos[1]+278,1)
ControlClick($hWnd,"",$handle,"left",1,40,278)

ControlSend($Hwnd,"",$handle,"{enter}")
WinWaitShow($handle)

ProcessWait("KuGou.exe")
ProcessWaitClose("KuGou.exe")
Sleep(100)
ProcessClose("kugou_1182.tmp")
ProcessClose("kugou_1182.exe")

FileDelete(@DesktopDir&"\酷狗音乐文件夹.lnk") 
FileDelete(@DesktopCommonDir&"\酷狗音乐文件夹.lnk") 
exit

Func WinWaitShow($tHandle)
        Do
                Sleep(100)
        Until BitAND(WinGetState($tHandle),2)
        EndFunc 
 楼主| 发表于 2012-8-3 10:38:15 | 显示全部楼层
后续补上更多
 楼主| 发表于 2012-8-3 10:42:20 | 显示全部楼层
不设回复可游览是为了游客也能看 - -谁知道居然没个人回复 悲哀
 楼主| 发表于 2012-8-3 10:44:28 | 显示全部楼层
酷狗判断安装完成其实挺简单  安装完成之前安装程序会运行一遍kugou.exe -参数 来完成最后的安装 可以根据这个进程判断完成
 楼主| 发表于 2012-8-3 10:46:01 | 显示全部楼层
最后直接结束酷狗的安装程序进程就可以阻止插件的安装 很多安装软件都可以通过这个方法去插件 比如QQ影音 PPS等
 楼主| 发表于 2012-8-3 10:47:14 | 显示全部楼层
脚本没加注释  不懂的提成来 我会经常来看看并解读  也欢迎大家提出意见 在此感谢
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-12-4 01:18 , Processed in 0.080074 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表