jevonleen 发表于 2009-3-20 19:49:29

关于WINRAR3.8

run("wrar380sc.exe")
WinWaitActive("WinRAR 3.80 简体中文版","目标文件夹")
Send("{enter}")<此处通过>
WinWaitActive("WinRAR 3.80 简体中文版安装","关联文件")
Send("{enter}")<我也曾换成ControlClick("WinRAR 3.80 简体中文版安装","确定","Button27"),还是不行>
WinClose("WinRAR 3.80 简体中文版")
WinClose("WinRAR")
错误的界面如附件中所示,请高手帮帮忙,谢谢!

[ 本帖最后由 jevonleen 于 2009-3-24 01:55 编辑 ]

ddx13 发表于 2009-3-21 01:08:47

run("wrar380sc.exe")
WinWaitActive("WinRAR 3.80 简体中文版","目标文件夹")
Send("{enter}");<此处通过>
WinWaitActive("WinRAR 简体中文版安装")
Send("{enter}");<我也曾换成ControlClick("WinRAR 3.80 简体中文版安装","确定","Button27"),还
是不行>
WinClose("WinRAR 简体中文版安装")
WinClose("WinRAR")




看清标提再安装。

b8922127 发表于 2009-3-23 17:59:09

試試看吧!!RUN("wrar380.exe");呼叫主程式


;================ 安裝作業 ================

WinWaitActive("WinRAR 3.80","Destination folder")
send("{TAB}")
sleep(100)
send("{TAB}")
sleep(100)
send("{ENTER}")
WinWaitActive("WinRAR Setup","These options control integration of WinRAR into Windows.")
sleep(100)
send("{Enter}")

WinWaitActive("WinRAR Setup","Thank you for using WinRAR !")
sleep(200)
send("{Enter}")

17911 发表于 2009-3-23 18:27:24

这样就对了
run("wrar380sc.exe")
WinWaitActive("WinRAR 3.80 简体中文版","目标文件夹")
Send("{enter}")
WinWaitActive("WinRAR 简体中文版安装")
Send("{enter}")
WinClose("WinRAR 简体中文版安装")
send("{Enter}")
WinClose("WinRAR")

[ 本帖最后由 17911 于 2009-3-23 18:28 编辑 ]

jevonleen 发表于 2009-3-24 01:50:46

谢谢各位!我已经自己解决了,4楼的最后一步不行

17911 发表于 2009-3-24 08:11:36

原帖由 jevonleen 于 2009-3-24 01:50 发表 http://www.autoitx.com/images/common/back.gif
谢谢各位!我已经自己解决了,4楼的最后一步不行
抱歉,疏忽了,应该这样
run("wrar380sc.exe")
WinWaitActive("WinRAR 3.80 简体中文版","目标文件夹")
Send("{enter}")
WinWaitActive("WinRAR 简体中文版安装")
Send("{enter}")
WinClose("WinRAR 简体中文版安装")
send("{Enter}")
Sleep(2000)
WinKill("C:\Documents and Settings\All Users\「开始」菜单\程序\WinRAR","")

ahkang 发表于 2009-4-18 16:06:15

发一个 WinRAR 3.8 绿化安装代码

原帖由 jevonleen 于 2009-3-20 19:49 发表 http://www.autoitx.com/images/common/back.gif
run("wrar380sc.exe")
WinWaitActive("WinRAR 3.80 简体中文版","目标文件夹")
Send("{enter}")
WinWaitActive("WinRAR 3.80 简体中文版安装","关联文件")
Send("{enter}")
WinClose("WinRAR 3.80 简体中文版") ...

将生成的程序文件放到 WinRAR 的安装目录下,即使重装系统也不必再去重新安装,只需双击一下就好。
主代码如下(若窗口标题和可见文本不符请自己修改):

;脚本开始 - 请在这下面添加您的代码:

Opt('WinTitleMatchMode',4)
Opt('WinWaitDelay',50)
Opt('TrayIconDeBug',1)

$WinTitle = 'WinRAR 简体中文版安装'
$SubTitle = '关联菜单项目'

Run(@ScriptDir&'\UnInstall /Setup.Sfx')
WinWait($WinTitle, 'WinRAR 关联文件' )
WinActivate($WinTitle, 'WinRAR 关联文件' )
ControlClick($WinTitle, 'WinRAR 关联文件', 'Button16' )
ControlCommand($WinTitle, 'WinRAR 关联文件', 'Button3', 'UnCheck' )
ControlCommand($WinTitle, 'WinRAR 关联文件', 'Button4', 'UnCheck' )
ControlCommand($WinTitle, 'WinRAR 关联文件', 'Button14', 'UnCheck' )
ControlCommand($WinTitle, 'WinRAR 关联文件', 'Button20', 'UnCheck' )
ControlCommand($WinTitle, 'WinRAR 关联文件', 'Button21', 'Check' )
ControlCommand($WinTitle, 'WinRAR 关联文件', 'Button24', 'Check' )
ControlClick($WinTitle, 'WinRAR 关联文件', 'Button25' )

WinWait($SubTitle, '确定' )
WinActivate($SubTitle, '确定' )
ControlCommand($SubTitle, '确定', 'Button2', 'Check' )
ControlCommand($SubTitle, '确定', 'Button3', 'UnCheck' )
ControlCommand($SubTitle, '确定', 'Button4', 'UnCheck' )
ControlCommand($SubTitle, '确定', 'Button5', 'UnCheck' )
ControlCommand($SubTitle, '确定', 'Button6', 'Check' )
ControlCommand($SubTitle, '确定', 'Button7', 'Check' )
ControlCommand($SubTitle, '确定', 'Button8', 'UnCheck' )
ControlCommand($SubTitle, '确定', 'Button9', 'UnCheck' )
ControlCommand($SubTitle, '确定', 'Button10', 'UnCheck' )
ControlCommand($SubTitle, '确定', 'Button11', 'UnCheck' )
ControlCommand($SubTitle, '确定', 'Button12', 'UnCheck' )
ControlClick($SubTitle, '确定', 'Button13' )

WinActivate($WinTitle, 'WinRAR 关联文件' )
ControlClick($WinTitle, 'WinRAR 关联文件', 'Button27' )

WinWait('WinRAR 简体中文版安装', '完成')
ControlClick('WinRAR 简体中文版安装', '完成', 'Button1' )

; DirCopy(@ScriptDir&"\WinRAR",@AppDataDir & "\WinRAR",1)
ShellExecuteWait("Rundll32.eXe","SetupAPI,InstallHinfSection DefaultInstall 132 .\AddReg.Inf")
RunWait('RegSvr32 /S ZipFldr') ; 恢复系统自带的右键 Zip 压缩功能Dll'

[ 本帖最后由 ahkang 于 2009-4-18 16:13 编辑 ]

supersuper 发表于 2009-4-21 16:19:14

我实验的时候需要在winclose("WinRAR")前面加个延时sleep,要不无法关闭弹出窗口,不知道为啥,难道我的机器运行速度太快了?

qddoit 发表于 2009-5-22 06:59:32

:face (10):

49666684 发表于 2011-4-17 06:32:05

来学习一下~
页: [1]
查看完整版本: 关于WINRAR3.8