From 2d352fcf33a566f10752281387eea5649e8c5e8f Mon Sep 17 00:00:00 2001 From: stecorb Date: Sat, 22 Aug 2020 01:15:18 +0200 Subject: [PATCH] Fix icon from showing up on certain window systems --- src/main/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/index.js b/src/main/index.js index de8b35b5..94070652 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -15,6 +15,7 @@ app.setName(productName) process.env.ELECTRON_DISABLE_SECURITY_WARNINGS = 'true' // const gotTheLock = app.requestSingleInstanceLock() +const path = require('path') const isDev = process.env.NODE_ENV === 'development' const isDebug = process.argv.includes('--debug') let mainWindow @@ -64,6 +65,9 @@ function createWindow () { backgroundColor: '#fff', width: 960, height: 540, + icon: isDev + ? path.join(__dirname, '../../_icons/iconColor.png') + : `${__dirname}/_icons/iconColor.png`, autoHideMenuBar: true, // useContentSize: true, webPreferences: { @@ -84,7 +88,7 @@ function createWindow () { } else { mainWindow.loadFile(`${__dirname}/index.html`) - global.__static = require('path') + global.__static = path .join(__dirname, '/static') .replace(/\\/g, '\\\\') }