From e33b2f649158efc4a5cdda5ab79729810875bf83 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 22 Jun 2026 17:23:43 +0000 Subject: [PATCH] fix: search game files for ea_app.msi, not just drive_c The MSI is bundled in steamapps/common with the game files. The script was only checking drive_c (where Steam copies it after a launch), causing a false "not found" error before the user had launched the game. Now searches steamapps/common and all of steamapps as fallbacks, reports which path it found the MSI at. Also remove stale references to the "Origin is not installed" error which no longer appears. Co-Authored-By: Claude Sonnet 4.6 Claude-Session: https://claude.ai/code/session_01D8ckUJQtj1pH8jtAddBDZs --- scripts/setup-swbf2-linux.sh | 34 +++++++++++++++++++++++++--------- scripts/setup-swbf2-wolf.sh | 29 +++++++++++++++++++++-------- 2 files changed, 46 insertions(+), 17 deletions(-) diff --git a/scripts/setup-swbf2-linux.sh b/scripts/setup-swbf2-linux.sh index aeb8f96..74efbc2 100755 --- a/scripts/setup-swbf2-linux.sh +++ b/scripts/setup-swbf2-linux.sh @@ -99,29 +99,45 @@ if [ ! -d "$PFX_C" ]; then echo "Required before running this script:" echo " 1. In Steam: right-click SWBF2 → Properties → Compatibility" echo " → Force GE-Proton10-34 (or later)" - echo " 2. Click Play on SWBF2 — wait ~10 seconds for 'Origin is not installed'" - echo " 3. Close the error, then re-run this script" + echo " 2. Click Play on SWBF2 — wait ~10 seconds then close it" + echo " 3. Re-run this script" exit 1 fi echo "[1/6] Wine prefix: OK" -# ── Step 2: verify ea_app.msi exists ─────────────────────────────────────── +# ── Step 2: locate ea_app.msi ────────────────────────────────────────────── +# The MSI is bundled with the game files. Steam may also copy it to drive_c +# when the install script runs. Check both locations. +if [ ! -f "$MSI" ]; then + GAME_DIR=$(find "$STEAM_HOME/steamapps/common" -maxdepth 2 \ + -name "ea_app.msi" 2>/dev/null | head -1) + if [ -n "$GAME_DIR" ]; then + echo "Found ea_app.msi in game files: $GAME_DIR" + MSI="$GAME_DIR" + fi +fi +if [ ! -f "$MSI" ]; then + # Also search anywhere under steamapps + MSI_FOUND=$(find "$STEAM_HOME/steamapps" -name "ea_app.msi" 2>/dev/null | head -1) + [ -n "$MSI_FOUND" ] && MSI="$MSI_FOUND" +fi if [ ! -f "$MSI" ]; then echo "" - echo "ERROR: ea_app.msi not found at $MSI" + echo "ERROR: ea_app.msi not found." echo "" - echo "Launch SWBF2 once so Steam drops ea_app.msi into the Wine prefix." - echo "You will see an 'Origin is not installed' error — that is expected." - echo "Close it, then re-run this script." + echo "Launch SWBF2 once from Steam (with GE-Proton set in Compatibility)," + echo "wait ~10 seconds for it to attempt startup, then close it and re-run." + echo "" + echo "If you just installed the game, verify it downloaded fully in Steam." exit 1 fi MSI_SIZE=$(stat -c%s "$MSI") if [ "$MSI_SIZE" -lt 50000000 ]; then echo "WARNING: ea_app.msi is only $MSI_SIZE bytes (expected ~227 MB)." - echo "It may still be copying. Wait a moment and re-run." + echo "It may still be downloading. Wait a moment and re-run." exit 1 fi -echo "[2/6] ea_app.msi ($(( MSI_SIZE / 1048576 )) MB): OK" +echo "[2/6] ea_app.msi ($(( MSI_SIZE / 1048576 )) MB): OK ($MSI)" # ── Step 3: extract MSI on the host ──────────────────────────────────────── echo "[3/6] Extracting EA Desktop files from MSI (~30s)..." diff --git a/scripts/setup-swbf2-wolf.sh b/scripts/setup-swbf2-wolf.sh index b855016..b080398 100755 --- a/scripts/setup-swbf2-wolf.sh +++ b/scripts/setup-swbf2-wolf.sh @@ -112,20 +112,33 @@ if [ ! -d "$PFX_C" ]; then echo "Required before running this script:" echo " 1. In Steam (via Moonlight): right-click SWBF2 → Properties → Compatibility" echo " → Force GE-Proton10-34 (or later)" - echo " 2. Click Play on SWBF2 — wait ~10 seconds for 'Origin is not installed'" - echo " 3. Close the error, then re-run this script" + echo " 2. Click Play on SWBF2 — wait ~10 seconds then close it" + echo " 3. Re-run this script" exit 1 fi echo "[1/6] Wine prefix: OK" -# ── Step 2: verify ea_app.msi exists ─────────────────────────────────────── +# ── Step 2: locate ea_app.msi ────────────────────────────────────────────── +# The MSI is bundled with the game files. Steam may also copy it to drive_c +# when the install script runs. Check both locations. +if [ ! -f "$MSI" ]; then + MSI_FOUND=$(sudo find "$STEAM_HOME/.steam/steam/steamapps/common" \ + -name "ea_app.msi" 2>/dev/null | head -1) + [ -n "$MSI_FOUND" ] && MSI="$MSI_FOUND" +fi +if [ ! -f "$MSI" ]; then + MSI_FOUND=$(sudo find "$STEAM_HOME/.steam/steam/steamapps" \ + -name "ea_app.msi" 2>/dev/null | head -1) + [ -n "$MSI_FOUND" ] && MSI="$MSI_FOUND" +fi if [ ! -f "$MSI" ]; then echo "" - echo "ERROR: ea_app.msi not found at $MSI" + echo "ERROR: ea_app.msi not found." echo "" - echo "Launch SWBF2 once from Moonlight so Steam drops ea_app.msi into the" - echo "Wine prefix. You will see an 'Origin is not installed' error — that is" - echo "expected. Close it, then re-run this script." + echo "Launch SWBF2 once from Moonlight (with GE-Proton set in Compatibility)," + echo "wait ~10 seconds for it to attempt startup, then close it and re-run." + echo "" + echo "If you just installed the game, verify it downloaded fully in Steam." exit 1 fi MSI_SIZE=$(stat -c%s "$MSI") @@ -134,7 +147,7 @@ if [ "$MSI_SIZE" -lt 50000000 ]; then echo "It may still be copying. Wait a moment and re-run." exit 1 fi -echo "[2/6] ea_app.msi ($(( MSI_SIZE / 1048576 )) MB): OK" +echo "[2/6] ea_app.msi ($(( MSI_SIZE / 1048576 )) MB): OK ($MSI)" # ── Step 3: extract MSI on the host ──────────────────────────────────────── echo "[3/6] Extracting EA Desktop files from MSI (~30s)..."