INF文件仅在Windows 7中找不到usbser.sys [英] Inf file can't find usbser.sys in Windows 7 only

查看:107
本文介绍了INF文件仅在Windows 7中找不到usbser.sys的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更新:由于下面的回答,我设法使它在Windows 7上运行.此后,我意识到Windows 10可以安装,但可以通过OEM USB串行驱动程序覆盖我的驱动程序.请参阅:在以下位置安装自定义inf的问题Windows 10专业版.Windows使用OEM驱动程序覆盖它

UPDATE: Thanks to the answer below I managed to get this to work on Windows 7. I have since realized that Windows 10 installs but overrides my driver with the OEM USB Serial driver. Please see: Trouble installing custom inf in Windows 10 Professional. Windows overrides it with OEM driver

-

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

I attempted to make an Inf file that installs a usb-serial device using the standard windows usb-serial driver. This file successfully installs the driver on Windows 8.1 and Windows 10 but fails in Windows 7 32bit and Windows 7 64 bit. I attempted to right-click install the driver from the desktop (default install). The first time I attempted this I was presented with the error "The inf file you suggested does not support this method of installation". I added the defaultInstall sections to the inf file. After I did this the error disappeared but the system could not find usbser.sys. "The file 'usbser.sys' on windows cd is needed."

要从Windows 7成功安装此文件,我需要向下面的inf文件添加什么?

What do I need to add to the inf file below in order to make this successfully install from Windows 7?

当前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,则会提示我错误安装失败".

If I then use the command RUNDLL32.EXE SETUPAPI.DLL,InstallHinfSection DefaultInstall 132 c500.inf on the command line I'm prompted with the error "Installation failed".

推荐答案

我已经制作了很多可在Windows 7上使用的基于usbser.sys的驱动程序.这是一个示例:

I've made plenty of usbser.sys-based drivers that work on Windows 7. Here is an example: https://github.com/pololu/p-star-examples/blob/master/drivers/p-star-serial.inf

我认为您不需要"DriverCopyFiles.nt"部分及其引用.查看上面链接到我的驱动程序,该驱动程序显示了如何改为引用"FakeModemCopyFileSection".

I think you don't need to have your "DriverCopyFiles.nt" section and the references to it. Look at the driver I linked to above which shows how to refer to a "FakeModemCopyFileSection" instead.

另外,一件令人讨厌的事情是,您选择在字符串"部分中使用字符串来制作"usbser".我真的看不到这一点,并且该字符串的定义附近的空白被弄乱了.您只需在使用的地方写"usbser"即可.

Also, one thing that looks fishy about yours is that you chose to make "usbser" by a string in the "Strings" section. I really don't see the point of that and the whitespace near for the definition of that string is messed up. You can just write "usbser" in the places where it is used.

这篇关于INF文件仅在Windows 7中找不到usbser.sys的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