From bf423414df15e05428d947c88d0c7363714470c2 Mon Sep 17 00:00:00 2001 From: SPTApyo Date: Sun, 4 Oct 2026 04:24:26 +0200 Subject: [PATCH 1/2] game-kerbalspaceprogram: Discover the Windows build on Linux --- .../game-kerbalspaceprogram/package.json | 2 +- .../game-kerbalspaceprogram/src/index.js | 20 ++++++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/extensions/games/game-kerbalspaceprogram/package.json b/extensions/games/game-kerbalspaceprogram/package.json index 1e806f7490..94cd1309e9 100644 --- a/extensions/games/game-kerbalspaceprogram/package.json +++ b/extensions/games/game-kerbalspaceprogram/package.json @@ -1,6 +1,6 @@ { "name": "game-kerbalspaceprogram", - "version": "1.0.2", + "version": "1.0.3", "description": "Support for Kerbal Space Program", "scripts": { "_assets": "copyfiles -u 1 -f ./assets/* dist", diff --git a/extensions/games/game-kerbalspaceprogram/src/index.js b/extensions/games/game-kerbalspaceprogram/src/index.js index 7e0e161ac9..6c49ff9c61 100644 --- a/extensions/games/game-kerbalspaceprogram/src/index.js +++ b/extensions/games/game-kerbalspaceprogram/src/index.js @@ -2,7 +2,21 @@ const Promise = require("bluebird"); const path = require("path"); const { fs, log, selectors, util } = require("@nexusmods/vortex-api"); -const extension = process.platform == "linux" ? ".x86_64" : "_x64.exe"; +const WINDOWS_EXEC = "KSP_x64.exe"; +const LINUX_EXEC = "KSP.x86_64"; + +function gameExecutable(discoveryPath) { + if (process.platform != "linux") { + return WINDOWS_EXEC; + } + // the Windows build can be installed too, to run through Proton + try { + fs.statSync(path.join(discoveryPath, WINDOWS_EXEC)); + return WINDOWS_EXEC; + } catch (err) { + return LINUX_EXEC; + } +} function findGame() { return util.GameStoreHelper.findByAppId("220200", "steam").then((game) => game.gamePath); @@ -16,8 +30,8 @@ function main(context) { queryPath: findGame, queryModPath: () => "GameData", logo: "gameart.jpg", - executable: () => "KSP" + extension, - requiredFiles: ["KSP" + extension], + executable: gameExecutable, + requiredFiles: [path.join("GameData", "Squad")], environment: { SteamAPPId: "220200", }, From 36431ce4f22474ccb77d3f7b0316d68e5d6eccc3 Mon Sep 17 00:00:00 2001 From: SPTApyo Date: Mon, 5 Oct 2026 06:26:13 +0200 Subject: [PATCH 2/2] Check for Windows directly --- extensions/games/game-kerbalspaceprogram/src/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/games/game-kerbalspaceprogram/src/index.js b/extensions/games/game-kerbalspaceprogram/src/index.js index 6c49ff9c61..824c3c4be0 100644 --- a/extensions/games/game-kerbalspaceprogram/src/index.js +++ b/extensions/games/game-kerbalspaceprogram/src/index.js @@ -6,14 +6,14 @@ const WINDOWS_EXEC = "KSP_x64.exe"; const LINUX_EXEC = "KSP.x86_64"; function gameExecutable(discoveryPath) { - if (process.platform != "linux") { + if (process.platform === "win32") { return WINDOWS_EXEC; } // the Windows build can be installed too, to run through Proton try { fs.statSync(path.join(discoveryPath, WINDOWS_EXEC)); return WINDOWS_EXEC; - } catch (err) { + } catch { return LINUX_EXEC; } }