In my organization we push out Adobe Reader using an Active Directory policy. In order to do this using we use the Software Management features of Active Directory which requires an .MSI. Adobe supplies an .MSI for Adobe Reader and it’s relatively simple to deploy as long as it’s a base version (ie. no updates). However, If you have to apply the quarterly updates the process becomes a little less intuitive. It is my hope that contributing this information and the script below will make the process a little easier for people to keep their Adobe Reader patched.

First, if you are deploying Adobe Reader, Adobe requires that you sign Distribution Agreement with them. It’s free, really not that difficult and it’s the only way to legally obtain the .MSI required to do the deployment. So just do it.

The purpose of this post is really about how to patch an Adobe Reader .MSI with the .MSP in a way that you are still able to customize the patched version with the Adobe Customization Wizard and then have that in a ready state to deploy using Active Directory. I’m not going to cover much of how to configure the group policies, I’m assuming that you already have that knowledge. After all, you guys are smart! :)

Since the scheduled updates of Adobe Reader is quarterly, patching it has not been I did often. By the time the new patch came out, I had forgotten how to do the process and wasn’t able to devote the time into trying to do it again. So, to help with this I’ve written a script that will patch the Adobe Reader .MSI using the .MSP and then extract some files from the .EXE installer. I’ll explain it below.

ECHO OFF

REM Title:       AdobeReaderPatcher.cmd
REM Date:        8/22/2012
REM Author:      Gregory Strike
REM URL:         http://www.gregorystrike.com/2012/08/23/how-to-deploy-adobe-reader-and-patches-with-active-directory/
REM
REM Purpose:     Automate the process of patching the Adobe Reader .MSI Installer
REM
REM Permissions: This script should be run from an elevated Command Prompt.
REM
REM This script was built using information I found at http://forums.adobe.com/message/4166521.

CLS

REM THESE MUST BE SET TO THE CORRECT VERSIONS!
SET BASEVER=1010
SET PATCHVER=1014
SET LANG=en_US

REM In most circumstances the variables following this line do not need to be modified.
SET BASE=AdbeRdr
SET PATCH=AdbeRdrUpd
SET CURDIR=%~dp0
SET AIPDIR=%CURDIR%AIP
SET EXEDIR=%CURDIR%EXE

REM Checking prerequisites
ECHO Checking prerequisites...
IF NOT EXIST %CURDIR%%BASE%%BASEVER%_%LANG%.msi GOTO :MISSINGFILE
IF NOT EXIST %CURDIR%%PATCH%%PATCHVER%.msp GOTO :MISSINGFILE
IF NOT EXIST %CURDIR%%BASE%%PATCHVER%_%LANG%.exe GOTO MISSINGFILE

IF EXIST %AIPDIR% GOTO :FOLDEREXISTS
IF EXIST %EXEDIR% GOTO :FOLDEREXISTS

REM Creating AIP Folder base
ECHO Creating AIP Folder base...
msiexec /a %CURDIR%%BASE%%BASEVER%_%LANG%.msi TARGETDIR="%AIPDIR%" /passive

REM Patching AIP with .MSP
ECHO Patching AIP with .MSP...
msiexec /a %AIPDIR%\%BASE%%BASEVER%_%LANG%.msi /p %CURDIR%%PATCH%%PATCHVER%.msp /passive

REM Renaming .MSI in AIP
ECHO Renaming .MSI in AIP...
RENAME %AIPDIR%\%BASE%%BASEVER%_%LANG%.msi %BASE%%PATCHVER%_%LANG%.msi

REM Extracting Setup Files from Base .EXE
ECHO Extracting Setup Files from Base .EXE...
%CURDIR%%BASE%%PATCHVER%_%LANG%.exe -sfx_o"%EXEDIR%" -sfx_ne
COPY %EXEDIR%\Setup.exe %AIPDIR%\Setup.exe
COPY %EXEDIR%\Setup.ini %AIPDIR%\Setup.ini

