From ceed457393424902accbd42c000cd958a5566a80 Mon Sep 17 00:00:00 2001 From: Phiality <155454343+PhialsBasement@users.noreply.github.com> Date: Sun, 24 May 2026 19:10:06 +1000 Subject: [PATCH 1/2] belauncher: Prepend install path for game_exe starting with backslash. PathIsRelativeW() returns FALSE for paths with a leading backslash, so a 64BitExe= entry like "\Game\Binaries\Win64\Game.exe" skipped the install-path prefix in launch_cmd. CreateProcessW then resolved it against the root of the current drive instead of the install directory, yielding ERROR_FILE_NOT_FOUND. Fixes games like Contractors Showdown (VR), which have opted in to allow linux but have such config --- programs/belauncher/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/belauncher/main.c b/programs/belauncher/main.c index a2b0666ad916..dce94706508b 100644 --- a/programs/belauncher/main.c +++ b/programs/belauncher/main.c @@ -169,7 +169,7 @@ int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPWSTR cmdline, int cm battleye_status = 0x9; /* Launching Game */ _write(1, &battleye_status, 1); - if (PathIsRelativeW(game_exeW)) + if (PathIsRelativeW(game_exeW) || game_exeW[0] == L'\\') path_len = wcslen(path); else path_len = 0; From 9ae91244cdba30b34f768505d116f0cade346b41 Mon Sep 17 00:00:00 2001 From: Phiality <155454343+PhialsBasement@users.noreply.github.com> Date: Mon, 25 May 2026 04:40:29 +1000 Subject: [PATCH 2/2] belauncher: Fix handling of leading backslash in game executable path Handle leading backslash for Windows BattlEye game executable paths. --- programs/belauncher/main.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/programs/belauncher/main.c b/programs/belauncher/main.c index dce94706508b..0e9fea966a8f 100644 --- a/programs/belauncher/main.c +++ b/programs/belauncher/main.c @@ -169,7 +169,16 @@ int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPWSTR cmdline, int cm battleye_status = 0x9; /* Launching Game */ _write(1, &battleye_status, 1); - if (PathIsRelativeW(game_exeW) || game_exeW[0] == L'\\') + /* Windows BattlEye treats a singleton leading-backslash 64BitExe as + * install-relative; strip it so the joined launch_cmd doesn't end up + * with a doubled separator. Skip if a second '\' follows so UNC paths + * are preserved. */ + if (game_exeW[0] == L'\\' && game_exeW[1] != L'\\') + { + memmove(game_exeW, game_exeW + 1, game_exe_len * sizeof(*game_exeW)); + --game_exe_len; + } + if (PathIsRelativeW(game_exeW)) path_len = wcslen(path); else path_len = 0;