In 32-bit OS you should be able to achieve this through installer. In 64-bit you'll have to sign the driver.
The procesdure to do this is called "Software First Install" method. Meaning you install the driver before your hardware is plugged in. The driver and other associated files are put in appropriate location and when the device is plugged it automatically binds to the driver. Is this what you are looking for?
In order to this Microsoft providea a bunch of tools,
- DIFX - Driver installation Framework
- WIX Installer
First you need to create an MSI or other installer and used DIFX API or WIX and merge the installation files to install the driver.
Please note that for 32 bit Windows XP, Win7 and Vista the driver need not be signed, hence all you need to do is put the CyUSB.sys file and the INF file(with your VID PID and other info) in proper location where windows searches. But in case of 64 bit machines, you need to get your device driver signed from Microsoft. You need to have your USB device firmware up and running. USB.org provides a set of tools to test your firmware for WHQL certification. The results of this must be sent to Microsoft and they will provide you a .CAT file. This file needs to be included in your installer.
Hope this helps.
Thanks for your replies!
I had a brief look to DIFX API and I'm planning tp use it. The only thing is that we deploy the application through ClickOnce (instead of a Windows Installer package) hence we cannot merge installation files. I suppose that it should work even if I install the driver at a later stage with respect to the software installation providing that the hardware is not plugged in before.
But in case the user plug it in before and Windows recognizes it wrongly, how can I later on programmaticaly force Windows to uset the right driver?
If the device is plugged in before the installtion of the driver via Difx or dpinst, the driver installer triggers the pnp hardware detection and installs the new driver for all devices matching the vid/pid.
If you dont want to sign the driver via Microsoft you should check to switch to WinUSB generic driver. WinUSB is available for all Windows Versions from Xp SP2 on. It is signed by microsoft and works failure free with the Cypress chips. If you use the driver, you can sign the cat file and get only the "Would you trust..." Message from UAC. In this dialog you can choose to trust always. A complete silent install, especially on 64 bit machines is only possible going through the complete WHQL signing process.