question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Persistently uses default osx icon

See original GitHub issue
  • Version: 20.28.3
  • Target: platform=darwin arch=x64 electron=2.0.6

Apps built with electron-builder for mac seem to persistently use the osx default icon, dmg background works just fine but also doesn’t use correct icon.

screen shot 2018-08-28 at 6 36 26 pm

I’ve scoured Google and any kind of help I can try to find including this issue tracker and have been trying solutions for hours

  • Do I have it in my build folder, maybe read next item
  • What does maybe mean?

I’m using Angular which builds to dist so I have to tell electron-builder to assign dist as the build folder and use build as the dist folder

  • How did I do that?

package.json

    "build": {
        "directories": {
            "buildResources": "dist",
            "output": "build"
        },
  • Where are my icons in the build folder?

./dist/project-name/assets/icons

  • Are they in icns format? Yes
  • What size is the icns file? 1024x1024
  • How am I referencing them in the file?

package.json

    "build": {
        "mac": {
            "icon": "./dist/project-name/assets/icons/icns/web_hi_res_512_1024x1024.icns",
        },
        "dmg": {
            "icon": "./dist/project-name/assets/icons/icns/web_hi_res_512_1024x1024.icns",
        },
  • Am I using files? Yes

package.json

    "build": {
        "files": [
            "./dist/**/*",
            "./main.js"
        ],
  • Finally what’s the full build section of package.json?

package.json (Full / uncut)

    "build": {
        "appId": "com.gmail.junehanabi.${name}",
        "productName": "Name",
        "copyright": "Copyright © 2018 June Hanabi",
        "directories": {
            "buildResources": "dist",
            "output": "build"
        },
        "files": [
            "./dist/**/*",
            "./main.js"
        ],
        "mac": {
            "category": "public.app-category.utilities",
            "target": [
                {
                    "target": "dmg",
                    "arch": [
                        "x64"
                    ]
                },
                {
                    "target": "zip",
                    "arch": [
                        "x64"
                    ]
                }
            ],
            "icon": "./dist/project-name/assets/icons/icns/web_hi_res_512_1024x1024.icns",
            "identity": null
        },
        "dmg": {
            "background": "./dist/project-name/assets/splash/DMGSplash.png",
            "icon": "./dist/project-name/assets/icons/icns/web_hi_res_512_1024x1024.icns",
            "title": "${productName}"
        },
        "win": {
            "target": [
                {
                    "target": "nsis",
                    "arch": [
                        "x64",
                        "ia32"
                    ]
                },
                {
                    "target": "portable",
                    "arch": [
                        "x64",
                        "ia32"
                    ]
                }
            ],
            "icon": "./dist/project-name/assets/icons/ico/web_hi_res_512_256x256.ico"
        },
        "nsis": {
            "installerIcon": "./dist/project-name/assets/icons/ico/web_hi_res_512_256x256.ico",
            "uninstallerIcon": "./dist/project-name/assets/icons/ico/web_hi_res_512_256x256.ico",
            "installerHeaderIcon": "./dist/project-name/assets/icons/ico/web_hi_res_512_256x256.ico",
            "deleteAppDataOnUninstall": true
        },
        "linux": {
            "target": [
                {
                    "target": "AppImage",
                    "arch": [
                        "x64",
                        "ia32"
                    ]
                }
            ],
            "icon": "./dist/project-name/assets/icons/png/mipmap-mdpi/ic_launcher.png",
            "synopsis": "Project Synopsis",
            "category": "Utility"
        },
        "appImage": {
            "synopsis": "Project Synopsis",
            "category": "Utility"
        }
    },

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:10

github_iconTop GitHub Comments

11reactions
pigd0gcommented, Feb 13, 2019

If you’re having the same issue, try creating a 1024x1024.png then using this script to generate your icon:

https://github.com/jamf/icns-Creator/blob/master/icns_creator.sh

7reactions
stoneWebcommented, Nov 6, 2018

So, how do you solve it?

Read more comments on GitHub >

github_iconTop Results From Across the Web

finder - Use pre-Big Sur icons in macOS apps and keep them ...
Use pre-Big Sur icons in macOS apps and keep them persistent across updates ... Here's an example - Changing Mac OS X Application...
Read more >
How to restore icons default on mac
In Mac OS X you restore your files/folders original icon easily. First of all select your folder/file in Finder, then right click on...
Read more >
Finder View Options - Globally Persistent… - Apple Community
Change the point size, column views you want showing, icon size, List view or other, etc. The important part - now click the...
Read more >
How to remove an application Icon from Dock from Mac OSX ...
I can see that the above script successfully removes the entry of MyApplication from the persistent-apps from com.apple.dock.plist plist.
Read more >
Prevent an application's Dock icons from showing in OS X
If needed, you can reduce Dock clutter by hiding the icon for persistent background and helper applications.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found