Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy fake EpicGamesLauncher.exe for games flagged with env variable #4385

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added public/bin/EpicGamesLauncher.exe
Copy link
Collaborator Author

@arielj arielj Mar 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this file is small enough and shouldn't really require changes in the future often, I think it's safe to include it in the build directly to make it simpler

Binary file not shown.
4 changes: 4 additions & 0 deletions src/backend/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ const gogdlAuthConfig = join(app.getPath('userData'), 'gog_store', 'auth.json')
const vulkanHelperBin = fixAsarPath(
join(publicDir, 'bin', process.arch, process.platform, 'vulkan-helper')
)
const fakeEpicExePath = fixAsarPath(
join(publicDir, 'bin', 'EpicGamesLauncher.exe')
)
const icon = fixAsarPath(join(publicDir, 'icon.png'))
const iconDark = fixAsarPath(join(publicDir, 'icon-dark.png'))
const iconLight = fixAsarPath(join(publicDir, 'icon-light.png'))
Expand Down Expand Up @@ -239,6 +242,7 @@ export {
nileLogFile,
discordLink,
execOptions,
fakeEpicExePath,
fixAsarPath,
configStore,
configPath,
Expand Down
24 changes: 21 additions & 3 deletions src/backend/storeManagers/legendary/games.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { existsSync } from 'graceful-fs'
import { copyFileSync, existsSync } from 'graceful-fs'
import axios from 'axios'

import {
Expand Down Expand Up @@ -40,7 +40,8 @@ import {
configStore,
isCLINoGui,
isLinux,
epicRedistPath
epicRedistPath,
fakeEpicExePath
} from '../../constants'
import {
appendGamePlayLog,
Expand All @@ -59,7 +60,8 @@ import {
launchCleanup,
getRunnerCallWithoutCredentials,
runWineCommand as runWineCommandUtil,
getKnownFixesEnvVariables
getKnownFixesEnvVariables,
getWinePath
} from '../../launcher'
import {
addShortcuts as addShortcutsUtil,
Expand Down Expand Up @@ -876,6 +878,22 @@ export async function launch(
...getKnownFixesEnvVariables(appName, 'legendary')
}

// We can get this env variable either from the game's settings or from known fixes
if (commandEnv['USE_FAKE_EPIC_EXE']) {
const fakeExeWinPath = 'C:\\windows\\command\\EpicGamesLauncher.exe'
const fakeEpicExePathInPrefix = await getWinePath({
path: fakeExeWinPath,
gameSettings,
variant: 'unix'
})

// we copy the file inside the prefix to avoid permission issues
if (!existsSync(fakeEpicExePathInPrefix))
copyFileSync(fakeEpicExePath, fakeEpicExePathInPrefix)

commandEnv['LEGENDARY_WRAPPER_EXE'] = fakeExeWinPath
}

const wrappers = setupWrappers(
gameSettings,
mangoHudCommand,
Expand Down
Loading