Skip to content
Merged
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: 1 addition & 1 deletion extensions/games/game-kerbalspaceprogram/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
20 changes: 17 additions & 3 deletions extensions/games/game-kerbalspaceprogram/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 === "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 {
return LINUX_EXEC;
}
}

function findGame() {
return util.GameStoreHelper.findByAppId("220200", "steam").then((game) => game.gamePath);
Expand All @@ -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",
},
Expand Down
Loading