Friday, 12 August 2011

Sequencing Adobe Acrobat 9 Pro - Recipe

Sequencing Adobe Acrobat 9 Pro is a bit trick. There are 2 methods depending if the users in your environment have admin rights or not.

If they have it, you can put a script inside the Acrobat OSD and in the first time the program is executed the PDF printer will be installed.

If they don't, then you will have to install it manually or do as I do. Create a package for SCCM and chain it with the virtual package.

I'll go through step by step using both methods.

The script will have to register the prnadmin.dll that's part of the Windows 2003 Resource Kit. You can download it from here. Also you'll have to manually install the printer in one computer to capture its settings. Acrobat virtualized will not work with the PDFPrinter default settings.

Extract the AcroPro90_efg.exe. You can do so with AcroPro90_efg.exe -nos_o"AcroPro" -nos_neJust make sure to replace the executable if it has a different name.

Share the Adobe PDF folder and replace the CurrentDir in the script with the share UNC path.
Copy the prnadmin.dll to the Adobe PDF folder. You will have to copy the printer settings file (after you capture it) to that folder as well.

To capture the settings you install the Adobe PDF printer and run this command:

RUNDLL32 PRINTUI.DLL,PrintUIEntry /Ss /n  "Adobe PDF"  /a  "file.dat" 2

Copy the script below to a notepad, save it as AdobePDF.vbs and copy it to that folder as well.

So you should have the Adobe PDF folder shared with the AdobePDF.vbs, prnadmin.dll and the file.dat files. And all the files that were there already of course.

------------------------------------------------------------------------------------------------------------
On Error Resume Next
dim CurrentDir, RegPrnCmd, oPort, oMaster, Port, PrintMaster, colInstalledPrinters, objWMIService, instPrinter
CurrentDir = "\\servername\AdobePDF$\"
strComputer = "."
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

'******** Register prnadmin.dll file on client computer *******
Set WshShell = Wscript.CreateObject("Wscript.Shell")
RegPrnCmd = "regsvr32 /s " &  CurrentDir & "Prnadmin.dll"
WshShell.Run RegPrnCmd,1,TRUE
'************** Create the port first *******************************

set oPort = CreateObject("Port.Port.1")
set oMaster = CreateObject("PrintMaster.PrintMaster.1")
oPort.PortName = "Adobe PDF"
oPort.PortType = 3
set colInstalledPrinters = objWMIService.ExecQuery ("Select * from Win32_Printer Where DriverName = 'Adobe PDF Converter'")

If colInstalledPrinters.Count = 0 Then
  oMaster.PortAdd oPort
  Wscript.Sleep(5000)
  WshShell.Run "RUNDLL32 PRINTUI.DLL,PrintUIEntry /if /b " & CHR(34) & "Adobe PDF" & CHR(34) &" /f " & CurrentDir & "adobepdf.inf /r " & CHR(34) & "Adobe PDF" & CHR(34) & " /m " & CHR(34) & "Adobe PDF Converter" & CHR(34)
  Wscript.Sleep(8000)
  WshShell.Run "RUNDLL32 PRINTUI.DLL,PrintUIEntry /Sr /n " & CHR(34) & "Adobe PDF" & CHR(34) &" /a " & CHR(34) & CurrentDir & "file.dat" & CHR(34) & " 2"
End If

Set objWMIService = Nothing
set oPort   = Nothing
set oMaster   = Nothing
-----------------------------------------------------------------------------------------------------------

Ok now you have all set go to your sequencer machine, launch sequencer and select the AcroPro.msi


Give a name to the package.



In the installation type select Custom.


Make sure you change the installation folder to  Q:\HowYouNamedThePackage



Now select the Adobe Acrobat Pro 9 and launch it. That's the only one you'll launch.



Accept the license. When prompt to register your software, click Don't ask again.

In the Review Installation Report click Next.



Now Select to Customize and click Next.



Remove the Windows Progman and make any customizations that you require.



Now select only the Adobe Acrobat 9 Pro and launch it.



Select your required OSs.



Now browse to the Q:\AdobeFolder and delete the Setup Files folder.



Now browse to Q:\AdobeFolder\Acrobat and delete the file acrotray.exe.config




Select to save the package now and tick the compress package box and click Next.

Now close the sequencer and go to the folder where you saved the project and edit the Adobe Acrobat Pro 9 OSD file. This part is only for users that have admin rights.



If your users don't have admin rights you will have to deploy the script to install the Adobe PDF printer via SCCM or install it manually.

And you are done!

NOTE: I have posted new info about the PDF printer. You can find it here.

4 comments:

  1. Hi Felipe, this is a great article. Any chance you write an article that supports Adobe Professional X on windows 7 64 bit appv.

    ReplyDelete
  2. Hi,

    I'll do it when I have some spare time. Subscribe to the blog or come back in a few days.

    Cheers

    ReplyDelete
  3. What files are already in your Adobe PDF folder, just to know if I take the right one. Btw I'm trying to sequence the standard edition, maybe there's differents with the folders name.

    ReplyDelete
  4. Hi,

    I dont have the file structure in my computer anymore. But as I said it's the extract files + AdobePDF.vbs + prnadmin.dll + file.dat that you got with the capture.

    ReplyDelete