mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-12-06 13:05:47 +00:00
fix(bionic): drop dead links from a prefix so Wine can put its files back
A prefix keeps links into the tool that set it up. When that tool is deleted (an older DroidDeck-Bionic replaced by an update, a removed DroidDeck-Proton) or no longer has a file, the links dangle. prepare_prefix relinks only when the version changes and never looks at system32/drivers, and Wine's update cannot write over a link that "exists", so network and controller drivers stayed missing: on the Elite, Brawlhalla said "Incorrect version" and went offline, and the pad stopped working in game (63 links into a deleted DroidDeck-Proton 11-12.2). launch.sh now removes dangling links in system32, syswow64, system32/drivers and Fonts at every launch and, when it removed any, clears pfx/.update-timestamp and pfx/.droiddeck-bionic so prepare_prefix relinks this tool's files and Wine's update writes its own drivers again (the repair the Elite session proved by hand). Tested on the Pocket FIT (r25 with this launch.sh, Brawlhalla): 20 dead links removed, relinked, Wine updated, game running at 99 s with no c0000142 and no stack overflow, 0 dead links left. A scan found dead links in 6 prefixes across the Pocket FIT and the Elite (up to 2,099 in one).
This commit is contained in:
1 parent
2435324c08
commit
11d8bcba2e
1 file changed
+14
@@ -241,6 +241,20 @@ if [ "$verb" != runinprefix ] && prefix_busy; then
|
||||
fi
|
||||
prefix_busy || rm -f "$NTSYNC_SHM".v*
|
||||
|
||||
# Links into a tool that is gone (an older DroidDeck-Bionic, a deleted DroidDeck-Proton) or to a file it no longer has.
|
||||
# Wine's update cannot write over them, so drivers (network, controller) and other files stay missing. Drop them and
|
||||
# clear both stamps: prepare_prefix relinks this tool's files and Wine's update puts its own back.
|
||||
dead=0
|
||||
for d in system32 syswow64 system32/drivers Fonts; do
|
||||
for f in "$COMPAT/pfx/drive_c/windows/$d"/*; do
|
||||
[ -L "$f" ] && [ ! -e "$f" ] && rm -f "$f" && dead=$((dead + 1))
|
||||
done
|
||||
done
|
||||
if [ $dead -gt 0 ]; then
|
||||
rm -f "$COMPAT/pfx/.update-timestamp" "$COMPAT/pfx/.droiddeck-bionic"
|
||||
echo "$(date +%H:%M:%S) removed $dead dead link(s) from the prefix; relinking and Wine's update follow"
|
||||
fi
|
||||
|
||||
prepare_prefix
|
||||
|
||||
# Steam's Windows client files in the prefix, the ones Proton copies from Steam's legacycompat folder: a game's
|
||||
|
||||
Reference in new issue
Block a user