Open
Description
This doesn't show any icon*.png
π’ , some workaround? Greetings.
node version : v22.7.0
Distributor ID: Ubuntu
Description: Ubuntu 24.04.1 LTS
Release: 24.04
Codename: noble
Files:
.
βββ img
βΒ Β βββ icon-128.png
βΒ Β βββ icon-16.png
βΒ Β βββ icon-256.png
βΒ Β βββ icon-32.png
βΒ Β βββ icon-64.png
βΒ Β βββ icon.png
βββ index.html
βββ LICENSE.md
βββ main.js
βββ package.json
βββ package-lock.json
βββ preload.js
βββ README.md
βββ renderer.js
βββ styles.css

Package.json
{
"name": "electron-quick-start",
"version": "1.0.0",
"description": "A minimal Electron application",
"main": "main.js",
"scripts": {
"start": "electron ."
},
"repository": "https://github.com/electron/electron-quick-start",
"keywords": [
"Electron",
"quick",
"start",
"tutorial",
"demo"
],
"author": "GitHub",
"license": "CC0-1.0",
"devDependencies": {
"electron": "^32.1.2"
},
"icon": "./img/icon-32.png"
}
Main.js
const fs = require('fs');
const ICON_PATH = path.join(__dirname, "img", "icon-32.png")
function checkIconPath(iconPath) {
if (fs.existsSync(iconPath)) {
return;
} else {
console.error(`Not exists ${iconPath}`);
process.exit(1);
}
}
checkIconPath(ICON_PATH);
function createWindow() {
// Create the browser window.
const mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
preload: path.join(__dirname, 'preload.js'),
icon: nativeImage.createFromPath(ICON_PATH),
},
icon: nativeImage.createFromPath(ICON_PATH),
})
// and load the index.html of the app.
mainWindow.loadFile('index.html')
// Open the DevTools.
// mainWindow.webContents.openDevTools()
}
// ...
// ...
// ...
Metadata
Metadata
Assignees
Labels
No labels