I have a C# application that’s using the FTD2XX.DLL from FTDI. This application is used for multiple generations of a single product and abstracts the physical hardware. There’s an FTDI and a HID implementation.
The application searches for both appropriate FTDI and HID devices, though it’s likely that no FTDI drivers exist if the user has the HID generation.
Background aside now. When I instantiate the FTDI class I get a modal, not generated by my code about not finding the FTDI driver and asks the user if the drivers are installed. I tried wrapping this in a TRY/CATCH block but no exception is thrown.
1: Is there a way to determine if the FTDI drivers are installed before trying to instantiate the FTDI class?
2: If not, is there a way to prohibit the FTDI dll from alerting the user when this happens?
I have the exact same requirements – in my case I’m enumerating the list of standard serial ports and appending this with the list of any attached FTDI devices. If the driver isn’t installed, then I’d like to not have those modal dialog boxes appear.
One quick and dirty way I’ve figured out to do this is to check for the file FTD2XX.DLL being in c:\windows\system32 (or wherever windows is installed). The existence of this file basically means the driver is installed.