TweetFollow Us on Twitter

MacEnterprise: Packaging for Enterprise Deployment

Volume Number: 25
Issue Number: 10
Column Tag: MacEnterprise

MacEnterprise: Packaging for Enterprise Deployment

Building Installer packages for mass unattended distribution

by Greg Neagle, MacEnterprise.org

Introduction

In past MacTech articles, we discussed reasons Mac OS X systems administrators might need to package or repackage software for deployment in their organization. Some common reasons are:

Packaging internally-developed software or tools

Capturing organization-specific changes or additions (licensing, configuration) into a package

Packaging third-party software that is distributed without an Installer package

Repackaging into a format compatible with your distribution mechanism

Repackaging software that won't install "silently" (i.e., prompts the user for info, or launches GUI applications)

In an ideal world, only the first two reasons would require a systems administrator to create an installation package (and if you can train your internal developers on packaging, maybe you can cross the first one off, too!). For the other scenarios, it would be more desirable to just take the installation package provided by your third-party software vendor and use it without having to repackage the software. This month, we'll talk about some of the reasons third-party installers don't work in enterprise environments and provide suggestions on how third-party software vendors could make their installers more enterprise-friendly.

Previous MacEnterprise columns have been targeted towards systems administrators in enterprise-scale organizations. This month's column should also be of interest to systems administrators, but I hope MacTech readers who are software developers find it relevant as well.

If you are a software developer, why should you bother making your installer friendly to enterprise environments? The number one reason is that if you do, you'll sell more of your product into an enterprise environment. Make it too hard to deploy in an enterprise, and systems administrators will look elsewhere and recommend your competitor's solutions.

Reason two: if your installer is not enterprise-friendly, systems administrators will almost certainly have to repackage your software in order to deploy it to their users. This introduces an opportunity for errors to creep into the install process. It's much easier to support your own software when you know it was installed with your own installer - if organizations have to repackage your software for installation, you've just introduced a new variable to support, or many, many new variables, as each organization that repackages your software may do it slightly differently.

Definitions

What does it mean when we refer to an installer as being enterprise-friendly? It's actually quite simple. An installer is enterprise-friendly when a system administrator can use standard mass-deployment tools to install your software on many machines automatically, and when, once installed this way, the software works as expected for all users of a given machine with no additional post-install configuration that cannot be done as a non-privileged user (i.e., a user without administrator rights).

Now you're wondering: "what does this author mean by 'standard mass-deployment tools'?" Again, a simple answer: on OS X, a standard mass-deployment tool is one that uses the Apple package format. This includes Apple Remote Desktop, LANrev, the Casper Suite, the KBOX, and many other commercial tools. All of these tools can use the Apple package format to install software remotely to a large number of managed machines.

Simple advice

The first, cheapest, simplest, and most important thing you can do as a software developer to ensure your software's installer is enterprise-friendly is to use an ssh session and the command-line installer tool (/usr/sbin/installer) to install your software on a remote machine. Test the install with no-one logged in as a GUI user, and for extra points, test the install with a GUI user logged in.

Some more details:

Copy the installer to the target machine in any way that is convenient - use scp to copy a disk image or tar or zip archive; or log on directly to the target machine and copy the installer from the web or a file server. Put it someplace readily accessible like /Users/Shared.

If a GUI user is logged into the target machine, log that user out.

Use ssh to login to the target machine as root or as an administrative user that has sudo rights.

> ssh gneagle@aquaman
Password:
Last login: Thu Feb  5 15:16:59 2009
(aquaman) gneagle [201] %

If you've logged in as an administrative user, use sudo to become root, and try to install your software:

(aquaman) gneagle [201] % sudo -s
Password:
[aquaman:/] root# cd /Users/Shared/
[aquaman:/Users/Shared] root# 
[aquaman:~] root# installer -target / -pkg MyApp.pkg

If you support Tiger, test with a target machine running Tiger as well as Leopard. Watch what happens on the target machine while the install is happening. No windows or dialogs should appear; no applications should launch. You should see no visible indication that anything is happening.

Assuming the installation was successful and silent, now, using the GUI on the target machine, log in as a non-admin user and verify your software works as expected. Do the same as an administrative user.

Repeat the experiment, this time with a GUI user login on the target machine.

If your software can be installed silently with this method, there is no visual indication that anything is happening when the install is occurring, and your software functions as expected when installed this way: congratulations! There's a very good chance your installer is enterprise-friendly!

Common pitfalls

