Skip to content
This repository has been archived by the owner on Dec 13, 2019. It is now read-only.

Electron build for win32 results in jagged app icons #192

Closed
somascope opened this issue Oct 19, 2018 · 2 comments
Closed

Electron build for win32 results in jagged app icons #192

somascope opened this issue Oct 19, 2018 · 2 comments

Comments

@somascope
Copy link

Software version

OS: Windows 7
Node: 10.11.0
NPM: 6.4.1
Any other software related to your bug: electron-builder 20.28.4

What did you get as the error?

There is no coding error that I experience. This is a visual issue of a build. I am building on win32 for an electron app. All of my attempts result in a simple but (to me) un-fixable problem where the app icons are jagged. I believe this is an image-processing bug of some kind with the build process for Electron.

I have details in the message board: https://forum.quasar-framework.org/topic/2827/windows-app-icon-with-electron-electron-builder-are-jagged

What were you expecting?

I was expecting clear app icons for A) the Windows installer that is generated from the build, and B) the windows start icon that appears on the desktop after installation.

What steps did you take, to get the error?

I run the build using: $ quasar build -m electron

I have provided my app's icons according in “\src-electron\icons” according to https://quasar-framework.org/guide/electron-preparation.html.

But even when I use the default Quasar app icons, the same obviously jagged images are the result.

It's confusing that only the Linux icon is used, as with tests I have changed ONLY that image/icon file for the Linux icon (‘src-electron/icons/linux-512x512.png’), and on win32 I see that in use for my app's icon. I expected that the Windows icon file ('icon.ico'), which I generated via uploading my main PNG icon to https://iconverticons.com/online/, would be used, but it was not. If I keep the Quasar version of this file in place, that does not get included in my build.

I found it odd that even when I specify the win32 ptarget with: $ quasar build -m electron -T win32, that

@somascope
Copy link
Author

I am wondering if this is an issue that I should actually create at https://github.com/electron-userland/electron-builder/issues instead.

If you folks think that's what should be done, then I'll close this and repeat there. But I'm honestly not sure, since Quasar does so much stuff compared to using Electron or electron-builder in a "naked" fashion. Thanks for any suggestions!

@somascope
Copy link
Author

I have found the appropriate electron-builder documentation to help me figure out what I was missing.

From https://www.electron.build/configuration/win#WindowsConfiguration-target, it indicates a 'win' object and an 'icon' object within. Once I included this and pointed to my Windows 'icon.ico' file, the icons for the installer and app look as-expected and clean.

The code in quasar.conf.js, when using electron-builder for bundling, is:

electron: {
  bundler: 'builder',
  extendWebpack (cfg) {
    // do something with Electron process Webpack cfg
  },
  builder: {
    // https://www.electron.build/configuration/configuration
    appId: 'com.etrac-mss.etrac',
    win: {
      icon: 'src-electron/icons/icon.ico'
    }
  }
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant