找回密码
 加入
搜索
查看: 2087|回复: 5

[系统综合] 安装摄像头驱动

  [复制链接]
发表于 2012-8-9 22:05:56 | 显示全部楼层 |阅读模式
已知一个摄像头需要安装驱动,驱动文件也有了如何自动安装
发表于 2012-8-9 22:18:22 | 显示全部楼层
请去看看 帮助里的 安装winzip

如果是没有安装程序的 纯驱动 那就 调用 devcon     吧 (xp)
发表于 2012-8-10 09:40:30 | 显示全部楼层
菜鸟站岗,等待老鸟飞过。。。。
发表于 2012-8-10 13:31:19 | 显示全部楼层
EXE文件吗,用/S参数试试,如果是纯驱动试试dpinst.exe搜索试试INF安装驱动。
或者使用自动安装脚本
发表于 2012-8-10 14:13:18 | 显示全部楼层
本帖最后由 Windows8 于 2012-8-10 14:18 编辑

1、提取SYSTEM32的devcon.exe
2、提取纯驱动
3、代码
#Include <File.au3>
Local $123=_FileListToArray(@ScriptDir,"*.inf",1)
For $i=1 To $123[0]
Run(@SystemDir&'\devcon.exe install "'&@ScriptDir&'\'&$123[$i]&'" (你的设备ID,必须有)')
Next
;请将@ScriptDir改为纯驱动的目录。必须保证你的驱动有INF,SYSTEM32必须要有devcon.exe。将“(你的设备ID,必须有)”改为摄像头硬件ID
发表于 2012-8-10 21:00:47 | 显示全部楼层
这是我自己用的一个自动安装INF驱动的脚本,和系统的“添加新硬件向导”一样,只是做成了自动点击
前提是需要有 dpinst.exe, 32位和64位系统用的不一样,上网搜索可分别下载
只需要指定INF文件所在目录即可,不需要提供硬件ID
#RequireAdmin
#NoTrayIcon

Local $hWnd
;Local $InstallDir = "F:\Driver\Video\XGI\Windows\xgi_volariz7_11404\2008R2"
;Local $InstallDir = "e:\Driver\Storage\RocketRAID 264x\Windows\Win7_08_08R2_x64"
Local $InstallDir = StringReplace($CmdLineRaw, '"', '')

FileChangeDir(@ScriptDir)
If Not FileExists($InstallDir) Or Not FileExists(@ScriptDir & "\dpinst64.exe") Or Not FileExists(@ScriptDir & "\dpinst32.exe") Then
   Exit
EndIf

If @OSArch = "X64" Then
   $CommandName = 'dpinst64.exe /LM /F /PATH "' & $InstallDir & '"'        
Else
   $CommandName = 'dpinst32.exe /LM /F /PATH "' & $InstallDir & '"'        
EndIf

$InstallPID = Run($CommandName)        ;启动安装程序
If @error Then
   Exit
Else
   $TimeOut = 100
   $Switch = False
   While 1
          $WinList = WinList("[CLASS:#32770]")
          For $p = 1 To $WinList[0][0]
                 ;ToolTip(WinGetProcess($WinList[$p][1]) &"--"& $InstallPID)
                 If WinGetProcess($WinList[$p][1]) = $InstallPID Then
                        $hWnd = $WinList[$p][1]
                        $Switch = True
                        ExitLoop
                 EndIf
          Next
          If $Switch = True Or $TimeOut <= 0 Then ExitLoop                ;时间超过10秒还不出现窗口则退出
          Sleep(100)
          $TimeOut -= 1
   WEnd
   
   $Handle = WinGetTitle($hWnd)                                                                ;取窗口标题
   $Title = "[TITLE:" & $Handle & ";CLASS:#32770]"                        ;完整窗口标题,用于区分其它窗口
   If $Handle <> "" Then
          ;WinSetTrans($Title, "", 0)
          ControlClick($Title, "", "Button2")
          While 1
                 If ControlCommand($Title, "", "Button7", "IsVisible", "") Then
                        ProcessClose($InstallPID)
                        Exit
                 EndIf
                 If Not ProcessExists($InstallPID) Then Exit
                 Sleep(500)
          WEnd
   Else
          Exit
   EndIf
EndIf
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-20 12:09 , Processed in 0.082190 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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