From a55f8e2d852bcc7276ea90b581f5f3944f317252 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 23 Jun 2026 23:16:49 +0000 Subject: [PATCH] =?UTF-8?q?fix(kyber-linux):=20fix=20prefix=20path=20?= =?UTF-8?q?=E2=80=94=20use=20numeric=20appid=20so=20Steam=20finds=20it?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Steam sets STEAM_COMPAT_DATA_PATH to compatdata/ when launching a non-Steam shortcut. The prefix was named 'kyber' so Steam was launching into an empty prefix, causing immediate exit. Change KYBER_COMPAT_ID to match KYBER_APPID (9900000001) and migrate any existing 'kyber' prefix. Also handle cmd.exe being a symlink: resolve and copy the real file as cmd-real.exe, then remove the symlink before writing the shim so we only affect the Kyber prefix and not Proton globally. Co-Authored-By: Claude Sonnet 4.6 Claude-Session: https://claude.ai/code/session_01D8ckUJQtj1pH8jtAddBDZs --- scripts/setup-kyber-linux.sh | 37 +++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/scripts/setup-kyber-linux.sh b/scripts/setup-kyber-linux.sh index d172a17..a62c53f 100755 --- a/scripts/setup-kyber-linux.sh +++ b/scripts/setup-kyber-linux.sh @@ -59,8 +59,8 @@ set -euo pipefail KYBER_INSTALLER="${1:-$HOME/Downloads/KyberLauncher.exe}" -KYBER_COMPAT_ID="kyber" # Wine prefix name under compatdata/ KYBER_APPID="9900000001" # non-Steam shortcut appid +KYBER_COMPAT_ID="$KYBER_APPID" # prefix dir must match appid for Steam to find it echo "=== Kyber Launcher — Native Linux Steam Setup ===" echo "" @@ -157,6 +157,16 @@ echo "" echo "[1/7] Installing Kyber into Wine prefix..." KYBER_PFX="$STEAM_HOME/steamapps/compatdata/$KYBER_COMPAT_ID" +OLD_PFX="$STEAM_HOME/steamapps/compatdata/kyber" + +# Migrate old 'kyber' prefix to the numeric appid directory Steam expects +if [ -d "$OLD_PFX" ] && [ ! -d "$KYBER_PFX" ]; then + echo " Migrating prefix: compatdata/kyber → compatdata/$KYBER_COMPAT_ID" + mv "$OLD_PFX" "$KYBER_PFX" +elif [ -d "$OLD_PFX" ] && [ -d "$KYBER_PFX" ]; then + echo " Removing old compatdata/kyber (numeric prefix already exists)..." + rm -rf "$OLD_PFX" +fi export STEAM_COMPAT_DATA_PATH="$KYBER_PFX" export STEAM_COMPAT_CLIENT_INSTALL_PATH="$STEAM_HOME" @@ -328,14 +338,23 @@ int WINAPI mainCRTStartup(void) { ExitProcess(code); } CEOF - x86_64-w64-mingw32-gcc -O2 -ffreestanding -nostdlib \ - -mno-stack-arg-probe \ - -e mainCRTStartup -o "$SHIM_EXE" "$SHIM_C" \ - -lkernel32 -lshell32 \ - && cp "$CMD_SHIM" "$CMD_REAL" \ - && cp "$SHIM_EXE" "$CMD_SHIM" \ - && echo " cmd shim installed." \ - || echo " WARNING: cmd shim compile failed — login may not work." + if x86_64-w64-mingw32-gcc -O2 -ffreestanding -nostdlib \ + -mno-stack-arg-probe \ + -e mainCRTStartup -o "$SHIM_EXE" "$SHIM_C" \ + -lkernel32 -lshell32; then + # If cmd.exe is a symlink, copy the real file out first, + # then remove the symlink so we replace only this prefix. + if [ -L "$CMD_SHIM" ]; then + cp "$(readlink -f "$CMD_SHIM")" "$CMD_REAL" + rm "$CMD_SHIM" + else + cp "$CMD_SHIM" "$CMD_REAL" + fi + cp "$SHIM_EXE" "$CMD_SHIM" + echo " cmd shim installed ($(stat -c%s "$CMD_SHIM") bytes)." + else + echo " WARNING: cmd shim compile failed — login may not work." + fi rm -f "$SHIM_C" "$SHIM_EXE" else echo " WARNING: mingw-w64 not found. Install it and re-run:"