Target:
Install an .inf
file that uses WinUSB as kernel-mode code.
Solution:
I solved my problem, not exactly as my initial idea of signing the .cat
file.
My answer may be disappointing for most of people and I may receive lots of critics for not using the best practices and etc. It's inelegant and sounds more like an workaround than a really solution. But considering the main business of the company and the hurry for using the driver in Windows 8 I've reached a solution that is satisfactory for the company.
The main difference between Windows 7 to Windows 8 when talking about installing an unsigned driver is that Windows 7 shows an annoying red warning message that recommends the user to not install the unsigned driver, and Windows 8, under normal circumstances just doesn't install it anyway.
We coexisted all this time with this warning in Windows 7, so what I've done is to reconfigure Windows 8 to act like Windows 7.
Step 1:
At the end of my software's installation the installer runs a program that verifies the Windows' version, if it is Windows 8 it prompts a dialog asking for installing the drivers and advices that it will demand to reboot the Windows. If the user agrees, it will run a batch file that does:
- Adds to HKLM..RunOnce a path for Batch File 2
- Disable Driver Signature Enforcement
- Restart the computer
Step 2:
When the user logs on it will run the second batch file, that was set to run into the RunOnce. It will do:
- Run the DPInst.exe
- Enable the Driver Signature Enforcement
- Restart the computer.
At this point the driver will be installed and the original settings are restored. The annoying red warning message remains, just like it was in Windows 7, and life goes on..