Skip to content

Commit 292427c

Browse files
committed
Move default Electron icons outside asar
Electron doesn't seem to want to load icons from within `asar`s, so this changes the default icons (used for window and tray) so that they are just regular files on disk and updates the reference to match. Part of element-hq#9897
1 parent f10e7ac commit 292427c

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

‎electron_app/src/electron-main.js‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,10 @@ app.on('ready', () => {
295295
console.log('No update_base_url is defined: auto update is disabled');
296296
}
297297

298-
const iconPath = `${__dirname}/../img/riot.${process.platform === 'win32' ? 'ico' : 'png'}`;
298+
// It's important to call `path.join` so we don't end up with the packaged
299+
// asar in the final path.
300+
const iconFile = `riot.${process.platform === 'win32' ? 'ico' : 'png'}`;
301+
const iconPath = path.join(__dirname, "..", "..", "img", iconFile);
299302

300303
// Load the previous window state with fallback to defaults
301304
const mainWindowState = windowStateKeeper({

‎package.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,10 @@
156156
"electronVersion": "4.2.4",
157157
"files": [
158158
"node_modules/**",
159-
"src/**",
160-
"img/**"
159+
"src/**"
161160
],
162161
"extraResources": [
162+
{ "from": "electron_app/img", "to": "img" },
163163
"webapp/**/*",
164164
"origin_migrator/**/*"
165165
],

0 commit comments

Comments
 (0)