Skip to content

epic: start Epic games under EpicGamesLauncher.exe (GTA V Enhanced from Epic) - #840

Merged
aaf2tbz merged 1 commit into
metalsharp:mainfrom
multision:fix/epic-launcher-parent
Nov 26, 2026
Merged

aaf2tbz merged 1 commit into
metalsharp:mainfrom
multision:fix/epic-launcher-parent

Conversation

@multision

@multision multision commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

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.exe starts the Rockstar Games Launcher, which looks for EpicGamesLauncher.exe above the game. Started straight from legendary, the game has no Windows parent, so the Rockstar Games Launcher logs:

[external] Creating epic min mode launch
[shell] Could not do OpenProcess on parent process.
[external] Unable to query parent process
[startup] Failed to relaunch from third party platform. Load will continue normally.

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:

  • At launch, the runtime's own start.exe (lib/wine/aarch64-windows on FEX, x86_64-windows on the regular build) is staged in the bottle as C:\Program Files (x86)\Epic Games\Launcher\Portal\Binaries\Win64\EpicGamesLauncher.exe, with an EpicGamesLauncher.metalsharp marker beside it.
  • legendary's --wine becomes cache/metalsharp-epic-game-launcher. It runs EpicGamesLauncher.exe /wait /b /unix <game> <args> through the existing metalsharp-wine-game-launcher, so window mode and resolution still apply. start /unix runs the game from its own folder and waits for it.
  • An EpicGamesLauncher.exe that 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's METALSHARP_LAUNCHED_BY chain treats it as a launcher (no launch.env in its folder), and a game whose folder has a launch.env still decides for itself, so PlayGTAV and GTA5_Enhanced keep their route.

GTA V Enhanced from Epic also needs _strerror_s in MetalSharp Wine: metalsharp/MetalSharp-Wine#109, #110 and #111.

Testing

  • make -C app/src-c VARIANT=fex test passes; the regular backend builds with -Werror.
  • A harness ran epic_stage_launcher_parent and epic_launcher_parent_wrapper_path against a home and prefix, then launched a probe from a folder with a space through the wrapper. The probe's parent was C:\Program Files (x86)\Epic Games\Launcher\Portal\Binaries\Win64\EpicGamesLauncher.exe (NtQueryInformationProcess, Toolhelp, and OpenProcess with every access mask).
  • GTA V Enhanced (Epic, FEX runtime, VKD3D-Proton, with the _strerror_s fix) through legendary and the wrapper: the launcher logs Running 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.
  • Through the backend's own Play path: this branch's FEX backend served ~/.metalsharp/run/backend.sock (the environment MetalSharp.app gives it) and POST /sharp-library/epic/play launched GTA V Enhanced. It staged the parent, the launcher logged Running 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).
  • On the regular x86_64 runtime the parent is staged from x86_64-windows/start.exe and the launcher again logs Running 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.
  • Note: once it starts, GTA V Enhanced (Epic) still exits with an access violation in its own code (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.

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.
@multision
multision requested a review from aaf2tbz as a code owner November 25, 2026 23:42
@aaf2tbz
aaf2tbz merged commit 8f31e5f into metalsharp:main Nov 26, 2026
6 checks passed
@aaf2tbz aaf2tbz mentioned this pull request Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants