Why does Devcon install a driver correctly while right-click install does not work

0

I have created a driver (.inf, .cat and .sys files) for a virtual HID device which I can successfully install on the commandline using

    devcon.exe /r install .\VirtualU2FToken.inf root\VirtualU2FToken

after which the virtual device appears in the device manager. However, when I right-click on the inf file and choose 'Install', Windows claims to successfully install the driver but the device does not appear.

So my question is: what is the difference between the right-click (which seems to call DefaultInfInstall.exe) and the devcon.exe way to install the driver? What do I need to do for the right click to work?

My inf file is below:

;
; VirtualU2FToken.inf
;

[Version]
Signature="$WINDOWS NT$"
Class=HIDClass ; TODO: edit Class
ClassGuid={745a17a0-74d3-11d0-b6fe-00a0c90f57da} ; TODO: edit ClassGuid
Provider=%ManufacturerName%
DriverPackageType=ClassFilter
CatalogFile=VirtualU2FToken.cat
DriverVer= ; TODO: set DriverVer in stampinf property pages

[DestinationDirs]
DefaultDestDir = 12
VirtualU2FToken_Device_CoInstaller_CopyFiles = 11

; ================= Class section =====================

[SourceDisksNames]
1 = %DiskName%,,,""

[SourceDisksFiles]
VirtualU2FToken.sys  = 1,,
WdfCoInstaller$KMDFCOINSTALLERVERSION$.dll=1 ; make sure the number matches with SourceDisksNames

;*****************************************
; Install Section
;*****************************************

[Manufacturer]
%ManufacturerName%=Standard,NT$ARCH$

[Standard.NT$ARCH$]
%VirtualU2FToken.DeviceDesc%=VirtualU2FToken_Device, Root\VirtualU2FToken ; TODO: edit hw-id

[VirtualU2FToken_Device.NT]
CopyFiles=Drivers_Dir

[VirtualU2FToken_Device.NT.HW]
AddReg = VirtualU2FToken_Device.NT.AddReg

[VirtualU2FToken_Device.NT.AddReg]
HKR,,"LowerFilters",0x00010000,"vhf"

[Drivers_Dir]
VirtualU2FToken.sys

;-------------- Service installation
[VirtualU2FToken_Device.NT.Services]
AddService = VirtualU2FToken,%SPSVCINST_ASSOCSERVICE%, VirtualU2FToken_Service_Inst

; -------------- VirtualU2FToken driver install sections
[VirtualU2FToken_Service_Inst]
DisplayName    = %VirtualU2FToken.SVCDESC%
ServiceType    = 1               ; SERVICE_KERNEL_DRIVER
StartType      = 3               ; SERVICE_DEMAND_START
ErrorControl   = 1               ; SERVICE_ERROR_NORMAL
ServiceBinary  = %12%\VirtualU2FToken.sys

;
;--- VirtualU2FToken_Device Coinstaller installation ------
;

[VirtualU2FToken_Device.NT.CoInstallers]
AddReg=VirtualU2FToken_Device_CoInstaller_AddReg
CopyFiles=VirtualU2FToken_Device_CoInstaller_CopyFiles

[VirtualU2FToken_Device_CoInstaller_AddReg]
HKR,,CoInstallers32,0x00010000, "WdfCoInstaller$KMDFCOINSTALLERVERSION$.dll,WdfCoInstaller"

[VirtualU2FToken_Device_CoInstaller_CopyFiles]
WdfCoInstaller$KMDFCOINSTALLERVERSION$.dll

[VirtualU2FToken_Device.NT.Wdf]
KmdfService =  VirtualU2FToken, VirtualU2FToken_wdfsect

[VirtualU2FToken_wdfsect]
KmdfLibraryVersion = $KMDFVERSION$

[Strings]
SPSVCINST_ASSOCSERVICE= 0x00000002
ManufacturerName="Nexus Group A.B." ;TODO: Replace with your manufacturer name
ClassName="HIDClass" ; TODO: edit ClassName
DiskName = "VirtualU2FToken Installation Disk"
VirtualU2FToken.DeviceDesc = "VirtualU2FToken Device"
VirtualU2FToken.SVCDESC = "VirtualU2FToken Service"
windows
installation
driver
asked on Stack Overflow Nov 11, 2019 by jonathanverner

1 Answer

0

it is because you are using Root enumerator (Root\VirtualU2FToken) when you are using Devcon install it creates device Node called Root\VirtualU2FToken

when you use the device manager install (or pnputil), it does not create a new Device Node, it just installs the driver to the driver store

answered on Stack Overflow Nov 12, 2019 by Baget

User contributions licensed under CC BY-SA 3.0