首页 文章

Inf文件无法在Windows 7中找到usbser.sys

提问于
浏览
0

UPDATE: 感谢下面的答案,我设法让它在Windows 7上运行 . 我已经意识到Windows 10安装但是用OEM USB串行驱动程序覆盖了我的驱动程序 . 请参阅:Trouble installing custom inf in Windows 10 Professional. Windows overrides it with OEM driver

我尝试使用标准的windows usb-serial驱动程序创建一个安装usb-serial设备的Inf文件 . 此文件在Windows 8.1和Windows 10上成功安装驱动程序,但在Windows 7 32位和Windows 7 64位中失败 . 我试图右键单击从桌面安装驱动程序(默认安装) . 我第一次尝试这个时,出现了错误“你建议的inf文件不支持这种安装方法” . 我将defaultInstall部分添加到inf文件中 . 我这样做后错误消失但系统找不到usbser.sys . “需要Windows CD上的'usbser.sys'文件 . ”

为了从Windows 7成功安装,我需要添加到下面的inf文件中?

当前的inf文件:

;************************************************************
; Windows USB CDC ACM Setup File
; Copyright (c) 2000 Microsoft Corporation

; Version v1.1, updated 17 April 2013

[Version]
Signature="$Windows NT$"
Class=Ports
ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}
Provider=%MFGNAME%
LayoutFile=layout.inf
CatalogFile=%MFGFILENAME%.cat
DriverVer=11/15/2007,5.1.2600.0

[Manufacturer]
%MFGNAME%=DeviceList, NTamd64

[DestinationDirs]
DefaultDestDir=12

;------------------------------------------------------------------------------
;  Windows 2000/XP/Vista-32bit Sections
;------------------------------------------------------------------------------

;DEFAULT SECTION ADDED
;---------------------------------------------
[DefaultInstall.nt]
include=mdmcpq.inf
CopyFiles=DriverCopyFiles.nt
AddReg=DriverInstall.nt.AddReg

[DefaultInstall.nt.Services]
AddService=usbser, 0x00000002, DriverService.nt
;---------------------------------------------

[DriverInstall.nt]
include=mdmcpq.inf
CopyFiles=DriverCopyFiles.nt
AddReg=DriverInstall.nt.AddReg

[DriverCopyFiles.nt]
usbser.sys,,,0x20

[DriverInstall.nt.AddReg]
HKR,,DevLoader,,*ntkern
HKR,,NTMPDriver,,%DRIVERFILENAME%.sys
HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"

[DriverInstall.nt.Services]
AddService=usbser, 0x00000002, DriverService.nt

[DriverService.nt]
DisplayName=%SERVICE%
ServiceType=1
StartType=3
ErrorControl=1
ServiceBinary=%12%\%DRIVERFILENAME%.sys

;------------------------------------------------------------------------------
;  Vista-64bit Sections
;------------------------------------------------------------------------------

;DEFAULT SECTION ADDED
;---------------------------------
[DefaultInstall.NTamd64]
include=mdmcpq.inf
CopyFiles=DriverCopyFiles.NTamd64
AddReg=DriverInstall.NTamd64.AddReg

[DefaultInstall.NTamd64.Services]
AddService=usbser, 0x00000002, DriverService.NTamd64
;----------------------------------

[DriverInstall.NTamd64]
include=mdmcpq.inf
CopyFiles=DriverCopyFiles.NTamd64
AddReg=DriverInstall.NTamd64.AddReg

[DriverCopyFiles.NTamd64]
%DRIVERFILENAME%.sys,,,0x20

[DriverInstall.NTamd64.AddReg]
HKR,,DevLoader,,*ntkern
HKR,,NTMPDriver,,%DRIVERFILENAME%.sys
HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"

[DriverInstall.NTamd64.Services]
AddService=usbser, 0x00000002, DriverService.NTamd64

[DriverService.NTamd64]
DisplayName=%SERVICE%
ServiceType=1
StartType=3
ErrorControl=1
ServiceBinary=%12%\%DRIVERFILENAME%.sys


;------------------------------------------------------------------------------
;  Vendor and Product ID Definitions
;------------------------------------------------------------------------------
; When developing your USB device, the VID and PID used in the PC side
; application program and the firmware on the microcontroller must match.
; Modify the below line to use your VID and PID.  Use the format as shown below.
; Note: One INF file can be used for multiple devices with different VID and PIDs.
; For each supported device, append ",USB\VID_xxxx&PID_yyyy" to the end of the line.
;------------------------------------------------------------------------------
[SourceDisksFiles]
[SourceDisksNames]
[DeviceList]
%linux.gserial%=DriverInstall, USB\VID_1FC9&PID_816A, USB\VID_1FC9&PID_816A&MI_00

[DeviceList.NTamd64]
%linux.gserial%=DriverInstall, USB\VID_1FC9&PID_816A, USB\VID_1FC9&PID_816A&MI_00

;------------------------------------------------------------------------------
;  String Definitions
;------------------------------------------------------------------------------
;Modify these strings to customize your device
;------------------------------------------------------------------------------
[Strings]
MFGFILENAME="c500"
DRIVERFILENAME ="usbser"
MFGNAME="Rinstrum Pty Ltd"
INSTDISK="Rinstrum USB Gadget Serial Driver Installer"
linux.gserial="Rinstrum USB Gadget Serial"
SERVICE="USB RS-232 Emulation Driver"

如果我然后在命令行上使用命令RUNDLL32.EXE SETUPAPI.DLL,InstallHinfSection DefaultInstall 132 c500.inf我提示错误“安装失败” .

2 回答

  • 0

    我已经制作了大量基于usbser.sys的驱动程序,可以在Windows 7上运行 . 这是一个例子:https://github.com/pololu/p-star-examples/blob/master/drivers/p-star-serial.inf

    我认为您不需要拥有“DriverCopyFiles.nt”部分及其引用 . 看看我上面链接的驱动程序,它显示了如何引用“FakeModemCopyFileSection” .

    另外,关于你的一件事看起来很可疑,你选择在“字符串”部分用字符串制作“usbser” . 我真的没有看到这一点,并且该字符串定义附近的空白被搞砸了 . 你可以在使用它的地方写“usbser” .

  • 0

    除了David Grayson的回答之外 . 我在https://github.com/pololu/p-star-examples/blob/master/drivers/p-star-serial.inf使用他的例子作为我的inf文件的基础 .

    确保您在.inf文件中指定的任何标识信息与设备管理器中显示的硬件ID完全匹配 . 例如,我在硬件ID中有一些&MI_00或&MI_01内容,这使得Windows与设备不匹配 .

    Hardware Ids in Device Manager

    嗯,似乎并不需要&REV_0000 .

相关问题