#!/bin/bash # ============================================================================= # Popcorn's Pantheon - Season I: Odin's Trial # Modpack UNINSTALLER for macOS: removes BepInEx + the modpack from the # Steam Valheim install (never touches vanilla game files) and deletes the # "Popcorn's Pantheon" Desktop launcher. Safe to run even if already vanilla. # ============================================================================= say_step() { printf '\n==> %s\n' "$1"; } say_ok() { printf ' %s\n' "$1"; } finish() { printf '\n' if [ -t 0 ]; then read -r -p "Press Return to close this window... " _ ; fi exit "$1" } printf '\n' printf " Popcorn's Pantheon - back to vanilla\n" printf ' Valheim modpack uninstaller for macOS\n' # ---- 1. Find the Valheim install (same detection as the installer) ---------- say_step 'Looking for your Valheim install...' STEAM_DIR="$HOME/Library/Application Support/Steam" CANDIDATES=("$STEAM_DIR/steamapps/common/Valheim") VDF="$STEAM_DIR/steamapps/libraryfolders.vdf" if [ -f "$VDF" ]; then while IFS= read -r lib; do CANDIDATES+=("$lib/steamapps/common/Valheim") done < <(sed -n 's/.*"path"[[:space:]]*"\([^"]*\)".*/\1/p' "$VDF") fi VALHEIM="" for c in "${CANDIDATES[@]}"; do if [ -d "$c/Valheim.app" ]; then VALHEIM="$c"; break; fi done REMOVED=0 if [ -z "$VALHEIM" ]; then printf '\nCould not find Valheim - skipping the game-folder cleanup.\n' printf 'Places checked:\n' for c in "${CANDIDATES[@]}"; do printf ' - %s\n' "$c"; done else say_ok "Found Valheim at: $VALHEIM" # ---- 2. Remove ONLY the files/dirs BepInEx + the modpack added ------------ say_step 'Removing BepInEx + the modpack...' TARGETS="BepInEx winhttp.dll doorstop_config.ini doorstop_libs .doorstop_version changelog.txt start_game_bepinex.sh start_server_bepinex.sh" for t in $TARGETS; do if [ -e "$VALHEIM/$t" ]; then rm -rf "$VALHEIM/$t" say_ok "Removed $t" REMOVED=$((REMOVED + 1)) fi done if [ "$REMOVED" -eq 0 ]; then say_ok 'Nothing to remove - the game is already vanilla.' fi fi # ---- 3. Remove the Desktop launcher ----------------------------------------- LAUNCHER="$HOME/Desktop/Popcorn's Pantheon.command" if [ -e "$LAUNCHER" ]; then rm -f "$LAUNCHER" say_ok "Removed the Desktop launcher (Popcorn's Pantheon.command)" REMOVED=$((REMOVED + 1)) fi printf '\n=================================================================\n' printf ' Done - back to vanilla. Launch Valheim via Steam normally.\n' printf '=================================================================\n\n' printf ' If anything still seems off, the nuclear fallback is:\n' printf ' Steam -> Valheim -> Properties -> Installed Files ->\n' printf ' "Verify integrity of game files".\n' finish 0