Fix Windows

This commit is contained in:
smartfrigde 2022-01-16 21:31:03 +01:00
parent 92a452cea4
commit 883bee6236
2 changed files with 11 additions and 7 deletions

View file

@ -15,8 +15,7 @@ import "./extensions/mods";
import "./extensions/plugin"; import "./extensions/plugin";
import "./tray"; import "./tray";
import "./shortcuts"; import "./shortcuts";
var contentPath: string = "null"; var contentPath: string;
var frame: boolean;
var channel: string; var channel: string;
export var mainWindow: BrowserWindow; export var mainWindow: BrowserWindow;
var settings: any; var settings: any;
@ -27,10 +26,10 @@ storage.has("settings", function (error, hasKey) {
if (!hasKey) { if (!hasKey) {
console.log("First run of the ArmCord. Starting setup."); console.log("First run of the ArmCord. Starting setup.");
setup(); setup();
contentPath = __dirname + "/content/setup.html"; contentPath = "content/setup.html";
} else { } else {
console.log("ArmCord has been run before. Skipping setup."); console.log("ArmCord has been run before. Skipping setup.");
contentPath = __dirname + "/content/splash.html"; contentPath = "content/splash.html";
} }
}); });
storage.get("settings", function (error, data: any) { storage.get("settings", function (error, data: any) {
@ -120,8 +119,13 @@ function createWindow() {
shell.openExternal(url); shell.openExternal(url);
return { action: "deny" }; return { action: "deny" };
}); });
console.log(contentPath)
try {
mainWindow.loadFile(contentPath); mainWindow.loadFile(contentPath);
} catch(e) {
console.log("Major error detected while starting up. User is most likely on Windows platform. Fallback to alternative startup.")
mainWindow.loadURL(`file://${__dirname}/content/splash.html`);
}
} }
app.whenReady().then(() => { app.whenReady().then(() => {

View file

@ -23,7 +23,7 @@ export function setup() {
channel: "stable", channel: "stable",
firstRun: "done", firstRun: "done",
armcordCSP: true, armcordCSP: true,
mods: "none" mods: "cumcord"
}, },
function (error) { function (error) {
if (error) throw error; if (error) throw error;