Changeset eed80117


Ignore:
Timestamp:
Oct 13, 2018 4:06:44 AM (22 months ago)
Author:
meeh <meeh@…>
Branches:
master
Children:
e326011
Parents:
f8fb4a6
Message:

OSX Launcher: dmg create script update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • launchers/macosx/osx_create_dmg.sh

    rf8fb4a6 reed80117  
    22DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
    33
    4 . .sign-secrets
     4source $DIR/.sign-secrets
    55
    66APP_NAME="I2PLauncher"
    7 VERSION="0.9.36"
    8 DMG_BACKGROUND_IMG="${DIR}/Background.png"
     7VERSION="0.9.37"
     8DMG_BACKGROUND_IMG=${BACKGROUND_IMG:-"Background.png"}
    99
    1010APP_EXE="${APP_NAME}.app/Contents/MacOS/${APP_NAME}"
    11 VOL_NAME="${APP_NAME} ${VERSION}"
     11VOL_NAME="${APP_NAME}-${VERSION}"
    1212DMG_TMP="${VOL_NAME}-temp.dmg"
    1313DMG_FINAL="${VOL_NAME}.dmg"
     
    2424   _DMG_BACKGROUND_TMP="${DMG_BACKGROUND_IMG%.*}"_dpifix."${DMG_BACKGROUND_IMG##*.}"
    2525
    26    sips -s dpiWidth 72 -s dpiHeight 72 ${DMG_BACKGROUND_IMG} --out ${_DMG_BACKGROUND_TMP}
     26   sips -s dpiWidth 72 -s dpiHeight 72 $DIR/${DMG_BACKGROUND_IMG} --out $DIR/${_DMG_BACKGROUND_TMP}
    2727
    28    DMG_BACKGROUND_IMG="${_DMG_BACKGROUND_TMP}"
     28
     29  DMG_BACKGROUND_IMG="${_DMG_BACKGROUND_TMP}"
    2930fi
    30 
    31 # clear out any old data
    32 rm -rf "${STAGING_DIR}" "${DMG_TMP}" "${DMG_FINAL}"
    3331
    3432# copy over the stuff we want in the final disk image to our staging dir
     
    4038#  assumes our contents are at least 1M!
    4139SIZE=`du -sh "${STAGING_DIR}" | sed 's/\([0-9\.]*\)M\(.*\)/\1/'`
    42 SIZE=`echo "${SIZE} + 1.0" | bc | awk '{print int($1+0.5)}'`
     40SIZE=`echo "${SIZE} + 23.0" | bc | awk '{print int($1+0.5)}'`
    4341
    4442if [ $? -ne 0 ]; then
     
    4947# create the temp DMG file
    5048hdiutil create -srcfolder "${STAGING_DIR}" -volname "${VOL_NAME}" -fs HFS+ \
    51       -fsargs "-c c=64,a=16,e=16" -format UDRW -size ${SIZE}M "${DMG_TMP}"
     49      -fsargs "-c c=64,a=16,e=16" -format UDRW -size ${SIZE}M "$RELEASE_DIR/${DMG_TMP}"
    5250
    5351echo "Created DMG: ${DMG_TMP}"
    5452
    5553# mount it and save the device
    56 DEVICE=$(hdiutil attach -readwrite -noverify "${DMG_TMP}" | \
     54DEVICE=$(hdiutil attach -readwrite -noverify "$RELEASE_DIR/${DMG_TMP}" | \
    5755         egrep '^/dev/' | sed 1q | awk '{print $1}')
    5856
    5957sleep 2
    6058
     59
     60
    6161# add a link to the Applications dir
    6262echo "Add link to /Applications"
    63 pushd /Volumes/"${VOL_NAME}"
    64 ln -s /Applications
     63cd /Volumes/"${VOL_NAME}"
     64ln -sf /Applications Applications
    6565
    6666# add a background image
    67 mkdir /Volumes/"${VOL_NAME}"/.background
    68 cp "${DMG_BACKGROUND_IMG}" /Volumes/"${VOL_NAME}"/.background/
     67mkdir -p /Volumes/"${VOL_NAME}"/.background
     68cp "$DIR/`basename ${DMG_BACKGROUND_IMG}`" /Volumes/"${VOL_NAME}"/.background/`basename ${DMG_BACKGROUND_IMG}`
     69
     70cd $RELEASE_DIR
    6971
    7072# tell the Finder to resize the window, set the background,
     
    99101# now make the final image a compressed disk image
    100102echo "Creating compressed image"
    101 hdiutil convert "${DMG_TMP}" -format UDZO -imagekey zlib-level=9 -o "${DMG_FINAL}"
     103hdiutil convert "$RELEASE_DIR/${DMG_TMP}" -format UDZO -imagekey zlib-level=9 -o "$RELEASE_DIR/${DMG_FINAL}"
    102104
    103 codesign --force --sign "${APPLE_CODE_SIGNER_ID}" "${DMG_FINAL}"
     105codesign --force --deep --sign "${APPLE_CODE_SIGNER_ID}" "$RELEASE_DIR/${DMG_FINAL}"
    104106
    105107# clean up
    106 rm -rf "${DMG_TMP}"
     108rm -rf "$RELEASE_DIR/${DMG_TMP}"
    107109rm -rf "${STAGING_DIR}"
     110
    108111
    109112echo 'Done.'
Note: See TracChangeset for help on using the changeset viewer.