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