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

No app icon (deb installation) #2654

Closed
samuelcarreira opened this issue Mar 1, 2018 · 5 comments · May be fixed by qcif/data-curator#563
Closed

No app icon (deb installation) #2654

samuelcarreira opened this issue Mar 1, 2018 · 5 comments · May be fixed by qcif/data-curator#563
Labels

Comments

@samuelcarreira
Copy link

  • Version: 20.2.0
  • Target: Linux (debian based distro)

package.json

"linux": {
      "category": "AudioVideo",
      "packageCategory": "AudioVideo",
      "synopsis": "...",
      "icon": "./build/icons",
      "target": [   {
          "target": "deb",
          "arch": [  "x64", "ia32" ]
        } ],
      "maintainer": "...",
      "desktop": {
        "Encoding": "UTF-8"
      }

The ./build/icons folder contains 10 png files named according to the image size: 16x16.png to 1024x1024.png

.desktop file produced

[Desktop Entry]
Name=appname
Comment=...
Exec="/opt/appname/appname" %U
Terminal=false
Type=Application
Icon=appname
Encoding=UTF-8
Categories=AudioVideo;

The generated .deb file have the following structure inside:

...
[usr]
----[share]
---------[icons]
-------------[hicolor]
------------------[16x16]
------------------------[apps]
---------------------------- appname.png
                                  ...
------------------ [1024x1024]
------------------------[apps]
---------------------------- appname.png

No app icon on any shortcut.

If I want to have an app icon I have to use the following:
1- add an icon file to root directory and specify it on the ExtraFiles entry of the package.json
2- change the linux.desktop key on the package.json to something like

"desktop": {
   Icon="/opt/appname/iconfilename.png"
   ...
}

What's the correct way to automate app icon creation with the electron builder?

@samuelcarreira
Copy link
Author

samuelcarreira commented Mar 2, 2018

I think I found the problem...
If you listing the files inside the usr/share/icons/hicolor/XX-XX/apps/ folder you see that the files are copied without other read permissions

ls icons

Also, they are copied with execute permissions!!

I change all the icon file permissions with the following command:
sudo chmod 0644 filename.png
and the system can now read the icons!

The electron builder copies the ExtraFiles with the following permissions -rwxrwxr-x so it can be read by the system if I manually specify the path to the icon as I said on the first post.

So until any proper fix, I suggest you use that method if you want icons on your deb installations

@samuelcarreira
Copy link
Author

I made another test...
This time I use the .ICNS file to generate the icon files

"linux": {
      "icon": "./build/icon.icns",
..
}

The electron builder copy all the files to the correct folder with the proper read permissions
(-rw-rw-r-- the group permissions to write aren't needed but that doesn't matter for this case)
So this way it's a better alternative to add the icons to your app

@samuelcarreira
Copy link
Author

I listed the file permissions on the ./build/icons folder and notice that the file permissions are wrong (-rwxrwx---). The electron builder copied the files without changing their permissions so that was my fault that the system cannot read the icons!

I changed all the .png icon file permissions inside the icons folder with the command
sudo chmod 0644 *
and the all files are copied correctly and the system can now read the icon.

I will close this issue, but before that, I will leave the following warning to other users with the same issue:

If you use custom png icons inside a folder (like ./build/icons/24x24.png) make sure that the files have the correct permissions. You can change that with the command sudo chmod 0644 *

@develar
Copy link
Member

develar commented Mar 5, 2018

@samuelcarreira You are hero. Thanks a lot.

@szTheory
Copy link

Fixed by adding "icon": "build/icon.icns", to the Linux section ass seen here szTheory/exifcleaner#99

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