File indexing completed on 2025-03-16 12:43:27
0001 #!/bin/bash 0002 0003 # 0004 # A bash script to create a dmg image file of the 0005 # final application bundle 0006 # (c) Tim Sutton 2007 0007 0008 # Change the next line to suite the verion release (no spaces) 0009 0010 VERSION=5 0011 APPNAME=Marble 0012 0013 # Should not need to edit after this point 0014 0015 VOLNAME=${APPNAME}${VERSION} 0016 DMGNAME=${VOLNAME}Uncompressed.dmg 0017 COMPRESSEDDMGNAME=${VOLNAME}.dmg 0018 set -x 0019 0020 echo "Removing old dmg if it exists" 0021 rm ~/Desktop/${DMGNAME} 0022 rm ~/Desktop/${COMPRESSEDDMGNAME} 0023 hdiutil create -size 65m -fs HFS+ -volname ${VOLNAME} ~/Desktop/${DMGNAME} 0024 0025 # Mount the disk image 0026 hdiutil attach ~/Desktop/${DMGNAME} 0027 0028 # Obtain device information 0029 DEVS=$(hdiutil attach ~/Desktop/${DMGNAME} | cut -f 1) 0030 DEV=$(echo $DEVS | cut -f 1 -d ' ') 0031 VOLUME=$(mount |grep ${DEV} | cut -f 3 -d ' ') 0032 0033 # copy in the application bundle 0034 cp -Rp /Applications/${APPNAME}.app ${VOLUME}/${APPNAME}.app 0035 0036 # copy in background image and folder settings for icon sizes etc 0037 tar xvfz extra_dmg_files.tar.gz -C ${VOLUME} 0038 cp ../LICENSE.txt ${VOLUME}/LICENSE.txt 0039 0040 # Unmount the disk image 0041 hdiutil detach $DEV 0042 0043 # Convert the disk image to read-only 0044 hdiutil convert ~/Desktop/${DMGNAME} \ 0045 -format UDZO -o ~/Desktop/${COMPRESSEDDMGNAME}