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.
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 tellelectron-builder
to assigndist
as thebuild
folder and usebuild
as thedist
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:
- Created 5 years ago
- Reactions:2
- Comments:10
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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
So, how do you solve it?