Created
February 6, 2025 17:23
-
-
Save valorisa/760bd0481c4b64e0b2c3e48b1f55a915 to your computer and use it in GitHub Desktop.
This script, 'install_mkvtoolnix_gui_brew_cask_on_macos.sh', automates the installation of the MKVToolNix GUI on macOS via Homebrew Cask. It first removes any existing MKVToolNix CLI binaries to prevent conflicts and uninstalls any previous CLI installation of MKVToolNix. Then, it checks if Rosetta 2 is installed (necessary for running Intel-bas…
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "🔍 Vérification et suppression des binaires existants..." | |
BIN_PATH="/opt/homebrew/bin" | |
MKV_BINARIES=("mkvextract" "mkvmerge" "mkvinfo" "mkvpropedit") | |
for bin in "${MKV_BINARIES[@]}"; do | |
if [ -f "$BIN_PATH/$bin" ]; then | |
echo "❌ Suppression de $bin..." | |
rm -f "$BIN_PATH/$bin" | |
fi | |
done | |
echo "🛠 Vérification et désinstallation de MKVToolNix (CLI)..." | |
if brew list -1 | grep -q "mkvtoolnix"; then | |
echo "📌 Désinstallation de MKVToolNix CLI..." | |
brew uninstall mkvtoolnix | |
else | |
echo "✅ Aucune version CLI de MKVToolNix trouvée." | |
fi | |
echo "💾 Vérification et installation de Rosetta 2..." | |
if ! pgrep oahd >/dev/null 2>&1; then | |
echo "💡 Installation de Rosetta 2..." | |
softwareupdate --install-rosetta --agree-to-license | |
else | |
echo "✅ Rosetta 2 est déjà installé." | |
fi | |
echo "📦 Installation de MKVToolNix GUI..." | |
brew install --cask mkvtoolnix | |
echo "📂 Vérification de l'installation..." | |
APP_PATH="/Applications/MKVToolNix-89.0.app" | |
if [ -d "$APP_PATH" ]; then | |
echo "🎉 MKVToolNix GUI a été installé avec succès ! 🚀" | |
echo "📌 Lancement de l'application..." | |
open -a "MKVToolNix" | |
else | |
echo "❌ Erreur : L'application MKVToolNix n'a pas été installée correctement." | |
echo "🔄 Essaye de relancer le script ou installe-la manuellement avec : brew install --cask mkvtoolnix" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Si tu es prêt à l'utiliser, voici comment le mettre en œuvre :
Enregistre le fichier sous ce nom : 'install_mkvtoolnix_gui_brew_cask_on_macos.sh'
Rends-le exécutable :
chmod +x install_mkvtoolnix_gui_brew_cask_on_macos.sh
Exécute-le :
./install_mkvtoolnix_gui_brew_cask_on_macos.sh