Adobe AIR : Yes, again

611 views
Skip to first unread message

Jim Zajkowski

unread,
Jul 2, 2012, 5:39:41 PM7/2/12
to munk...@googlegroups.com
Hi all,

We've had no end of problems with Adobe AIR hanging installing at the
loginwindow. I've tried launching it using launchctl bsexec under the
loginwindow pgid, etc, it doesn't matter, still hangs. I've used
Greg's package wrapper, etc.

I finally got tired of it and ended up figuring out how Adobe's
terrible installer works. The two key things that it does are that it
injects the .air filetype into its installer script, and it ships with
its Flash plugin with a split-off resource fork that needs to be
stitched back.

We're using Jenkins to build our most-updated apps (currently AIR,
Firefox, and Chrome; Flash tomorrow :) when they change upstream, so
then I have two scripts here, the first is the script Jenkins uses to
make the AIR dmg and plist, and the second is the postinstall script
that Munki runs that actually makes AIR work.

Hope this is helpful to someone else.

build.sh:


#!/bin/bash -ex

# download latest Adobe AIR
ftp -o adobeair.dmg
http://airdownload.adobe.com/air/mac/download/latest/AdobeAIR.dmg

# Mount disk image on temp space
mountpoint=`hdiutil attach -mountrandom /tmp -nobrowse adobeair.dmg |
awk '/private\/tmp/ { print $3 } '`
echo Mounted on $mountpoint

# Obtain version
version=`defaults read "$mountpoint/Adobe AIR
Installer.app/Contents/Frameworks/Adobe
AIR.framework/Resources/Info.plist" CFBundleVersion`

# Make a disk image with just the framework on it
hdiutil create -srcfolder "$mountpoint/Adobe AIR
Installer.app/Contents/Frameworks" -format UDZO -o
AdobeAIR-${version}.dmg
hdiutil detach "$mountpoint"

# Build pkginfo
plist=`pwd`/AdobeAIR-${version}.plist

/usr/local/munki/makepkginfo AdobeAIR-${version}.dmg -i 'Adobe
AIR.framework' -d /Library/Frameworks --postinstall_script
"postinstall.sh" > "$plist"

# Change path and other details in the plist
defaults write "${plist}" installer_item_location
"jenkins/AdobeAIR-${version}.dmg"
defaults write "${plist}" minimum_os_version "10.7.0"
defaults write "${plist}" uninstallable -bool NO
defaults write "${plist}" display_name "Adobe AIR Framework"
defaults write "${plist}" name "AdobeAIR"

# Make readable by humans
/usr/bin/plutil -convert xml1 "$plist"
chmod a+r "$plist"


postinstall.sh:

#!/bin/bash

# Delete old versions
rm -rf '/Applications/Adobe/Flash Player/AddIns/airappinstaller'
rm -rf '/Applications/Utilities/Adobe AIR Application Installer.app'
rm -rf '/Applications/Utilities/Adobe AIR Uninstaller.app'
rm -rf '/Users/Shared/Library/Application Support/Adobe/AIR'

# Copy installer app
rsync -avE '/Library/Frameworks/Adobe
AIR.framework/Versions/Current/Adobe AIR Application Installer.app'
'/Applications/Utilities'

# Add config to make installer app be able to open .air files
defaults write '/Applications/Utilities/Adobe AIR Application
Installer.app/Contents/Info.plist' 'CFBundleDocumentTypes' '( {
CFBundleTypeExtensions = ( "air" ); CFBundleTypeIconFile = "Adobe AIR
Installer Package.icns"; CFBundleTypeMIMETypes = (
"application/vnd.adobe.air-application-installer-package+zip" );
CFBundleTypeName = "com.adobe.air.InstallerPackage"; CFBundleTypeRole
= Viewer; } )'
plutil -convert xml1 '/Applications/Utilities/Adobe AIR Application
Installer.app/Contents/Info.plist'
chmod a+r '/Applications/Utilities/Adobe AIR Application
Installer.app/Contents/Info.plist'

# I heard you like plugins so I put a plugin in your plugin
mkdir -p '/Applications/Adobe/Flash Player/AddIns/airappinstaller'
cp '/Library/Frameworks/Adobe AIR.framework/Resources/airappinstaller'
'/Applications/Adobe/Flash Player/AddIns/airappinstaller'
cp '/Library/Frameworks/Adobe
AIR.framework/Resources/airappinstaller.rsrc'
'/Applications/Adobe/Flash
Player/AddIns/airappinstaller/airappinstaller/..namedfork/rsrc'
cp '/Library/Frameworks/Adobe AIR.framework/Resources/digest.s'
'/Applications/Adobe/Flash Player/AddIns/airappinstaller'


