14 lines
479 B
JavaScript
14 lines
479 B
JavaScript
const fs = require('fs');
|
|
const p = require('path');
|
|
const png = fs.readFileSync(p.join(__dirname, 'icons', 'app.png'));
|
|
const hdr = Buffer.alloc(6);
|
|
hdr.writeUInt16LE(1, 2);
|
|
hdr.writeUInt16LE(1, 4);
|
|
const ent = Buffer.alloc(16);
|
|
ent.writeUInt16LE(1, 4);
|
|
ent.writeUInt16LE(32, 6);
|
|
ent.writeUInt32LE(png.length, 8);
|
|
ent.writeUInt32LE(22, 12);
|
|
fs.writeFileSync(p.join(__dirname, 'icons', 'app.ico'), Buffer.concat([hdr, ent, png]));
|
|
console.log('app.ico bytes:', 22 + png.length);
|