add interactive prompt to optionally skip XIVLauncher installation during setup

This commit is contained in:
CPTN Cosmo 2026-04-18 15:42:49 +02:00
parent 16719f7400
commit c754fc7e7a

View file

@ -65,62 +65,70 @@ install_aur_version() {
echo "Checking for XIVLauncher installation..." echo "Checking for XIVLauncher installation..."
if ! check_xivlauncher_installed; then 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 if [ -f "/etc/os-release" ]; then
. /etc/os-release . /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
fi fi
# Fallback for others INSTALLED=false
else OS_ID="${ID:-linux}"
echo "Detected OS: $OS_ID." OS_LIKE="${ID_LIKE:-}"
if command -v flatpak >/dev/null 2>&1; then # Logic for SteamOS / Bazzite (Force Flatpak)
echo "Flatpak found. Defaulting to Flatpak version." # 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 install_flatpak_version
if check_xivlauncher_installed; then INSTALLED=true; fi 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 # Logic for Arch / CachyOS (Try AUR, Fallback to Flatpak)
if ! check_xivlauncher_installed; then elif [[ "$OS_ID" == "arch" ]] || [[ "$OS_ID" == "cachyos" ]] || [[ "$OS_LIKE" == *"arch"* ]]; then
echo "WARNING: Automated installation failed or XIVLauncher is still not detected." echo "Detected Arch-based OS ($OS_ID)."
echo "You will need to install XIVLauncher manually."
read -p "Press Enter to continue with wrapper installation anyway..." _ 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 else
echo "XIVLauncher installed successfully!" echo "Skipping XIVLauncher installation."
fi fi
else else
echo "XIVLauncher is already present." echo "XIVLauncher is already present."