--Jim

--
Jim Zajkowski
Mac Systems Group
College of Literature, Science, and the Arts
University of Michigan

Jim Zajkowski

unread,
Jul 3, 2012, 9:35:29 AM7/3/12
to munk...@googlegroups.com
The two files are unreadable here; I've copied them to this gist:
https://gist.github.com/3039711

Anyone can use build.sh to produce a munki dmg and pkginfo for Adobe
AIR that installs correctly without using their installer.

We're automating building some packages using Jenkins to note when
URLs change. I hope to write up how that works soon, since I think
it'd be useful for people who are tired of repackaging browsers and
plugins.

--Jim

Timothy Sutton

unread,
Jul 3, 2012, 12:08:52 PM7/3/12
to munk...@googlegroups.com
Thanks Jim,

Quite a comprehensive automation. I've been deploying AIR 3.1, and just tested the latest 3.3 version, using Munki by following Adobe's launchctl bsexec instructions, and it's been working so far. Adobe has this documented a couple places, for example here:

http://www.adobe.com/content/dam/Adobe/en/devnet/creativesuite/pdfs/AAMEE_Exception/en_us/AAMEE_Exceptions.pdf


Did it fail every time for you, or was it sporadic? My only current test case is Help documentation support for Vectorworks, but the AIR installation itself has seemed reliable enough. I've tested this on 10.6 and 10.7 so far.




For comparison, my pkginfo has it copy Adobe AIR Installer.app to /tmp using a copy_from_dmg type, then I have a postinstall_script:

launchctl bsexec `ps auwwx |grep [l]oginwindow | awk '{ print $2 }'` /private/tmp/Adobe\ AIR\ Installer.app/Contents/MacOS/Adobe\ AIR\ Installer -silent

rm -rf /private/tmp/Adobe\ AIR\ Installer.app


...and also some other nonsense to configure the eulaAccepted and updateDisabled text files in the user's application support area. I also make it RequireLogout.


My uninstall method is similar:

launchctl bsexec `ps auwwx |grep [l]oginwindow | awk '{ print $2 }'` /Applications/Utilities/Adobe\ AIR\ Uninstaller.app/Contents/MacOS/Adobe\ AIR\ Installer -uninstall


Your solution is a reverse-engineering of their installer, whereas this method is "supported" by Adobe (even if their exceptions deployer can't even spit out the correct shell commands, they've at least documented it to that effect). Of course, automating the updates and pkginfo creation is good, I'm mainly just wondering why their silent install method wasn't working for you.


-Tim

Jim Zajkowski

unread,
Jul 4, 2012, 3:49:38 PM7/4/12
to munk...@googlegroups.com
Hi Tim,

Our previous AIR package worked identically to what you describe: we'd
copy the AIR Installer to /Library/Application Support/Adobe and then
invoke it with launchctl bsexec, exactly as it says in the Adobe PDF,
as mentioned in the Capser documentation, and as your postinstall
works.

On systems where it hung, it reliably hung every time. It's not munki
specific since I was able to reproduce the hang on one system via ssh.
Our munki deployment is roughly 1,000 systems today; about 10% of
them would hang. The vast majority of our users have admin rights on
their systems. We thought initially it was because they'd upgraded
AIR on their own, but even the very lastest release would hang, and we
found one hanging system that didn't have a previous AIR installation.
All of our munki systems are running 10.7.

I also tried having the AIR installer install a small app (we tested
FocusBooster) to do the AIR installation at the same time - it also
hung.

It does not hang if the installation is done while a user is logged in.

I'm not thrilled about reverse-engineering the installer as opposed to
a supported strategy; this is our only reverse-engineered installer.

Most of our systems are on faculty desks, and so getting time to work
through an entire reproduction of why one system is hanging is not
really possible. I'd like to trace the installer to figure out if
it's possible to resolve the hang, but with tickets coming in asking
what is this "managed software update" thing and demanding it be
turned it off, and no better solutions anywhere... well, this is the
best solution I could come up with.

--Jim
Reply all
Reply to author
Forward
0 new messages