According to my project howto install software silently I came accross a new challenge how to handle an automated implementation of windows based drivers when we have no setup binary for the driver installation.
First I was stuck, but finally I found a solution how to solve this challenge. During my researches I’ve discovered a tool called devcon.exe from microsoft. Devcon is part of the Windows Driver Kit an can be found here.
DevCon (Devcon.exe), the Device Console, is a command-line tool that displays detailed information about devices on computers running Windows. You can use DevCon to enable, disable, install, configure, and remove devices.
After downloading the the Windows Driver Kit we see a bunch of msi installers, but we only need to install the following one: Windows Driver Kit-x86_en-us.msi
If we check the installation directory we find the devcon.exe that we copy to a sample location where a inf file is stored.
Let’s have a closer look what we can do with devcon.exe. The command to install a scpecific inf file is: devcon.exe dp_add drivername.inf
Sometimes it works without problems and we get: Driver package added
It can’t be that easy! Let’s try another one and a windows security message pops out 😉
To overcome this, I had to find a way that Windows will trust my driver source or something that will accept this message automatically. I’ve decided to find a solution for the second option and I’ve discoverd AutoIT, a powerfull scripting engine! 🙂
AutoIt v3 is a freeware BASIC-like scripting language designed for automating the Windows GUI and general scripting. It uses a combination of simulated keystrokes, mouse movement and window/control manipulation in order to automate tasks in a way not possible or reliable with other languages
I’m amazed! 😀
AutoItIT comes with a helper tool that read out usefull informations about a target window.
With help of this informations I wrote a simple script with AutoIT to autmate this task:
Another advantage of that tool is that it’s possible to create a binary file. I did successfull test this in a virtual machine, but I want to see this if it works when I plug in a spcific hardware that require a driver.
First I got a driver error and after running my AutoIt binary file I could successfull implement the driver and the board can be seen in the windows device manager 🙂
Note: the final deployment task will I do with RES One Automation Manager