diff --git a/src/main.ts b/src/main.ts index 370aa7b..129dcec 100644 --- a/src/main.ts +++ b/src/main.ts @@ -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" }; }); - - mainWindow.loadFile(contentPath); + 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(() => { diff --git a/src/utils.ts b/src/utils.ts index 9a9972f..902a2d1 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -23,7 +23,7 @@ export function setup() { channel: "stable", firstRun: "done", armcordCSP: true, - mods: "none" + mods: "cumcord" }, function (error) { if (error) throw error;