Skip to content

Commit 7ad6dd7

Browse files
aboseclaude
andcommitted
fix: load BrowserWindow icon from resources/ in packaged AppImage
The BrowserWindow icon path resolved correctly in dev (`__dirname` = src-electron/, so `../src-tauri/icons/icon.png` reached the source tree) but not in the packaged AppImage, where `__dirname` is inside the asar and src-tauri/ is not bundled. Electron silently dropped the icon and the taskbar fell back to the generic Electron icon. Copy icon.png into the AppImage's resources/ via extraResources, and load it from process.resourcesPath when app.isPackaged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 616d245 commit 7ad6dd7

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

src-electron/electron-builder.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ extraResources:
2727
to: "bin"
2828
- from: "phoenix-dist"
2929
to: "phoenix-dist"
30+
- from: "../src-tauri/icons/icon.png"
31+
to: "icon.png"
3032

3133
extraMetadata:
3234
main: main.js

src-electron/main.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,9 @@ async function createWindow() {
118118
contextIsolation: true,
119119
nodeIntegration: false
120120
},
121-
icon: path.join(__dirname, '..', 'src-tauri', 'icons', 'icon.png')
121+
icon: app.isPackaged
122+
? path.join(process.resourcesPath, 'icon.png')
123+
: path.join(__dirname, '..', 'src-tauri', 'icons', 'icon.png')
122124
});
123125

124126
// Track window state for persistence

0 commit comments

Comments
 (0)