问题
I have made a signed USB Serial inf file for a custom device and created an installer that successfully installs the driver to Windows 7 (32/64), Windows 8.1 (64) but not Windows 10. This applies to the default installation (right-click, install) directly on the file, using Device Manager and using PNPUTIL. The device driver successfully installs but the OEM usbser driver is used instead. After clicking "Update Driver" and selecting my driver in Device Manager, Windows prompts me with "The best driver software is already installed for your device". If I use Device Manager and choose "Have Disk" I can successfully get around the issue with Windows 10 enforcing their own driver. This doesn't get me any closer to having a successful inf file and installer though.
My process for default installation:
- Unplug the device from the USB port
- Load a snap shot of freshly-installed Windows 10 Professional
- Right click, install on the .inf file
- Plug in the device
- Look at Device Manager and see that the standard USB Serial Device driver made by Microsoft is used instead of my driver
If I then uninstall it and repeat steps 3-5 it sometimes allows my custom driver to stick.
I've been told that my driver installs on Windows 10 Enterprise, which confuses matters further.
Question: What am I doing wrong?
My inf file:
;************************************************************
; 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
Update: additional info from 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]
Update: setupapi.dev.log gives the following error when trying to install the device
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.
Update: The VBox guest additions installer manages to install my inf file in WIN10. Here is the source:
https://www.virtualbox.org/browser/vbox/trunk/src/VBox/Additions/WINNT/Installer/VBoxDrvInst.cpp#L433
回答1:
Windows needs to be activated before the user is granted the permission to override the OEM drivers in Windows 10. Activating windows on my test machine solved this issue.
回答2:
Try setting your DriverVer
directive correctly, with today's date and 1.0.0.0. The date is one thing that Windows looks at when deciding what driver to use.
来源:https://stackoverflow.com/questions/42014826/trouble-installing-custom-inf-in-windows-10-professional-windows-overrides-it-w