Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusion with the icons #1399

Closed
miguelsmuller opened this issue Mar 23, 2017 · 13 comments · May be fixed by qcif/data-curator#563
Closed

Confusion with the icons #1399

miguelsmuller opened this issue Mar 23, 2017 · 13 comments · May be fixed by qcif/data-curator#563
Labels

Comments

@miguelsmuller
Copy link

I'm kind of lost ... sorry if the question is stupid but I need help.

My project is this one: https://github.com/miguelsmuller/centro-de-estudos

I set the icons for linux, windows and mac in main.js file. But it happens the following:
In linux: File icon and docker icon is electron standard.
In windows: The file icon is the default of the electron. The icon in docker is the one configured in main.js.

I know I have to configure the electron-builder icon as well. But what the responsibilities of each one. How to configure the icons correctly?

@develar
Copy link
Member

develar commented Mar 23, 2017

You should not do it in runtime. See https://github.com/electron-userland/electron-builder#quick-setup-guide

Please, please follow guide and defaults.

Create a directory build in the root of the project and save a background.png (macOS DMG background), icon.icns (macOS app icon) and icon.ico (Windows app icon) into it.

The Linux icon set will be generated automatically based on the macOS icns file (or you can put them into the build/icons directory if you want to specify them yourself. The filename must contain the size (e.g. 32x32.png) of the icon).

Or read all "icon" options in the https://github.com/electron-userland/electron-builder/wiki/Options if you don't want to follow defaults and want to explicitly set all icons.

@miguelsmuller
Copy link
Author

Is there an option for me to change the default build directory for icons? My build directory is listed in .gitignore.

@develar
Copy link
Member

develar commented Mar 23, 2017

the default build directory for icons

Yes. https://github.com/electron-userland/electron-builder/wiki/Developer-API#MetadataDirectories-buildResources

"directories": {
  "buildResources ": "assets"
}

@miguelsmuller
Copy link
Author

OK. I did what you suggested. But it looks like it did not work for me, it still uses the default icon.

I used the buildResources option to change the default directory:

"directories": {
   "buildResources": "app/assets/images/build"
}

And in this directory you have the files:

  • icon.icns
  • icon.ico
  • icon.png

The file icon.png measures 512x512. I also have a folder icons with the files:

  • icon-512x512.png
  • icon-256x256.png
  • icon-128x128.png
  • icon-96x96.png
  • icon-32x32.png
  • icon-48x48.png
  • icon-64x64.png
  • icon-24x24.png
  • icon-16x16.png

Before I received the following alert:
⚠️ Application icon is not set, default Electron icon will be used

Now I do not receive more. It means that the icons have been located.

@develar
Copy link
Member

develar commented Mar 23, 2017

Thanks for clear report. I will check. Please set env DEBUG=electron-builder and attach log of the terminal output. (please update electron-builder to 16.2.1)

@miguelsmuller
Copy link
Author

Here is debug log:

administrador@laboratorio10:~/centro-de-estudos$ DEBUG=electron-builder npm run pack

> [email protected] pack /home/administrador/centro-de-estudos
> build --dir

  electron-builder Two package.json structure is used (dev: /home/administrador/centro-de-estudos/package.json, app: /home/administrador/centro-de-estudos/app/package.json) +0ms
  electron-builder Effective config: {
  electron-builder   "appId": "com.devim.centro-de-estudos",
  electron-builder   "directories": {
  electron-builder     "buildResources": "app/assets/images/build"
  electron-builder   },
  electron-builder   "extraResources": "app/components",
  electron-builder   "linux": {
  electron-builder     "category": "Education",
  electron-builder     "target": [
  electron-builder       "AppImage",
  electron-builder       "deb"
  electron-builder     ]
  electron-builder   },
  electron-builder   "win": {
  electron-builder     "target": "NSIS"
  electron-builder   }
  electron-builder } +5ms
No native production dependencies
Packaging for linux x64 using electron 1.6.2 to dist/linux-unpacked
  electron-builder Spawning /home/administrador/centro-de-estudos/node_modules/7zip-bin-linux/x64/7za x -bd /home/administrador/.electron/electron-v1.6.2-linux-x64.zip -o/home/administrador/centro-de-estudos/dist/linux-unpacked +10s

7-Zip (a) [64] 15.14 : Copyright (c) 1999-2015 Igor Pavlov : 2015-12-31
p7zip Version 15.14.1 (locale=pt_BR.UTF-8,Utf16=on,HugeFiles=on,64 bits,2 CPUs Pentium(R) Dual-Core  CPU      E5300  @ 2.60GHz (1067A),ASM)

Scanning the drive for archives:
1 file, 47588468 bytes (46 MiB)

Extracting archive: /home/administrador/.electron/electron-v1.6.2-linux-x64.zip
--
Path = /home/administrador/.electron/electron-v1.6.2-linux-x64.zip
Type = zip
Physical Size = 47588468

Everything is Ok

Files: 70
Size:       126350486
Compressed: 47588468
  electron-builder /home/administrador/centro-de-estudos/node_modules/7zip-bin-linux/x64/7za (5812) exited with code 0 +2s
  electron-builder Dev or extraneous dependencies: ../../electron-builder.yml, ../../electron-builder.json, ../../electron-builder.json5 +5ms
  electron-builder Copying /home/administrador/centro-de-estudos to /home/administrador/centro-de-estudos/dist/linux-unpacked/resources +3s

I upgraded the electron-builder to version 16.3.0. On windows worked as expected. In linux I still can not solve the problem. Follow the images below.
screen-linux
screen-windows

@miguelsmuller
Copy link
Author

Can you consider this issue as open?

@develar develar reopened this Mar 27, 2017
@develar
Copy link
Member

develar commented Mar 27, 2017

I still doesn't have time to investigate. I will try to find time in 2 days.

@develar
Copy link
Member

develar commented Mar 28, 2017

windows, macOS — icon correctly set.
linux — I get clear error (it seems you are using old electron-builder version. Will be fixed.

@HaulinOats
Copy link

The documentation still isn't very clear on how to handle icons. It took me quite a bit of searching to figure out that I needed to make an assets/build folder along with NOT having a leading slash in front of the 'buildResources' path in the package.json, as @develar posted above.

Really think the documentation should have examples. Really does help clarify things. Don't find Electron Builder's docs to be very intuitive.

@a-lizards-breath
Copy link

Seriously the docs for this are reallyyy bad. @brett84c I'm going to try that now, hopefully it works. Getting kinda tired of fighting this extremely simple thing.

@a-lizards-breath
Copy link

@brett84c you are now my favorite person. Thanks for posting this

@develar
Copy link
Member

develar commented Feb 20, 2018

@brett84c It is no-go way. What's better — add checks (to assist) and support intuitive forms. So — post issue in the form: 1) code to reproduce (config?) 2) expected 3) actual So, instead of documenting pitfall, I will fix the root cause.

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

Successfully merging a pull request may close this issue.

4 participants