I have always used either the windbg attaching or VS attaching to debug my drivers, now I want to try out automatic deployment.
My goal:
Set up VS2019 in such a way that when I put a breakpoint on my driverEntry and press F5, visual studio automatically compile the driver and deploy it on the test machine, and create a service for the driver, attach to the target machine and start the service. And when I stop debugging, it should detach and stop the service and delete it.
I have already setup a target machine (using provisioning in the Configure devices → add device) and the required WDK components are already installed on the target machine. And this is a software WDM driver and I don’t have a INF to install it, I load it using sc create + start
(similar to osrloader).
My question is:
What should I select in the project properties -> Driver install -> Deployment
, considering that I don’t have a INF file?
Should I select Custom Command Line? Because I already tried that, but you can’t just give it a command line like "sc create ... & sc start .."
, because based on msdn, it seems like we actually have to give it a “script file” name? I tried to also create a batch file that does the sc create + start and use additional Files to add that .bat file (so i can type this script file’s name in the custom command line box), but right clicking and selecting add file in additional files doesn’t work and nothing happens!!
So how can i set this up for my case? I also tried to select “Fast reinstall” and “Install/Reinstall And Verify” But i get weird errors which are probably related to the driver not having an INF file.