Repository navigation
epic: start Epic games under EpicGamesLauncher.exe (GTA V Enhanced from Epic) - #840
Merged
Merged
Conversation
On Windows an Epic game's parent is the Epic Games Launcher, and some launchers check
it. GTA V Enhanced's PlayGTAV.exe starts the Rockstar Games Launcher, which looks for
EpicGamesLauncher.exe above it. Started straight from legendary it found no parent
("Could not do OpenProcess on parent process"), tried to relaunch through
com.epicgames.launcher:, and opened without the Epic entitlement, so GTA V showed
"Buy now".
The runtime's own start.exe is staged in the bottle as Epic Games\Launcher\Portal\
Binaries\Win64\EpicGamesLauncher.exe, and legendary's --wine is a wrapper that runs the
game with "EpicGamesLauncher.exe /wait /b /unix <game> <args>" through
metalsharp-wine-game-launcher. start /unix runs the game from its own folder and waits
for it, so the launch is otherwise unchanged. An EpicGamesLauncher.exe that MetalSharp
did not stage is left alone, and the game then starts as before.
1 of 5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On Windows an Epic game's parent process is the Epic Games Launcher, and some launchers check that. GTA V Enhanced from Epic is one of them.
PlayGTAV.exestarts the Rockstar Games Launcher, which looks forEpicGamesLauncher.exeabove the game. Started straight from legendary, the game has no Windows parent, so the Rockstar Games Launcher logs:It then opens without the Epic entitlement, and GTA V shows Buy now in the launcher.
With this change, Epic games start under an
EpicGamesLauncher.exe:start.exe(lib/wine/aarch64-windowson FEX,x86_64-windowson the regular build) is staged in the bottle asC:\Program Files (x86)\Epic Games\Launcher\Portal\Binaries\Win64\EpicGamesLauncher.exe, with anEpicGamesLauncher.metalsharpmarker beside it.--winebecomescache/metalsharp-epic-game-launcher. It runsEpicGamesLauncher.exe /wait /b /unix <game> <args>through the existingmetalsharp-wine-game-launcher, so window mode and resolution still apply.start /unixruns the game from its own folder and waits for it.EpicGamesLauncher.exethat MetalSharp didn't stage (no marker) is left alone, and the game then starts as before. The same fallback applies if staging fails or there is no game-launcher wrapper.Nothing new is shipped: the parent is Wine's
start.exe. MetalSharp Wine'sMETALSHARP_LAUNCHED_BYchain treats it as a launcher (nolaunch.envin its folder), and a game whose folder has alaunch.envstill decides for itself, so PlayGTAV and GTA5_Enhanced keep their route.GTA V Enhanced from Epic also needs
_strerror_sin MetalSharp Wine: metalsharp/MetalSharp-Wine#109, #110 and #111.Testing
make -C app/src-c VARIANT=fex testpasses; the regular backend builds with-Werror.epic_stage_launcher_parentandepic_launcher_parent_wrapper_pathagainst a home and prefix, then launched a probe from a folder with a space through the wrapper. The probe's parent wasC:\Program Files (x86)\Epic Games\Launcher\Portal\Binaries\Win64\EpicGamesLauncher.exe(NtQueryInformationProcess, Toolhelp, andOpenProcesswith every access mask)._strerror_sfix) through legendary and the wrapper: the launcher logsRunning from Epic Games Launcher.and verifies the Epic entitlement, and the game starts and opens its window. Before this change it logged the errors above and showed Buy now.~/.metalsharp/run/backend.sock(the environment MetalSharp.app gives it) andPOST /sharp-library/epic/playlaunched GTA V Enhanced. It staged the parent, the launcher loggedRunning from Epic Games Launcher.and verified the Epic entitlement, and the game opened its window and kept running (with Wine (arm64): implement _strerror_s (GTA V Enhanced from Epic) MetalSharp-Wine#109 and fix(gptk): async toolkit install, auto-launch steam, isolate d3dmetal cards #112).x86_64-windows/start.exeand the launcher again logsRunning from Epic Games Launcher.The Rockstar Games Launcher then fails to initialize on that runtime on its own (also started directly, without Epic), which is not part of this PR.GTA5_Enhanced.exe+0x12c6eb, a write to NULL) a few seconds after its window opens. That's separate from this launch change and is not fixed here.