Kein App-Symbol in der Linux-App mit Electron-Builder, wird aber angezeigt, wenn Electron direkt verwendet wirdLinux

Linux verstehen
Anonymous
 Kein App-Symbol in der Linux-App mit Electron-Builder, wird aber angezeigt, wenn Electron direkt verwendet wird

Post by Anonymous »

Ich programmiere eine App mit vite, svelte@4, electron und electron-builder. Wenn ich Electron ./start-electron.js ausführe, wird das Logo angezeigt, aber nach vielen Tagen des Ausprobierens bekomme ich es immer noch nicht in der gepackten App, weder in der linux-unpacked noch in der .AppImage-Datei – nur die Standard-Wayland/X11-Symbole.
Was fehlt mir? Wie kann ich mehr Informationen aus dem Electron-Builder-Prozess herausholen?
meine Konfigurationen sehen so aus:
package.json

Code: Select all

{
// name and homepage...
"version": "2.0.0",
"private": true,
"type": "module",
"main": "./start-electron.js",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview",
"check": "svelte-check --tsconfig ./tsconfig.json && tsc -p tsconfig.node.json",
"electron": "electron ./start-electron.js",
"package": "npm run build && electron-builder --config electron-builder.ts",
"package-multiplatform": "npm run build && electron-builder --win --linux --config electron-builder.ts"
},
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^3.1.2",
"@tsconfig/svelte": "^5.0.5",
"@types/three": "^0.179.0",
"electron": "^32.1.2",
"electron-builder": "^25.0.5",
"prettier": "3.6.2",
"svelte": "^4.2.19",
"svelte-check": "^4.3.3",
"tslib": "^2.8.1",
"typescript": "^5.9.3",
"vite": "^5.4.10",
"vite-plugin-static-copy": "^3.1.4",
"vite-tsconfig-paths": "^5.1.4",
"html2canvas": "^1.4.1",
"staffelei": "file:Staffelei",
"three": "^0.180.0"
}
}
start-elextron.js

Code: Select all

import { app, BrowserWindow } from "electron/main";
import os from "node:os";

const doOpenDevTools = !app.isPackaged || app.commandLine.hasSwitch("defribbulate");

const isLinux = os.platform() == "linux";

function createWindow() {
const fnIcon = "dist/logo/bounce/256x256.png";

// Create the browser window
const mainWindow = new BrowserWindow({
width: 1200,
height: 800,
minWidth: 400,
minHeight: 400,
show: false,
icon: isLinux ? fnIcon : undefined,
});
mainWindow.removeMenu();

// and load the index.html of the app.
mainWindow.loadFile("./dist/index.html");

mainWindow.on("ready-to-show", mainWindow.show);

if (doOpenDevTools) {
// Open the DevTools.
mainWindow.webContents.openDevTools();
}
}

// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.whenReady().then(() => {
createWindow();

app.on("activate", function () {
// On macOS it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (BrowserWindow.getAllWindows().length === 0) {
createWindow();
}
});

// Quit when all windows are closed, except on macOS.  There, it's common
// for applications and their menu bar to stay active until the user quits
// explicitly with Cmd + Q.
app.on("window-all-closed", function () {
if (process.platform !== "darwin") {
app.quit();
}
});
});

electron-builder.ts

Code: Select all

import { Configuration } from "electron-builder";

export default {
appId: "com.some.app",
productName: "Appfelkuchen",
icon: "./dist/logo/bounce/256x256.png",
files: ["start-electron.js", "dist/**/*"],
win: {
icon: "./dist/logo/generated/appfelkuchen.ico",
},
asar: false,
linux: {
executableName: "RaumSchauKasten",
category: "Utility",
target: ["dir", "AppImage"],
},
directories: {
buildResources: "resources",
output: "release",
},
} satisfies Configuration;
Das Dateilayout sieht folgendermaßen aus:
Image

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post