1

I have an Electron app which I want to distribute to all operating systems.

I have an issue with the Linux release file. I've tested both the .deb file and the .AppImage file.

The problem is the icon: while if I run my app on Ubuntu using .deb file it correctly shows the icon, when I use the .AppImage it doesn't.

Also, the icon works fine when I run it in development mode as well as when released for Windows and macOS.

Why is that so?

The source code of my app is available here

Francesco Borzi
  • 56,083
  • 47
  • 179
  • 252

1 Answers1

2

AppImage has bug for icon. You need to set it in your main window.

  const options = {
    backgroundColor: '#fff',
    width: 1200,
    height: 800,
    webPreferences: {
      nativeWindowOpen: true,
      nodeIntegration: true
    }
  }

  if (process.platform === "linux") {
    options.icon = path.join(`${__dirname}/icon/icon.png`);
  }

  mainWindow = new BrowserWindow(options);