FESTPLATTE: Kompakt-Installation (spart ca. 1-1,5 GB) + Cache-Aufräumen
Mac-Installer fragt jetzt nach dem Installationsumfang: - VOLLSTÄNDIG: alle 21 Effekte, GStreamer belegt ca. 1,5-2,5 GB - KOMPAKT: 15 Effekte, nur ca. 0,5-1 GB (verzichtet auf 6 Effekte aus gst-plugins-bad/ugly: Blur/Schärfen, Solarize, Brennen, Dilate, Exclusion). Videowiedergabe (libav), Compositor und alle 15 restlichen Effekte voll nutzbar. - Auswahl läuft über native macOS-Dialoge (osascript, 3 Buttons) - Danach: Homebrew-Cache-Aufräumen anbieten (gibt 0,5-2 GB frei, Installation bleibt unverändert) - nativer Ja/Nein-Dialog, zusätzlich im GUI-Installer nach Mac-Installation - GUI-Installer hat Variante als Combobox (wird an Worker durchgereicht) Gesamt-Festplatte nach Installation (Kompakt): ca. 1-1,5 GB statt ca. 2,5 GB. RAM unverändert ca. 42 MB Leerlauf (gemessen). GUI-Smoke-Test: Variante vorhanden, Cleanup-Dialog existiert und läuft mit gemockter Antwort durch, Fenster sauber beendet.
This commit is contained in:
+41
-33
@@ -1,38 +1,35 @@
|
||||
#!/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).
|
||||
# Kein Tippen im Terminal noetig: Passwort-Eingabe laeuft ueber den
|
||||
# nativen macOS-Dialog (osascript administrator privileges).
|
||||
# Ablauf: Homebrew pruefen -> Installationsumfang waehlen (Festplatte!)
|
||||
# -> installieren -> Cache-Aufraeumen anbieten -> GUI-Installer.
|
||||
# Alle Abfragen kommen als native macOS-Fenster (Buttons), das
|
||||
# Administrator-Passwort fragt macOS selbst ab - kein Terminal-Tippen.
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
echo "=================================================="
|
||||
echo " HMS MediaEngine – Installation"
|
||||
echo " (Dieses Fenster zeigt nur den Fortschritt an –"
|
||||
echo " alle Abfragen kommen als eigene macOS-Fenster)"
|
||||
echo " Fortschritt siehst du hier; alle Abfragen kommen als"
|
||||
echo " eigene macOS-Fenster mit Klick-Buttons."
|
||||
echo "=================================================="
|
||||
echo ""
|
||||
|
||||
# Dialog mit Buttons: gibt nur bei 'Weiter' true zurueck
|
||||
eingabe() {
|
||||
local antwort
|
||||
antwort=$(osascript -e 'display alert "'$1'" message "'$2'" buttons {"Abbrechen","Weiter"} default button "Weiter" as informational' 2>/dev/null)
|
||||
echo "$antwort" | grep -q "Weiter"
|
||||
}
|
||||
|
||||
# --- Homebrew ---
|
||||
# --- 1) 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 benoetigt Homebrew (Paketmanager fuer macOS). Die Installation dauert einige Minuten – danach geht es automatisch weiter. Das Passwort wird im naechsten Fenster von macOS abgefragt."; then
|
||||
echo ""
|
||||
echo ">> Installiere Homebrew (macOS fragt nach deinem Administrator-Passwort)..."
|
||||
osascript -e 'do shell script "NONINTERACTIVE=1 /bin/bash -c \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)\"" with administrator privileges with prompt "Homebrew fuer HMS MediaEngine installieren"' >/dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
osascript -e 'display alert "Homebrew-Installation fehlgeschlagen" message "Bitte das Fenster nochmal versuchen oder Meldung an den Support schicken." as critical' >/dev/null 2>&1
|
||||
if eingabe "Homebrew installieren?" "HMS MediaEngine benoetigt Homebrew (Paketmanager fuer macOS). Die Installation dauert einige Minuten. Dein Administrator-Passwort wird im naechsten Fenster von macOS abgefragt."; then
|
||||
echo ">> Installiere Homebrew (macOS fragt nach deinem Passwort)..."
|
||||
if ! osascript -e 'do shell script "NONINTERACTIVE=1 /bin/bash -c \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)\"" with administrator privileges with prompt "Homebrew fuer HMS MediaEngine installieren"' >/dev/null 2>&1; then
|
||||
osascript -e 'display alert "Homebrew-Installation fehlgeschlagen" message "Bitte erneut versuchen oder die Meldung an den Support schicken." as critical' >/dev/null 2>&1
|
||||
exit 1
|
||||
fi
|
||||
BREW=/opt/homebrew/bin/brew
|
||||
@@ -42,35 +39,46 @@ if [ -z "$BREW" ]; then
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
echo ">> Homebrew: $BREW"
|
||||
|
||||
echo ">> Homebrew gefunden: $BREW"
|
||||
# --- 2) Installationsumfang (Festplatte) waehlen ---
|
||||
VARIANTE=$(osascript -e 'display alert "Welcher Installationsumfang?" message "Vollstaendig: alle 21 Effekte. GStreamer belegt dann ca. 1,5-2,5 GB." & linefeed & linefeed & "Kompakt: 15 Effekte, belegt nur ca. 0,5-1 GB. Verzichtet auf Blur/Schaerfen, Solarize, Brennen, Dilate und Exclusion." & linefeed & linefeed & "Beide Varianten spielen alle Videos und Bilder vollstaendig ab - der Unterschied liegt nur in 6 wenigen Effekten." buttons {"Abbrechen","Kompakt","Vollstaendig"} default button "Vollstaendig" as informational' 2>/dev/null)
|
||||
case "$VARIANTE" in
|
||||
*Kompakt*)
|
||||
PKGS="python@3.12 python-tk gstreamer gst-plugins-base gst-plugins-good gst-libav pygobject"
|
||||
echo ">> Gewaehlt: Kompakt (spart ca. 1-1,5 GB)"
|
||||
;;
|
||||
*Abbrechen*|"")
|
||||
exit 1
|
||||
;;
|
||||
*)
|
||||
PKGS="python@3.12 python-tk gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-libav pygobject"
|
||||
echo ">> Gewaehlt: Vollstaendig (alle Effekte)"
|
||||
;;
|
||||
esac
|
||||
|
||||
# --- Python 3.12 + tkinter ---
|
||||
if ! "$BREW" list --versions python-tk >/dev/null 2>&1; then
|
||||
if eingabe "Python-Komponenten installieren?" "python@3.12 mit tkinter (grafische Oberflaeche) wird installiert."; then
|
||||
echo ""
|
||||
echo ">> Installiere Python + tkinter..."
|
||||
"$BREW" install python@3.12 python-tk
|
||||
fi
|
||||
# --- 3) Installation ---
|
||||
echo ""
|
||||
echo ">> Installiere Komponenten per Homebrew (dauert einige Minuten)..."
|
||||
if ! "$BREW" install $PKGS; then
|
||||
osascript -e 'display alert "Problem bei der Installation" message "Homebrew meldete einen Fehler. Der grafische Installer prueft jetzt, was trotzdem angekommen ist." as warning' >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
# --- GStreamer ---
|
||||
if ! "$BREW" list --versions gstreamer >/dev/null 2>&1; then
|
||||
if eingabe "GStreamer installieren?" "GStreamer mit allen Video-/Audio-Plugins wird installiert (ca. 5-10 Minuten, je nach Internet)."; then
|
||||
echo ""
|
||||
echo ">> Installiere GStreamer + Plugins..."
|
||||
"$BREW" install gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-libav pygobject
|
||||
fi
|
||||
# --- 4) Homebrew-Cache aufräumen (optional, gibt 0,5-2 GB frei) ---
|
||||
if osascript -e 'display alert "Homebrew-Cache aufraeumen?" message "Loescht die heruntergeladenen Installationspakete und gibt etwa 0,5-2 GB Festplatte frei. Die Installation selbst bleibt unveraendert." buttons {"Nein","Ja"} default button "Ja" as informational' 2>/dev/null | grep -q "Ja"; then
|
||||
echo ">> Raeume Homebrew-Cache auf..."
|
||||
"$BREW" cleanup --prune=all >/dev/null 2>&1
|
||||
echo ">> Cache freigegeben."
|
||||
fi
|
||||
|
||||
# --- GUI-Installer starten ---
|
||||
# --- 5) GUI-Installer starten (verifiziert und startet die App) ---
|
||||
PY=/opt/homebrew/bin/python3
|
||||
if [ ! -x "$PY" ]; then PY=/usr/local/bin/python3; fi
|
||||
if [ ! -x "$PY" ]; then PY=python3; fi
|
||||
[ -x "$PY" ] || PY=/usr/local/bin/python3
|
||||
[ -x "$PY" ] || PY=python3
|
||||
|
||||
echo ""
|
||||
echo ">> Starte grafischen Installer (Fenster oeffnet sich)..."
|
||||
"$PY" installer_gui.py
|
||||
|
||||
echo ""
|
||||
echo "Fertig. Ab jetzt genuegt: 'HMS MediaEngine.app' doppelklicken."
|
||||
echo "Fertig. Ab jetzt genuegt: HMS MediaEngine.app doppelklicken."
|
||||
|
||||
Reference in New Issue
Block a user