#!/bin/bash #============================================================================== # INSTALL MESSAGE NOTES -> PROPRESENTER # Run this once on the ProPresenter Mac. It puts the program in # ~/Library/Application Support/MessageNotes, puts "Message Notes to # ProPresenter" on the Desktop, and asks a few setup questions. # Running it again updates the program and keeps the settings. #============================================================================== cd "$(dirname "$0")" || exit 1 clear echo "Installing Message Notes -> ProPresenter" echo finish() { echo; read -r -p "Press Enter to close this window." _; exit "$1"; } if [ ! -f message-notes.pyz ] || [ ! -f "Message Notes to ProPresenter.command" ]; then echo "This installer has to stay in the kit folder, next to message-notes.pyz." finish 1 fi # macOS's own Python comes with Apple's free Command Line Tools if ! /usr/bin/xcode-select -p >/dev/null 2>&1 || ! /usr/bin/python3 -c 'import sys; sys.exit(sys.version_info < (3, 8))' >/dev/null 2>&1; then echo "This Mac first needs Apple's free Command Line Tools (they include Python)." echo "A box will pop up: click Install and wait until it's finished (5-15 minutes)," echo "then double-click this installer again." /usr/bin/xcode-select --install >/dev/null 2>&1 finish 1 fi D="$HOME/Library/Application Support/MessageNotes" L="$HOME/Desktop/Message Notes to ProPresenter.command" mkdir -p "$D" || finish 1 cp message-notes.pyz "$D/message-notes.pyz" || finish 1 cp "Message Notes to ProPresenter.command" "$L" || finish 1 chmod +x "$L" /usr/bin/xattr -c "$D/message-notes.pyz" "$L" 2>/dev/null # no "downloaded from the internet" warning echo "Installed version $(/usr/bin/python3 "$D/message-notes.pyz" --version 2>&1)" echo " program: $D/message-notes.pyz" echo " Desktop: Message Notes to ProPresenter" /usr/bin/python3 "$D/message-notes.pyz" --setup status=$? echo echo "All set. From now on just double-click 'Message Notes to ProPresenter' on the Desktop." finish $status