【问题标题】:Trouble installing custom inf in Windows 10 Professional. Windows overrides it with OEM driver在 Windows 10 专业版中安装自定义 inf 时遇到问题。 Windows 使用 OEM 驱动程序覆盖它
【发布时间】:2017-06-20 06:27:00
【问题描述】:

我为自定义设备制作了一个签名的 USB Serial inf 文件,并创建了一个安装程序,可以成功地将驱动程序安装到 Windows 7 (32/64)、Windows 8.1 (64) 但不是 Windows 10。这适用于默认安装(右键单击,安装)直接在文件上,使用设备管理器和使用 PNPU​​TIL。设备驱动程序安装成功,但使用的是 OEM usbser 驱动程序。单击“更新驱动程序”并在设备管理器中选择我的驱动程序后,Windows 会提示我“已为您的设备安装了最佳驱动程序软件”。如果我使用设备管理器并选择“从磁盘安装”,我可以成功解决 Windows 10 强制执行自己的驱动程序的问题。不过,这并没有让我更接近成功的 inf 文件和安装程序。

我的默认安装过程:

  1. 从 USB 端口拔下设备
  2. 加载新安装的 Windows 10 专业版的快照
  3. 右键单击,安装在 .inf 文件上
  4. 插入设备
  5. 查看设备管理器,发现使用的是微软的标准USB Serial Device驱动,而不是我的驱动

如果我随后将其卸载并重复步骤 3-5,它有时会使我的自定义驱动程序保持不变。

有人告诉我,我的驱动程序安装在 Windows 10 Enterprise 上,这让事情变得更加混乱。

问题:我做错了什么?

我的 inf 文件:

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

; Version v1.1, updated 17 April 2013


[Strings]
DriverPackageDisplayName="Rinstrum USB Serial Drivers"
ManufacturerName="Rinstrum"
ServiceName="USB RS-232 Emulation Driver"
linux.gserial="Rinstrum USB Gadget Serial"
MFGNAME="Rinstrum"

[DefaultInstall]
CopyINF=c500.inf

[Version]
DriverVer=03/02/2017,1.0.0.0
Signature=$Windows NT$
Class=Ports
ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}
Provider=%MFGNAME%
CatalogFile=c500.cat
DriverPackageDisplayName=%DriverPackageDisplayName%
PnpLockdown=1

[Manufacturer]
%MFGNAME%=Models,NTx86,NTamd64,NTarm

[DestinationDirs]
DefaultDestDir=12
FakeModemCopyFileSection=12

[Models.NTx86]
%linux.gserial%=DriverInstall, USB\VID_1FC9&PID_816A, USB\VID_1FC9&PID_816A&MI_00

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

[Models.NTarm]
%linux.gserial%=DriverInstall, USB\VID_1FC9&PID_816A, USB\VID_1FC9&PID_816A&MI_00

[DriverInstall]
Include=mdmcpq.inf
CopyFiles=FakeModemCopyFileSection
AddReg=DriverAddReg

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

[DriverInstall.Services]
Include=mdmcpq.inf
AddService=usbser,0x2,DriverService

[DriverService]
DisplayName=%ServiceName%
ServiceType=1
StartType=3
ErrorControl=1
ServiceBinary=%12%\usbser.sys
LoadOrderGroup=Base

更新:来自 setupapi.dev.log 的附加信息

>>>  [Device Install (DiInstallDriver) - C:\Users\R&D\Desktop\c500.inf]
>>>  Section start 2017/02/03 17:17:58.321      
cmd: "C:\Windows\System32\InfDefaultInstall.exe" "C:\Users\R&D\Desktop\c500.inf"     
ndv: Flags: 0x00000000     
ndv: INF path: C:\Users\R&D\Desktop\c500.inf     
inf: {SetupCopyOEMInf: C:\Users\R&D\Desktop\c500.inf} 17:17:58.337     
inf:      Copy style: 0x00000000 !   
inf:      Driver package is already in driver store     
inf:      Driver Store Path: C:\Windows\System32\DriverStore\FileRepository\c500.inf_amd64_4fee793fb11027ac\c500.inf    inf:      Published Inf Path: C:\Windows\INF\oem4.inf     
inf: {SetupCopyOEMInf exit (0x00000000)} 17:17:58.368
<<<  Section end 2017/02/03 17:17:58.399
<<<  [Exit status: SUCCESS]

更新: setupapi.dev.log 在尝试安装设备时出现以下错误

 sig:                     Success: File is signed in Authenticode(tm) catalog.
 sig:                     Error 0xe0000242: The publisher of an Authenticode(tm) signed catalog has not yet been established as trusted.

更新: VBox 来宾添加安装程序设法在 WIN10 中安装我的 inf 文件。以下是来源:

https://www.virtualbox.org/browser/vbox/trunk/src/VBox/Additions/WINNT/Installer/VBoxDrvInst.cpp#L433

【问题讨论】:

  • 您的设备是否是复合的?根据答案,您在“型号”部分列出的两个设备 ID 之一不正确。您可能应该发布设备管理器的屏幕截图,以便我们检查您的设备 ID。
  • 我从未见过像您在“模型”部分中所做的那样在同一行列出两个设备 ID,MSDN documentation 表示它们的处理方式不同,因此我建议不要这样做。每个设备 ID 一行。

标签: windows usb driver usbserial inf


【解决方案1】:

在授予用户覆盖 Windows 10 中的 OEM 驱动程序的权限之前,需要激活 Windows。在我的测试机器上激活 Windows 解决了这个问题。

【讨论】:

    【解决方案2】:

    尝试使用今天的日期和 1.0.0.0 正确设置您的 DriverVer 指令。日期是 Windows 在决定使用什么驱动程序时会考虑的一件事。

    【讨论】:

    • 感谢您指出这一点。不幸的是,它没有效果。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-03-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-12-11
    相关资源
    最近更新 更多