diff --git a/installer.sh b/installer.sh index 231d146..801e0f9 100755 --- a/installer.sh +++ b/installer.sh @@ -65,62 +65,70 @@ install_aur_version() { echo "Checking for XIVLauncher installation..." if ! check_xivlauncher_installed; then - echo "XIVLauncher not found. Attempting auto-installation..." + echo "XIVLauncher (Native/Flatpak) not found." + echo "If you use XLM (Steam Compatibility Tool), you can skip this step." + read -p "Would you like to install XIVLauncher? [y/N]: " INSTALL_XIVL + + if [[ "$INSTALL_XIVL" =~ ^[Yy]$ ]]; then + echo "Attempting auto-installation..." - if [ -f "/etc/os-release" ]; then - . /etc/os-release - fi - - INSTALLED=false - OS_ID="${ID:-linux}" - OS_LIKE="${ID_LIKE:-}" - - # Logic for SteamOS / Bazzite (Force Flatpak) - # Bazzite often identifies as bazzite or fedora but has image-based constraints. - # Usually recommended to use Flatpaks. - if [[ "$OS_ID" == "steamos" ]] || [[ "$OS_ID" == "bazzite" ]] || [[ "$OS_ID" == "chimeraos" ]]; then - echo "Detected Gaming OS ($OS_ID). Using Flatpak." - install_flatpak_version - if check_xivlauncher_installed; then INSTALLED=true; fi - - # Logic for Arch / CachyOS (Try AUR, Fallback to Flatpak) - elif [[ "$OS_ID" == "arch" ]] || [[ "$OS_ID" == "cachyos" ]] || [[ "$OS_LIKE" == *"arch"* ]]; then - echo "Detected Arch-based OS ($OS_ID)." - - if command -v yay >/dev/null 2>&1; then - install_aur_version "yay" - INSTALLED=true - elif command -v paru >/dev/null 2>&1; then - install_aur_version "paru" - INSTALLED=true - else - echo "No AUR helper (yay/paru) found. Falling back to Flatpak." - install_flatpak_version - if check_xivlauncher_installed; then INSTALLED=true; fi + if [ -f "/etc/os-release" ]; then + . /etc/os-release fi - # Fallback for others - else - echo "Detected OS: $OS_ID." - - if command -v flatpak >/dev/null 2>&1; then - echo "Flatpak found. Defaulting to Flatpak version." + INSTALLED=false + OS_ID="${ID:-linux}" + OS_LIKE="${ID_LIKE:-}" + + # Logic for SteamOS / Bazzite (Force Flatpak) + # Bazzite often identifies as bazzite or fedora but has image-based constraints. + # Usually recommended to use Flatpaks. + if [[ "$OS_ID" == "steamos" ]] || [[ "$OS_ID" == "bazzite" ]] || [[ "$OS_ID" == "chimeraos" ]]; then + echo "Detected Gaming OS ($OS_ID). Using Flatpak." install_flatpak_version if check_xivlauncher_installed; then INSTALLED=true; fi - else - echo "Flatpak is not installed." - echo "We recommend installing XIVLauncher via Flatpak on this distribution." - echo "Please install Flatpak using your package manager, then run this script again." - fi - fi - # Final Check - if ! check_xivlauncher_installed; then - echo "WARNING: Automated installation failed or XIVLauncher is still not detected." - echo "You will need to install XIVLauncher manually." - read -p "Press Enter to continue with wrapper installation anyway..." _ + # Logic for Arch / CachyOS (Try AUR, Fallback to Flatpak) + elif [[ "$OS_ID" == "arch" ]] || [[ "$OS_ID" == "cachyos" ]] || [[ "$OS_LIKE" == *"arch"* ]]; then + echo "Detected Arch-based OS ($OS_ID)." + + if command -v yay >/dev/null 2>&1; then + install_aur_version "yay" + INSTALLED=true + elif command -v paru >/dev/null 2>&1; then + install_aur_version "paru" + INSTALLED=true + else + echo "No AUR helper (yay/paru) found. Falling back to Flatpak." + install_flatpak_version + if check_xivlauncher_installed; then INSTALLED=true; fi + fi + + # Fallback for others + else + echo "Detected OS: $OS_ID." + + if command -v flatpak >/dev/null 2>&1; then + echo "Flatpak found. Defaulting to Flatpak version." + install_flatpak_version + if check_xivlauncher_installed; then INSTALLED=true; fi + else + echo "Flatpak is not installed." + echo "We recommend installing XIVLauncher via Flatpak on this distribution." + echo "Please install Flatpak using your package manager, then run this script again." + fi + fi + + # Final Check + if ! check_xivlauncher_installed; then + echo "WARNING: Automated installation failed or XIVLauncher is still not detected." + echo "You will need to install XIVLauncher manually if you don't use XLM." + read -p "Press Enter to continue with wrapper installation anyway..." _ + else + echo "XIVLauncher installed successfully!" + fi else - echo "XIVLauncher installed successfully!" + echo "Skipping XIVLauncher installation." fi else echo "XIVLauncher is already present."