原帖由 jevonleen 于 2009-3-20 19:49 发表
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 编辑 ] |