#!/usr/bin/env bash # One-command installer for VIctory-Tux on Linux. # Downloads the latest victory.exe release binary, fetches official FSR 3.1 / # DLSS SDK DLLs into /bin, verifies Proton & d3dcompiler_47, and # registers a desktop application shortcut for the graphical launcher. # # Usage: # ./linux/install.sh [options] # curl -fsSL https://raw.githubusercontent.com/itzwayago/VIctory-Tux/main/linux/install.sh | bash # # Options: # --runtime=PATH Runtime directory (default: /runtime or $VICTORY_RUNTIME_DIR) # --repo-dir=PATH Target clone directory when run via curl | bash (~/.local/share/victory-tux) # --tag=latest|vX.Y.Z Release tag to download victory.exe from (default: latest) # --upscalers=MODE Upscaler SDKs to fetch: all, fsr, dlss (default: all) # --skip-upscalers Skip fetching FSR/DLSS SDK DLLs # --skip-exe Keep existing victory.exe instead of downloading a release binary # --desktop-only Only create/refresh ~/.local/share/applications/victory-tux.desktop # --no-desktop Do not create a .desktop shortcut # --no-winetricks Do not attempt winetricks d3dcompiler_47 installation # --dry-run Show resolved paths and planned steps without making changes # -h, --help Show this help set -euo pipefail REPO_URL="https://github.com/itzwayago/VIctory-Tux" INSTALL_REPO_DIR="${VICTORY_INSTALL_DIR:-$HOME/.local/share/victory-tux}" RUNTIME_DIR="${VICTORY_RUNTIME_DIR:-}" RELEASE_TAG="latest" UPSCALER_MODE="all" SKIP_UPSCALERS=0 SKIP_EXE=0 DESKTOP_ONLY=0 NO_DESKTOP=0 NO_WINETRICKS=0 DRY_RUN=0 for arg in "$@"; do case "$arg" in --runtime=*) RUNTIME_DIR="${arg#*=}" ;; --repo-dir=*) INSTALL_REPO_DIR="${arg#*=}" ;; --tag=*) RELEASE_TAG="${arg#*=}" ;; --upscalers=all|--upscalers=fsr|--upscalers=dlss) UPSCALER_MODE="${arg#*=}" ;; --skip-upscalers) SKIP_UPSCALERS=1 ;; --skip-exe) SKIP_EXE=1 ;; --desktop-only) DESKTOP_ONLY=1 ;; --no-desktop) NO_DESKTOP=1 ;; --no-winetricks) NO_WINETRICKS=1 ;; --dry-run) DRY_RUN=1 ;; -h|--help) sed -n '2,22p' "$0" | sed 's/^# \{0,1\}//' exit 0 ;; *) echo "Unknown option: $arg" >&2 exit 2 ;; esac done # Detect whether we are executing from an existing checkout or standalone (e.g. curl | bash). SELF_PATH="${BASH_SOURCE[0]:-}" SCRIPT_DIR="" if [ -n "$SELF_PATH" ] && [ -f "$SELF_PATH" ]; then SCRIPT_DIR="$(cd -- "$(dirname -- "$SELF_PATH")" && pwd -P)" fi if [ -z "$SCRIPT_DIR" ] || [ ! -f "$SCRIPT_DIR/play.sh" ] || [ ! -f "$SCRIPT_DIR/fetch-upscalers.sh" ]; then echo "==> Bootstrapping VIctory-Tux repository into $INSTALL_REPO_DIR" command -v git >/dev/null 2>&1 || { echo "Error: git is required for standalone install." >&2; exit 1; } if [ "$DRY_RUN" = "1" ]; then echo "DRY_RUN: would clone $REPO_URL.git into $INSTALL_REPO_DIR and run linux/install.sh" exit 0 fi if [ -d "$INSTALL_REPO_DIR/.git" ]; then echo " ok (existing clone) $INSTALL_REPO_DIR" else mkdir -p "$(dirname -- "$INSTALL_REPO_DIR")" git clone --depth 1 "$REPO_URL.git" "$INSTALL_REPO_DIR" fi exec "$INSTALL_REPO_DIR/linux/install.sh" "$@" fi REPO_ROOT="$(cd -- "$SCRIPT_DIR/.." && pwd -P)" WORKSPACE_ROOT="$(cd -- "$REPO_ROOT/.." && pwd -P)" if [ -z "$RUNTIME_DIR" ]; then if [ -d "$REPO_ROOT/runtime" ]; then RUNTIME_DIR="$REPO_ROOT/runtime" elif [ -d "$REPO_ROOT/mutant-runtime" ]; then RUNTIME_DIR="$REPO_ROOT/mutant-runtime" elif [ -d "$WORKSPACE_ROOT/mutant-runtime" ]; then RUNTIME_DIR="$WORKSPACE_ROOT/mutant-runtime" else RUNTIME_DIR="$REPO_ROOT/runtime" fi fi DESKTOP_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/applications" DESKTOP_FILE="$DESKTOP_DIR/victory-tux.desktop" install_desktop_entry() { local launcher_path="$SCRIPT_DIR/launcher.sh" local apps_dir="$DESKTOP_DIR" mkdir -p "$apps_dir" cat >"$DESKTOP_FILE" </dev/null 2>&1; then update-desktop-database "$apps_dir" >/dev/null 2>&1 || true fi echo " ok desktop shortcut -> $DESKTOP_FILE" } find_proton() { local roots=( "$HOME/.steam/steam/steamapps/common" "$HOME/.local/share/Steam/steamapps/common" "$HOME/.var/app/com.valvesoftware.Steam/.local/share/Steam/steamapps/common" "$HOME/.steam/root/compatibilitytools.d" "$HOME/.local/share/Steam/compatibilitytools.d" "/usr/share/steam/compatibilitytools.d" ) local candidates=( "Proton - Experimental" "Proton Hotfix" "Proton 10.0" "Proton 9.0" ) for root in "${roots[@]}"; do [ -d "$root" ] || continue for name in "${candidates[@]}"; do if [ -x "$root/$name/proton" ]; then echo "$root/$name" return 0 fi done local ge for ge in "$root"/GE-Proton* "$root"/Proton*; do if [ -x "$ge/proton" ]; then echo "$ge" return 0 fi done done return 1 } echo "VIctory-Tux Linux Installer" echo " Repo: $REPO_ROOT" echo " Runtime: $RUNTIME_DIR" echo " Release: $RELEASE_TAG" if [ "$DRY_RUN" = "1" ]; then echo " Steps: create runtime dirs, download victory.exe (skip=$SKIP_EXE), upscalers=$UPSCALER_MODE (skip=$SKIP_UPSCALERS), desktop (skip=$NO_DESKTOP)" exit 0 fi if [ "$DESKTOP_ONLY" = "1" ]; then install_desktop_entry exit 0 fi mkdir -p "$RUNTIME_DIR/bin" "$RUNTIME_DIR/pfx" "$RUNTIME_DIR/data" "$RUNTIME_DIR/logs" "$RUNTIME_DIR/cache" if [ "$SKIP_EXE" = "0" ]; then command -v curl >/dev/null 2>&1 || { echo "Error: curl is required." >&2; exit 1; } if [ "$RELEASE_TAG" = "latest" ]; then EXE_URL="$REPO_URL/releases/latest/download/victory.exe" else EXE_URL="$REPO_URL/releases/download/$RELEASE_TAG/victory.exe" fi echo "==> Downloading victory.exe ($RELEASE_TAG)" TMP_EXE="$(mktemp "$RUNTIME_DIR/bin/.victory.exe.XXXXXX")" if ! curl --fail --location --proto '=https' --tlsv1.2 --progress-bar "$EXE_URL" -o "$TMP_EXE"; then rm -f "$TMP_EXE" echo "Error: failed to download $EXE_URL" >&2 exit 1 fi if [ "$(head -c 2 "$TMP_EXE")" != "MZ" ]; then rm -f "$TMP_EXE" echo "Error: downloaded file is not a valid Windows PE executable." >&2 exit 1 fi mv -f "$TMP_EXE" "$RUNTIME_DIR/bin/victory.exe" chmod +x "$RUNTIME_DIR/bin/victory.exe" echo " ok victory.exe -> $RUNTIME_DIR/bin/victory.exe" else echo "==> Skipping victory.exe download (--skip-exe)" fi if [ "$SKIP_UPSCALERS" = "0" ]; then echo "==> Fetching upscaler SDK DLLs ($UPSCALER_MODE)" "$SCRIPT_DIR/fetch-upscalers.sh" "--$UPSCALER_MODE" "--dest=$RUNTIME_DIR/bin" else echo "==> Skipping upscaler SDKs (--skip-upscalers)" fi echo "==> Checking Proton & d3dcompiler_47" if PROTON_FOUND="$(find_proton)"; then echo " ok Proton: $PROTON_FOUND" else echo " warn: No Steam Proton / GE-Proton found in standard directories." echo " Install Proton Experimental via Steam, or set PROTON_PATH when launching." fi D3D_FOUND="" if [ -f "$RUNTIME_DIR/bin/d3dcompiler_47.dll" ]; then D3D_FOUND="$RUNTIME_DIR/bin/d3dcompiler_47.dll" elif [ -f "$RUNTIME_DIR/pfx/drive_c/windows/system32/d3dcompiler_47.dll" ]; then D3D_FOUND="$RUNTIME_DIR/pfx/drive_c/windows/system32/d3dcompiler_47.dll" fi if [ -n "$D3D_FOUND" ]; then echo " ok d3dcompiler_47.dll: $D3D_FOUND" elif [ "$NO_WINETRICKS" = "0" ] && command -v winetricks >/dev/null 2>&1 && [ -d "$RUNTIME_DIR/pfx/drive_c" ]; then echo " -> Installing d3dcompiler_47 into $RUNTIME_DIR/pfx via winetricks" if WINEPREFIX="$RUNTIME_DIR/pfx" winetricks -q d3dcompiler_47 >/dev/null 2>&1; then echo " ok d3dcompiler_47.dll installed in prefix" else echo " warn: winetricks d3dcompiler_47 did not complete automatically." echo " You can install it later with: WINEPREFIX=\"$RUNTIME_DIR/pfx\" winetricks -q d3dcompiler_47" fi else echo " note: d3dcompiler_47.dll not yet present in bin/ or pfx/." echo " If shader translation asks for it on first launch, run:" echo " WINEPREFIX=\"$RUNTIME_DIR/pfx\" winetricks -q d3dcompiler_47" fi echo "==> Checking host tools" for tool in python3 gamescope mangohud vulkaninfo nvidia-smi; do if command -v "$tool" >/dev/null 2>&1; then echo " ok $tool" else echo " optional missing: $tool" fi done if python3 -c "import PySide6" >/dev/null 2>&1; then echo " ok GUI toolkit: PySide6" elif python3 -c "import PyQt6" >/dev/null 2>&1; then echo " ok GUI toolkit: PyQt6" elif python3 -c "import tkinter" >/dev/null 2>&1; then echo " ok GUI toolkit: tkinter" else echo " warn: No Python GUI toolkit found (install python3-pyside6, python3-pyqt6, or python3-tk)" fi if [ "$NO_DESKTOP" = "0" ]; then echo "==> Installing desktop entry" install_desktop_entry fi echo "" echo "Done! Next steps:" echo " 1) Launch GUI: $SCRIPT_DIR/launcher.sh" echo " 2) Or CLI run: VICTORY_GAME_DIR=/path/to/game VICTORY_RUNTIME_DIR=$RUNTIME_DIR $SCRIPT_DIR/play.sh framegen"