Created
April 3, 2010 01:16
-
-
Save gonzoua/353963 to your computer and use it in GitHub Desktop.
script for packaging OS X application in dmg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
VOLNAME="My Cool App" | |
APPNAME=MyCoolApp | |
TARGET_BUILD_DIR=/Users/gonzo/Projects/MyCoolApp/build/Release | |
if [ -e "/Volumes/$VOLNAME" ]; then | |
echo "Detaching old $VOLNAME" | |
hdiutil detach "/Volumes/$VOLNAME" | |
fi | |
rm -f "$TARGET_BUILD_DIR/$VOLNAME.dmg" "$TARGET_BUILD_DIR/${VOLNAME}_big.dmg" | |
# create/attach dmg for distribution | |
echo "Creating blank DMG" | |
hdiutil create -size 10000k -volname "$VOLNAME" -attach -fs HFS+ "$TARGET_BUILD_DIR/${VOLNAME}_big.dmg" | |
cp -R "$TARGET_BUILD_DIR/$APPNAME.app" "/Volumes/$VOLNAME/" | |
ls -la "/Volumes/$VOLNAME/" | |
hdiutil detach "/Volumes/$VOLNAME" | |
echo "Compresing disk image" | |
hdiutil convert -format UDZO -o "$TARGET_BUILD_DIR/$VOLNAME.dmg" "$TARGET_BUILD_DIR/${VOLNAME}_big.dmg" | |
rm -f "$TARGET_BUILD_DIR/${VOLNAME}_big.dmg" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment