Hi all,

I am packaging CutePDF for a Windows 7 environment and I can't for the life of me get the rundll32 command to work.
I get an error message that says "Operation could not be completed (0x00000002)".

The command line I am using to install my printer is

rundll32.exe printui.dll,PrintUIEntry /if /b "CutePDF Writer" /f "C:\Program Files\Acro Software\CutePDF Writer\cutepdf.inf" /r "CPW2:" /m "CutePDF Writer"

I used the suggestion from the Package KB to populate my inf file and my inf file looks like this -

*************************************************************************************

[Version]
Signature="$Windows NT$"
Provider="CutePDF"
ClassGUID={4D36E979-E325-11CE-BFC1-08002BE10318}
Class=Printer

[PortMonitors]
"CutePDF Writer Monitor" = CutePDFWriterMonitor

[CutePDFWriterMonitor]
CopyFiles = @CPWMON2K.DLL
PortMonitorDll = CPWMON2K.DLL

[Manufacturer]
"CutePDF"

[CutePDF]
"CutePDF Writer" = CUTEPDF.PPD, Cute_PDF_Writer

[CUTEPDF.PPD]
CopyFiles=@CUTEPDFW.PPD,PSCRIPT
DataSection=PSCRIPT_DATA
DataFile=CUTEPDFW.PPD

[PSCRIPT]
PSCRIPT5.DLL
PS5UI.DLL
PSCRIPT.HLP
PSCRIPT.NTF

[PSCRIPT_DATA]
DriverFile=PSCRIPT5.DLL
ConfigFile=PS5UI.DLL
HelpFile=PSCRIPT.HLP

[DestinationDirs]
DefaultDestDir=66000

[SourceDisksNames.x86]
1 = "CutePDF",,,""
2 = "CutePDF3",PSCRIPT.HLP,,3,""

[SourceDisksFiles]
CPWMON2K.DLL = 1
CUTEPDFW.PPD = 1
PS5UI.DLL = 1
PSCRIPT.HLP = 2
PSCRIPT.NTF = 1
PSCRIPT5.DLL = 1

*************************************************************************************************
Has anyone got any ideas why I'm getting this error message?
Thanks,
Mark

0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Answers

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
0

@Mark_Holland21

Hi, this has worked for me on other troublesome installes that popped up with the driver signing prompt in Windows 7, but I have not tested for CutePDF.

Install CutePDF on any machine manually, when you have clicked the "always trust..." it should install the certificate in the following reg location:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SystemCertificates\TrustedPublisher\Certificates\<cetificate ID here>

Simply export the reg key to a reg file and import it as part of the install, but before everything else.  You should then get a completely unattended and silent install.

Hope that works for you, please let me know (as CutePDF is on my list to package for this years build)

Stu

Answered 05/25/2010 by: Stueymonster
Yellow Belt

Please log in to comment
0

Hi,

Yes I tried /q and I also tried /Gw but all this does is suppress the dialog. The driver doesn't install with these switches.
Thanks for the idea,
Still no joy....

Rgds,
Mark

Answered 04/22/2010 by: mark_holland21
Second Degree Green Belt

Please log in to comment
0

Have you tried using the /q switch for quiet mode?

rundll32 printui.dll,PrintUIEntry /if /b "CutePDF Writer" /f cutepdf.inf /r "CPW2:" /m "CutePDF Writer" /q

Answered 04/21/2010 by: captain_planet
Brown Belt

Please log in to comment
0

I got it to work....to a point.
I've managed to use everything Manu77 has said and it worked ok.
In my msi I've used a VBScript to stop the print spooler service, then I use the rundll32 command to install the printer driver and then i use a VBScript to restart my Print Spooler service.

All works ok apart from the Unsigned Driver warning that pops up when the Custom Action to install the driver is run.

Our Group Policy is set up to allow unsigned drivers to be installed without a warning and so I am hoping this will overcome this issue.

However, in the meantime to test I tried the following 2 switches to disable the Driver Signing in Windows 7 but it doesn't work and the warning dialog still appears during install.

bcdedit.exe -set loadoptions DDISABLE_INTEGRITY_CHECKS
bcdedit.exe -set TESTSIGNING ON

Anyone know what I could do here?

Thanks for your replies.
Rgds,
Mark

Answered 04/21/2010 by: mark_holland21
Second Degree Green Belt

Please log in to comment
0

Hi Mark,

I installed the application following way, 

1. Copy the source files from your temp folder, before the installation.

2. Copy cpwmon2k.dll and cpwsave.exe to %systemroot%\system32.

