1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
#!/bin/sh
app="MySQLWorkbench.app"
srcdir="DerivedData/MySQLWorkbench/Build/Products/Release"
edition=$1
ver=$2
if test "$ver" == ""; then
echo "./make_dmg.sh <edition> <wbversion>"
exit 1
fi
templatedmg=~/guibuild/mysqlworkbench-$edition-template.dmg
finaldmg=mysql-workbench-$edition-$ver-osx-x86_64
if [ ! -d $srcdir ]; then
srcdir="build/Release"
fi
###############################################################################################
echo "Packaging $finaldmg"
#oifs=$IFS
#IFS=,
echo "Attaching template $templatedmg"
hdiutil attach "$templatedmg" -noautoopen -mountpoint template
echo "Copying app"
rm -fr "template/$app"
ditto "$srcdir/$app" "template/$app"
if [ $? -ne 0 ]; then
hdiutil detach template -force -quiet
echo "Could not copy .app to template dmg"
exit 1
fi
echo "Copying background image"
cp build/mac/background.tiff template/
chflags hidden template/background.tiff
SetFile -a V template/background.tiff
rm -fr "template/LGPL sources"
echo "Detaching template"
hdiutil detach template -force -quiet
rm -f $finaldmg.*
echo "Creating dmg"
hdiutil convert "$templatedmg" -format UDBZ -imagekey zlib-level=9 -o "$finaldmg" -ov
hdiutil internet-enable -yes "$finaldmg".dmg
|