DIFx issue during printer installation.

Got a problem you cannot solve? Try here.
Post Reply
bokkie
Posts: 767
Joined: Sun Feb 08, 2009 6:30 am

DIFx issue during printer installation.

Post by bokkie »

I've successfully created a printer driver using C++. Outside of my IA9 (R2) project I have the relevant files that are used to install and register the printer. I can manually create the printer in Win 7 using the Devices and Printers control panel and then right-click to Add a Printer. All of that works ok and once I've selected the .inf the printer is successfully installed and works ok. As I understand it, if I add a DIFx statement to my project and wire it up to the same .inf file, will that actually create the printer for me? That's what I was hoping to see.

I've added output variables to the DIFx statement and it returns 1 in the variable for # Copied and 0 in the others so it seems to be doing something. I was hoping I'd see a new printer created but there's nothing listed. It's likely I'm missing the point of what DIFx should do but could someone give me some insight into it? I'm not sure if I need to do something else in my MSIcode after the DIFx statement that will actually register the printer.

As I say, everything works if I do it manually. Any ideas?

Edit: There is a Windows winspool.dll function called AddPrinter which I might need to use? Perhaps there's an easier way but if I have to use it, I'll make a plan.
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP
mills
Posts: 814
Joined: Tue Jul 06, 2010 7:10 pm
Location: Honolulu, HI

Re: DIFx issue during printer installation.

Post by mills »

Could you post a screenshot of your DIFx dialog settings?
Andy Mills
InstallAware
Other Help:
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help - Press F1 in the InstallAware IDE.
bokkie
Posts: 767
Joined: Sun Feb 08, 2009 6:30 am

Re: DIFx issue during printer installation.

Post by bokkie »

Andy,

As requested is a screenshot of my DIFx settings and some other code around it. The highlighted lines are utilities that I need to run to create a "nul" port and the AddPrinter exectubale is something I cobbled together in C# that adds the printer. Without my AddPrinter executable the .inf file does not actually create the printer. If I run it via the Device and Printers control panel then it works. I'm convinced my AddPrinter is required as the same functionality is possibly implied/assumed when I run it through the control panel?
Attachments
DIFx screenshot.jpg
DIFx screenshot.jpg (228.64 KiB) Viewed 3383 times
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP
Post Reply