Skip to content

Commit b20fe20

Browse files
committed
Fix icon.ico - create proper ICO format for Windows build
1 parent b5fa41e commit b20fe20

3 files changed

Lines changed: 31 additions & 2 deletions

File tree

assets/icon.ico

351 KB
Binary file not shown.

package.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
"electron": "^28.1.0",
1919
"electron-builder": "^24.9.1",
2020
"electron-icon-builder": "^2.0.1",
21+
"png-to-ico": "^3.0.1",
22+
"to-ico": "^1.1.5",
2123
"vite": "^5.0.10",
2224
"wait-on": "^7.2.0"
2325
},
@@ -44,11 +46,15 @@
4446
"target": [
4547
{
4648
"target": "nsis",
47-
"arch": ["x64"]
49+
"arch": [
50+
"x64"
51+
]
4852
},
4953
{
5054
"target": "portable",
51-
"arch": ["x64"]
55+
"arch": [
56+
"x64"
57+
]
5258
}
5359
],
5460
"icon": "assets/icon.ico"

scripts/create-ico.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
const toIco = require('to-ico');
2+
const fs = require('fs');
3+
const path = require('path');
4+
5+
async function createIco() {
6+
try {
7+
const pngPath = path.join(__dirname, '../assets/icon.png');
8+
const icoPath = path.join(__dirname, '../assets/icon.ico');
9+
10+
const buf = await toIco([fs.readFileSync(pngPath)], {
11+
resize: true,
12+
sizes: [16, 24, 32, 48, 64, 128, 256]
13+
});
14+
15+
fs.writeFileSync(icoPath, buf);
16+
console.log('✓ ICO file created successfully');
17+
} catch (err) {
18+
console.error('Error creating ICO:', err);
19+
process.exit(1);
20+
}
21+
}
22+
23+
createIco();

0 commit comments

Comments
 (0)