Files
hms-mediaengine/HMS-Mac-Install.command
T

51 lines
1.8 KiB
Bash
Raw Normal View History

#!/bin/bash
# HMS MediaEngine macOS-Installation per Doppelklick (Finder)
# Ablauf: brew pruefen/installieren -> python3+tk pruefen ->
# GUI-Installer starten (Passwort-Dialog kommt von macOS selbst).
# Falls python3/tkinter fehlt: Fallback-Dialoge nativ per osascript.
cd "$(dirname "$0")"
echo "HMS MediaEngine Installation"
eingabe() {
osascript -e 'display alert "'$1'" message "'$2'" buttons {"Abbrechen","Weiter"} default button "Weiter" as informational' >/dev/null 2>&1
[ $? -eq 0 ]
}
# --- Homebrew ---
BREW=""
for p in /opt/homebrew/bin/brew /usr/local/bin/brew; do
if [ -x "$p" ]; then BREW="$p"; break; fi
done
if [ -z "$BREW" ]; then
if eingabe "Homebrew installieren?" "HMS MediaEngine benötigt Homebrew (der Paketmanager für macOS). Es wird jetzt installiert danach geht es automatisch weiter."; then
NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
BREW=/opt/homebrew/bin/brew
else
exit 1
fi
fi
# --- Python 3.12 + tkinter ---
"$BREW" list python-tk >/dev/null 2>&1 || {
if eingabe "Python-Komponenten installieren?" "Es wird python@3.12 mit tkinter installiert (für die grafische Oberfläche)."; then
"$BREW" install python@3.12 python-tk
fi
}
# --- GStreamer ---
"$BREW" list gstreamer >/dev/null 2>&1 || {
if eingabe "GStreamer installieren?" "Es werden GStreamer und alle Video-/Audio-Plugins installiert (ca. 510 Minuten)."; then
"$BREW" install gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-libav pygobject
fi
}
# --- GUI-Installer starten ---
PY=/opt/homebrew/bin/python3
if [ ! -x "$PY" ]; then PY=/usr/local/bin/python3; fi
echo ""
echo "Starte grafischen Installer (Fenster öffnet sich)..."
"$PY" installer_gui.py