jackly 发表于 2008-6-6 11:11:56

QQ自动安装程序完整版

此代码为本人原创,刚学习一天:face (31):
;输入QQ文件名称窗口
#Region --- CodeWizard generated code Start ---
;InputBox features: Title=Yes, Prompt=Yes, Default Text=Yes
If Not IsDeclared("sInputBoxAnswer") Then Local $qqname
$qqname = InputBox("请输QQ安装文件名","如:qq.exe","QQ2008bata1.exe"," ","-1","-1","-1","-1")
Select
        Case @Error = 0 ;OK - The string returned is valid

        Case @Error = 1 ;The Cancel button was pushed

        Case @Error = 3 ;The InputBox failed to open

EndSelect
#EndRegion --- CodeWizard generated code End ---
If $qqname="" Then
MsgBox("0","请正确输入文件名","请重新输入",5)
Exit
EndIf
;输入QQ安装路径

#Region --- CodeWizard generated code Start ---
;InputBox features: Title=Yes, Prompt=Yes, Default Text=Yes
If Not IsDeclared("sInputBoxAnswer") Then Local $sqqlujin
$qqlujin = InputBox("请输入你想把QQ安在什么地方!","如:D:\tencent\","D:\tencent\"," ","-1","-1","-1","-1")
Select
        Case @Error = 0 ;OK - The string returned is valid

        Case @Error = 1 ;The Cancel button was pushed

        Case @Error = 3 ;The InputBox failed to open

EndSelect
#EndRegion --- CodeWizard generated code End ---
If $qqlujin="" Then
MsgBox("0","请输入正确的QQ路径","请重新输入",5)
Exit
EndIf

;是否安装快车
#Region --- CodeWizard generated code Start ---
#include <Constants.au3>

;MsgBox features: Title=Yes, Text=Yes, Buttons=Yes and No, Default Button=Second, Icon=Question, Timeout=5 ss
If Not IsDeclared("iMsgBoxAnswer") Then Local $qqkuaiche
$qqkuaiche = MsgBox($MB_YESNO + $MB_DEFBUTTON2 + $MB_ICONQUESTION,"是否安装快车","是否安装快车",5)
Select
        Case $qqkuaiche = $IDYES

        Case $qqkuaiche = $IDNO

        Case $qqkuaiche = -1 ;Timeout

EndSelect
#EndRegion --- CodeWizard generated code End ---
;是否安装QQ工具栏
#Region --- CodeWizard generated code Start ---
#include <Constants.au3>

;MsgBox features: Title=Yes, Text=Yes, Buttons=Yes and No, Default Button=Second, Icon=Question, Timeout=5 ss
If Not IsDeclared("iMsgBoxAnswer") Then Local $qqtool
$qqtool = MsgBox($MB_YESNO + $MB_DEFBUTTON2 + $MB_ICONQUESTION,"是否安装QQ工具栏","是否安装QQ工具栏",5)
Select
        Case $qqtool = $IDYES

        Case $qqtool = $IDNO

        Case $qqtool = -1 ;Timeout

EndSelect
#EndRegion --- CodeWizard generated code End ---
;是否安装搜搜
#Region --- CodeWizard generated code Start ---
#include <Constants.au3>

;MsgBox features: Title=Yes, Text=Yes, Buttons=Yes and No, Default Button=Second, Icon=Question, Timeout=5 ss
If Not IsDeclared("iMsgBoxAnswer") Then Local $qqsoso
$qqsoso = MsgBox($MB_YESNO + $MB_DEFBUTTON2 + $MB_ICONQUESTION,"是否安装搜搜","是否安装搜搜",5)
Select
        Case $qqsoso = $IDYES

        Case $qqsoso = $IDNO

        Case $qqsoso = -1 ;Timeout

EndSelect
#EndRegion --- CodeWizard generated code End ---


;安装程序开始






ProcessClose("QQ.exe")
$1="QQ"

If not FileExists ($qqname) Then
MsgBox (0+16,"警告","没有找到指定的QQ安装文件"& @CRLF &"请把本程序放到QQ安装文件所在目录中运行")
Exit
EndIf

Run($qqname)

WinWait($1)
;提示QQ正在安装
#Region --- CodeWizard generated code Start ---
;ToolTip features: Text=Yes, X Coordinate=Default, Y Coordinate=Default, Title=Yes, Info icon, Balloon Tip
If Not IsDeclared("sToolTipAnswer") Then Local $sToolTipAnswer
$sToolTipAnswer = ToolTip("请稍候,QQ正在装!",Default,Default,"QQ正在安装",1,1)
#EndRegion --- CodeWizard generated code End ---
If Not WinActivate($1) Then
    WinActive($1)
    WinWaitActive ($1)
EndIf
Send("!i")

WinWait($1)
If Not WinActivate ("$1") Then
WinActivate($1)
WinWaitActive($1)
EndIf

ControlCommand($1,"","Button4","Check","")
ControlCommand($1,"","Button10","Check","")
Sleep(1000)
Send("!n")

WinWaitActive($1)
ControlSetText($1,"","Edit1",$qqlujin)
;安装快车,工具栏,搜搜
If $qqkuaiche=$IDYES Then;快车
ControlCommand($1,"","Button4","Check","")
Else
ControlCommand($1,"","Button4","UnCheck","")
EndIf
If $qqtool=$IDYES Then;工具栏
ControlCommand($1,"","Button5","Check")
Else
    ControlCommand($1,"","Button5","UnCheck")
EndIf
If $qqsoso=$IDYES Then;搜搜
   ControlCommand($1,"","Dialog12671","Check")
Else
    ControlCommand($1,"","Dialog12671","UnCheck")
EndIf
Send("!n")

WinWait($1,"完成 QQ200")
If Not WinActivate($1) Then
WinActivate($1)
WinWaitActive($1)
EndIf

;安装完成
#Region --- CodeWizard generated code Start ---
;ToolTip features: Text=Yes, X Coordinate=Default, Y Coordinate=Default, Title=Yes, Info icon, Balloon Tip
If Not IsDeclared("sToolTipAnswer") Then Local $sToolTipAnswer
$sToolTipAnswer = ToolTip("你的QQ已安装到指定的盘下,谢谢你的使用",Default,Default,"QQ安装完成",1,1)
#EndRegion --- CodeWizard generated code End ---

ControlCommand($1,"","Button4","UnCheck","")
ControlCommand($1,"","Button5","UnCheck","")
Send("!f")


[ 本帖最后由 jackly 于 2008-6-6 11:13 编辑 ]

流氓兔 发表于 2008-6-7 18:59:13

感觉不是很好用,而且开始过程就停下了

78391493 发表于 2008-8-23 09:10:24

晕,绑了一推流氓软件。。。
页: [1]
查看完整版本: QQ自动安装程序完整版