REM Updating Setup.ini
ECHO Updating Setup.ini...

TYPE %EXEDIR%\Setup.ini | FINDSTR /I /V \[Product\] > %AIPDIR%\Setup1.ini
TYPE %AIPDIR%\Setup1.ini | FINDSTR /I /V MSI= > %AIPDIR%\Setup2.ini
TYPE %AIPDIR%\Setup2.ini | FINDSTR /I /V PATCH= > %AIPDIR%\Setup.ini
DEL %AIPDIR%\Setup1.ini
DEL %AIPDIR%\Setup2.ini

ECHO. >> %AIPDIR%\Setup.ini
ECHO [Product] >> %AIPDIR%\Setup.ini
ECHO MSI=%BASE%%PATCHVER%_%LANG%.msi >> %AIPDIR%\Setup.ini

GOTO :END

:MISSINGFILE
ECHO.
ECHO ERROR - One of the following files was not found:
ECHO %BASE%%BASEVER%_%LANG%.msi
ECHO %PATCH%%PATCHVER%.msp
ECHO %BASE%%PATCHVER%_%LANG%.exe
ECHO.
ECHO 1. Verify these files exist in the same directory as this script (%CURDIR%).
ECHO 2. Verify the BASEVER, PATCHVER and LANG variables at the top are correct.

GOTO :END

:FOLDEREXISTS
ECHO.
ECHO ERROR - One or both of these folders already exists:
ECHO %AIPDIR%
ECHO %EXEDIR%
ECHO.
ECHO Please delete these folders and rerun the script.
ECHO.

:END
ECHO.
ECHO Script Complete.

Unless Adobe changes the process or naming convention of their files this script should take three files and output a working AIP (Administrator Install Point) directory with a patched .MSI that is ready to deploy via Group Policy. It follows all the steps that Adobe has laid out but simply automates it. Using this, the AIP is also in a state that can be customized by the Adobe Customization Wizard if you need to create a transform (.MST) to customize the options that are deployed. You only need this script if you are deploying a PATCHED .MSI. If you are using a base version this is unnecessary.

Here’s a list of the files you need. You should be able to pull these from Adobe’s FTP site (ftp://ftp.adobe.com/pub/adobe/reader/win/). They should all be downloaded and placed in the same folder. Again, remember the Distribution Agreement mentioned above.

File Example Filename
The script above, Silly! AdobeReaderPatcher.cmd
The base .MSI AdbeRdr1010_en_US.msi
The .MSP patch AdbeRdrUpd1014.msp
The .EXE installer for the new version AdbeRdr1014_en_US.exe

Once all the files are downloaded and located in the same folder you need to update some variables in the script so that it knows which versions it’s working with. The script doesn’t modify it’s logic based on these variables, it’s really just using them to generate filenames on the fly. The script above was written shortly after Adobe Reader X v10.1.4 was released so it is already set to take the v10.1.0 .MSI and apply the v10.1.4 .MSP to the en_US version. Note the following lines in the script is where you make the modifications.

REM THESE MUST BE SET TO THE CORRECT VERSIONS!
SET BASEVER=1010
SET PATCHVER=1014
SET LANG=en_US

Once your changes are saved, launch an elevated Command Prompt and CD to your working directory.

Once there run AdobeReaderPatcher.cmd (or whatever you named it), and it will go through the patching process.

The script will generate a directory called “AIP”. When all is done, this will be the folder you copy to your network share or customize with the Adobe Customization Wizard. I should mention that the two setup (setup.exe and setup.ini) files that are copied are pulled from the .EXE. It’s actually the only reason we need the .EXE. Some of the options you may choose in the Adobe Customization Wizard require these files.

It’ll be interesting to see if this works with the next version of Adobe Reader X (v10.1.5?). Good luck everyone!


Gregory Strike

Husband, father, IT dude & blogger wrapped up into one good looking package.