MAC Build: new package UI design (thanks to @ITAYC0HEN) ()

* MAC Build: new package UI design (thanks to @ITAYC0HEN)

* MAC Build: fixed path bar absence
This commit is contained in:
a1ext 2018-12-04 08:38:16 +03:00 committed by Itay Cohen
parent cf501d2606
commit 636057bd53
3 changed files with 66 additions and 1 deletions

View File

@ -77,8 +77,17 @@ after_success:
mkdir -p Cutter.app/Contents/Resources/r2/share && mkdir -p Cutter.app/Contents/Resources/r2/share &&
cp -a /usr/local/share/radare2 Cutter.app/Contents/Resources/r2/share/ && cp -a /usr/local/share/radare2 Cutter.app/Contents/Resources/r2/share/ &&
mkdir image && cp -a Cutter.app image/ && mkdir image && cp -a Cutter.app image/ &&
export VOL_NAME="Cutter v${CUTTER_VERSION}" &&
export DMG_TMP_FILE="Cutter-v$CUTTER_VERSION-x64.macOS-tmp.dmg" &&
export DMG_FILE="Cutter-v$CUTTER_VERSION-x64.macOS.dmg" && export DMG_FILE="Cutter-v$CUTTER_VERSION-x64.macOS.dmg" &&
hdiutil create -srcfolder image -volname Cutter -fs HFS+ "$DMG_FILE" && export SIZE=`du -sh "image" | sed 's/\([0-9\.]*\)M\(.*\)/\1/'` &&
export SIZE=`echo "${SIZE} + 10.0" | bc | awk '{print int($1+0.5)}'` &&
hdiutil create -srcfolder image -volname "${VOL_NAME}" -fs HFS+ -fsargs "-c c=64,a=16,e=16" -format UDRW -size ${SIZE}M "$DMG_TMP_FILE" &&
export DEVICE=$(hdiutil attach -readwrite -noverify "${DMG_TMP_FILE}" | egrep '^/dev/' | sed 1q | awk '{print $1}') &&
sleep 2 &&
../scripts/prepare_package_ui_macos.sh "Cutter" "${PWD}/../src/macos/cutter_mac_app.png" "${VOL_NAME}" &&
hdiutil detach "${DEVICE}" &&
hdiutil convert "${DMG_TMP_FILE}" -format UDZO -imagekey zlib-level=9 -o "${DMG_FILE}" &&
export FILE_TO_UPLOAD="$DMG_FILE" export FILE_TO_UPLOAD="$DMG_FILE"
; fi ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then

View File

@ -0,0 +1,56 @@
#!/bin/bash
if ! [[ $# -eq 3 ]]; then
echo "Usage: $0 [App name] [background.png] [Volume name]"
exit 1
fi
APP_NAME=$1
DMG_BACKGROUND_IMG=$2
VOL_NAME=$3
if [[ ! -f ${DMG_BACKGROUND_IMG} ]]; then
echo "background not found"
exit 1
fi
echo "Adding link to '/Applications'..."
pushd /Volumes/"${VOL_NAME}" || exit 1
ln -s /Applications " " || exit 1
popd || exit 1
echo "Package background set up..."
mkdir /Volumes/"${VOL_NAME}"/.background || exit 1
cp "${DMG_BACKGROUND_IMG}" /Volumes/"${VOL_NAME}"/.background/ || exit 1
DMG_BACKGROUND_IMG_BASENAME=$(basename "${DMG_BACKGROUND_IMG}")
# tell the Finder to resize the window, set the background,
# change the icon size, place the icons in the right position, etc.
echo '
tell application "Finder"
tell disk "'${VOL_NAME}'"
open
set current view of container window to icon view
set toolbar visible of container window to false
set statusbar visible of container window to false
set the bounds of container window to {400, 100, 925, 508}
set viewOptions to the icon view options of container window
set arrangement of viewOptions to not arranged
set icon size of viewOptions to 122
set background picture of viewOptions to file ".background:'${DMG_BACKGROUND_IMG_BASENAME}'"
set position of item "'${APP_NAME}'.app" of container window to {117, 193}
set position of item " " of container window to {411, 193}
set position of item ".background" of container window to {1000, 1000}
set position of item ".fseventsd" of container window to {1010, 1010}
close
open
update without registering applications
delay 2
end tell
end tell
' | osascript || exit 1
echo "Syncing..."
sync || exit 1

Binary file not shown.

After

(image error) Size: 28 KiB