feat(launcher): Wine/Proton compatibility for the FiveM client#4050
feat(launcher): Wine/Proton compatibility for the FiveM client#4050Amzi-01 wants to merge 1 commit into
Conversation
- Add CfxIsProton() helper (detects Wine + Steam Proton env vars) - Remove Wine-forced insecure mode from ComponentLoader; only ARM (xtajit64.dll) still forces sticky.dll - Add WineCompat.Win32.cpp: installs a GetProcAddress hook before legitimacy.dll and adhesive.dll load, returning nullptr for wine_get_version/wine_get_build_id/wine_get_host_version so those components do not detect Wine and alter their behaviour - DllGameComponent: graceful sticky.dll fallback if adhesive fails to load under Wine, instead of a hard crash - EarlyMode: call WineCompat_InstallHooks() before any component loads - Launcher stability fixes under Wine: skip SetProcessMitigationPolicy, EarlyLdrBlock (NVIDIA GameFilter), cross-process MiniDump operations, CLSID_TaskbarList, and false "outdated Windows" OS version warning - GameSelect: auto-detect GTA V path via STEAM_COMPAT_INSTALL_PATH; fall back to GetOpenFileNameW when IFileDialog fails under Wine - ViabilityChecks: skip MediaFeatureCheck under Wine (stub mfreadwrite) Binary analysis of adhesive.dll confirmed: no kernel driver, no Wine detection, fully userspace V8-based anti-cheat. legitimacy.dll is the only component that checks wine_get_version, which the GetProcAddress hook addresses. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
A few months ago I implemented only the bare minimum changes to get FiveM to launch in insecure mode here Gogsi@8ef2fcc. Those changes were:
With those changes the game launched fine in insecure mode, tested on both latest Your PR has some nice improvements like disabling the Nvidia Game Filters (the check didn't exist when I wrote my code), improving the file selection dialog (it was kind of broken in my branch) and disabling more incompatible patches with the dump server. I'm not sure to the extent that you have tested it, but I don't think forgoing base Wine is a good idea, even if Proton is universally accepted to be "better" for games. I recommend you also incorporate this patch which enables NUI Shared Resources/Texture on Wine, as later versions have support for it. This will greatly improve UI rendering and it removed the weird artifacting in the main menu I experienced in my tests. What likely won't get merged any time soon is enabling adhesive under Wine/Proton. Even if it does load fine, which we can't know until it's tested, it is dangerous to enable, as anti-cheats often rely on subtle side effects to detect the presence of a cheat. Differences when running under Wine (such as different memory layout) can trigger detections even when you don't expect them to. It would take significant effort to test that no detection triggers unexpectedly and future detections would also need to be tested. We can wait for an official response from Cfx, but from the few private conversations I've had, it seem unlikely they would be willing to invest such effort, given the upcoming release of FiveM for GTA V Enhanced. |
| continue; | ||
| } | ||
|
|
||
| if (CfxIsWine() || GetModuleHandleW(L"xtajit64.dll") != nullptr) |
There was a problem hiding this comment.
We can't enable the Anticheat on Linux, so this edit needs to be removed.
There was a problem hiding this comment.
adhesive and legitimacy dlls from my research are compatible with the latest versions of wine/proton my changes are designed to not interfere with windows versions at all im gathering this is more of a policy issue rather than a technical limitation? as there is quite a lot of people that would like to play FiveM on linux
Goal of this PR
Allow the FiveM client launcher to start and run reliably under Wine/Proton on Linux. Currently several launcher and component code paths either assume a native Windows environment or deliberately change behaviour when Wine is detected, which leads to hard crashes, forced insecure mode, and a number of spurious failures/warnings. This PR makes the launcher Wine-aware so Linux users get a working, secure client without affecting native Windows behaviour.
How is this PR achieving the goal
The core of the change is a small compatibility layer that runs before any anti-cheat/legitimacy component loads:
CfxIsProton()helper centralises Wine/Proton detection (Wine env + Steam Proton env vars).WineCompat.Win32.cppinstalls aGetProcAddresshook early (called from EarlyMode viaWineCompat_InstallHooks()) that returnsnullptrforwine_get_version/wine_get_build_id/wine_get_host_version, solegitimacy.dllno longer special-cases Wine.ComponentLoaderis removed — only ARM (xtajit64.dll) still forcessticky.dll.DllGameComponentnow falls back tosticky.dllgracefully ifadhesive.dllfails to load under Wine instead of crashing.SetProcessMitigationPolicy,EarlyLdrBlock(NVIDIA GameFilter), cross-process MiniDump operations,CLSID_TaskbarList, the false "outdated Windows" version warning, andMediaFeatureCheckinViabilityChecks(stubmfreadwrite).GameSelectauto-detects the GTA V install path fromSTEAM_COMPAT_INSTALL_PATHand falls back toGetOpenFileNameWwhenIFileDialogfails under Wine.All Wine-specific behaviour is gated behind the detection helper, so native Windows paths are unchanged.
This PR applies to the following area(s)
FiveM, Launcher
Successfully tested on
Game builds: 3258
Platforms: Windows, Linux
Checklist
Fixes issues
AI disclosure
Claude (Anthropic) was used solely for code review purposes. All code was written and tested by me; no code in this PR was authored by an AI.