From 0c361d57fc43b40a91f89d32f374d95127af08f2 Mon Sep 17 00:00:00 2001 From: Nicolas Constant Date: Fri, 2 Oct 2020 20:59:36 -0400 Subject: [PATCH] try other icon fix --- main-electron.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/main-electron.js b/main-electron.js index 665b70f9..02a9914d 100644 --- a/main-electron.js +++ b/main-electron.js @@ -4,14 +4,20 @@ const { app, Menu, MenuItem, BrowserWindow, shell } = require("electron"); // Keep a global reference of the window object, if you don't, the window will // be closed automatically when the JavaScript object is garbage collected. let win; +const globalAny = global; + +if (process.env.NODE_ENV !== 'development') { + globalAny.__static = require('path').join(__dirname, '/assets/icons').replace(/\\/g, '\\\\'); +} function createWindow() { - // Create the browser window - let icon = join(__dirname, '/src/assets/icons/icon-512x512.png'); + // Set icon + let icon = join(globalAny.__static, '/png/512x512.png'); if (process.platform === "win32") { - icon = join(__dirname, '/assets/icons/win/icon.ico'); + icon = join(globalAny.__static, '/win/icon.ico'); } + // Create the browser window win = new BrowserWindow({ width: 377, height: 800,