From ea11797d077f7d597c1c63853cc37fd1c8e8976d Mon Sep 17 00:00:00 2001 From: Yuriy Puchkov Date: Tue, 1 Dec 2020 19:25:46 +0200 Subject: [PATCH] MacOS - add Application link to the package --- .github/workflows/MacOS-pack.yml | 9 +++-- packaging/macos/update_package.sh | 55 +++++++++++++++++++++++++++++++ src/CMakeLists.txt | 2 +- 3 files changed, 63 insertions(+), 3 deletions(-) create mode 100755 packaging/macos/update_package.sh diff --git a/.github/workflows/MacOS-pack.yml b/.github/workflows/MacOS-pack.yml index 7bda0e6b..6669e367 100644 --- a/.github/workflows/MacOS-pack.yml +++ b/.github/workflows/MacOS-pack.yml @@ -41,12 +41,17 @@ jobs: cd build make - - name: Build dmg image + - name: Build dmg package run: | cd build /usr/local/opt/qt5/bin/macdeployqt src/flameshot.app -dmg - - name: Upload dmg image + - name: Update dmg package links + run: | + cd build/src + ../../packaging/macos/update_package.sh + + - name: Upload dmg package shell: bash run: | python3 -m pip install -U -q requests diff --git a/packaging/macos/update_package.sh b/packaging/macos/update_package.sh new file mode 100755 index 00000000..048be244 --- /dev/null +++ b/packaging/macos/update_package.sh @@ -0,0 +1,55 @@ +#!/bin/bash + +echo "Change the permision of .dmg file" +hdiutil convert "flameshot.dmg" -format UDRW -o "flameshot_rw.dmg" + +echo "Mount it and save the device" +DEVICE=$(hdiutil attach -readwrite -noverify "flameshot_rw.dmg" | egrep '^/dev/' | sed 1q | awk '{print $1}') +sleep 5 + +echo "Create the sysmbolic link to application folder" +PATH_AT_VOLUME="/Volumes/src:flameshot/" +CURRENT_PATH="$(pwd)" +cd "${PATH_AT_VOLUME}" +ln -s /Applications +cd "${CURRENT_PATH}" + +# TODO - add background and icon location. +# https://forum.qt.io/topic/94987/how-can-i-add-symbolic-link-application-and-background-image-in-dmg-package/3 +#echo "copy the background image in to package" +#mkdir -p "${PATH_AT_VOLUME}".background/ +#cp backgroundImage.png "${PATH_AT_VOLUME}".background/ +#echo "done" +# +## 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 "/Volumes/src:flameshot" +# 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, 1110, 645} +# set viewOptions to the icon view options of container window +# set arrangement of viewOptions to not arranged +# set icon size of viewOptions to 72 +# set background picture of viewOptions to file ".background:backgroundImage.png" +# set position of item "flameshot.app" of container window to {160, 325} +# set position of item "Applications" of container window to {560, 320} +# close +# open +# update without registering applications +# delay 2 +# end tell +# end tell +#' | osascript +# +#sync + +# unmount it +hdiutil detach "${DEVICE}" +rm -f "flameshot.dmg" + +hdiutil convert "flameshot_rw.dmg" -format UDZO -o "flameshot.dmg" +rm -f "flameshot_rw.dmg" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3b55a49e..e95c059d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -167,7 +167,7 @@ else() endif() if(NOT USE_OPENSSL) - message(WARNING "OpenSSL is required to upload screenshot to imgur") + message(WARNING "OpenSSL is required to upload screenshots") endif() target_compile_definitions(flameshot PRIVATE APP_PREFIX="${CMAKE_INSTALL_PREFIX}")