As it turns out, it's not hard at all to make an Installer package that is enterprise friendly. The simpler the installer package, the more likely it is enterprise-friendly. But here are some common pitfalls that can make third-party software unnecessarily difficult to deploy in an enterprise environment.

Pitfall #1: using alternate packaging formats

To make your installer enterprise-friendly, use the Apple Installer package format. This does not mean you have to use Apple's PackageMaker tool to create your packages, but whatever tool you use must have as its final output an installation package compatible with Apple's Installer. If you use any other format for your installer, enterprise administrators will almost certainly have to repackage your software to deliver it to their users.

This pitfall extends to the so-called "drag-and-drop" disk images: with this type of install, the user is given a disk or disk image, that when opened, presents the software and typically, instructions to drag it into the Applications folder. While this installation method is acceptable for simple interactive installs, it does not work with mass-deployment tools, once again forcing the administrator to repackage your software.

If you (or your customers) prefer drag-and-drop installs and don't want to give them up, at least consider making an Installer package available as an option for system administrator use. Such an optional package could even be included on the disk image that contains the drag-and-drop application, perhaps in a subfolder and mentioned in a READ ME file.

Pitfall #2: asking for administrator credentials on first launch

Some software asks for administrator credentials on first launch so that it can install additional items. Some examples are TextWrangler, and TextMate, each of which ask the user if they can install command-line tools, which requires administrator rights. If the user declines, the software won't ask again. Worse examples include some of the Adobe Acrobat family of products, which ask every time the product is launched until its demands are met.

This is problematic in an enterprise environment because best practices dictate that most users do not have administrative rights, and so cannot provide the requested credentials. The assumption that a user of your software has or can obtain administrator rights after your software has been installed is simply a bad assumption in an enterprise environment, or any other large-scale environment (like education).

To avoid the issue, administrators have to repackage the software; either including the optional installations or packaging a modified version of the software that doesn't ask the user to install the additional items.

From an administrator's viewpoint, it would be better if the installer simply installed everything it wanted installed up front. In the case of TextWrangler and TextMate, there are no installers - these are distributed as drag-and-drop disk images - so again, the option of an Installer package would make administrators lives easier. In the case of software like Acrobat or Reader, vendors should provide a way for administrators to turn this behavior off without having to modify or repackage the software.

Pitfall #3: pre- and post-install scripts

If your installer makes use of pre- and/or post-install scripts, test them during your remote install tests to make sure they don't do anything visible. The Microsoft Office 2008 installer has a post-install script that attempts to add things to the dock. When run remotely when no one was logged in on a Tiger machine, this script caused the Finder and Dock to open behind the login window. Not only was that annoying, it was a security risk since the Finder was running as root! The Office 2008 installer is not the first installer to do something like this, and unfortunately, probably won't be the last.

Even if a user is logged in, if the administrator was installing Office 2008 remotely, is it really good form to kill and relaunch a user's Dock out from under them?

Other things to watch out for are scripts that attempt to quit open applications, and anything that makes use of AppleScript, which may not behave as expected when no-one is logged in.

Fortunately, a pre- or post- script can easily tell if it's being run in the context of a non-GUI install: the installer command sets the COMMAND_LINE_INSTALL environment variable. Just test for it and exit or skip over a task if it's set - here's a Perl example from a postflight script in the iTunes install package that updates the Dock:

# exit if command-line install
exit(0) if ($ENV{'COMMAND_LINE_INSTALL'});

Pitfall #4: Licensing and registration

It's a fact of life that many commercial applications need some sort of license code or registration code to run as an effort to combat piracy. If your installer requires entering a license code as part of the install process, it will not be able to be installed via mass-deployment tools. Site licensing can help the problem somewhat, but still doesn't solve it completely if the installer asks for the site license code. Consider these alternatives:

If the software is being installed via command line (i.e. the COMMAND_LINE_INSTALL environment variable is set), allow the installation to occur without entering a registration code. Your app could then ask for the registration code at first launch. (But that can cause its own problems...)

An ever better option, but one that I've seen very few vendors embrace, is to provide administrators with a method to include the registration code or codes with the installer. This could take the form of a separate package install that simply installs the registration code(s), or a properly named and formatted text file that a script included with the installer looks for and uses, or some other method for an admin to provide registration codes without having to visit each machine or do a full repackaging of your software.

There are certainly other failure modes and issues that can make an installer less than enterprise-friendly, but these are among the most common pitfalls.

More information

Apple has some documentation on software delivery, managed installs and remote installs. A PDF is available here:

http://developer.apple.com/documentation/developertools/conceptual/SoftwareDistribution/SoftwareDeliveryGuide.pdf

