belauncher: Prepend install path for game_exe starting with backslash.#331
belauncher: Prepend install path for game_exe starting with backslash.#331PhialsBasement wants to merge 2 commits into
Conversation
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
| _write(1, &battleye_status, 1); | ||
|
|
||
| if (PathIsRelativeW(game_exeW)) | ||
| if (PathIsRelativeW(game_exeW) || game_exeW[0] == L'\\') |
There was a problem hiding this comment.
I think it might be useful to add a comment about game_exeW[0] == L'\\'.
I'm not a Windows dev, but I searched around and it seems leading backslash is supposed to translate to the root of the disk we're currently in.
That implies the line game_exeW[0] == L'\\' is working around BattleEye bug, where it translates the dir incorrectly (i.e. the game that works on Windows actually wasn't supposed to work there either).
So, I think it's useful to add a comment explaining the situation, i.e. why exactly we do the game_exeW[0] == L'\\' check here.
There was a problem hiding this comment.
Ive just applied some comments to help identify that.
|
Maybe it would be better to check if the path is relative on the string + 1 to remove the \ character? Something like |
Handle leading backslash for Windows BattlEye game executable paths.
Good idea, done with memmove since game_exeW is an array rather than a pointer, plus a |
|
I think using memmove is a bit overkill, just define a second variable that points to the array |
I'd prefer to keep the memmove, it leaves |
belauncher.exefails to launch the game when a title'sBELauncher.inispecifies a64BitExe=value with a leading backslash (a Win32 "root-relative" path), e.g.:64BitExe=\Game\Binaries\Win64\Game.exeThe existing guard in
programs/belauncher/main.conly prepends the install directory whenPathIsRelativeW(game_exeW)returns TRUE, however,PathIsRelativeWreturns FALSE for any path whose first character is\(per the implementation indlls/kernelbase/path.c)Reproduced under Proton Experimental (11.0-20260518b) with a title whose
BELauncher.iniuses a leading-backslash64BitExe=. WithWINEDEBUG=+belauncher:Note
launch_cmdis missing thepathprefix, even thoughpathis known and traced one line earlier. The file atS:\common\<Game>\<Game>\Binaries\Win64\<Game>.exeexists; the path Wine actually queried (<current_drive>:\<Game>\Binaries\Win64\<Game>.exe) does not.Editing the title's
BELauncher.inito remove the leading backslash makes the launch succeed, confirming the diagnosis.P.S this fixes Contractors Showdown/Exfilzone which is yet another W for the steam frame