3. Create the following registry entries.

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\CutePDF Writer Monitor]
"Driver"="cpwmon2k.dll"
"CPW2:"="CutePDF Writer"

4. Restart the spool service

NET STOP SPOOLER
NET START SPOOLER

5. Created cutepdf.inf and added the following entries. Saved the file to the 'Driver' folder which was unpacked earlier.

[Version]
Signature="$Windows NT$"
Provider="CutePDF"
ClassGUID={4D36E979-E325-11CE-BFC1-08002BE10318}
Class=Printer

[PortMonitors]
"CutePDF Writer Monitor" = CutePDFWriterMonitor

[CutePDFWriterMonitor]
CopyFiles = @CPWMON2K.DLL
PortMonitorDll = CPWMON2K.DLL

[Manufacturer]
"CutePDF"

[CutePDF]
"CutePDF Writer" = CUTEPDF.PPD, Cute_PDF_Writer

[CUTEPDF.PPD]
CopyFiles=@CUTEPDFW.PPD,PSCRIPT
DataSection=PSCRIPT_DATA
DataFile=CUTEPDFW.PPD

[PSCRIPT]
PSCRIPT5.DLL
PS5UI.DLL
PSCRIPT.HLP
PSCRIPT.NTF

[PSCRIPT_DATA]
DriverFile=PSCRIPT5.DLL
ConfigFile=PS5UI.DLL
HelpFile=PSCRIPT.HLP

[DestinationDirs]
DefaultDestDir=66000

[SourceDisksNames.x86]
1 = "CutePDF",,,""

[SourceDisksFiles]
CPWMON2K.DLL = 1
CUTEPDFW.PPD = 1
PS5UI.DLL = 1
PSCRIPT.HLP = 1
PSCRIPT.NTF = 1
PSCRIPT5.DLL = 1

6. Run the following command,

rundll32 printui.dll,PrintUIEntry /if /b "CutePDF Writer" /f cutepdf.inf /r "CPW2:" /m "CutePDF Writer"


Hope this helps.

Answered 04/19/2010 by: Manu77
Orange Senior Belt

Please log in to comment
0

Hi Manu,

Thanks for your reply, could you please post the command line that you are running, plus the contents and location of the cutepdf.inf file?
I am just about to try this printui.exe to see how that does.

Answered 04/19/2010 by: mark_holland21
Second Degree Green Belt

Please log in to comment
0

The command line works without restart.

If captured it throws error. I just restarted the machine before second capture it worked well for me.

Manu

Answered 04/16/2010 by: Manu77
Orange Senior Belt

Please log in to comment
0

Hmmm, I just read this, out of interest..... "In Windows 7 PRINTUI.EXE can be used as shorthand for RUNDLL32 PRINTUI.DLL,PrintUIEntry"

Not that it probably helps....

Answered 04/16/2010 by: captain_planet
Brown Belt

Please log in to comment
0

....to be honest, I can't comment on Windows 7 Mark.  I don't even have a VM with it on any more.  Have you got an XPSP2 vm?  I guess if it works on that, you know it's Windows 7-specific and if so, one of the other boys will have to jump in here I'm afraid.....

Try using ProcMon too.  It may tell you a bit more about what's going on.....

Answered 04/16/2010 by: captain_planet
Brown Belt

Please log in to comment
0

Hi Captain_planet,

Thanks for your reply, I am trying the command line outside of my msi initially so sequencing isn't even in the equation just yet and I am still getting the issue.

I am using Windows 7 and I am not sure if there's a difference with how Windows 7 handles drivers versus Windows XP.

I've also followed the post by BEPhipps to the letter and I still get the error.

Not sure what to do....

I will try the restart option next but I'm not sure if that's going to do it.....

Answered 04/16/2010 by: mark_holland21
Second Degree Green Belt

Please log in to comment
0

Hi Mark,

Restarting the machine after installing application may help.

Manu

Answered 04/16/2010 by: Manu77
Orange Senior Belt

Please log in to comment
0

Mark, that post by BEPhipps worked for me.  The ordering of the steps in there are VERY important though, so re-trace your steps.  Also, you've added an extra line here '2 = "CutePDF3",PSCRIPT.HLP,,3,""' under '[SourceDisksNames.x86]' so you may want to check that works.  I'd also check your sequencing in the Windows Installer.  Remember this CA needs to run somewhere after installFiles and before InstallFinalize in the deferred context.....

Answered 04/16/2010 by: captain_planet
Brown Belt

Please log in to comment
Answer this question or Comment on this question for clarity