From d5d1482c082404fde18c6124b98cfb9ff859ac24 Mon Sep 17 00:00:00 2001 From: Ariel Juodziukynas Date: Sat, 6 Jan 2024 11:17:00 -0800 Subject: [PATCH] Fixes related to "Installing Prerequisites" status (#3393) --- src/backend/storeManagers/gog/setup.ts | 9 +-------- src/backend/storeManagers/nile/setup.ts | 4 +++- src/backend/tools/ipc_handler.ts | 4 +++- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/backend/storeManagers/gog/setup.ts b/src/backend/storeManagers/gog/setup.ts index d6d291b70c..ad550949f3 100644 --- a/src/backend/storeManagers/gog/setup.ts +++ b/src/backend/storeManagers/gog/setup.ts @@ -9,12 +9,7 @@ import { import { copySync } from 'fs-extra' import path from 'node:path' import { GameInfo, InstalledInfo } from 'common/types' -import { - checkWineBeforeLaunch, - getShellPath, - sendGameStatusUpdate, - spawnAsync -} from '../../utils' +import { checkWineBeforeLaunch, getShellPath, spawnAsync } from '../../utils' import { GameConfig } from '../../game_config' import { logError, logInfo, LogPrefix, logWarning } from '../../logger/logger' import { isWindows } from '../../constants' @@ -52,8 +47,6 @@ async function setup( LogPrefix.Gog ) - sendGameStatusUpdate({ appName, runner: 'gog', status: 'prerequisites' }) - const gameSettings = GameConfig.get(appName).config if (!isWindows) { const isWineOkToLaunch = await checkWineBeforeLaunch(appName, gameSettings) diff --git a/src/backend/storeManagers/nile/setup.ts b/src/backend/storeManagers/nile/setup.ts index 7e350192be..3e7d9711d8 100644 --- a/src/backend/storeManagers/nile/setup.ts +++ b/src/backend/storeManagers/nile/setup.ts @@ -58,7 +58,6 @@ export default async function setup( 'Running setup instructions, if you notice issues with launching a game, please report it on our Discord server', LogPrefix.Nile ) - sendGameStatusUpdate({ appName, runner: 'nile', status: 'prerequisites' }) const gameSettings = GameConfig.get(appName).config if (!isWindows) { @@ -76,6 +75,9 @@ export default async function setup( } logDebug(['PostInstall:', fuel.PostInstall], LogPrefix.Nile) + + sendGameStatusUpdate({ appName, runner: 'nile', status: 'prerequisites' }) + // Actual setup logic for (const action of fuel.PostInstall) { const exeArguments = action.Args ?? [] diff --git a/src/backend/tools/ipc_handler.ts b/src/backend/tools/ipc_handler.ts index c239bf6f5c..839409a889 100644 --- a/src/backend/tools/ipc_handler.ts +++ b/src/backend/tools/ipc_handler.ts @@ -3,7 +3,7 @@ import { ipcMain } from 'electron' import { Winetricks, runWineCommandOnGame } from '.' import path from 'path' import { isWindows } from 'backend/constants' -import { execAsync } from 'backend/utils' +import { execAsync, sendGameStatusUpdate } from 'backend/utils' ipcMain.handle( 'runWineCommandForGame', @@ -48,6 +48,8 @@ ipcMain.handle('callTool', async (event, { tool, exe, appName, runner }) => { } break } + + sendGameStatusUpdate({ appName, runner, status: 'done' }) }) ipcMain.on('winetricksInstall', async (event, { runner, appName, component }) =>