Author Topic: Windows Automated Driver Installation  (Read 15466 times)

henkman

  • Member
  • ***
  • Posts: 5
Windows Automated Driver Installation
« on: July 12, 2014, 03:32:24 pm »
Hi,

I developed a USB device for use with WinUSB several years ago. With Windows 8 I found out that in box driver installation is possible by extentending my device firmware with the 0xEE Microsoft OS string descriptor and Device Interface GUID retrieval. More on that can be found at https://github.com/pbatard/libwdi/wiki/WCID-Devices.

From what i read it seems that the same procedure should work on WIndows 7. However, for some reason which I do not know, it does not seem to work in my case.
During device enumeration I can see that the  USB\MS_COMP_WINUSB string becomes visible but Windows does not find the appropriate driver altough winusb is already available on my OS. The only way to get it work is by supplying my old inf file again.

The Zadiq application shows that my device is WCID compatible but driver automatic installation fails on W7. (I don't have W8 and could not test it on that OS).

My device responds correctly to the Extended Compat ID OS Feature Descriptor (wIndex = 0x0004) and the Extended Prperties OS Feature Descriptor (wIndex = 0x0005).

Did I misinterpret the inbox WinUSB installation for Windows 7 or is there something else which I should check for installation of WinUSB device without inf file on W7 ?

Any help/suggestions highly appreciated,
Henk

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Windows Automated Driver Installation
« Reply #1 on: July 12, 2014, 03:59:07 pm »

henkman

  • Member
  • ***
  • Posts: 5
Re: Windows Automated Driver Installation
« Reply #2 on: July 12, 2014, 05:27:49 pm »
Hi Jan,

Thanks for your prompt response.
I believe I have an old one.

; WinUsb.inf
; Microsoft Windows WinUsb Driver INF
; Copyright (c) Microsoft Corporation


[SourceDisksNames]
3426=windows cd

[SourceDisksFiles]
winusb.sys       = 3426

[Version]
Signature="$Windows NT$"
Provider=%MS%
pnplockdown=1                       ; Third Party Protected
DriverVer=06/21/2006,6.1.7601.17514

[DestinationDirs]
DefaultDestDir = 12
WINUSB_CoInstaller_CopyFiles = 11

[DefaultInstall]
CopyFiles=WINUSB.CopyFiles

[WINUSB.NT]
CopyFiles=WINUSB.CopyFiles
AddReg=WINUSB.AddReg

[WINUSB.AddReg]
HKR,,DevLoader,,*ntkern
HKR,,NTMPDriver,,winusb.sys

[WINUSB.NT.Services]
Addservice = WINUSB, 0x00000002, WINUSB.AddService

[WINUSB.NT.UMDFServices]
Addservice = WINUSB, 0x00000000, WINUSB.AddService

[WINUSB.AddService]
DisplayName    = %WINUSB_SvcDesc%
ServiceType    = 1                  ; SERVICE_KERNEL_DRIVER
StartType      = 3
ErrorControl   = 1                  ; SERVICE_ERROR_NORMAL
ServiceBinary  = %12%\WinUSB.SYS

[WINUSB.CopyFiles]
winusb.sys,,,0x0100                 ; Microsoft Protected

;
; --- Coinstaller section for kmdf ---
;
;[WINUSB.NT.CoInstallers]
;AddReg=WINUSB_CoInstaller_AddReg
;CopyFiles=WINUSB_CoInstaller_CopyFiles

;[WINUSB_CoInstaller_AddReg]
;HKR,,CoInstallers32,0x00010000, "WdfCoInstaller01000.dll,WdfCoInstaller"

;[WINUSB_CoInstaller_CopyFiles]
;WdfCoInstaller01000.dll

;[WINUSB_Device.NT.Wdf]
;KmdfService = WINUSB, WINUSB_wdfsect
;[WINUSB_wdfsect]
;KmdfLibraryVersion = 1.0


[Strings]
;
;Not localizable

MS="Microsoft"
;
;Localizable
;

WINUSB_SvcDesc = "WinUsb Driver"


But how do I update the old one?

regards
Henk

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Windows Automated Driver Installation
« Reply #3 on: July 12, 2014, 10:02:39 pm »
The article I linked to says to go through Windows Update.

henkman

  • Member
  • ***
  • Posts: 5
Re: Windows Automated Driver Installation
« Reply #4 on: July 13, 2014, 06:11:56 am »
Hi Jan,

I've read it ofcourse but I can't get it work. The arcticle suggests that the updated inf should be downloaded automatically when Windows Update is configured for automatic updates but for some reason I do not get an updated Winusb.inf on my computer.
Editing of the file is also not possible.

Any ideas?

regards,
Henk

Tsuneo

  • Frequent Contributor
  • ****
  • Posts: 145
Re: Windows Automated Driver Installation
« Reply #5 on: July 13, 2014, 07:44:56 pm »
Quote
henkman
I believe I have an old one.
Not just the INF file, you need a catalog (.cat) file for the INF file.
It is "certified" INF means.

Quote
henkman
The arcticle suggests that the updated inf should be downloaded automatically when Windows Update is configured for automatic updates but for some reason I do not get an updated Winusb.inf on my computer.
Unfortunately, Windows Update doesn’t distribute the driver.
"Microsoft Update Catalog" does.
As of the download procedure of "WinUSB class" driver, refer to this post,

"MS-official "WinUSB class" driver for XP, Vista and 7"
http://www.microchip.com/forums/m790429.aspx

Tsuneo

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Windows Automated Driver Installation
« Reply #6 on: July 13, 2014, 08:53:09 pm »
Wow, this is crazy...thanks as always, Tsuneo!

henkman

  • Member
  • ***
  • Posts: 5
Re: Windows Automated Driver Installation
« Reply #7 on: July 14, 2014, 01:49:06 pm »
Hi Tsuneo,

Many thanks for your reply! However there is still one issue left...
I've tested this solution on another W7 machine.

I can get the driver installed but there is one disadvantage with this method.

After issuing the winusbcompat driver it installs the updated WinUSB driver and my device is accepted by windows.
However, because it failed to find the driver initially (we need to direct windows to the location of the new cat file) the DeviceInterfaceGUIDs query is not performed.
I believe this has to do with the fact that the 0xEE retrieval is only performed once when the device is first plugged in.

Thus it results in a installed driver without regkey added for the DeviceInterfaceGUIDs.

The only solution to solve that problem is to delete the regkey under VIDPID in the usbflags section of the registry.
After that a new enumeration of the device installs the driver correctly and also retrieves the correct DeviceInterfaceGUIDs.

That does not seem to be a nice solution for rolling out the product. Maybe there is another way to preinstall the new driver?

Or am I am misinterpreting something.. ?

Regards,
Henk

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research

Tsuneo

  • Frequent Contributor
  • ****
  • Posts: 145
Re: Windows Automated Driver Installation
« Reply #9 on: July 16, 2014, 09:26:48 am »
Quote
I believe this has to do with the fact that the 0xEE retrieval is only performed once when the device is first plugged in.
When your PC would have a device instance of the VID/PID of your target device, Windows shouldn't retrieve MS OS descriptor (string index: 0xEE). You have to delete (uninstall) the device instance on the Device Manager, first.

Quote
That does not seem to be a nice solution for rolling out the product.
Usually, the PCs of your customers don't have any device instance of the VID/PID of your products.
And then, the driver installation works as you expect.

You may pre-install the "WinUSB class" (winusbcompat) driver, using DPInst utility, along with the installation of your PC applications.

DPInst utility
http://msdn.microsoft.com/en-us/library/ff544842%28v=vs.85%29.aspx

Tsuneo