Merge pull request #102 from outis1one/claude/zealous-heisenberg-8ylloi
Claude/zealous heisenberg 8ylloi
This commit is contained in:
+46
-6
@@ -967,23 +967,43 @@ _steam_home() {
|
|||||||
# InstallSuccessful flag is shared across all EA titles; the Valve has-run key
|
# InstallSuccessful flag is shared across all EA titles; the Valve has-run key
|
||||||
# is per-AppID but identical in form for every EA game — so this works for any
|
# is per-AppID but identical in form for every EA game — so this works for any
|
||||||
# of them. Safe + idempotent; only touches the AppID passed in.
|
# of them. Safe + idempotent; only touches the AppID passed in.
|
||||||
|
#
|
||||||
|
# IMPORTANT: wineserver holds registry state in memory and flushes it back to
|
||||||
|
# disk, overwriting any edits made while the container is running. We stop the
|
||||||
|
# WolfSteam container first, patch the files on disk, then restart — so the
|
||||||
|
# keys survive intact when wineserver next starts.
|
||||||
_apply_ea_fix() {
|
_apply_ea_fix() {
|
||||||
local appid="$1"
|
local appid="$1"
|
||||||
local steam_home reg
|
local steam_home reg acf container_was_running=0
|
||||||
steam_home=$(_steam_home)
|
steam_home=$(_steam_home)
|
||||||
reg="$steam_home/.steam/steam/steamapps/compatdata/$appid/pfx/system.reg"
|
reg="$steam_home/.steam/steam/steamapps/compatdata/$appid/pfx/system.reg"
|
||||||
|
acf="$steam_home/.steam/steam/steamapps/appmanifest_${appid}.acf"
|
||||||
|
|
||||||
if [ ! -f "$reg" ]; then
|
if [ ! -f "$reg" ]; then
|
||||||
echo "No Proton prefix for AppID $appid yet (looked for $reg)."
|
echo "No Proton prefix for AppID $appid yet (looked for $reg)."
|
||||||
echo "In Steam: set the game to GE-Proton (./manage.sh ge-proton),"
|
echo "In Steam: set the game to GE-Proton (./manage.sh ge-proton),"
|
||||||
echo "click Play once to build the prefix, then re-run this."
|
echo "click Play once to build the prefix, then re-run this."
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
if sudo grep -q 'EADesktopSetup' "$reg" 2>/dev/null; then
|
|
||||||
echo "AppID $appid already patched. Cancel the 'installing' screen in Steam and Play."
|
# Stop the Steam container so wineserver is not running when we edit the
|
||||||
return 0
|
# registry. We restart it at the end so the user's session resumes.
|
||||||
|
local steam_container
|
||||||
|
steam_container=$(docker ps --format '{{.Names}}' | grep -i 'WolfSteam' | head -1)
|
||||||
|
if [ -n "$steam_container" ]; then
|
||||||
|
echo "Stopping $steam_container so wineserver is not running during patch..."
|
||||||
|
docker stop "$steam_container" >/dev/null
|
||||||
|
container_was_running=1
|
||||||
|
sleep 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if sudo grep -q 'EADesktopSetup' "$reg" 2>/dev/null; then
|
||||||
|
echo "Registry keys already present in AppID $appid prefix."
|
||||||
|
else
|
||||||
echo "Patching EA install-script markers for AppID $appid..."
|
echo "Patching EA install-script markers for AppID $appid..."
|
||||||
# Wine v2 registry format uses doubled backslashes as the path separator.
|
# Wine v2 registry format uses doubled backslashes as the path separator.
|
||||||
|
# Both the 64-bit path and the Wow6432Node path are written; Steam's
|
||||||
|
# HasRunStringKey check reads the 64-bit path (no Wow6432Node).
|
||||||
{
|
{
|
||||||
printf '\n[Software\\\\Electronic Arts\\\\EA Desktop] 1781772837\n"InstallSuccessful"="true"\n'
|
printf '\n[Software\\\\Electronic Arts\\\\EA Desktop] 1781772837\n"InstallSuccessful"="true"\n'
|
||||||
printf '\n[Software\\\\Wow6432Node\\\\Electronic Arts\\\\EA Desktop] 1781772837\n"InstallSuccessful"="true"\n'
|
printf '\n[Software\\\\Wow6432Node\\\\Electronic Arts\\\\EA Desktop] 1781772837\n"InstallSuccessful"="true"\n'
|
||||||
@@ -992,7 +1012,26 @@ _apply_ea_fix() {
|
|||||||
} | sudo tee -a "$reg" >/dev/null
|
} | sudo tee -a "$reg" >/dev/null
|
||||||
# Keep the prefix owned by the in-container user or Wine rejects it.
|
# Keep the prefix owned by the in-container user or Wine rejects it.
|
||||||
sudo chown 1000:1000 "$reg"
|
sudo chown 1000:1000 "$reg"
|
||||||
echo "Done. In Steam: cancel the 'running install script' screen if shown, then Play."
|
echo " Registry patched."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Reset StateFlags to 4 (fully installed) so Steam won't re-run install scripts.
|
||||||
|
if [ -f "$acf" ]; then
|
||||||
|
sudo sed -i 's/"StateFlags"\s*"[0-9]*"/"StateFlags"\t\t"4"/' "$acf"
|
||||||
|
# StateFlags 4 = update required (re-runs install scripts); 6 = fully installed.
|
||||||
|
# We want 6 so Steam launches the game directly.
|
||||||
|
sudo sed -i 's/"StateFlags"\t\t"4"/"StateFlags"\t\t"6"/' "$acf"
|
||||||
|
sudo chown 1000:1000 "$acf"
|
||||||
|
echo " StateFlags set to 6 (fully installed)."
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$container_was_running" = 1 ]; then
|
||||||
|
echo "Restarting Wolf (Steam will reconnect automatically)..."
|
||||||
|
docker compose -f "$SCRIPT_DIR/docker-compose.yml" up -d >/dev/null 2>&1 || \
|
||||||
|
docker start "$steam_container" >/dev/null 2>&1 || true
|
||||||
|
echo " Wolf restarted. Reconnect from Moonlight and click Play."
|
||||||
|
fi
|
||||||
|
echo "Done. In Steam: if the 'running install script' screen appears, cancel it, then Play."
|
||||||
}
|
}
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
@@ -1704,8 +1743,9 @@ _manage_wolf_complete() {
|
|||||||
install-completion backup"
|
install-completion backup"
|
||||||
COMPREPLY=( $(compgen -W "$commands" -- "$cur") )
|
COMPREPLY=( $(compgen -W "$commands" -- "$cur") )
|
||||||
}
|
}
|
||||||
# Register for any script named manage.sh regardless of path
|
# Register for both 'manage.sh' and './manage.sh' invocation styles
|
||||||
complete -F _manage_wolf_complete manage.sh
|
complete -F _manage_wolf_complete manage.sh
|
||||||
|
complete -F _manage_wolf_complete ./manage.sh
|
||||||
COMPEOF
|
COMPEOF
|
||||||
# Also source it immediately in the current shell if possible
|
# Also source it immediately in the current shell if possible
|
||||||
echo "source \"$COMP_FILE\"" >> "$HOME/.bash_completion" 2>/dev/null || true
|
echo "source \"$COMP_FILE\"" >> "$HOME/.bash_completion" 2>/dev/null || true
|
||||||
|
|||||||
Reference in New Issue
Block a user