Skip to content
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
2 changes: 2 additions & 0 deletions electron-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ linux:
- build/bin/${arch}/linux/*
- build/bin/x64/win32/GalaxyCommunication.exe
- build/bin/x64/win32/EpicGamesLauncher.exe
- build/bin/galaxy.exe
- build/bin/libgalaxyunixlib.dll.so

rpm:
fpm: ['--rpm-rpmbuild-define', '_build_id_links none']
Expand Down
2 changes: 1 addition & 1 deletion meta/downloadHelperBinaries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const RELEASE_TAGS = {
legendary: '0.20.39',
gogdl: 'v1.2.0',
nile: 'v1.1.2',
comet: 'v0.2.0',
comet: 'v0.3.2',
'epic-integration': 'v0.4'
} as const satisfies Record<DownloadedBinary, string>

Expand Down
Binary file added public/bin/galaxy.exe
Binary file not shown.
Binary file added public/bin/libgalaxyunixlib.dll.so
Binary file not shown.
8 changes: 8 additions & 0 deletions src/backend/constants/paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ export const galaxyCommunicationExePath = fixAsarPath(
join(publicDir, 'bin', 'x64', 'win32', 'GalaxyCommunication.exe')
)

export const galaxyOverlayShimExePath = fixAsarPath(
join(publicDir, 'bin', 'galaxy.exe')
)

export const galaxyOverlayShimUnixlibExePath = fixAsarPath(
join(publicDir, 'bin', 'libgalaxyunixlib.dll.so')
)

export const webviewPreloadPath = fixAsarPath(
join('file://', publicDir, 'webviewPreload.js')
)
Expand Down
44 changes: 32 additions & 12 deletions src/backend/launcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ import {
fixesPath,
flatpakHome,
galaxyCommunicationExePath,
galaxyOverlayShimExePath,
galaxyOverlayShimUnixlibExePath,
runtimePath,
userHome
} from './constants/paths'
Expand Down Expand Up @@ -790,6 +792,7 @@ async function prepareWineLaunch(
failureReason?: string
envVars?: Record<string, string>
}> {
const extendedEnv: Record<string, string> = {}
const gameSettings =
GameConfig.get(appName).config ||
(await GameConfig.get(appName).getSettings())
Expand Down Expand Up @@ -909,34 +912,51 @@ async function prepareWineLaunch(

try {
if (runner === 'gog' && experimentalFeatures?.cometSupport !== false) {
const galaxyCommWinePath =
'C:\\ProgramData\\GOG.com\\Galaxy\\redists\\GalaxyCommunication.exe'
const galaxyCommPath = 'C:\\ProgramData\\GOG.com\\Galaxy'
const communicationDest = await getWinePath({
path: galaxyCommWinePath,
path: galaxyCommPath,
gameSettings,
variant: 'unix'
})

if (!existsSync(communicationDest)) {
mkdirSync(dirname(communicationDest), { recursive: true })
await copyFile(galaxyCommunicationExePath, communicationDest)
const communicationExe = join(
communicationDest,
'redists/GalaxyCommunication.exe'
)
const galaxyOverlay = join(communicationDest, 'overlay-heroic')

if (!existsSync(communicationExe)) {
mkdirSync(dirname(communicationExe), { recursive: true })
await copyFile(galaxyCommunicationExePath, communicationExe)
await runWineCommand({
commandParts: [
'sc',
'create',
'GalaxyCommunication',
`binpath=${galaxyCommWinePath}`
`binpath=${galaxyCommPath}`
],
gameSettings,
protonVerb: 'runinprefix'
})
}
if (!existsSync(galaxyOverlay)) {
mkdirSync(galaxyOverlay, { recursive: true })
await copyFile(
galaxyOverlayShimExePath,
join(galaxyOverlay, 'galaxy.exe')
)
await copyFile(
galaxyOverlayShimUnixlibExePath,
join(galaxyOverlay, 'libgalaxyunixlib.dll.so')
)
}
extendedEnv['HEROIC_GOGDL_WRAPPER_EXE'] = join(
galaxyCommPath,
'overlay-heroic/galaxy.exe'
)
}
} catch (err) {
logError([
'Failed to install GalaxyCommunication dummy into the prefix:',
err
])
logError(['Failed to install galaxy components into the prefix', err])
}

// If DXVK/VKD3D installation is enabled, install it
Expand Down Expand Up @@ -972,7 +992,7 @@ async function prepareWineLaunch(
gameManagerMap[runner].getGameInfo(appName)
const envVars = setupWineEnvVars(gameSettings, installFolderName)

return { success: true, envVars: envVars }
return { success: true, envVars: { ...envVars, ...extendedEnv } }
}

export function readKnownFixes(appName: string, runner: Runner) {
Expand Down
Empty file.
20 changes: 14 additions & 6 deletions src/backend/storeManagers/gog/games.ts
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,10 @@ export async function launch(
return false
}

if (!isOnline() && wineEnvVars) {
delete wineEnvVars['HEROIC_GOGDL_WRAPPER_EXE']
}

commandEnv = {
...commandEnv,
...wineEnvVars
Expand Down Expand Up @@ -695,12 +699,16 @@ export async function launch(
false
) {
const path = getCometBin()
child = spawn(join(path.dir, path.bin), [
'--from-heroic',
'--username',
userData.username,
'--quit'
])
child = spawn(
join(path.dir, path.bin),
['--from-heroic', '--username', userData.username, '--quit'],
{
env: {
...process.env,
...setupWrapperEnvVars({ appName, appRunner: 'gog' })
}
}
)
child.stdout.setEncoding('utf-8')
child.stderr.setEncoding('utf-8')
child.stdout.on('data', (data: string) => {
Expand Down
2 changes: 1 addition & 1 deletion src/backend/storeManagers/gog/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ async function setup(
`/DIR=${gameDirectoryPath}`,
`/Language=${language}`,
`/LANG=${language}`,
`/ProductId=${language}`,
`/ProductId=${supportCommand.gameID}`,
`/galaxyclient`,
`/buildId=${manifestData.product.timestamp}`,
`/versionName=${gameInfo.install.version}`,
Expand Down
31 changes: 31 additions & 0 deletions src/frontend/screens/Settings/components/CometComponents.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { CachedOutlined } from '@mui/icons-material'
import { useState } from 'react'
import { useTranslation } from 'react-i18next'

const CometComponents = () => {
const { t } = useTranslation()

const [isUpdating, setUpdating] = useState(false)

return (
<>
<h3>{t('setting.comet.components', 'Comet Components')}</h3>

<div className="footerFlex">
<button className="button is-primary" onClick={() => {}}>
<CachedOutlined />
<span>
{isUpdating
? t(
'setting.eosOverlay.checkingForUpdates',
'Checking for updates...'
)
: t('setting.eosOverlay.checkForUpdates', 'Check for updates')}
</span>
</button>
</div>
</>
)
}

export default CometComponents
1 change: 1 addition & 0 deletions src/frontend/screens/Settings/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,4 @@ export { default as ResetHeroic } from './ResetHeroic'
export { default as BeforeLaunchScriptPath } from './BeforeLaunchScriptPath'
export { default as AfterLaunchScriptPath } from './AfterLaunchScriptPath'
export { default as AllowInstallationBrokenAnticheat } from './AllowInstallationBrokenAnticheat'
export { default as CometComponents } from './CometComponents'
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
AltLegendaryBin,
AltNileBin,
ClearCache,
CometComponents,
CustomCSS,
DisableLogs,
DownloadNoHTTPS,
Expand Down Expand Up @@ -299,6 +300,11 @@ export default function AdvancedSetting() {
<hr />
</div>

<div className="advancedSetting">
<CometComponents />
<hr />
</div>

<div className="advancedSetting">
<ExperimentalFeatures />
<hr />
Expand Down
Loading