Home > Bash scripting, Casper, Mac administration, Office 2011, Packaging > Creating an updated Office 2011 SP 2 installer

Creating an updated Office 2011 SP 2 installer

I’ve been working on getting Office 2011 SP 2 added to my work’s Casper Self Service, but I was hitting a problem. When I tried putting Microsoft’s unmodified Office 2011 SP 2 installer into Self Service and then installing it, the policy was failing. I didn’t want to repackage with Composer, as I’m generally a believer in using the standard installer whenever possible. Fortunately, after mulling it over for a bit, I realized that I had already solved this problem. As an added bonus, I should be able to include the latest Office updates and thus be able to deploy a fully up-to-date Office 2011 SP 2 installer. See below the jump for the details.

Prerequisites:

Volume-licensed Office 2011 SP 2 installer

Latest available Office 2011 updates

Iceberg

To build, set up a new Iceberg project. Since we’ll need to run this installer with root privileges, I recommend setting the project type to Darwin: Package. That will open the project with the installation privileges automatically set to root. In this case, I’m naming the project Microsoft Office 2011 SP2 14.2.2

Screen shot 2011-06-24 at 10.35.04 AM

Select your Office 2011 and applicable Office 2011 update installer packages. Drag them into the Additional Resources section of your Iceberg project.

Screen shot 2012-05-09 at 3.28.13 PM

Create the following choices.xml file and save it as noquit.xml. This should hopefully tell Office 2011 to not quit your browsers:


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" ">
<plist version="1.0">
<array>
        <dict>
            <key>attributeSetting</key>
            <integer>0</integer>
            <key>choiceAttribute</key>
            <string>selected</string>
            <key>choiceIdentifier</key>
            <string>quit</string>
        </dict>
</array>
</plist>

Once created, drag the noquit.xml file into the Additional Resources section of your Iceberg project.

Screen shot 2012-05-09 at 3.29.00 PM

The last piece is telling the installers to run. For this, you’ll need a postflight script. Here’s the one I’m using:


#!/bin/sh
 
sudo installer -dumplog -verbose -pkg "$1/Contents/Resources/Office 2011 with Service Pack 2 Installer.pkg" -target / -applyChoiceChangesXML "$1/Contents/Resources/noquit.xml"
sudo installer -dumplog -verbose -pkg "$1/Contents/Resources/Office 2011 14.2.2 Update.pkg" -target / -applyChoiceChangesXML "$1/Contents/Resources/noquit.xml"

Once you’ve got the postflight script built, run the following command to make the script executable:

sudo chmod a+x /path/to/postflight

Once it’s been made executable, drag the script into the Installation Scripts section in the postflight line. Next, ensure the checkbox next to postflight is checked.

Screen shot 2012-05-09 at 3.29.38 PM

Last step, go ahead and build the package. (If you don’t know to build, check the Help menu for the Iceberg User Guide. The information you need is in Chapter 3 – Creating a package.)

Once the package has been built, test it by taking it to a test machine that doesn’t have Office 2011 installed and install it. The end result should be that you have a fully up-to-date Office 2011 SP 2 installed and ready to go.

