Difference between revisions of "Guidelines for Mac software packaging"

From AFP548 Wiki
Jump to navigation Jump to search
Line 197: Line 197:
 
#Once the app has finished downloading, open up Terminal and type the command:<br /><code>'''rm -rf "/Applications/iPhoto.app/Contents/_MASReceipt"'''</code><br /><code>'''sudo pkgbuild --install-location /Applications --component /Applications/iPhoto.app ./Desktop/iPhoto_v9.4.3.pkg'''</code>
 
#Once the app has finished downloading, open up Terminal and type the command:<br /><code>'''rm -rf "/Applications/iPhoto.app/Contents/_MASReceipt"'''</code><br /><code>'''sudo pkgbuild --install-location /Applications --component /Applications/iPhoto.app ./Desktop/iPhoto_v9.4.3.pkg'''</code>
 
#The .PKG installer can be used in DeployStudio using the '''Package Install''' task with the '''Postponed installation''' option unchecked.
 
#The .PKG installer can be used in DeployStudio using the '''Package Install''' task with the '''Postponed installation''' option unchecked.
 +
 +
=== Maxon Cinema 4D R14 ===
 +
According to Maxon's documentation, you cannot do a "silent install" with their installer — you need to install it once manually. They payload is delivered to /Applications/MAXON, which Maxon says can be copies to other machines if you need to deploy it to multiple machines. (Maxon offers a volume license server which handles authorization). To use with modular deployment/imaging tools, simply package /Applications/MAXON from a test machine using your preferred packaging tool.
  
 
=== Microsoft Office 2011 ===
 
=== Microsoft Office 2011 ===

Revision as of 19:43, 1 August 2013

The following article will provide a general guideline written by Gary Larizza that pertains to creating packages for Mac OS X. It will also provide instructions on how to guide other specific apps that are commonly used in different organizations. The specific guides are written for use in either DeployStudio and/or InstaDMG. However these packages can most likely be used in other software deployment solutions like Munki, Casper, Absolute Manager, Filewave, etc.

The Commandments of Packaging

Whether you're a Mac Developer or Systems Admin, you've probably had to package up a bundle of files for deployment onto a number of machines. There are many ways to do this with just as many software options; it's easy to get confused and make some simple mistakes. The current trend away from deploying software into a monolithic "Golden Master" image and toward a modular package-based approach is pushing (or SHOULD BE pushing) Devs and DevOps folk to rethink the way they package. You can't automatically assume that a package will always be installed interactively on the boot volume through the GUI (could you ever really?), but that still doesn't stop certain developers from doing so.

Because of this, I've tried to compile a list (call them 'Commandments' if you must) of rules to abide by when you're packaging files for installation/deployment in OS X.

Many of these commandments stem from the fact that sometimes packages aren't going to be installed on the boot-volume of the system. Tools like InstaDMG, System Image Utility, and even the act of installing packages from the command line will install packages to a separate volume or Disk Image. In this vein, running scripts that test against the currently booted OS produce unintended results (at best).

In the end, whether you need to package up a bunch of fonts or the next killer app, and whether you're double-clicking on the package to install it or deploying it via Munki, InstaDMG, Puppet, Filewave, LANRev, or whatever, it should STILL WORK with your deployment method of choice. These guidelines should lead us all to that end result: installing software quickly and efficiently via your chosen method without damaging your system.

Many thanks go out to the many members of the Macenterprise Mailing list for providing many of these rules. I can only take credit in compiling these rules, and not coming up with them on my own.