and an HTML version is here:

http://developer.apple.com/documentation/developertools/conceptual/SoftwareDistribution

Call to action

Software vendors: if you follow the suggestions in this article, your installer will be enterprise-friendly and you may even see increased sales and fewer enterprise support issues.

System administrators: if your software vendors aren't providing enterprise-friendly installers, let them know! File bug reports, pester your account representatives, or, worse case, investigate alternatives from vendors who "get it." Good luck!


Greg Neagle is a member of the steering committee of the Mac OS X Enterprise Project (macenterprise.org) and is a senior systems engineer at a large animation studio. Greg has been working with the Mac since 1984, and with OS X since its release. He can be reached at gregneagle@mac.com.

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

Ableton Live 11.3.11 - Record music usin...
Ableton Live lets you create and record music on your Mac. Use digital instruments, pre-recorded sounds, and sampled loops to arrange, produce, and perform your music like never before. Ableton Live... Read more
Affinity Photo 2.2.0 - Digital editing f...
Affinity Photo - redefines the boundaries for professional photo editing software for the Mac. With a meticulous focus on workflow it offers sophisticated tools for enhancing, editing and retouching... Read more
SpamSieve 3.0 - Robust spam filter for m...
SpamSieve is a robust spam filter for major email clients that uses powerful Bayesian spam filtering. SpamSieve understands what your spam looks like in order to block it all, but also learns what... Read more
WhatsApp 2.2338.12 - Desktop client for...
WhatsApp is the desktop client for WhatsApp Messenger, a cross-platform mobile messaging app which allows you to exchange messages without having to pay for SMS. WhatsApp Messenger is available for... Read more
Fantastical 3.8.2 - Create calendar even...
Fantastical is the Mac calendar you'll actually enjoy using. Creating an event with Fantastical is quick, easy, and fun: Open Fantastical with a single click or keystroke Type in your event details... Read more
iShowU Instant 1.4.14 - Full-featured sc...
iShowU Instant gives you real-time screen recording like you've never seen before! It is the fastest, most feature-filled real-time screen capture tool from shinywhitebox yet. All of the features you... Read more
Geekbench 6.2.0 - Measure processor and...
Geekbench provides a comprehensive set of benchmarks engineered to quickly and accurately measure processor and memory performance. Designed to make benchmarks easy to run and easy to understand,... Read more
Quicken 7.2.3 - Complete personal financ...
Quicken makes managing your money easier than ever. Whether paying bills, upgrading from Windows, enjoying more reliable downloads, or getting expert product help, Quicken's new and improved features... Read more
EtreCheckPro 6.8.2 - For troubleshooting...
EtreCheck is an app that displays the important details of your system configuration and allow you to copy that information to the Clipboard. It is meant to be used with Apple Support Communities to... Read more
iMazing 2.17.7 - Complete iOS device man...
iMazing is the world’s favourite iOS device manager for Mac and PC. Millions of users every year leverage its powerful capabilities to make the most of their personal or business iPhone and iPad.... Read more

Latest Forum Discussions

See All

Motorsport legends NASCAR announce an up...
NASCAR often gets a bad reputation outside of America, but there is a certain charm to it with its close side-by-side action and its focus on pure speed, but it never managed to really massively break out internationally. Now, there's a chance... | Read more »
Skullgirls Mobile Version 6.0 Update Rel...
I’ve been covering Marie’s upcoming release from Hidden Variable in Skullgirls Mobile (Free) for a while now across the announcement, gameplay | Read more »
Amanita Design Is Hosting a 20th Anniver...
Amanita Design is celebrating its 20th anniversary (wow I’m old!) with a massive discount across its catalogue on iOS, Android, and Steam for two weeks. The announcement mentions up to 85% off on the games, and it looks like the mobile games that... | Read more »
SwitchArcade Round-Up: ‘Operation Wolf R...
Hello gentle readers, and welcome to the SwitchArcade Round-Up for September 21st, 2023. I got back from the Tokyo Game Show at 8 PM, got to the office here at 9:30 PM, and it is presently 11:30 PM. I’ve done what I can today, and I hope you enjoy... | Read more »
Massive “Dark Rebirth” Update Launches f...
It’s been a couple of months since we last checked in on Diablo Immortal and in that time the game has been doing what it’s been doing since its release in June of last year: Bringing out new seasons with new content and features. | Read more »
‘Samba De Amigo Party-To-Go’ Apple Arcad...
SEGA recently released Samba de Amigo: Party-To-Go () on Apple Arcade and Samba de Amigo: Party Central on Nintendo Switch worldwide as the first new entries in the series in ages. | Read more »
The “Clan of the Eagle” DLC Now Availabl...
Following the last paid DLC and free updates for the game, Playdigious just released a new DLC pack for Northgard ($5.99) on mobile. Today’s new DLC is the “Clan of the Eagle" pack that is available on both iOS and Android for $2.99. | Read more »
Let fly the birds of war as a new Clan d...
Name the most Norse bird you can think of, then give it a twist because Playdigious is introducing not the Raven clan, mostly because they already exist, but the Clan of the Eagle in Northgard’s latest DLC. If you find gathering resources a... | Read more »
Out Now: ‘Ghost Detective’, ‘Thunder Ray...
Each and every day new mobile games are hitting the App Store, and so each week we put together a big old list of all the best new releases of the past seven days. Back in the day the App Store would showcase the same games for a week, and then... | Read more »
Urban Open-World RPG ‘Project Mugen’ Fro...
Last month, NetEase Games revealed a new free to play open world RPG tentatively titled Project Mugen for mobile, PC, and consoles. I’ve liked the setting and aesthetic since its first trailer, and today’s new video has the Game Designer and... | Read more »

