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 的WinRAR 3.8 绿化安装代码