Re: driver, not device, installation

Xiaofan Chen <[email protected]> Mon, 10 Sep 2018 09:54:34 +0800
Newsgroups gmane.comp.lib.libusb.devel.windows
Message-ID <CAGjSPUApSsmhGDa1k4FJ2yVu7mg4Tcoi_vBFSOi2m2ywV_+Kyg@mail.gmail.com>
On Fri, Sep 7, 2018 at 10:38 PM Tyler Bell <[email protected]> wrote:
>
> From what I can tell, that is not, what I need. That targets the driver to a device,
> which is what the bug 84 conversation indicates I should not do. I only want the .sys and .dll in
> the correct windows directories and registered to the system. This is complicated by the need for
> UAC and 32/64 bit divide(a 32 bit app cannot install drivers on a 64-bit machine and and 64-bit
> app cannot run on a 32-bit machine).
>  These are not huge issues, but as libusb has already nicely solved these concerns for "primary
> driver" installation, it would be great(and, it seems, trivial?) if we could reuse the existing code for
> filter driver installation.

If you install this file libusb-win32-devel-filter-1.2.6.0.exe, it
will do the necessary for you to put
the libusb0.sys and libusb0.dll in the right place. And it will create
the start-up menu for the
inf-wizard (not working for new version of Windows, that is why I
added libusbk-inf-wizard.exe
here as well and filter wizard which still works for Windows 10.
https://sourceforge.net/projects/libusb-win32/files/libusb-win32-releases/

Or if you install libusbK-3.0.7.0-setup.exe (recommended over the
above package), it will install
libusb0.sys/libusbk.sys/libusb0.dll/libusbk.dll in the right place.
And in the end it will run the
filter wizard for you as well.
https://sourceforge.net/projects/libusb-win32/files/libusbK-release/

> Backing up a bit, I have to interface with a device that has a driver from the manufacturer(FTDI
> USB-serial cables). The OEM driver is limited(but also required) so I've augmented it w/ libusb.
> The best way to manage this on a client's machine that I can find is to use libusb as a filter driver.
> However, to install libusb as a filter driver for a device, libwdi assumes that libusb already exists
> on the client machine. This is not a good assumption to make for a client machine. Infwizard doesn't
> seem capable of creating an inf for filter driver mode and I'm not sure that, even if it did, it would copy
> the DLL&SYS files.

If you use FTDI device, better way is to use libftdi-1.0 and it uses
libusb-1.0 API, there you
have the option of using different libusb-1.0 Windows backend, one of
the option is to use
usbdk (filter, similar to libusb-win32 filter but works better in new
Windows versions).

For usbdk, it is the same, you need to the 32bit/64bit installer first
(as admin) and then you
can use the command line to install/uninstall the filter.
https://github.com/daynix/UsbDk
https://github.com/daynix/UsbDk/releases

You may need to use libusb-1.0.21 build with usbdk for now and not
libusb-1.0.22 due to
the following change. libftdi has not been updated to incorporate the change.
https://github.com/libusb/libusb/issues/443

Leagacy libftdi-0.1 uses libusb-0.1 API and you can use libusb-win32
filter with it but libftdi-0.1
is no longer maintained.

-- 
Xiaofan