At this point, I’ve successfully used this installer to install Office 2011 SP 2 12.2.2 via DeployStudio, in Casper’s Self Service, and by running it on its own. In all cases, it’s worked fine but test, test test.

  1. Anonymous
    May 9, 2012 at 10:22 pm

    I also try to avoid repackaging when possible, but in this case I have had much better luck just following Microsofts instructions for creating an updated package for deployment.

    http://mac2.microsoft.com/help/office/14/en-us/admin/item/a35ab53c-badf-4fef-bbfe-d5005ad6f7d4?category=1dbf952e-1f61-47f6-85fa-196a22eaf824

  2. Cliff Hirtle
    May 16, 2012 at 4:35 pm

    Thanks for posting Rich. Appears bit more complicated than our former process of just slipstreaming new updates into the original Office installer (which now exhibits the annoying re-license issue). Downloaded new SP2 installer from MVLS and does not offer ability to view contents, presumably due to flat package format? Odd as 14.2.2 update *does* retain ability to view package contents.

    • May 16, 2012 at 5:38 pm

      Cliff,

      Yes, it looks like Microsoft (a little confusingly) went for a flat package for the SP 2 full installer and a bundle package for their SP 2 updates. That’s the reason I went with the choices.xml file, as I couldn’t get into the SP 2 full installer easily to edit the all-quit postflight script like I used to do.

  3. May 17, 2012 at 1:36 pm

    Cliff,

    To the best of my knowledge, this missing license issue happens when you have Office 2011 SP 1 install, don’t launch any Office apps (which means the 2011 SP 1 setup assistant didn’t run), then immediately install the Office 2011 SP 2 updates.

    What this means in practice is that, if you have a fresh Office 2011 SP 1 install, launch Word or another Office application before installing SP 2. If you’re doing an automated deployment, get the Office 2011 SP 2 full installer to do your fresh installs and you should be fine.

  4. May 18, 2012 at 7:51 pm

    Wouldn’t bypassing the noquit pkg also allow it to install with Office apps running? Seems that could potentially cause a problem. Has anyone reported a borked office install if Office was updated with Office apps running?

    • May 18, 2012 at 7:57 pm

      No problems reported by my folks. In general, the folks installing it via Self Service are the folks who don’t currently have Office 2011.

      • May 18, 2012 at 7:59 pm

        Gotcha. That would make sense. I guess I was mainly considering this only for the updater for existing 2011 installs. How are you handling those? Only when logged out?

      • May 18, 2012 at 8:59 pm

        We’re pushing the Office 2011 update patches via our KBox 1000’s monthly patch cycle, which forces a restart after patching. Our folks also have admin rights, so they can (and a lot do) also update Office themselves when AutoUpdate notifies them that updates are available.

  5. Cliff Hirtle
    July 6, 2012 at 9:22 pm

    Thanks again for posting this up Rich. Got stuck on this process before due to some syntax errors on the post flight. Just tried again and working perfectly. Had always slipstreamed or Composer-template’d my Office installer before, but this method’s just as simple. One question: you do not bother to replicate original installer’s splash screens and Dock fix up scripts? Presuming due to management of those items external to installer?

    • July 6, 2012 at 9:41 pm

      Cliff,

      No, I don’t replicate either of those. Running the installers from the command line with root privs seems to stop those scripts from running.

  6. Cliff Hirtle
    July 9, 2012 at 4:24 pm

    One thing I did notice is that similar to the older slipstreaming method, because payloads are installing via post install, the visual installer cannot calculate the total install size (4KB in this case). Obviously not a issue with the CLI install method but a minor concern for users doing self-install.

  7. Cliff Hirtle
    July 11, 2012 at 6:52 pm

    OK, well I managed to get the older slipstreaming Office SP1 + 1.4.2.3 update working again with no missing license file by simply creating an additional small package installer to install the /Library/Preferences/com.microsoft.office.licensing.plist file. Seems to be working just fine on the test machines I am running it on. Unclear if this is the newer 1.4.2.3 update that no longer breaks the licensing of the suite or that this one plist file is, in fact, the reason for the licensing break in the first place. Suspect the latter.

  8. Jim Ferr
    April 3, 2014 at 12:27 pm

    Hi Folks, I tried to do this with our copy of Office 2011 and the 14.3.9 update. The main installation package works fine but when it gets to the 14.3.9 update it errors out every time. The 14.3.9 update works fine from the command line with the noquit XML file or by itself but as part of the package created by Iceberg it fails with the following error:

    Apr 3 08:16:57 macadminlaptop.oncampus.local installd[890]: PackageKit: Install Failed: Error Domain=PKInstallErrorDomain Code=112 “An error occurred while running scripts from the package “Office2011-14-3-9.pkg”.” UserInfo=0x7fcd6b4b8790 {NSFilePath=./postflight, NSURL=file://localhost/Users/admin/Desktop/My%20ICE%20project/Office2011-14-3-9/build/Office2011-14-3-9.pkg, PKInstallPackageIdentifier=ca.durhamcollege.Office2011-14-3-9, NSLocalizedDescription=An error occurred while running scripts from the package “Office2011-14-3-9.pkg”.} {
    NSFilePath = “./postflight”;
    NSLocalizedDescription = “An error occurred while running scripts from the package \U201cOffice2011-14-3-9.pkg\U201d.”;
    NSURL = “file://localhost/Users/admin/Desktop/My%20ICE%20project/Office2011-14-3-9/build/Office2011-14-3-9.pkg”;
    PKInstallPackageIdentifier = “ca.durhamcollege.Office2011-14-3-9″;
    }
    Apr 3 08:16:57 macadminlaptop.oncampus.local Installer[12123]: Install failed: The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance.
    Apr 3 08:16:57 macadminlaptop.oncampus.local Installer[12123]: IFDInstallController 2FB0 state = 8
    Apr 3 08:16:57 macadminlaptop.oncampus.local Installer[12123]: Displaying ‘Install Failed’ UI.

  9. April 15, 2014 at 8:43 pm

    @Jim: some of the Office installers have expired certificates so they can get stopped by Gatekeeper. I just added the “-allowUntrusted” flag to my installer command and it worked OK. Example:

    /usr/sbin/installer -dumplog -verbose -pkg “$install_dir/Office 2011 14.4.1 Update.pkg” -target “$3″ -allowUntrusted -applyChoiceChangesXML “$install_dir/noquit.xml”

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 160 other followers

%d bloggers like this: