Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions emrg/gui/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,22 @@ function main() {

// ── 窗口 ────────────────────────────────────────────────

// rant 2026-08-11T17:37:03:打包版曾用 Electron 默认图标(蓝色原子球)。
// package.json build.mac/win/linux.icon 显式指向 packaging/assets 单文件修复主图标;
// 这里为 Windows/Linux 窗口标题栏提供运行时图标(打包版经 extraResources 落到 resources/icon.png)。
function windowIconPath() {
const candidates = [
path.join(__dirname, "..", "icon.png"), // packaged: resources/icon.png(extraResources)
path.join(__dirname, "..", "packaging", "assets", "icon.png"), // source: 仓库 packaging/assets/icon.png
];
return candidates.find((p) => fs.existsSync(p)) || undefined;
}

function createWindow() {
win = new BrowserWindow({
width: 1000,
height: 700,
icon: windowIconPath(),
webPreferences: {
contextIsolation: true,
nodeIntegration: false,
Expand Down
17 changes: 12 additions & 5 deletions emrg/gui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
{
"from": "../dist/runtime",
"to": "runtime"
},
{
"from": "../packaging/assets/icon.png",
"to": "icon.png"
}
],
"files": [
Expand All @@ -41,7 +45,7 @@
"package.json",
"scripts/**"
],
"icon": "../packaging/assets/",
"icon": "../packaging/assets/icon.png",
"mac": {
"hardenedRuntime": true,
"notarize": false,
Expand All @@ -54,7 +58,8 @@
]
}
],
"category": "public.app-category.developer-tools"
"category": "public.app-category.developer-tools",
"icon": "../packaging/assets/icon.icns"
},
"win": {
"target": [
Expand All @@ -64,7 +69,8 @@
"x64"
]
}
]
],
"icon": "../packaging/assets/icon.ico"
},
"linux": {
"target": [
Expand All @@ -76,12 +82,13 @@
"from": "../dist/runtime",
"to": "runtime"
}
]
],
"icon": "../packaging/assets/icon.png"
},
"nsis": {
"oneClick": false,
"allowToChangeInstallationDirectory": true,
"perMachine": false
}
}
}
}
Loading