diff --git a/src/main/events/library/open-game-installer.ts b/src/main/events/library/open-game-installer.ts index 0b7e98db..5a3295eb 100644 --- a/src/main/events/library/open-game-installer.ts +++ b/src/main/events/library/open-game-installer.ts @@ -54,12 +54,14 @@ const openGameInstaller = async ( } const gamePathFileNames = fs.readdirSync(gamePath); - const gameAlternativeSetupPath = gamePathFileNames.find( + const gamePathExecutableFiles = gamePathFileNames.filter( (fileName: string) => path.extname(fileName).toLowerCase() === ".exe" ); - if (gameAlternativeSetupPath) { - return executeGameInstaller(path.join(gamePath, gameAlternativeSetupPath)); + if (gamePathExecutableFiles.length === 1) { + return executeGameInstaller( + path.join(gamePath, gamePathExecutableFiles[0]) + ); } if (spawnSync("which", ["lutris"]).status === 0) {