找回密码
 加入
搜索
查看: 4600|回复: 4

[原创] MSN官方安程序安装脚本

  [复制链接]
发表于 2010-1-21 19:54:46 | 显示全部楼层 |阅读模式
网吧msn版本太旧,自动安装下..有版本判断,适合网吧用

不足请大侠多指点.
FileInstall('msg8.exe',@TempDir & '\msg8.exe',1) ;把msn安装程序包进来..

;如果版本号相同,直接运行,目录好像是默认的,应该不用改
$ver=FileGetVersion('C:\Program Files\Windows Live\Messenger\msnmsgr.exe')
If $ver=='14.0.8089.726' Then
        Run('C:\Program Files\Windows Live\Messenger\msnmsgr.exe')
        Exit
EndIf

;关闭ie...不然安装会多一步..
$msg=MsgBox(1,'注意','MSN安装程序将在5秒内关闭ie浏览器,如不便请点 取消 退出程序',10)
If $msg=2 Then
        Exit
EndIf
killie()

;开始安装
Run(@TempDir & '\msg8.exe')
BlockInput(1)
WinWaitActive('Windows Live','查看隐私声明')
Send('!a')
WinWaitActive('Windows Live','所需空间')
;点掉多余的项目,这些东西要下载半天..很郁闷...
ControlClick('Windows Live','所需空间','[CLASS:wlsplctl32;INSTANCE:1]','',1,11,38)
ControlClick('Windows Live','所需空间','[CLASS:wlsplctl32;INSTANCE:1]','',1,11,60)
ControlClick('Windows Live','所需空间','[CLASS:wlsplctl32;INSTANCE:1]','',1,11,82)
ControlClick('Windows Live','所需空间','[CLASS:wlsplctl32;INSTANCE:1]','',1,11,105)
ControlClick('Windows Live','所需空间','[CLASS:wlsplctl32;INSTANCE:1]','',1,11,154)
Send('!i')
WinWaitActive('Windows Live','设置为默认搜索提供程序')
Send('!c')
WinWaitActive('Windows Live','关闭')
Send('!c')
BlockInput(0)


Func killie()  ;关掉ie 和 msn
        Do
        $killie=ProcessExists("IEXPLORE.EXE")
        $killmsn=ProcessExists('msnmsgr.exe')
        If ProcessExists("IEXPLORE.EXE") Then
        ProcessClose("IEXPLORE.EXE.exe") 
        EndIf
        If ProcessExists("msnmsgr.exe") Then
        ProcessClose("msnmsgr") 
        EndIf
        Until $killie+$killmsn=0
EndFunc
发表于 2010-1-21 22:19:39 | 显示全部楼层
拣一点能用的
 楼主| 发表于 2010-7-17 13:00:10 | 显示全部楼层
发现了更好,现快的方法...如下

首先.下载一个官方的msn安装程序,一路next安装完,后在系统临时文件夹(%tmp%)下子目录里(这个目录名是随机的)找到一个Messenger.msi的安装文件.
这个就是msn内部安装文件了..它安装很快的..接下来就批处理或au3写个程序安装就行了.


1批处理方法


::::这句用来判断是否已经安装:::::::
if exist c:\msn.dat goto noupdate

start /wait messenger.msi
echo update>c:\msn.dat

:noupdate
start "C:\Program Files\Windows Live\Messenger\messenger.exe"


2 AU3方法
用au3写个小程序喽..au3可以直接判断messenger.exe的版本号,代码如下


FileInstall('msg8.exe',@TempDir & '\messenger.msi',1) ;把msn程序直接包在自己写的程序里面
;开始验证版本..如果版本是新版就直接运行
$ver=FileGetVersion('C:\Program Files\Windows Live\Messenger\msnmsgr.exe')
If $ver=='14.0.8089.726' Then
Run('C:\Program Files\Windows Live\Messenger\msnmsgr.exe')
Exit
EndIf

;不是新版,安装
BlockInput(1) ;这句禁止输入.,你也可以不写;;
ShellExecuteWait(@TempDir & '\Messenger.msi')
BlockInput(0)
;运行
Run('C:\Program Files\Windows Live\Messenger\msnmsgr.exe')




OK了..其实au3很简单,写小程序也很方便..bat的话要把安装文件和bat放在同一文件夹下,而au3只要把他包进来就行了.
发表于 2010-7-17 16:48:28 | 显示全部楼层
后面这个不错
发表于 2010-7-17 21:04:52 | 显示全部楼层
楼主强悍!确实好!
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-5 18:50 , Processed in 0.075756 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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