From 1a47d4b47b6a58b4a2b5c5834cf1bcb8c985352c Mon Sep 17 00:00:00 2001 From: Remy Raes Date: Mon, 10 Jan 2022 00:32:55 +0100 Subject: [feat] launch button install Northstar if it's not installed --- src/app/main.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/app') diff --git a/src/app/main.js b/src/app/main.js index 0c48db1..1fdaa00 100644 --- a/src/app/main.js +++ b/src/app/main.js @@ -3,6 +3,7 @@ const path = require("path"); const { ipcRenderer } = require("electron"); const lang = require("../lang"); +let shouldInstallNorthstar = false; var settings = { gamepath: "", @@ -43,7 +44,14 @@ function setpath(value = false) { ipcRenderer.send("setpath", value); } -function launch() {ipcRenderer.send("launch")} +function launch() { + if (shouldInstallNorthstar) { + update(); + shouldInstallNorthstar = false; + } else { + ipcRenderer.send("launch"); + } +} function launchVanilla() {ipcRenderer.send("launchVanilla")} function log(msg) { @@ -153,6 +161,7 @@ ipcRenderer.on("version", (event, versions) => { // Since Northstar is not installed, we cannot launch it northstar.innerText = 'Install'; + shouldInstallNorthstar = true; } }); ipcRenderer.send("getversion"); -- cgit v1.2.3