DIFx API wrapper which simplifies driver installation and uninstallation.
Goals:
- Simplify using DIFx.
- Reduce bitness concerns.
- Reduce DLL dependencies.
- Accessible through NuGet.
You won't need to write your own messy interop declarations to use the library. The Disposable pattern is used for automatic cleanup.
Example:
using (var difx = new DIFx())
{
var flags = DriverPackageFlags.ONLY_IF_DEVICE_PRESENT | DriverPackageFlags.FORCE;
difx.DriverInstallPackage(extractedInf, flags);
}
EmbeddedDIFx contains both the x86 and x64 versions of DIFxAPI, and automatically detects and utilizes the appropriate version at runtime. This can simplify production of a single installer rather than having to make x86 and x64 versions or writing and maintaining similar runtime logic in your installer code.
You only need to include EmbeddedDIFx.dll, instead of the x86 and x64 versions of DIFxAPI, to use DIFx. If your goal is to reach a single-file driver installer with zero loose file dependencies, check out how the installer at ScpDriverInterface works for inspiration. (It extracts the .inf and related driver files on the fly as well.)
The NuGet package can be acquired in the usual NuGet ways, such as the Package Manager console with:
Install-Package EmbeddedDIFx