Skip to content

Instantly share code, notes, and snippets.

@jamesez
Created July 10, 2012 17:47
Show Gist options
  • Save jamesez/3085058 to your computer and use it in GitHub Desktop.
Save jamesez/3085058 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