MSEndpointMgr

Slipstream Adobe Reader with PowerShell

If you’ve been reading my other posts about how to slipstream Adobe Reader for deployment with ConfigMgr 2012, this post will come in handy. When slipstreaming Adobe Reader there are quite a few steps to do in the right order and tedious command lines to remember. Instead I’ve created a basic PowerShell script that handles it all. With this script you only need to use one single command, neat right?

Download the script

You can download the script from the TechNet Gallery.

Downloading the correct files

When slipstreaming Adobe Reader it’s important to know the difference between a Base installer, Quarterly released patch and a Security patch. The Base installer is the the actual application, while a Quarterly patch can contain new features and security updates. It will always contain the Base installer and the patch itself, when you extract its contents. A Security patch is just that, a patch meant to fix a security issue. You should apply the installer and patches in the following order:
Base Installer -> Quarterly patch -> Security patch
If you would explain this a bit more detailed with Adobe Reader 11.0.5 that was released a few months ago, it looks like this:
11.0.0 -> 11.0.4 -> 11.0.5
For the most current release, which is Adobe Reader 11.0.6, it should be applied in the following order:
11.0.0 -> 11.0.6
How do you know this? Well you could of course Google/Bing the release notes, but a good hint is that if the latest release is an executable, it will contain the Base installer and the patch itself. That would be a Quarterly patch. Normally security patches are released as MSP files directly. Let me give you an example with the latest release 11.0.6, simply just download the file from here:
ftp://ftp.adobe.com/pub/adobe/reader/win/11.x/11.0.06/en_US/AdbeRdr11006_en_US.exe

How to use the script

1. Downloaded the necessary file(s) to a folder somewhere (should be a local drive or mapped network drive). I’ve downloaded AdbeRdr11006_en_US.exe to C:\Downloads. I’ll refer to this location as the Download folder in this post.
2. Create a folder called AIP. I’ve created it at C:\AIP and will refer to it as the TargetFolder.
3. Download the script from TechNet Gallery and extract it C:\Scripts.
4. Open an elevated PowerShell console, browse to C:\Scripts and run the following command:

.\New-AdobeReaderAIP.ps1 -FileName "AdbeRdr11006_en_US.exe" -DownloadFolder "C:\Download" -TargetFolder "C:\AIP"

5. The script will now start to slipstream Adobe Reader.
Note: In the video below I’m slipstreaming Adobe Reader 11.0.5, just to show that the script works with both Quarterly patches and Security patches.

(1584)

Nickolaj Andersen

Chief Technical Architect and Enterprise Mobility MVP since 2016. Nickolaj has been in the IT industry for the past 10 years specializing in Enterprise Mobility and Security, Windows devices and deployments including automation. Awarded as PowerShell Hero in 2015 by the community for his script and tools contributions. Creator of ConfigMgr Prerequisites Tool, ConfigMgr OSD FrontEnd, ConfigMgr WebService to name a few. Frequent speaker at conferences such as Microsoft Ignite, NIC Conference and IT/Dev Connections including nordic user groups.

38 comments

  • When trying Version 11 on V10 I get the error “The upgrade patch cannot be installed by the Windows Installer service because the program to be upgraded may be missing, or the upgrade patch may update a different version of the program. Verify that the program to be upgraded exists on your computer and that you have the correct upgrade patch.” Works fine for v4 and v5. I see they changed the name on the .msp to take out the sec, I added it and still got the above error.

  • Hi, thanks for script, however I’ve made some changes due to 11.0.8 version, where 11007 is update and 11008 is security update (different order then in your script). I’ve aded the code for sorting msp files by version in filename and then installing patches from oldest to newest.
    My code:
    [CmdletBinding()]
    param(
    [parameter(Mandatory=$true)]
    [string]$FileName,
    [parameter(Mandatory=$true)]
    [string]$DownloadFolder,
    [parameter(Mandatory=$true)]
    [string]$TargetFolder
    )
    Process {
    $order = @()
    $OrderByVersion = @()
    Write-Output “INFO: Extracting content to ‘$($DownloadFolder)\AdobeReader'”
    Start-Process -FilePath “$($DownloadFolder)\$($FileName)” -ArgumentList “-nos_o$($DownloadFolder)\AdobeReader -nos_ne” -Wait -NoNewWindow
    if (Get-ChildItem -Path “$($DownloadFolder)\AdobeReader” -Filter “AcroRead.msi”) {
    Write-Output “INFO: Successfully extracted all files”
    Write-Output “INFO: Starting to create the AIP at ‘$($TargetFolder)'”
    Start-Process “msiexec.exe” -ArgumentList “/a $($DownloadFolder)\AdobeReader\AcroRead.msi /qn TARGETDIR=$($TargetFolder)” -Wait
    Write-Output “INFO: Successfully created the AIP”
    Write-Output “INFO: Searching for patches to apply”
    $Patches = Get-ChildItem -Path $DownloadFolder -Recurse -Filter “AdbeRdr*.msp”
    if ($Patches -ne $null) {
    $Patches | ForEach-Object {
    $PatchFilePath = $_ | Select-Object -ExpandProperty FullName
    if ($_.Name -match “AdbeRdrSecUpd”) {
    $order +=,@($_.Name.TrimStart(“AdbeRdrSecUpd”), $_, $PatchFilePath)
    }
    if ($_.Name -match “AdbeRdrUpd”) {
    $order +=,@($_.Name.TrimStart(“AdbeRdrSecUpd”), $_, $PatchFilePath)
    }
    }
    $OrderByVersion = $order | sort-object @{Expression={$_[0]}; Ascending=$true}
    foreach ($patch in $OrderByVersion){
    Write-Output “INFO: Found: ‘$($patch[1])'”
    Write-Output “INFO: Applying ‘$($patch[1])'”
    Start-Process “msiexec.exe” -ArgumentList “/a $($TargetFolder)\AcroRead.msi /qb /p $($patch[2]) TARGETDIR=$($TargetFolder)” -Wait
    Write-Output “INFO: Succesfully applied ‘$($patch[1])'”
    }
    }
    else {
    Write-Output “INFO: Unable to locate any patches”
    }
    Write-Output “Successfully created a slipstreamed installer for Adobe Reader”
    }
    else {
    Write-Output “ERROR: Unable to loate AcroRead.msi after extraction”
    }
    Copy-Item “$($DownloadFolder)\AdobeReader\setup.ini” -Destination “$($TargetFolder)” -Force
    Remove-Item “$($DownloadFolder)\AdobeReader” -Recurse -Force
    }

  • Can the script above be used as a function call within another Powershell script?
    I have a Powershell script I’ve written that “builds” a Windows 7 PC from just the basic operating system (and a few added things, like Adobe 9) with just the Administrator account, to having several users, locking desktops through Group Policy, adding software and our own apps, etc.
    One of the things I need to do is update Adobe Reader to version 11. I thought a simple silent run of the executable file would work like this –
    $result = Start-Process -Wait -FilePath ‘C:\install_reader11_en_mssd_aaa_aih.exe’ -ArgumentList ‘/S’ -PassThru
    But the “wizard” still opens up and expects you to click through.
    I tried writing an AutoIt script to click through the wizard, but it’s not like your typical wizard – there are no control IDs nor any visible nor hidden text to work with in AutoIt. I can make it work by sending Tabs, Enters and Sleep commands in AutoIt, but that’s not very reliable.
    So I’m wondering if your script might not work as a function within my script to install the C:\install_reader11_en_mssd_aaa_aih.exe file?

  • hi Nickolaj.
    thanks for the guide, but I have some question for you. Are it not possible to customize the package? Remove the shortcut, turn of adobe update?
    thanks,
    Regard,
    Kristian

  • I’ve discovered that if there are spaces in the file paths, (example:”C\Adobe Reader\Source\” the script will fail

  • Will this solution work for deploying Adobe Reader 11.0.07 to 1300 workstations or is there an easier way of doing it? We recently installed SCCM 2012 which we are using to patch workstations with. We haven’t tried to push any applications with it yet and I haven’t been able to find a step by step guide using SCCM 2012 to silently deploy Adobe Reader 11.0.07. Any suggestions? Thanks
    Pat

    • Hi Pat,
      Yes of course. This script will create a folder structure with the necessary files in location you specify for AIP. Copy all those files to your content library (where you store the source files for packages, applications etc). I myself haven’t yet created a step by step guide for deploying Adobe Reader. But it’s really simple:
      1. Create a new application and choose the MSI installer type.
      2. Point to the AcroRead.msi created by the slipstream script.
      3. Fill in name, version etc for the application and finish the wizard.
      The wizard for creating an application based on a MSI file is really simplified and you’ll notice that when you’ve specified the MSI file. Now the tricky part is to use supersedence. Some key points are:
      – If you have any previously version of Adobe Reader on your client machines, you need to create an application for each of the versions out there.
      – The latest version of Adobe Reader should always supersede all older versions
      I’d suggest that you read up on the new application model:
      https://technet.microsoft.com/en-us/library/gg682125.aspx
      Regards,
      Nickolaj

  • Hi Nickolaj,
    I’ve just used your script for 11.0.07 and it has worked perfectly. Thanks for your hard work!

    • Hi Al,
      That’s great to hear! This is why I do it, and I thank you for the kind words. Let me know if you have any idea for something that could be automated 🙂
      Regards,
      Nickolaj

  • I am trying to download the 11.0.07 exe but it seem that the FTP site is down. Do you know of any other links to get the .exe file
    so I can patch Reader?

    • Hi Brian,
      Unfortunately, I don’t. Check the FTP again, it should be up. Perhaps they moved it or something.
      Regards,
      Nickolaj

      • It is up…my internal network at my office is having routing issues! I would have had this done last week if the engineers had said something!! I will give it a shot. Thanks Nickolaj!!

  • Hi,
    When I run the script, at two points after the extraction I just get a Windows Installer window up listing all the switches you can add to an MSI at command line.
    I am doing something wrong?
    Thanks
    Chris

    • Hi Chris,
      That’s strange, what files have you downloaded and have you created the folder structure as pointed out?
      Regards,
      Nickolaj

      • Hi Nickolaj,
        I’ve downloaded the latest version of Adobe (11007) and made your script. Downloaded the latest .msp too.
        I’ve altered the paths to point to my own Downloads folder, and the target is a network share where all our Source Files for ConfigMgr are stored.
        Powershell thinks the script runs successfully, but all it does is create the mentioned prompts, as well as a setup.ini file in the TargetFolder.
        I’m working on my desk machine running Windows 8.1, not the server that SCCM2012 sits on, if that makes a difference!
        Thanks
        Chris

  • Adobe not share AdbeRdr11007_PL.exe, only AdbeRdr1100_pl.exe so I need first download basic and afert this I need patch to 11.0.0 -> 11.0.6 – 11.0.7. This is my problem. I don’t know how I should do it in Your way.

  • Hi Nickolaj,
    Now we have 11.0.07 Planned update, May 13, 2014, do you know how updated from AdbeRdr11000_pl_PL to 11.0.07 PL with Your script?
    Mario

      • Hi Mario,
        I downloaded this file:
        ftp://ftp.adobe.com/pub/adobe/reader/win/11.x/11.0.07/en_US/AdbeRdr11007_en_US.exe
        to G:\AdobePatch\Downloads. I then ran my script with the following parameters:
        .\New-AdobeReaderAIP.ps1 -FileName “AdbeRdr11007_en_US.exe” -DownloadFolder “G:\AdobePatch\Downloads” -TargetFolder “G:\AdobePatch\AIP”
        When I installed Adobe Reader using the files in G:\AdobePatch\AIP, it seemed to work. Atleast I have version 11.0.7 when I launch Adobe Reader.
        I’m not sure if the process is the same for the PL version, but why not just give it a try? It seems that 11.0.7 is another quarterly patch from Adobe.
        Regards,
        Nickolaj

  • Flawless victory. Successfully used this guide to update to Reader 11.0.6 in SCCM 2012.
    A++ Would follow instructions again.

    • Hi Michael!
      I’m glad that it worked out for you. I’ve used this method for quite some time now and it has never failed on me, yet hehe.
      Regards,
      Nickolaj

    • Hi Jason,
      That doesn’t make any sense, if you create a new script file and copy and paste the script from the post, that part will not be the 53rd row. It will be row 4 🙂
      Are you able to send me a screenshot of your script when it’s opened in PowerShell ISE? You’ll find my email on the About page.
      Best regards,
      Nickolaj

  • [CmdletBinding()]
    param(
    [parameter(Mandatory=$true)]
    [string]$FileName, ————–LINE 53
    [parameter(Mandatory=$true)]
    [string]$DownloadFolder,
    [parameter(Mandatory=$true)]
    [string]$TargetFolder
    )
    Process {
    Write-Output “INFO: Extracting content to ‘$($DownloadFolder)\AdobeReader'”
    Start-Process -FilePath “$($DownloadFolder)\$($FileName)” -ArgumentList “-nos_o$($DownloadFolder)\AdobeReader -nos_ne” -Wait -NoNewWindow
    if (Get-ChildItem -Path “$($DownloadFolder)\AdobeReader” -Filter “AcroRead.msi”) {
    Write-Output “INFO: Successfully extracted all files”
    Write-Output “INFO: Starting to create the AIP at ‘$($TargetFolder)'”
    Start-Process “msiexec.exe” -ArgumentList “/a $($DownloadFolder)\AdobeReader\AcroRead.msi /qn TARGETDIR=$($TargetFolder)” -Wait
    Write-Output “INFO: Successfully created the AIP”
    Write-Output “INFO: Searching for patches to apply”
    $Patches = Get-ChildItem -Path $DownloadFolder -Recurse -Filter “AdbeRdrUpd*.msp”
    $Patches | ForEach-Object {
    $PatchFilePath = $_ | Select-Object -ExpandProperty FullName
    if ($_ -match “AdbeRdrUpd”) {
    Write-Output “INFO: Found: ‘$($_)'”
    Write-Output “INFO: Applying ‘$($_)'”
    Start-Process “msiexec.exe” -ArgumentList “/a $($TargetFolder)\AcroRead.msi /qb /p $($PatchFilePath) TARGETDIR=$($TargetFolder)” -Wait
    Write-Output “INFO: Succesfully applied ‘$($_)'”
    $SecurityPatches = Get-ChildItem -Path $DownloadFolder -Recurse -Filter “AdbeRdrSecUpd*.msp”
    $SecurityPatches | ForEach-Object {
    $PatchFilePath = $_ | Select-Object -ExpandProperty FullName
    if ($_ -match “AdbeRdrSecUpd”) {
    Write-Output “INFO: Found: ‘$($_)'”
    Write-Output “INFO: Applying ‘$($_)'”
    Start-Process “msiexec.exe” -ArgumentList “/a $($TargetFolder)\AcroRead.msi /qb /p $($PatchFilePath) TARGETDIR=$($TargetFolder)” -Wait
    Write-Output “INFO: Succesfully applied ‘$($_)'”
    }
    }
    }
    else {
    Write-Output “INFO: Unable to locate any patches”
    }
    }
    Write-Output “Successfully created a slipstreamed installer for Adobe Reader”
    }
    else {
    Write-Output “ERROR: Unable to loate AcroRead.msi after extraction”
    }
    Remove-Item “$($DownloadFolder)\AdobeReader” -Recurse -Force
    }

    • Hi Jason,
      Could you please open your script-file in PowerShell ISE and then only paste row 53 from there?
      I’ve copied the script from youor previous comment in PowerShell ISE and did not get any validation errors.
      Regards,
      Nickolaj

  • Powershell error. What am I doing wrong?
    Missing closing ‘)’ in expression.
    At C:\AIP\New-AdobeReaderAIP.ps1:53 char:1
    + <<<< [string]$FileName,
    + CategoryInfo : ParserError: (CloseParenToken:TokenId) [], ParseException
    + FullyQualifiedErrorId : MissingEndParenthesisInExpression

    • Hi Jason,
      Have you copied the whole script? There’s a ‘)’ missing at your row 53. Could you please paste row 53 here so I can take a look?
      Regards,
      Nickolaj

  • Is it the any way to decrease size after patching?
    The size after patching is 138 MB. This is little to much when size AdbeRdr11000_pl_PL + AdbeRdrUpd11006 is about 50 MB.
    Yours script works! Thanks.

    • Hi Mario,
      I’m not aware of any method where you could decrease the slipstreamed package. The only thing I can come up with would be for you to compress it to a zip-file using e.g. 7-zip and then use 7-zips command line utility to unpack it. But hey, do you see where I’m going? It’s now starting to become a real hassle, is it really worth it?
      Regards,
      Nickolaj

  • Hi, in Your movie the path is
    “C:\Download”
    but the path in tuts in this post have “s” on the end.
    ” I’ve downloaded AdbeRdr11006_en_US.exe to C:\Downloads”
    One letter to much but if don’t read carefully then will show a lot of red letters in Powershell .;)

    • Hi Mario,
      Thanks for pointing that out! What’s important here is that you don’t have to use the same folder structure as I’ve been doing.
      Regards,
      Nickolaj

Sponsors