#!/usr/bin/env bash # Launch Devour with DevourUnlocker via Proton (sets WINEDLLOVERRIDES so winhttp.dll is loaded) # Usage: ./scripts/launch.sh or bash scripts/launch.sh --diagnose set -euo pipefail GAME_DIR="${GAME_DIR:-$HOME/.local/share/Steam/steamapps/common/Devour}" PREFX="${WINEPREFIX:-$HOME/.local/share/Steam/steamapps/compatdata/1274570/pfx}" PROTON="${PROTON:-$HOME/.local/share/Steam/compatibilitytools.d/GE-Proton10-34/proton}" if [[ ! -f "$GAME_DIR/DEVOUR.exe" ]]; then echo "[!] No DEVOUR.exe at $GAME_DIR — set GAME_DIR=/path" exit 1 fi if [[ ! -f "$GAME_DIR/version.dll" ]]; then echo "[!] version.dll not found beside DEVOUR.exe — running injector --deploy-only..." python3 "$(dirname "$0")/../standalone/injector.py" --deploy-only || true fi if [[ ! -f "$GAME_DIR/version.dll" ]]; then echo "[!] Still no version.dll — build or run scripts/install.sh" exit 1 fi echo "[*] Game: $GAME_DIR" echo "[*] Prefix: $PREFX" echo "[*] Proton: $PROTON" echo "[*] Launching with version.dll (primary unlocker) — no manual Steam Launch Options needed if installed via install.sh" echo "[*] Check $GAME_DIR/DevourUnlocker.log after" if [[ "${1:-}" == "--diagnose" ]]; then python3 "$(dirname "$0")/../standalone/devour_unlocker.py" diagnose exit 0 fi export WINEPREFIX="$PREFX" export STEAM_COMPAT_DATA_PATH="$HOME/.local/share/Steam/steamapps/compatdata/1274570" export STEAM_COMPAT_CLIENT_INSTALL_PATH="$HOME/.local/share/Steam" export SteamAppId=1274570 # version.dll is primary unlocker (UnityPlayer.dll imports VERSION.dll, so native version.dll in game dir is auto-loaded on Windows; # on Proton/Wine we still set WINEDLLOVERRIDES silently so user never needs to set it manually) if [[ -z "${WINEDLLOVERRIDES:-}" ]]; then export WINEDLLOVERRIDES="version=n,b" else export WINEDLLOVERRIDES="version=n,b;${WINEDLLOVERRIDES}" fi export WINEDEBUG=-all # Kill stale wineserver wineserver -k 2>/dev/null || true sleep 1 rm -f "$GAME_DIR/DevourUnlocker.log" # Launch via proton (background, then wait 5s and show log) timeout 30 "$PROTON" run "$GAME_DIR/DEVOUR.exe" & PROTON_PID=$! echo "[*] Proton pid $PROTON_PID — waiting 15s for DevourUnlocker.log..." sleep 15 if [[ -f "$GAME_DIR/DevourUnlocker.log" ]]; then echo "--- DevourUnlocker.log ---" cat "$GAME_DIR/DevourUnlocker.log" else echo "[!] No DevourUnlocker.log — DLL not loaded. Check WINEDLLOVERRIDES and that libgcc etc are beside winhttp.dll" ls -lh "$GAME_DIR"/*.dll 2>&1 | head -n 20 fi echo "[*] Game should be running — press F6 for GUI, check in-game wardrobe. This script will exit but game keeps running." wait $PROTON_PID 2>/dev/null || true