fix(desktop): run a store game's exe through its launcher so the EA environment and Origin process are set up (#2486)

* fix(desktop): run a store game's exe through its launcher so the EA environment and Origin process are set up

* fix(desktop): keep a store game's prefix and resolve its launcher through symlinks and deep folders

* fix(desktop): keep the exe's resolved compatdata folder when running its launcher and find the sidecar beside a symlinked exe
This commit is contained in:
Kurt Himebauch authored and GitHub committed 2026-11-11 20:55:37 -05:00
1 parent 2953739f1e
commit 8961d088f2
5 files changed
+130 -7

No files matched your search

+38
View File
@@ -136,6 +136,30 @@ class CommandTest(Temp):
self.assertEqual(OPEN["command"](script, [], "x86 script")[0],
[OPEN["FEX"], "run", "--mode", "on", "--for", str(self.tmp), "--", "/bin/sh", script])
def test_a_store_games_exe_runs_through_its_launcher(self):
exe, launcher = str(self.tmp / "game.exe"), str(self.tmp / "launch.bat")
with mock.patch.dict(OPEN, {"store_launcher": lambda path: launcher if path == exe else None,
"exe_prefix": lambda path: ["--prefix", "4242", "--compatdata", "/c/4242"]}):
keep = ["--prefix", "4242", "--compatdata", "/c/4242"]
self.assertEqual(OPEN["command"](exe, [], "windows")[0], [OPEN["PROTON_RUN"]] + keep + [launcher])
self.assertEqual(OPEN["command"](exe, [], "windows", True)[0],
[OPEN["PROTON_RUN"], "--window"] + keep + [launcher])
self.assertEqual(OPEN["command"](exe, ["-x"], "windows")[0], [OPEN["PROTON_RUN"], exe, "-x"])
other = str(self.tmp / "other.exe")
self.assertEqual(OPEN["command"](other, [], "windows")[0], [OPEN["PROTON_RUN"], other])
def test_a_store_games_launcher_keeps_the_exes_prefix(self):
exe = self.tmp / "game.exe"
exe.write_text("x")
root = str(self.tmp / "steam")
with mock.patch.dict(os.environ, {"STEAM_COMPAT_CLIENT_INSTALL_PATH": root}), \
mock.patch.dict(OPEN, {"PROTON_RUN": str(BIN / "droiddeck-proton-run"),
"store_launcher": lambda path: str(self.tmp / "launch.bat")}):
command = OPEN["command"](str(exe), [], "windows")[0]
located = RUN["locate"](str(exe), root)
self.assertEqual(command[1:5], ["--prefix", located.appid, "--compatdata", located.compatdata])
self.assertEqual(str(RUN["own_id"](str(exe))), str(RUN["locate"](str(exe), root).appid))
def test_a_native_program_on_noexec_storage_runs_from_a_copy(self):
program = self.write("storage/tool", elf(183))
x86 = self.write("storage/game.x86_64", elf(62))
@@ -737,6 +761,20 @@ class ProtonRunTest(Temp):
self.assertEqual(env["STEAM_COMPAT_DATA_PATH"], str(signed))
self.assertFalse((self.root / "steamapps/compatdata/2733369024").exists())
def test_a_launcher_run_keeps_the_resolved_compatdata_folder(self):
bat = self.write("Games/Epic/Game/.droiddeck-launch.bat", b"@echo off")
signed = self.root / "steamapps/compatdata/-1561598272"
signed.mkdir(parents=True)
other = self.tmp / "Library2/steamapps/compatdata/555"
other.mkdir(parents=True)
for compatdata, appid in ((signed, "2733369024"), (other, "555")):
with self.subTest(compatdata=str(compatdata)):
code, calls, dirs = self.run_main(["--prefix", appid, "--compatdata", str(compatdata), str(bat)])
self.assertIsNone(code)
self.assertEqual(calls[0][2]["STEAM_COMPAT_DATA_PATH"], str(compatdata))
code, calls, dirs = self.run_main(["--prefix", "555", str(bat)])
self.assertEqual(calls[0][2]["STEAM_COMPAT_DATA_PATH"], str(self.root / "steamapps/compatdata/555"))
def test_prefix_folder_prefers_initialized_unsigned_over_empty_signed(self):
signed = self.root / "steamapps/compatdata/-1561598272"
signed.mkdir(parents=True)