0

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.

itzuvid
  • 81
  • 1
  • 7
  • I wonder your code. Can you put some parts but determination. How do you install it? – ssovukluk Sep 19 '17 at 12:18
  • 1
    Sorry. I use the two api provided by windows to install a printer Driver. `UploadPrinterDriverPackageA(NULL,infPath.c_str(),"Windows NT x86",UPDP_UPLOAD_ALWAYS,GetDesktopWindow(),targetPath,&length);` and `InstallPrinterDriverFromPackageA(NULL,targetPath,driver_name.c_str(),"Windows NT x86",0);` The trouble is in determining this infPath in the first function call. I need to know which one to drop in here exactly. – itzuvid Sep 19 '17 at 12:32

0 Answers0