

The return codes from devcon were not trackable from within the NSIS script. Uninstalling the USB device from the Device Manager was particularly difficult due to a problem with the devcon.exe (Device Console) program constantly erroring out for some reason when executed from NSIS. This results in issues if you ever offer driver upgrades the user might actually not load the newest driver after upgrading if the old INF file is present.

The INF file is still left on your system in the form of the originally installed OEM driver INF file. The uninstall utilities such as PnPutil.exe only partially remove the device driver. Neither of these steps were easy to solve given the information on the internet. Uninstalls any USB devices from the Device ManagerĬompletely removes the driver files from the Windows DriverStore The features that I wanted for the uninstaller were: For some reason Microsoft has made it incredibly difficult to ensure that you can unload and delete any installed INF files you might have installed on your system programatically. Simply speaking, performing a clean uninstall of a device driver on Windows is an incredibly tricky process. The dpinst.xml file contains all the configuration options for this utility. The dpinst.exe (Driver Package Installer) utility was helpful in abstracting away the complexities of installing a driver and the installer is heavily centered around that step. Triggers a re-scan of the "unknown" plug and play devices to force the device to install itself correctly Installs the driver into the Windows DriverStore Performs an uninstall of any older install of the same productĬopies the correct binary files depending on the architecture being targetted (32 or 64 bit) The features of the installer are as follows: There is a lot of information already out there on how to install device drivers and do all sorts of fancy device install operations. The installer was a quite straight-forward process.

The full code for the installer can be found on GitHub I quickly learned however that creating a fully automatic installer for a Windows driver is very tricky. The NSIS system is incredibly powerful and quite easy to learn. I finally decided on writing one in the Nullsoft Scriptable Install System or NSIS for short. The USB driver I created for the Xbox Big Button Controller has been sorely lacking a decent installer.
