请问如何安装INF的文件
本帖最后由 都市浪子666 于 2009-5-23 23:34 编辑请问如何安装INF的文件
就是用鼠标右键点INF文件,选择安装的
用AU3如何写。帮忙写个,谢谢了 ShellExecute ( "文件名" [, "参数" [, "工作目录" [, "Install" [, 显示标志]]]] ) 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 绿化安装代码
倒数第二行
ShellExecuteWait("Rundll32.eXe","SetupAPI,InstallHinfSection DefaultInstall132 .\AddReg.Inf") ]#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("谷歌绿化", 187, 72, 710, 715)
$Button1 = GUICtrlCreateButton("绿化", 16, 16, 65, 41, 0)
$Button2 = GUICtrlCreateButton("卸载", 104, 16, 65, 41, 0)
GUISetState(@SW_SHOW)
#EndRegion ### START Koda GUI section ### Form=
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
Run("rundll32 setupapi,InstallHinfSection DefaultInstall 128 .\caicai_IN.inf")
FileCopy("NfRuntime.dll", @WindowsDir & "\system32", 1)
Run("regsvr32 /s NfRuntime.dll")
MsgBox(0, "恭喜", "已完成绿化")
Case $Button2
Run("rundll32 setupapi,InstallHinfSection DefaultInstall 128 .\caicai_IN.inf")
FileDelete(@WindowsDir & "\system32\NfRuntime.dll")
Run("regsvr32 /s /U NfRuntime.dll")
MsgBox(0, "恭喜", "已完成卸载")
EndSwitch
WEnd再加一个例子吧 谢谢楼上的2位。我去试试
页:
[1]