Skip to content

Instantly share code, notes, and snippets.

@motionbug
Forked from jamesez/gist:3085058
Created July 10, 2012 17:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save motionbug/3085136 to your computer and use it in GitHub Desktop.
Save motionbug/3085136 to your computer and use it in GitHub Desktop.
Build Chrome dmg
#!/bin/bash -ex
# Mount disk image on temp space
mountpoint=`hdiutil attach -mountrandom /tmp -nobrowse googlechrome.dmg | awk '/private\/tmp/ { print $3 } '`
echo Mounted on $mountpoint
# Determine version number
version=`defaults read "$mountpoint/Google Chrome.app/Contents/Info.plist" CFBundleShortVersionString`
echo Google Chrome version $version
# unmount
hdiutil detach $mountpoint
# Set up variables
dmg=Google-Chrome-$version.dmg
plist=Google-Chrome-$version.plist
plistbase=`basename $plist .plist`
# Rename disk image
mv googlechrome.dmg $dmg
# Build pkginfo
/usr/local/munki/makepkginfo -m go-w -g admin -o root $dmg > $plist
defaults write "`pwd`/$plistbase" installer_item_location "jenkins/$dmg"
defaults write "`pwd`/$plistbase" minimum_os_version "10.7.0"
defaults write "`pwd`/$plistbase" uninstallable -bool NO
/usr/bin/plutil -convert xml1 $plist
chmod a+r $plist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment