fix(bionic): name guest files by their Android paths in store launches

DroidDeck-Bionic's Wine has Android's root on Z:, but DroidDeck's store
launch files and helpers name guest files by guest Z: paths. A Ubisoft
game then skipped its service and started directly (Watch_Dogs exited at
launch); the Epic parent stand-in, GOG/Rockstar registry values, reg.exe
imports and the EA probe pointed at the wrong tree in the same way.
Reported by 2-Shar on PR #3037.

- proton: map guest Z: paths in every run argument (also NAME=Z:..., as
  in an installer's /DIR=) and export DROIDDECK_GUEST_ROOT, the guest's
  root as this Wine names it; launch.sh keeps it.
- StoreLaunch: the Ubisoft service and the Epic parent stand-in start
  from %DD_R% (DROIDDECK_GUEST_ROOT, else Z:). An installed Ubisoft
  game's older launch file is rewritten at the next library scan.
- droiddeck-store-launch: windows_path() asks DroidDeck-Bionic's
  getcompatpath when that tool runs the game.
- droiddeck-gog-maintenance: name the tool for the registry step.
This commit is contained in:
The412Banner committed 2026-11-23 00:44:48 +00:00
1 parent 2aae4b2284
commit f17d3ddaad
9 files changed
+194 -14

No files matched your search

+24 -7
View File
@@ -26,6 +26,16 @@ real() {
case "$p" in /data/*|/storage/*|/sdcard/*|/system/*|/apex/*|/vendor/*) echo "$p" ;; *) echo "$DDNATV_ROOT$p" ;; esac
}
# A guest Z: path (also as NAME=Z:..., e.g. an installer's /DIR=) -> the Z: path of its Android file; anything else unchanged
zpath() {
local p k
case "$1" in
[Zz]:[\\/]*) p=${1:2}; p=$(real "${p//\\//}"); printf 'Z:%s\n' "${p//\//\\}" ;;
*=[Zz]:[\\/]*) k=${1%%=[Zz]:[\\/]*}; printf '%s=%s\n' "$k" "$(zpath "${1#"$k="}")" ;;
*) printf '%s\n' "$1" ;;
esac
}
here=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
tool=$(real "$here")
compat=$(real "${STEAM_COMPAT_DATA_PATH:-$HOME/.local/share/Steam/steamapps/compatdata/0}")
@@ -33,24 +43,31 @@ compat=$(real "${STEAM_COMPAT_DATA_PATH:-$HOME/.local/share/Steam/steamapps/comp
case "$verb" in
run|waitforexitandrun|runinprefix)
[ $# -gt 0 ] || exit 0
# A Windows path (DroidDeck's Xbox launch names the game on a drive letter of its own) or a bare program name
# (DroidDeck's store steps run cmd.exe, which Wine finds in system32) goes to Wine unchanged.
# Another Windows path (DroidDeck's Xbox launch names the game on a drive letter of its own) or a bare program
# name (DroidDeck's store steps run cmd.exe, which Wine finds in system32) goes to Wine unchanged.
case "$1" in
[Zz]:[\\/]*) exe=$(zpath "$1") ;;
[A-Za-z]:[\\/]*) exe=$1 ;;
/*) exe=$(real "$1") ;;
*/*) exe=$(real "$PWD/$1") ;;
*) exe=$1 ;;
esac
shift
# DroidDeck's store and Xbox helpers name guest files by Z: paths (reg.exe import, cmd.exe /c, msiexec /i, setup
# /DIR=); this Wine's Z: is Android's root.
args=()
for a in "$@"; do args+=("$(zpath "$a")"); done
export DROIDDECK_BIONIC_ROOT="$DDNATV_ROOT"
# The Xbox runtime's DLC and mount folders come as Z: paths of the guest; this Wine sees the Android side.
# The guest's root as this Wine names it; the store launch files DroidDeck writes (StoreLaunch.kt) start their
# helpers from it.
r=$(real /); r=${r%/}; DROIDDECK_GUEST_ROOT="Z:${r//\//\\}"; export DROIDDECK_GUEST_ROOT
# The Xbox runtime's DLC and mount folders come as ;-separated Z: paths of the guest.
zreal() {
local out="" part p
local out="" part
local -a parts
IFS=';' read -r -a parts <<< "$1"
for part in "${parts[@]}"; do
case "$part" in [Zz]:\\*) p=${part:2}; p=$(real "${p//\\//}"); part="Z:${p//\//\\}" ;; esac
out="${out:+$out;}$part"
out="${out:+$out;}$(zpath "$part")"
done
echo "$out"
}
@@ -75,7 +92,7 @@ print(" ".join(sorted(n for n in names if re.fullmatch(r"[A-Za-z_][A-Za-z0-9_]*"
PY
)
export DROIDDECK_BIONIC_KEEP
exec /system/bin/sh "$tool/bionic/launch.sh" "$verb" "$compat" "$exe" "$@" ;;
exec /system/bin/sh "$tool/bionic/launch.sh" "$verb" "$compat" "$exe" ${args[@]+"${args[@]}"} ;;
getcompatpath)
p=$(real "${1:-}")
printf 'Z:%s\n' "${p//\//\\}" ;;