We have written an application that manages OpenVPN from the tray as an add-on for a bigger software package.
OpenVPN includes a file called tapinstall.exe that installs the OpenVPN adapter (or any driver for that matter). Doing some research, this file is the exact same as a command-line tool called devcon that Microsoft includes in the Windows DDK. The OpenVPN guys just renamed it for their use.
So we use it during our setup (msi) installer in a custom action to install the driver, which for the most part, works just fine.
Every now and again, devcon fails and hangs--never exiting. After that point, you can re-run devcon and it will install the driver twice... which basically breaks OpenVPN.
Has anyone seen this issue with devcon, know what it's doing, or know a way to fix it?
As an alternate solution, does anyone know how to install a driver from C#? (we have a .inf and a .sys file)
UPDATE: We've found this issues to be pretty rare. It occurs most often when we've applied an update where we uninstall the V8 version of the OpenVPN adapter and then install the new version (V9) of the OpenVPN adapter. It also seems to not happen if you restart your PC in between installs, so we might be better off forcing a PC restart on uninstall....
SIDE NOTE: I've heard of people using WiX and the DifxAPI (I think that is what it's called) to install drivers from an MSI installer. Any ideas if this can be done from plain C# in a custom action? We don't really want to start over with our setup project using WiX (it could be time consuming).