pauldennis
Posts: 50
Joined: Fri Oct 31, 2008 11:36 am

Install Printer Driver rundll32.exe

I have a working innosetup installer that I am trying to move to AI. This installs a pdf ghostscript printer using the exisitng HP drivers. I am confused about the running these commands.

I have imported the iss script and this creates a custom action for "file attached to installation rundll32.exe" for this iss command.
Filename: "{sys}\rundll32.exe"; Parameters: "printui.dll,PrintUIEntry /if /b ""PDF Maker Printer"" /f ""{win}\inf\ntprint.inf"" /r ""PDFMakerPort:"" /m ""{#iPrtDriver_Vista}

this is incorrect because rundll32.exe already exists and we are not installing it. therefore which custom action do I use for rundll32.exe commands ?

Thanks
Paul
pauldennis
Posts: 50
Joined: Fri Oct 31, 2008 11:36 am

Re: Install Printer Driver rundll32.exe

Hello, I am trying to run

rundll32 printui.dll,PrintUIEntry /if /b "PDF Maker Printer" /f %windir%\inf\ntprint.inf /r "PDFMakerPort:" /m "HP Color LaserJet 2800 Series PS"

can somebody please advise if I should be using "exe with working directory" or the custom action "launch file open URL"

regards
pauldennis
Posts: 50
Joined: Fri Oct 31, 2008 11:36 am

Re: Install Printer Driver rundll32.exe

I am still struggling with this. I have a working installer that sets up a redirected port and a command line which installs a printer. However when I try and run using either of the options "exe with working directory" or the custom action "launch file open URL" I get error message dialog

Operation could not be completed 0x00000003

I have logging on and this error occurs when viewer.exe is run. This is on 64bit windows 7

I am using in the custom action command line
[SystemFolder]\rundll32 printui.dll,PrintUIEntry /if /b "PDF Maker Printer" /f [WindowsFolder]\inf\ntprint.inf /r "PDFMakerPort:" /m "HP Color LaserJet 2800 Series PS"

The same installer without the custom action. If I run from the windows command line it works
rundll32 printui.dll,PrintUIEntry /if /b "PDF Maker Printer" /f %windir%\inf\ntprint.inf /r "PDFMakerPort:" /m "HP Color LaserJet 2800 Series PS"
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Install Printer Driver rundll32.exe

Hello Paul,

You can try to set the custom action with "Deferred, with no impersonation" and see if the problem persists.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
pauldennis
Posts: 50
Joined: Fri Oct 31, 2008 11:36 am

Re: Install Printer Driver rundll32.exe

I have working installers for both x86 and x64 which now install the printer correctly. However I am running a cmd file to install the printer as follows:

custom action type: file attached to the installation.
Command line "[#xpprinter.cmd]"
deferred with no impersonation

xpprinter.cmd as follows:
rundll32 printui.dll,PrintUIEntry /if /b "Complete Picture PDF Printer" /f %windir%\inf\ntprint.inf /r "CompletePicturePDFPrinterPort:" /m "HP Color LaserJet 4550 PS" /q

The problem is this displays the command prompt which is not a very professional looking install. Can somebody please explain how I run the command directly from AI. Should I be using "exe with working directory" or the custom action "launch file open URL"

I am also very confused about which commands should be in quotes.

thanks
Paul
pauldennis
Posts: 50
Joined: Fri Oct 31, 2008 11:36 am

Re: Install Printer Driver rundll32.exe

For reference this is how I got into work.

This you need to choose the custom action option launch file open URL deferred with no impersonation.

The command line is

"[SystemFolder]rundll32.exe" printui.dll,PrintUIEntry /if /b "Complete Picture PDF Printer" /f "[WindowsFolder]inf\ntprint.inf" /r "CompletePicturePDFPrinterPort:" /m "HP Color LaserJet 4550 PS"

this know you have to have the Quotes as above and there is no \ after the AI system property. So

"[SystemFolder]rundll32.exe" this works
"[SystemFolder]\rundll32.exe" no good
"[SystemFolder]"\rundll3it2.exe no good but this is what AI inserts when you use the property editor

It would be useful if there was a decent explanation of the syntax for the command line using the AI properties. It took me ages to sort this out.

Regards
Paul

Return to “Common Problems”