The Commandments

  1. Do not assume that your package will be installed interactively via the GUI or on the currently booted volume.
    This rule encompasses the core of my argument above; some of the better (and finer) points were:
    1. Do not use tools like sw_vers as conditional tests in your pre/post-install scripts - they only check the currently booted operating system.
    2. DO check that your pre/post-install scripts work on paths with spaces in them.
    3. DO reference files on the target volume by using $3 (in bash) rather than using absolute file references. Even if you only plan on "allowing" this package to be run on the boot volume, people will want to use this in other workflows.
    4. DO check that your package works from the command line with the following conditions: when a user is logged in, when no-one is logged in, and when installing to a non-boot volume.
  2. Unnecessary actions are unnecessary.
    If that sounds a little redundant, try installing a package that opens a browser window to the installed-software's homepage. Some packages also do "helpful" things like using osascript to open a finder window showing their newly-installed Application. The problem with this is that if you install this package at the loginwindow, then a Finder window (opened by root, no less) is spawned behind the loginwindow. Someone logging in right after the package is installed now has a finder window with root permissions. Also, with regard to unloading kext files, Karl Kuehn has a great piece of advice, "If you need to do something like unload/load a kext, then you might want to pay attention to whether you are actually installing on the boot volume or not. This can be done by looking to see if the target volume ($3 in bash) is "/" or not. If it is not, then you don't want to go playing with kext-commands. You probably also want to check for the COMMAND_LINE_INSTALL variable, as this means that the user is probably not aware that something is going on. A complicating factor is that InstaDMG will in some cases wrap thing in a chroot jail, so the test for target volume is not always completely accurate (but we do set the COMMAND_LINE_INSTALL flag)." Similar suggestions of this nature were as follows:
    1. Do not require unnecessary reboots if you can accomplish the same thing by loading/unloading kext files or restarting services.
    2. Do not automatically add files to the Dock, Desktop, or anywhere short of /Applications or required directories.
    3. Don't use osascript (or other methods) to open Finder windows. See this article --> http://blog.macadmincorner.com/adobe-flash-10-installer-launches-finder-as-root/ ***Note that as of 10.5 and higher, I'm told that this bug no longer applies. The rule is still important, however, for packages installed from the command line or into a Disk Image (a la InstaDMG).
    4. This could have warranted another rule entirely: DO NOT install unnecessary third party plugins/software/system preferences/helper files without warning! Yes, Growl is nice, but if you're using it only to remind us about registration and creating an online ID, then give us the chance to opt-out of its inclusion!
    5. Do not ask for admin/elevated privileges if they're not needed for installation.
    6. Do not require the user to close other applications.
    7. Do not create separate PPC/Intel Installers. If you DO have a metapackage with separate payloads for separate architectures, perform your architecture check on the destination volume, not the currently booted operating system (See: Rule #1)
    8. Do not use an "Application First Run" script that requires administrator privileges to correctly setup the Application.
  3. Licensing should have the option to be managed by Systems Administrators.
    Licenses are manageable through the GUI, but the option for centrally managing licenses should exist transparently to the end user. Whether you allow for a scriptable licensing interface, separate license files that exist OUTSIDE of the user's Home Directory, or license files controlled through preference manifests and MCX, there should be an option for Systems Administrators to license your software without prompting the user to enter a code. Not only does this solve management and deployment issues, but it allows for separate installation and licensing packages to thwart unauthorized installation.
    1. Do not place licensing and registration files in the user's home directory.
    2. DO read Rule 1 for placement of licensing and registration files.
    3. Do not build licensing/registration mechanisms into the installer GUI.
    4. Do allow a scriptable licensing interface to your software.
  4. Use pre/post-install scripts only when necessary (and heed all other rules with your scripts).
    Pre and Post-install scripts can be very helpful in specific situations, but if your intentions are to install files it's best to do that within a payload. Many folks who use tools like Radmind, Puppet, Lanrev, and et cetera rely on having specific loadsets for every package. It's much easier to use lsbom on a package and see exactly what will be installed rather than waiting for some third-party voodoo or post-install script to modify files (and then have to use fsevents to see what has changed). Karl Kuehn once again provides some invaluable information: "If you can't avoid asking the user a question during the install (there are very, very few cases where this is actually acceptable), and can't put it in an installer plugin (note: these are not run with command-line installs), then you should probably be checking for the COMMAND_LINE_INSTALL environmental variable. If it is set, then you should avoid whatever it was you were going to do. If you can't do this for some reason, then it is time to go back to the drawing board (or developers) and figure it out again."
    1. Don't use post-install scripts to create or modify files - do this in the package payload.
    2. If you must use post-install scripts, don't use osascript to move and copy files (that's why we have cp/mv).
    3. GUI-based scripting can be hazardous to your health (See Rule #1)
    4. Do exit a script with 0 on success, or a non-zero number if there are errors.
  5. Be true to the Operating System.
    This nebulous rule covers all relevant suggestions dealing with the operating system onto which you're installing your package. If you're going to support OS X back to version 10.4, then it goes without saying that you should TEST your package on every version from 10.4 up to the most current version.
    1. Do test your package on all filesystems and versions that your package supports.
    2. Do use the documented OS X .pkg format (and not just a .pkg wrapper for some third party solution that installs the software for you).
    3. Do provide an uninstaller or uninstall script.
    4. Do follow the directory structure mandated by the target platform's software deployment guidelines.
    5. Do not change the ownership and permissions of core Operating System folders and files.
    6. Do keep your config data and cache data separate.
  6. Naming Conventions are Necessary and Helpful.
    Give your packages meaningful names and version numbers. VPN.pkg is NOT helpful. Providing your vendor and product name, along with important version numbers, will make Systems Administrators VERY happy when they try to sort out lists of packages.
    1. Do list your vendor and product name in your package name.
    2. Do give packages meaningful names with version numbers.

So there you have it, an extensive (yet most likely INCOMPLETE) list of some of the biggest gripes from Sysadmins who have to maintain more than one Mac in their organization. Please forgive the little errors (such as post-install instead of postinstall, if you prefer) and feel free to comment to your heart's content. Hopefully those who package applications will read this and change their ways. Until then, I'll be with everyone else who needs to repackage some Crappy App whose package installer just won't work...

Software Packaging Tools

There are many tools out there that are available for software packaging. This is not an exhaustive list.

Specific software packaging

Please keep in mind that some of these instructions are version specific. This should get updated regularly as new software comes out that needs to be deploy. Lastly, avoid re-packaging if possible and try to use the original installers. Obviously that's not always going to be possible.

Instructions will be provided here on how to get either a PKG or DMG installer that can be used with InstaDMG and/or DeployStudio. Also, note that I usually try to stick with a naming convention that includes the version of the application this way I can know for sure what version I'm dealing with.

Adobe CS6

For DeployStudio:

  1. Download the installation media from the Adobe Licensing Website: https://licensing.adobe.com/. This media should be located on our servers as well.
  2. Download and install the | Adobe Application Management Enterprise Edition (AAMEE) deployment tool. Please read the Deployment Guide as well which will explain which version of the AAMEE tool to use for the different Adobe CS products.
  3. The resulting .PKG installer that is created using the AAMEE deployment tool can be used in DeployStudio using the Package Install task with the Postponed installation option checked.

Adobe Creative Cloud

  1. Download installation media from the Adobe Creative Cloud website: https://creative.adobe.com/.
  2. Download and install the Adobe Creative Cloud Packager deployment tool. Please read the documentation to ensure the products being packaged are licensed appropriately.
  3. The resulting .PKG installer that is created using the Adobe Creative Cloud Packager deployment tool can be used in DeployStudio using the Package Install task with the Postponed installation option checked.

Adobe Flash Player

For InstaDMG and DeployStudio:

  1. Download Adobe Flash Player for OS X from http://www.adobe.com/products/flashplayer/distribution3.html
  2. Open the DMG file.
  3. Right-click the Install Adobe Flash Player.app and select Show Package Contents.
  4. Browse to \Contents\Resources\ and you should see the .pkg installer file called Adobe Flash Player.pkg. That's the installer file you want to copy for software deployment (whether you use DeployStudio or InstaDMG).
  5. The .PKG installer can be used in DeployStudio using the Package Install task with the Postponed installation option checked.

Amadeus Pro 2

For InstaDMG and DeployStudio:

  1. Download the latest version of Amadeus Pro from http://www.hairersoft.com/
  2. Open the DMG file which contains Amadeus Pro.app
  3. Open up Terminal and type the command:
    sudo pkgbuild --install-location /Applications --component /Amadeus\ Pro/Amadeus\ Pro.app ./Desktop/AmadeusPro2.pkg
  4. The .PKG installer can be used in DeployStudio using the Package Install task with the Postponed installation option unchecked.

The PDF manual needs to be downloaded after the fact. If you want to include the manual in a deployment rather than have the user download it on first launch, you will want to package the contents of the directory /Library/Application Support/Amadeus Pro from a test machine that already has the manual. The directory contains the manual and an accompanying plist file. You can add this to the app package or make two packages (one for the app, one for the manual), with the latter being recommended. Use a packing tool in either case, as the plist file is not a valid component for pkgbuild from the command line. Also, if you do include the manual in your deployment, you may want to change the plist for the app (~/Library/Preferences/com.HairerSoft.AmadeusPro.plist) via your preferred method (e.g., MCX, defaults write) so that the manual does not automatically open up on first launch. The key is HSLastOpened with an integer value of 1.

AnyConnect 3.1

For DeployStudio only:
It does not need to be repackaged. The .PKG installer can be used in DeployStudio using the Package Install task with the Postponed installation option checked.

Avid Pro Tools 10.3.2

For DeployStudio only:

  1. This software needs to be repackaged. Use Composer to do a New & Modified Snapshot.
  2. The .PKG installer can be used in DeployStudio using the Package Install task with the Postponed installation open checked.

Compressor 4

For InstaDMG and DeployStudio:

  1. Download Compressor from the Mac App Store.
  2. Once app has finished downloading, open up Terminal and type the command:
    rm -rf "/Applications/Compressor.app/Contents/_MASReceipt"
    sudo pkgbuild --install-location /Applications --component /Applications/Compressor.app ./Desktop/Compressor_v4.0.6.pkg
  3. The .PKG installer can be used in DeployStudio using the Package Install task with the Postponed installation option unchecked.

Computrace Client 8716-35963

For InstaDMG and DeployStudio:

  1. Needs to be repackaged. Use Composer to do a New & Modified Snapshot.
  2. The .PKG installer can be used in DeployStudio using the Package Install task with the Postponed installation option unchecked.

CoRD 0.5.7

For InstaDMG and DeployStudio:

  1. Download CoRD from http://cord.sourceforge.net/
  2. Once the file has finished downloading, unzip it and and copy CoRD.app to the /Applications folder.
  3. Open up Terminal and type the command:
    sudo pkgbuild --install-location /Applications --component /Applications/CoRD.app ./Desktop/CoRD_v0.5.7.pkg
  4. The .PKG installer can be used in DeployStudio using the Package Install task with the Postponed installation option unchecked.

Fetch 5.7.3

For InstaDMG and DeployStudio:

  1. Download Fetch from http://fetchsoftworks.com/
  2. Open the DMG file which contains Fetch.app
  3. Open up Terminal and type the command:
    sudo pkgbuild --install-location /Applications --component /Fetch\ Installer/Fetch.app ./Desktop/Fetch_v5.7.3.pkg
  4. The .PKG installer can be used in DeployStudio using the Package Install task with the Postponed installation option unchecked.

FileZilla

For InstaDMG and DeployStudio:

  1. Download FileZilla from https://filezilla-project.org/download.php
  2. Once the file has finished downloading, unzip it and and copy FileZilla.app to the /Applications folder.
  3. Open up Terminal and type the command:
    sudo pkgbuild --install-location /Applications --component /Application/FileZilla.app ./Desktop/FileZilla_v3.6.0.2.pkg
  4. The .PKG installer can be used in DeployStudio using the Package Install task with the Postponed installation option unchecked.

Final Cut Pro X

For InstaDMG and DeployStudio:

  1. Download Final Cut Pro X from the Mac App Store.
  2. Once the app has finished downloading, open up Terminal and type the command:
    rm -rf "/Applications/Final Cut Pro.app/Contents/_MASReceipt"
    sudo pkgbuild --install-location /Applications --component /Applications/Final\ Cut\ Pro.app ./Desktop/Final_Cut_Pro_v10.0.8.pkg
  3. The .PKG installer can be used in DeployStudio using the Package Install task with the Postponed installation option unchecked.

Final Cut Studio 3

For InstaDMG and DeployStudio:

  1. Needs to be repackaged. Use Composer to do a New & Modified Snapshot.
  2. Do NOT run Apple Software Update during the snapshot process.
  3. The .PKG installer can be used in DeployStudio using the Package Install task with the Postponed installation option unchecked.

Firefox

For InstaDMG and DeployStudio:

  1. Download Firefox from http://www.mozilla.org/en-US/firefox/all/ (current release) or http://www.mozilla.org/en-US/firefox/organizations/all.html (Extended Support Release for organizations)
  2. Open the DMG file which contains Firefox.app.
  3. Open up Terminal and type the command:
    sudo pkgbuild --install-location /Applications --component /Volumes/Firefox/Firefox.app ./Desktop/Firefox.pkg
  4. The .PKG installer can be used in DeployStudio using the Package Install task with the Postponed installation option unchecked.

Flip4Mac 3.1

For InstaDMG and DeployStudio:

  1. Download Flip4Mac from http://www.telestream.net/flip4mac/
  2. Open the DMG file which contains Flip4Mac.pkg. That's the installer file you want to copy for software deployment (whether you use DeployStudio or InstaDMG).
  3. The .PKG installer can be used in DeployStudio using the Package Install task with the Postponed installation option unchecked.

GarageBand 6

For InstaDMG and DeployStudio:

  1. Download GarageBand from the Mac App Store.
  2. Once the app has finished downloading, open up Terminal and type the command:
    rm -rf "/Applications/GarageBand.app/Contents/_MASReceipt"
    sudo pkgbuild --install-location /Applications --component /Applications/GarageBand.app ./Desktop/GarageBand_v6.0.5.pkg
  3. The .PKG installer can be used in DeployStudio using the Package Install task with the Postponed installation option unchecked.

GIMP 2.8.4

For InstaDMG and DeployStudio:

  1. Download GIMP from http://www.gimp.org/downloads/
  2. Open the DMG file which contains Gimp.app
  3. Open up Terminal and type the command:
    sudo pkgbuild --install-location /Applications --component /Volumes/Gimp\ 2.8.4\ MountainLion/Gimp.app ./Desktop/GIMP_v2.8.4.pkg
  4. The .PKG installer can be used in DeployStudio using the Package Install task with the Postponed installation option unchecked.

Google Chrome

For InstaDMG and DeployStudio:

  1. Download Goolge Chrome from https://www.google.com/intl/en/chrome/browser/
  2. Open the DMG file which contains Google Chrome.app
  3. Open up Terminal and type the command:
    sudo pkgbuild --install-location /Applications --component /Volumes/Google\ Chrome/Google\ Chrome.app ./Desktop/Google_Chrome_24.pkg
  4. The .PKG installer can be used in DeployStudio using the Package Install task with the Postponed installation option unchecked.

HandBrake 0.9.8

For InstaDMG and DeployStudio:

  1. Download HandBrake from http://handbrake.fr/downloads.php
  2. Open the DMG file which contains HandBrake.app
  3. Open up Terminal and type the command:
    sudo pkgbuild --install-location /Applications --component /Volumes/HandBrake-0.9.8-MacOSX.6_GUI_x86_64/HandBrake.app ./Desktop/HandBrake_v0.9.8.pkg
  4. The .PKG installer can be used in DeployStudio using the Package Install task with the Postponed installation option unchecked.

iMovie 9

For InstaDMG and DeployStudio:

  1. Download iMovie from the Mac App Store.
  2. Once the app has finished downloading, open up Terminal and type the command:
    rm -rf "/Applications/iMovie.app/Contents/_MASReceipt"
    sudo pkgbuild --install-location /Applications --component /Applications/iMovie.app ./Desktop/iMovie_v9.0.8.pkg
  3. The .PKG installer can be used in DeployStudio using the Package Install task with the Postponed installation option unchecked.

iPhoto 9

For InstaDMG and DeployStudio:

  1. Download iPhoto from the Mac App Store.
  2. Once the app has finished downloading, open up Terminal and type the command:
    rm -rf "/Applications/iPhoto.app/Contents/_MASReceipt"
    sudo pkgbuild --install-location /Applications --component /Applications/iPhoto.app ./Desktop/iPhoto_v9.4.3.pkg
  3. The .PKG installer can be used in DeployStudio using the Package Install task with the Postponed installation option unchecked.

Maxon Cinema 4D R14

According to Maxon's documentation, you cannot do a "silent install" with their installer — you need to install it once manually. They payload is delivered to /Applications/MAXON, which Maxon says can be copies to other machines if you need to deploy it to multiple machines. (Maxon offers a volume license server which handles authorization). To use with modular deployment/imaging tools, simply package /Applications/MAXON from a test machine using your preferred packaging tool.

Microsoft Office 2011

DeployStudio only

To build an updated Office 2011 installer, you will use Iceberg and will need to have the latest Microsoft Office 2011 installer (located on our server) and any updates you wish to include. I will be using an Office 2011 SP3 installer and the Office 14.3.4 update along with any relevant updates. The updates can be found here: http://www.microsoft.com/mac/downloads

Select your Office 2011 and the applicable Office 2011 update installer packages. To get the Office 2011 SP3 volume licensed installer, please open up the SW_DVD5_Office_Mac_Standard_2011w_SP3_English_ISO_MLF_X18-77844.ISO file and copy the package installer to your desktop. The same goes for the additional updates which typically are .PKG files contained in .DMG files. The .PKG files are the installers and will be what refer to going forward.

  1. Open Iceberg.
  2. Click on File and then New Project.
  3. We’ll need to run this installer with root privileges. Select the project type Darwin: Package. That will open the project with the installation privileges automatically set to root.
  4. Name the project appropriately and make sure to save the project to a location that's easy for you to find (Desktop). In this case, I’m naming the project Microsoft Office 2011 SP3 14.3.4.
  5. On the left side window of Iceberg, click on Scripts.
  6. On the right side window of Iceberg, you will see a section called Additional Resources. Drag the .PKG installers for Office 2011 SP3 and its updates into the Additional Resources section of your Iceberg project.

The next part will allow us to create a file that will tell the Office 2011 installer to not quit Safari (which it does as part of its normal installation). Create the following choices.xml file using TextWrangler or some other text editor 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.

The last piece is telling the installers to run. For this, you’ll need to create a postflight scrip as follows. You can do this in Text Wrangler or another text editor and save the file as postflight with NO file extension:

#!/bin/sh

sudo installer -dumplog -verbose -pkg "$1/Contents/Resources/Office 2011 with Service Pack 3 Installer.pkg" -target / -applyChoiceChangesXML "$1/Contents/Resources/noquit.xml"
sudo installer -dumplog -verbose -pkg "$1/Contents/Resources/Office 2011 14.3.4 Update.pkg" -target / -applyChoiceChangesXML "$1/Contents/Resources/noquit.xml"

Note: This the names of the installers in the script should be the actual name of the installers you are using. Changed the file names in the script as needed to match the actual names of the file you are using.

Once you’ve got the postflight script built, you need to make it executable so that it will run:

  1. Open Terminal from /Applications/Utilities
  2. Run the following command to make the script executable:
    sudo chmod a+x /path/to/postflight

Once the postflight script been made executable, drag the script into the Installation Scripts section in the postflight line in Iceberg. Ensure the checkbox next to postflight is checked.


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 newly created .PKG installer can be used in DeployStudio using the Package Install task with the Postponed installation option checked.


InstaDMG only

Open up TextWrangler (or a text editor) and save the following script as buildoffice.sh to your Desktop.

#!/bin/sh
#
#Modifies Office 2011 SP3 installer to make it instaDMG ready. Expects $1 with the iso
#http://nbalonso.com
TMPDIR='/tmp/buildoffice'
if [ "$1" == "" ]; then
    echo "Usage:
    ./buildoffice.sh [path to iso file]\n"
    exit -1
fi
echo "INFO: Starting"
##
if [ "`md5 ${1} | awk '{ print $NF }' `" == "2acc0fadb6050e15aacd51958be24571" ]; then
    echo "INFO: The iso provided matches the 14.3.0 volume installer"
else
    echo "ERROR: the iso does not match the 14.3.0 volume installer"
    exit -1
fi
##
##
echo "INFO: Silently mounting the iso"
hdiutil attach ${1} -quiet -nobrowse
##
##
echo "INFO: Expanding the pkg"
pkgutil --expand '/Volumes/Microsoft Office 2011/Office Installer.pkg' /tmp/buildoffice/
##
##
echo "INFO: Unmounting the iso"
hdiutil detach '/Volumes/Microsoft Office 2011/' -quiet
##
##
echo "INFO: Fixing things..."
find /tmp/buildoffice/ -name PackageInfo -print0 | xargs -0 chmod +x
echo '#!/bin/sh
#MS code commented below
#launchctl unload -w /Library/LaunchDaemons/com.microsoft.office.licensing.helper.plist
HELPERPLIST="$3/Library/LaunchDaemons/com.microsoft.office.licensing.helper.plist"
if [ "$3" == "/" ]; then
    #installing on the startup disk // running OSX
    launchctl unload -w $HELPERPLIST
fi
exit 0' > ${TMPDIR}/Office2011_all_licensing_14.3.0.pkg/Scripts/preinstall
echo '#!/bin/sh
chown root:wheel "$3/Library/LaunchDaemons/com.microsoft.office.licensing.helper.plist"
chmod 644 "$3/Library/LaunchDaemons/com.microsoft.office.licensing.helper.plist"
chown root:wheel "$3/Library/PrivilegedHelperTools/com.microsoft.office.licensing.helper"
chmod 755 "$3/Library/PrivilegedHelperTools/com.microsoft.office.licensing.helper"
if [ "$3" == "/" ]; then
    #installing on the startup disk // running OSX
    launchctl load -w "$3/Library/LaunchDaemons/com.microsoft.office.licensing.helper.plist"
fi
exit 0' > ${TMPDIR}/Office2011_all_licensing_14.3.0.pkg/Scripts/postinstall
echo '#!/bin/sh
exit 0' > ${TMPDIR}/Office2011_all_quit_14.3.0.pkg/Scripts/preinstall
echo '#!/bin/bash
RESOURCES_DIRECTORY=`/usr/bin/dirname "$0"`
SET_ICON_FILE_PATH="${RESOURCES_DIRECTORY}/fix_custom_icon"
INSTALLATION_FOLDER="$3/Applications/Microsoft Office 2011/"
"$SET_ICON_FILE_PATH" "$INSTALLATION_FOLDER"
exit 0' > ${TMPDIR}/Office2011_en_required_14.3.0.pkg/Scripts/postinstall
##
##
echo "INFO: Compressing the new installer"
pkgutil --flatten ${TMPDIR} ~/Desktop/My_Office_2011_SP3_installer.pkg
##
##Clean the house
echo "INFO: Deleting the temporary folder"
rm -rfd '${TMPDIR}/'
##
echo "SUCCESS"
exit 0
  1. Copy the Office 2011 SP3 ISO (located on our servers) to your desktop.
  2. Open up Terminal.app located in /Applications/Utilities/.
  3. Drag the buildoffice.sh script to the Terminal screen and then drag the Office 2011 SP3 ISO to the Terminal screen and press Enter.
  4. The final result will be a .PKG installer that you can now use in InstaDMG.

Motion 5

For InstaDMG and DeployStudio:

  1. Download Motion from the Mac App Store.
  2. Once the app has finished downloading, open up Terminal and type the command:
    rm -rf "/Applications/Motion.app/Contents/_MASReceipt"
    sudo pkgbuild --install-location /Applications --component /Applications/Motion.app ./Desktop/Motion_v5.0.7.pkg
  3. The .PKG installer can be used in DeployStudio using the Package Install task with the Postponed installation option unchecked.

Pharos Popup Client

For DeployStudio:

  1. Use the installer located on http://pharos.custhelp.com/
  2. The .PKG installer can be used in DeployStudio using the Package Install task with the Postponed installation option checked.

To automate the configuration of the Pharos printer, you can edit the Popup Client installer. This assumes you can use the Generic PostScript driver for your printers and enables Duplex printing.

  1. Download the Pharos Popup Client installer.
  2. Open up Composer.app.
  3. Drag the .PKG installer into the left side menu of Composer where it says Packages.
  4. The .PKG installer should now be listed. Select it and click on the button called Convert to Source.
  5. Now you will see the package listed under Sources ready to be modified.
  6. Click on the arrow to the left of the package name so that it collapses all options.
  7. Right-click the Scripts folder and select Add Shell Script and then postinstall.
  8. Select postinstall below the Scripts folder on the left side menu.
  9. The script can be edited to look as follows:

    #!/bin/sh
    ## postinstall

    pathToScript=$0
    pathToPackage=$1
    targetLocation=$2
    targetVolume=$3

    /usr/sbin/lpadmin -p Pharos_Printer -E -v popup://pharosservername.com/path -o APOptionalDuplexer=True -P "/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/Resources/Generic.ppd"

    exit 0 ## Success


  10. Click on the Source folder for the package.
  11. You may be prompted to save changes made to script. Be sure to click Save.
  12. Click on button that says Build as PKG. You will be prompted to select the folder where you wish to save the newly created Popup Client installer.
  13. The .PKG installer can be used in DeployStudio using the Package Install task with the Postponed installation option checked.

rEFInd 0.6.11

For DeployStudio:

  1. Download rEFInd from http://www.rodsbooks.com/refind/
  2. Open up IceBerg.
  3. Click on File menu and select New Project.
  4. Select Core package and click Next.
  5. Set Project Name: rEFInd v0.6.11.
  6. Set Project directory: ~/Desktop
  7. Click Finish
  8. Click on the arrow next to the project on the left side to collapse your package options.
  9. Select Files
  10. On the right side you will see a list of folders and their owner/group permissions. Right-click on / and select New Folder.
  11. Call the new folder tmp
  12. Right-click tmp and select Show Info
  13. Set Owner: root and Group: wheel. Make sure permissions are 755 which means Owner: RWX, Group: R-X, Others: R-X. Close the Information window when done.
  14. Right-click tmp and select Add Files. Select the rEFInd zip file you downloaded earlier.
  15. Right-click refind-bin-0.6.11.zip and select Show Info.
  16. Set Owner: root and Group: wheel. Make sure permissions are 755 which means Owner: RWX, Group: R-X, Others: R-X. Close the Information window when done.
  17. Open up Text Wrangler or your text editor of choice and create the following postinstall script and save it simply as postinstall (no file extension):

    #!/bin/sh
    ## postinstall

    pathToScript=$0
    pathToPackage=$1
    targetLocation=$2
    targetVolume=$3

    #unzip contents of rEFInd zip file to /tmp directory
    /usr/bin/unzip /tmp/refind-bin-0.6.11.zip -d /tmp/

    #run the rEFInd installer
    sudo /tmp/refind-bin-0.6.11/install.sh

    exit 0 ## Success


  18. When the postinstall script is saved, run the following command on it via Terminal:
    sudo chmod a+x /path/to/postinstall
  19. Going back to IceBerg, click on the Scripts section in the left side of the window.
  20. Check postinstall.
  21. Drag the newly created postinstall script to that same line.
  22. Click on Build menu and select Build.
  23. You should now have a package that should be located in ~/Desktop/rEFInd 0.6.11./build/
  24. The .PKG installer can be used in DeployStudio using the Package Install task with the Postponed installation option checked.

Silverlight 5.1

For InstaDMG and DeployStudio:

  1. Download Silverlight from http://www.microsoft.com/silverlight/
  2. Open the DMG file which contains the Silverlight.pkg installer. That's the installer file you want to copy for software deployment (whether you use DeployStudio or InstaDMG).
  3. The .PKG installer can be used in DeployStudio using the Package Install task with the Postponed installation option unchecked.

SketchUp Pro 8

For InstaDMG and DeployStudio:

  1. Download SketchUp Pro from http://sketchup.google.com/gsu8/download.html
  2. Open the DMG file which contains SketchUp Pro 8.0 Installer.pkg. That's the installer file you want to copy for software deployment (whether you use DeployStudio or InstaDMG).
  3. The .PKG installer can be used in DeployStudio using the Package Install task with the Postponed installation option checked. Please note that the installer as it comes will not be licensed. Read SketchUp Pro License for instructions on how to create a package for licensing.

SketchUp Pro 8 License

For InstaDMG and DeployStudio:

  1. Make sure SketchUp Pro 8 has been installed. Do not open application yet.
  2. Run a New and Modified Snapshot with Composer.
  3. This license needs to be packaged up. Use Composer to do a New & Modified Snapshot.
  4. The .PKG installer can be used in DeployStudio using the Package Install task with the Postponed installation option checked. Make sure this package is run after installing SketchUp Pro 8.

TextWrangler 4.5

For InstaDMG and DeployStudio:

  1. Download TextWrangler from http://www.barebones.com/products/textwrangler/
  2. Open the DMG file which contains TextWrangler.app
    1. Open up Terminal and type the command:
      sudo pkgbuild --install-location /Applications --component /Volumes/TextWrangler\ 4.5/TextWrangler.app ./Desktop/TextWrangler_v4.5.pkg
  3. The .PKG installer can be used in DeployStudio using the Package Install task with the Postponed installation option unchecked.

Vectorworks 2013

For DeployStudio only:

  1. The installation media is on our servers.
  2. This software needs to be repackaged. Use Composer to do a New & Modified Snapshot.
  3. Make sure you download any and all updates prior to doing the snapshot. You can get the updates from: http://www.vectorworks.net/downloads/index.php
  4. Avoid making configurations if possible during the installation snapshot. Make a separate package for specific configurations that the user may need if its for a particular class and/or lab.
  5. The .PKG installer can be used in DeployStudio using the Package Install task with the Postponed installation open checked.

There is a license server that is required in order to run Vectorworks. If you have machines running VectorWorks on different subnets you will want to take note of the IP Address of the license server. In order to run Vectorworks you need to be on the same subnet as the license server. However there is a workaround which you can read about here: http://kbase.vectorworks.net/questions/469/NetHASP.ini+Configuration+Guide

Additionally, if you wish to avoid repackaging, you can try to utilize the Vectorworks 2013 installer and use the silent command line options available here: http://kbase.vectorworks.net/questions/1078/Silent+Installation+of+Vectorworks+2013

VLC Player 2.0.5

For InstaDMG and DeployStudio:

  1. Download VLC Player from http://www.videolan.org/vlc/download-macosx.html
  2. Open the DMG file which contains VLC.app
    1. Open up Terminal and type the command:
      sudo pkgbuild --install-location /Applications --component /Volumes/vlc-2.0.5/VLC.app ./Desktop/VLC_v2.0.5.pkg
  3. The .PKG installer can be used in DeployStudio using the Package Install task with the Postponed installation option unchecked.

Updates can be disabled with this command: defaults write /Library/Preferences/org.videolan.vlc SUEnableAutomaticChecks 0

Specific Settings

Dock

Administrator User

References