Skip to content

Commit 487be8e

Browse files
committed
Copy fake EpicGamesLauncher.exe for games flagged with env variable
1 parent 0189b13 commit 487be8e

File tree

3 files changed

+25
-3
lines changed

3 files changed

+25
-3
lines changed

public/bin/EpicGamesLauncher.exe

148 KB
Binary file not shown.

src/backend/constants.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ const gogdlAuthConfig = join(app.getPath('userData'), 'gog_store', 'auth.json')
9393
const vulkanHelperBin = fixAsarPath(
9494
join(publicDir, 'bin', process.arch, process.platform, 'vulkan-helper')
9595
)
96+
const fakeEpicExePath = fixAsarPath(
97+
join(publicDir, 'bin', 'EpicGamesLauncher.exe')
98+
)
9699
const icon = fixAsarPath(join(publicDir, 'icon.png'))
97100
const iconDark = fixAsarPath(join(publicDir, 'icon-dark.png'))
98101
const iconLight = fixAsarPath(join(publicDir, 'icon-light.png'))
@@ -240,6 +243,7 @@ export {
240243
nileLogFile,
241244
discordLink,
242245
execOptions,
246+
fakeEpicExePath,
243247
fixAsarPath,
244248
configStore,
245249
configPath,

src/backend/storeManagers/legendary/games.ts

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { existsSync } from 'graceful-fs'
1+
import { copyFileSync, existsSync } from 'graceful-fs'
22
import axios from 'axios'
33

44
import {
@@ -40,7 +40,8 @@ import {
4040
configStore,
4141
isCLINoGui,
4242
isLinux,
43-
epicRedistPath
43+
epicRedistPath,
44+
fakeEpicExePath
4445
} from '../../constants'
4546
import {
4647
appendGamePlayLog,
@@ -59,7 +60,8 @@ import {
5960
launchCleanup,
6061
getRunnerCallWithoutCredentials,
6162
runWineCommand as runWineCommandUtil,
62-
getKnownFixesEnvVariables
63+
getKnownFixesEnvVariables,
64+
getWinePath
6365
} from '../../launcher'
6466
import {
6567
addShortcuts as addShortcutsUtil,
@@ -876,6 +878,22 @@ export async function launch(
876878
...getKnownFixesEnvVariables(appName, 'legendary')
877879
}
878880

881+
// We can get this env variable either from the game's settings or from known fixes
882+
if (commandEnv['USE_FAKE_EPIC_EXE']) {
883+
const fakeExeWinPath = 'C:\\windows\\command\\EpicGamesLauncher.exe'
884+
const fakeEpicExePathInPrefix = await getWinePath({
885+
path: fakeExeWinPath,
886+
gameSettings,
887+
variant: 'unix'
888+
})
889+
890+
// we copy the file inside the prefix to avoid permission issues
891+
if (!existsSync(fakeEpicExePathInPrefix))
892+
copyFileSync(fakeEpicExePath, fakeEpicExePathInPrefix)
893+
894+
commandEnv['LEGENDARY_WRAPPER_EXE'] = fakeExeWinPath
895+
}
896+
879897
const wrappers = setupWrappers(
880898
gameSettings,
881899
mangoHudCommand,

0 commit comments

Comments
 (0)