Commit 14bcafae authored by Ivan Yossi's avatar Ivan Yossi 👌 Committed by Ashwin Dhakaita

packaging macOS: Add custom Icon for dmg volume

parent 26c811a0
......@@ -92,20 +92,7 @@ print_usage () {
\t image recomended size is at least 950x500\n"
}
get_script_dir() {
script_source="${BASH_SOURCE[0]}"
# go to target until finding root.
while [ -L "${script_source}" ]; do
script_target="$(readlink ${script_source})"
if [[ "${script_source}" = /* ]]; then
script_source="$script_target"
else
script_dir="$(dirname "${script_source}")"
script_source="${script_dir}/${script_target}"
fi
done
echo "$(dirname ${script_source})"
}
......@@ -160,6 +147,10 @@ for arg in "${@}"; do
done
if [[ ! ${DMG_STYLE} ]]; then
<<<<<<< HEAD
=======
DMG_STYLE="${SCRIPT_SOURCE_DIR}/default.style"
>>>>>>> packaging macOS: Add custom Icon for dmg volume
fi
echo "Using style from: ${DMG_STYLE}"
......@@ -559,6 +550,7 @@ createDMG () {
if [[ ! -d "/Volumes/${DMG_title}/.background" ]]; then
mkdir "/Volumes/${DMG_title}/.background"
fi
<<<<<<< HEAD
cp -v ${DMG_background} "/Volumes/${DMG_title}/.background/"
mkdir "/Volumes/${DMG_title}/Terms of Use"
......@@ -573,6 +565,18 @@ tell application "Finder"
set current view of container window to icon view
set toolbar visible of container window to false
' "${DMG_title}" "${DMG_background##*/}" | osascript
=======
cp -v ${DMG_background} "/Volumes/${DMG_title}/.background/"
## Apple script to set style
style="$(<"${DMG_STYLE}")"
printf "${style}" "${DMG_title}" "${DMG_background##*/}" | osascript
#Set Icon for DMG
cp -v "${SCRIPT_SOURCE_DIR}/KritaIcon.icns" "/Volumes/${DMG_title}/.VolumeIcon.icns"
SetFile -a C "/Volumes/${DMG_title}"
>>>>>>> packaging macOS: Add custom Icon for dmg volume
chmod -Rf go-w "/Volumes/${DMG_title}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment