Skip to content

Commit 6cbaefd

Browse files
committed
chore: use native patcher
1 parent 2235c5d commit 6cbaefd

File tree

1 file changed

+10
-11
lines changed
  • src/backend/storeManagers/hyperplay

1 file changed

+10
-11
lines changed

src/backend/storeManagers/hyperplay/utils.ts

+10-11
Original file line numberDiff line numberDiff line change
@@ -387,14 +387,14 @@ export async function getEpicListingUrl(projectId: string): Promise<string> {
387387
}
388388

389389
export const runModPatcher = async (appName: string) => {
390-
// game_folder/client-patcher patch.exe -m patch/manifest.json
391390
const installPath = getGameInfo(appName)?.install.install_path
392391
if (!installPath) {
393392
logError(`Cannot find install path for ${appName}`, LogPrefix.HyperPlay)
394393
return
395394
}
396395

397-
const patcher = join(installPath, 'client-patcher.exe')
396+
const patcherBinary = isWindows ? 'client-patcher.exe' : 'client-patcher'
397+
const patcher = join(installPath, patcherBinary)
398398
const manifest = join(installPath, 'patch', 'manifest.json')
399399

400400
logInfo(
@@ -407,15 +407,14 @@ export const runModPatcher = async (appName: string) => {
407407
}
408408

409409
try {
410-
if (!isWindows) {
411-
const gameSettings = await getSettings(appName)
412-
runWineCommand({
413-
gameSettings,
414-
commandParts: [patcher, 'patch', '-m', manifest],
415-
wait: true
416-
})
417-
} else {
418-
await spawnAsync(patcher, ['patch', '-m', manifest])
410+
const { stderr, stdout } = await spawnAsync(
411+
patcherBinary,
412+
['patch', '-m', 'patch/manifest.json'],
413+
{ cwd: installPath }
414+
)
415+
logInfo(['Patch Applied', stdout], LogPrefix.HyperPlay)
416+
if (stderr) {
417+
logError(stderr, LogPrefix.HyperPlay)
419418
}
420419
} catch (error) {
421420
throw new Error(`Error running patcher: ${error}`)

0 commit comments

Comments
 (0)