Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trouble installing custom inf in Windows 10 Professional. Windows overrides it with OEM driver

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:

  1. Unplug the device from the USB port
  2. Load a snap shot of freshly-installed Windows 10 Professional
  3. Right click, install on the .inf file
  4. Plug in the device
  5. 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

like image 537
Luke Allison Avatar asked Feb 03 '17 00:02

Luke Allison


People also ask

How to install the INF driver in Windows 10?

Here’s a quick guide on installing the INF driver from Device Manager: Press Windows key + R to open up a Run dialog box. Then, type “ devmgmt.msc ” and press Enter to open up Device Manager. If prompted by UAC (User Account Control) click Yes at the prompt.

How do I update the INF driver in Device Manager?

If prompted by UAC (User Account Control) click Yes at the prompt. Once you get inside Device Manager, right-click on the device that whose INF driver belongs to. Then, click on Update Driver software ( or Update Driver). At the next window, click Browse my computer for driver software.

Why can’t I install the INF file?

Typically, the error is encountered when the user tries to right-click the inf file and chooses Install from the contextual menu. The INF file you selected does not support this method of installation. We investigated this particular error by trying to replicate the issue and looking at various user reports.

How do I get around Windows 10 enforcing their own drivers?

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.


1 Answers

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.

like image 200
Luke Allison Avatar answered Sep 22 '22 13:09

Luke Allison