I'm writing a C++ Code to automate printer driver installation. I use the following functions to achieve installation from the inf file.
UploadPrinterDriverPackageA(NULL,infPath.c_str(),"Windows NT x86",UPDP_UPLOAD_ALWAYS,GetDesktopWindow(),targetPath,&length);
InstallPrinterDriverFromPackageA(NULL,targetPath,driver_name.c_str(),"Windows NT x86",0);
The trouble is to get the infPath's value. Given a driver package, I seem to get around 3 or more inf files inside it. I want to determine the right inf file that i can use to install it. Any help on how to differentiate the inf files based on the system architecture and OS version?
Also how do I determine the name of the driver from that?
Any help is much appreciated. TIA.