Skip to content

Free fork of NotProton: Windows Steam games in Mac Steam, on CodeWeavers' Wine and Apple's Game Porting Toolkit

fix(run): say when a full disk stopped the prefix from being built

raymondchins680163b0b5b3
diff --git a/dylib/feats/compat_run.sh b/dylib/feats/compat_run.sh
index f91b08c..756484c 100755
--- a/dylib/feats/compat_run.sh
+++ b/dylib/feats/compat_run.sh
@@ -1343,6 +1343,12 @@ refuse_broken_prefix() {
show_alert "This Steam library cannot hold the game's prefix" "It is formatted $fs, which has no symbolic links, so Wine cannot set up the game here. Move the game to a library on an APFS drive."
exit 1
esac
+ # Wine reports a full disk only as error=112 on each file it could not copy.
+ free_kb=$(df -Pk "$STEAM_COMPAT_DATA_PATH" 2>/dev/null | awk 'NR == 2 { print $4 }')
+ if [ -n "$free_kb" ] && [ "$free_kb" -lt 2097152 ]; then
+ show_alert "The disk is too full for the game's prefix" "Wine needs about 2 GB free to set up the game. Free some space on the drive that holds this Steam library, then rebuild the prefix in Bridgeplay."
+ exit 1
+ fi
show_alert "The game's prefix could not be set up" "Wine did not finish building it. Rebuild the prefix in Bridgeplay, then launch again. bridgeplay-run.log has the details."
exit 1
}
diff --git a/dylib/tests/prefixnotecheck.sh b/dylib/tests/prefixnotecheck.sh
index 9ffb443..2b35581 100755
--- a/dylib/tests/prefixnotecheck.sh
+++ b/dylib/tests/prefixnotecheck.sh
@@ -92,17 +92,20 @@ is "an unknown file system does not notify" "" "$(cat "$work/notes")"
echo "== a prefix Wine did not finish"
pfx="$two/steamapps/compatdata/42/pfx"
-check_prefix() { # check_prefix FS: prints the exit status
+check_prefix() { # check_prefix FS [FREE_KB]: prints the exit status
: > "$work/log"
: > "$work/notes"
env log="$work/log" notes="$work/notes" body="$body" fs="$1" WINEPREFIX="$pfx" \
STEAM_COMPAT_DATA_PATH="$two/steamapps/compatdata/42" \
- sh -c 'eval "$body"; volume_type() { [ -z "$fs" ] || echo "$fs /Volumes/Drive"; }
+ free="${2:-99999999}" sh -c 'eval "$body"; volume_type() { [ -z "$fs" ] || echo "$fs /Volumes/Drive"; }
+ df() { printf "Filesystem 1024-blocks Used Available\n/dev/disk3 1 1 %s\n" "$free"; }
refuse_broken_prefix' && echo 0 || echo $?
}
is "no dosdevices stops the launch" 1 "$(check_prefix apfs)"
has "it is logged" "Wine did not finish building it" "$work/log"
has "the player is told to rebuild" "The game's prefix could not be set up|Wine did not finish building it. Rebuild the prefix" "$work/notes"
+is "a full disk stops the launch" 1 "$(check_prefix apfs 1024)"
+has "a full disk is named" "The disk is too full for the game's prefix" "$work/notes"
is "exFAT stops the launch" 1 "$(check_prefix exfat)"
has "exFAT names the file system" "This Steam library cannot hold the game's prefix|It is formatted exfat" "$work/notes"
mkdir -p "$pfx/drive_c/windows/system32" "$pfx/dosdevices"