Fix icon from showing up on certain window systems

This commit is contained in:
stecorb 2020-08-22 01:15:18 +02:00
parent 8ee1737c38
commit 2d352fcf33
1 changed files with 5 additions and 1 deletions

View File

@ -15,6 +15,7 @@ app.setName(productName)
process.env.ELECTRON_DISABLE_SECURITY_WARNINGS = 'true' process.env.ELECTRON_DISABLE_SECURITY_WARNINGS = 'true'
// const gotTheLock = app.requestSingleInstanceLock() // const gotTheLock = app.requestSingleInstanceLock()
const path = require('path')
const isDev = process.env.NODE_ENV === 'development' const isDev = process.env.NODE_ENV === 'development'
const isDebug = process.argv.includes('--debug') const isDebug = process.argv.includes('--debug')
let mainWindow let mainWindow
@ -64,6 +65,9 @@ function createWindow () {
backgroundColor: '#fff', backgroundColor: '#fff',
width: 960, width: 960,
height: 540, height: 540,
icon: isDev
? path.join(__dirname, '../../_icons/iconColor.png')
: `${__dirname}/_icons/iconColor.png`,
autoHideMenuBar: true, autoHideMenuBar: true,
// useContentSize: true, // useContentSize: true,
webPreferences: { webPreferences: {
@ -84,7 +88,7 @@ function createWindow () {
} else { } else {
mainWindow.loadFile(`${__dirname}/index.html`) mainWindow.loadFile(`${__dirname}/index.html`)
global.__static = require('path') global.__static = path
.join(__dirname, '/static') .join(__dirname, '/static')
.replace(/\\/g, '\\\\') .replace(/\\/g, '\\\\')
} }