post_install.sh.cmake 869 B

12345678910111213141516171819202122232425
  1. #!/bin/sh
  2. # Check if Finder is running (for systems with Finder disabled)
  3. finder_status=`ps aux | grep "/System/Library/CoreServices/Finder.app/Contents/MacOS/Finder" | grep -v "grep"`
  4. if ! [ "$finder_status" == "" ] ; then # Finder is running
  5. osascript << EOF
  6. tell application "Finder"
  7. activate
  8. select the last Finder window
  9. reveal POSIX file "/Applications/@APPLICATION_EXECUTABLE@.app"
  10. end tell
  11. EOF
  12. fi
  13. # Always enable the new 10.10 finder plugin if available
  14. if [ -x "$(command -v pluginkit)" ]; then
  15. # add it to DB. This happens automatically too but we try to push it a bit harder for issue #3463
  16. pluginkit -a "/Applications/@APPLICATION_EXECUTABLE@.app/Contents/PlugIns/FinderSyncExt.appex/"
  17. # Since El Capitan we need to sleep #4650
  18. sleep 10s
  19. # enable it
  20. pluginkit -e use -i @APPLICATION_REV_DOMAIN@.FinderSyncExt
  21. fi
  22. exit 0