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 "./tray";
import "./shortcuts";
var contentPath: string = "null";
var frame: boolean;
var contentPath: string;
var channel: string;
export var mainWindow: BrowserWindow;
var settings: any;
@ -27,10 +26,10 @@ storage.has("settings", function (error, hasKey) {
if (!hasKey) {
console.log("First run of the ArmCord. Starting setup.");
setup();
contentPath = __dirname + "/content/setup.html";
contentPath = "content/setup.html";
} else {
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) {
@ -120,8 +119,13 @@ function createWindow() {
shell.openExternal(url);
return { action: "deny" };
});
console.log(contentPath)
try {
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(() => {

View file

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