Price Scanner via MacPrices.net

Apple AirPods 2 with USB-C now in stock and o...
Amazon has Apple’s 2023 AirPods Pro with USB-C now in stock and on sale for $199.99 including free shipping. Their price is $50 off MSRP, and it’s currently the lowest price available for new AirPods... Read more
New low prices: Apple’s 15″ M2 MacBook Airs w...
Amazon has 15″ MacBook Airs with M2 CPUs and 512GB of storage in stock and on sale for $1249 shipped. That’s $250 off Apple’s MSRP, and it’s the lowest price available for these M2-powered MacBook... Read more
New low price: Clearance 16″ Apple MacBook Pr...
B&H Photo has clearance 16″ M1 Max MacBook Pros, 10-core CPU/32-core GPU/1TB SSD/Space Gray or Silver, in stock today for $2399 including free 1-2 day delivery to most US addresses. Their price... Read more
Switch to Red Pocket Mobile and get a new iPh...
Red Pocket Mobile has new Apple iPhone 15 and 15 Pro models on sale for $300 off MSRP when you switch and open up a new line of service. Red Pocket Mobile is a nationwide service using all the major... Read more
Apple continues to offer a $350 discount on 2...
Apple has Studio Display models available in their Certified Refurbished store for up to $350 off MSRP. Each display comes with Apple’s one-year warranty, with new glass and a case, and ships free.... Read more
Apple’s 16-inch MacBook Pros with M2 Pro CPUs...
Amazon is offering a $250 discount on new Apple 16-inch M2 Pro MacBook Pros for a limited time. Their prices are currently the lowest available for these models from any Apple retailer: – 16″ MacBook... Read more
Closeout Sale: Apple Watch Ultra with Green A...
Adorama haș the Apple Watch Ultra with a Green Alpine Loop on clearance sale for $699 including free shipping. Their price is $100 off original MSRP, and it’s the lowest price we’ve seen for an Apple... Read more
Use this promo code at Verizon to take $150 o...
Verizon is offering a $150 discount on cellular-capable Apple Watch Series 9 and Ultra 2 models for a limited time. Use code WATCH150 at checkout to take advantage of this offer. The fine print: “Up... Read more
New low price: Apple’s 10th generation iPads...
B&H Photo has the 10th generation 64GB WiFi iPad (Blue and Silver colors) in stock and on sale for $379 for a limited time. B&H’s price is $70 off Apple’s MSRP, and it’s the lowest price... Read more
14″ M1 Pro MacBook Pros still available at Ap...
Apple continues to stock Certified Refurbished standard-configuration 14″ MacBook Pros with M1 Pro CPUs for as much as $570 off original MSRP, with models available starting at $1539. Each model... Read more

Jobs Board

Omnichannel Associate - *Apple* Blossom Mal...
Omnichannel Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
Cashier - *Apple* Blossom Mall - JCPenney (...
Cashier - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Blossom Mall Read more
Operations Associate - *Apple* Blossom Mall...
Operations Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
Retail Key Holder- *Apple* Blossom Mall - Ba...
Retail Key Holder- APPLE BLOSSOM MALL Brand: Bath & Body Works Location: Winchester, VA, US Location Type: On-site Job ID: 03YM1 Job Area: Store: Sales and Support Read more
Omnichannel Associate - *Apple* Blossom Mal...
Omnichannel Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.