diff --git a/electron_app/img/riot.png b/electron_app/img/riot.png index aacfc1a8a50..f52d02c88bb 100644 Binary files a/electron_app/img/riot.png and b/electron_app/img/riot.png differ diff --git a/electron_app/src/electron-main.js b/electron_app/src/electron-main.js index 9c75123ff21..8b837caec2b 100644 --- a/electron_app/src/electron-main.js +++ b/electron_app/src/electron-main.js @@ -295,7 +295,10 @@ app.on('ready', () => { console.log('No update_base_url is defined: auto update is disabled'); } - const iconPath = `${__dirname}/../img/riot.${process.platform === 'win32' ? 'ico' : 'png'}`; + // It's important to call `path.join` so we don't end up with the packaged + // asar in the final path. + const iconFile = `riot.${process.platform === 'win32' ? 'ico' : 'png'}`; + const iconPath = path.join(__dirname, "..", "..", "img", iconFile); // Load the previous window state with fallback to defaults const mainWindowState = windowStateKeeper({ diff --git a/electron_app/src/tray.js b/electron_app/src/tray.js index bd07d7d433d..61e059723df 100644 --- a/electron_app/src/tray.js +++ b/electron_app/src/tray.js @@ -65,7 +65,7 @@ exports.create = function(config) { global.mainWindow.webContents.on('page-favicon-updated', async function(ev, favicons) { if (!favicons || favicons.length <= 0 || !favicons[0].startsWith('data:')) { if (lastFavicon !== null) { - win.setIcon(defaultIcon); + global.mainWindow.setIcon(defaultIcon); trayIcon.setImage(defaultIcon); lastFavicon = null; } diff --git a/package.json b/package.json index 96458d7bf31..531f5d4a052 100644 --- a/package.json +++ b/package.json @@ -156,10 +156,10 @@ "electronVersion": "4.2.4", "files": [ "node_modules/**", - "src/**", - "img/**" + "src/**" ], "extraResources": [ + { "from": "electron_app/img", "to": "img" }, "webapp/**/*", "origin_migrator/**/*" ],