Please describe your issue:
I followed https://blog.macsales.com/28492-create-your-own-custom-icons-in-10-7-5-or-later
Then I ran
Console output when you run electron-packager with the environment variable DEBUG=electron-packager. Please include the stack trace if one exists.
~/Desktop/out/electron-packager ~/code/electron-quick-start/ QuantumPilot --platform=all --icon=../QuantumPilot.iconset/
Packaging app for platform darwin x64 using electron v0.36.11
Packaging app for platform linux x64 using electron v0.36.11
Packaging app for platform mas x64 using electron v0.36.11
WARNING: signing is required for mas builds. Provide the osx-sign option, or manually sign the app later.
Packaging app for platform win32 x64 using electron v0.36.11
Wrote new apps to:
/Users/quantum/Desktop/out/QuantumPilot-darwin-x64
/Users/quantum/Desktop/out/QuantumPilot-linux-x64
/Users/quantum/Desktop/out/QuantumPilot-mas-x64
/Users/quantum/Desktop/out/QuantumPilot-win32-x64
<!-- For bugs and questions, please answer these questions to the best of your ability. -->
What command line arguments are you passing? Alternatively, if you are using the API, what
parameters are you passing to the packager() function?
--icon="../QuantumPilot.iconset/"
Please provide either a failing minimal testcase (with a link to the code) or detailed steps to
reproduce your problem. Using electron-quick-start
is a good starting point.
The app icon still shows the default. How do I make custom icons?
@quantumproducer Try using a .icns file instead of a raw iconset 馃憤
@MarshallOfSound I created QuantumPilot.icns which has the 10 icon files (if I open with Preview). So I tried
/Desktop/out/electron-packager ~/code/electron-quick-start/ QuantumPilot --platform=all --icns="~/Desktop/QuantumPilot.icns"
with and without the quotes on the last argument, but no dice.
@quantumproducer Can you try an absolute path to the icns file, just to be 100% accurate 馃憤
@MarshallOfSound same issue.. how can I check y electron-packager version?
Run DEBUG=electron-packager ~/Desktop/out/electron-packager ~/code/electron-quick-start/ QuantumPilot --platform=all --icns="~/Desktop/QuantumPilot.icns"
~/cd Desktop/out
~/Desktop/out/ls
QuantumPilot-darwin-x64 QuantumPilot-mas-x64
QuantumPilot-linux-x64 QuantumPilot-win32-x64
~/Desktop/out/rm -rf QuantumPilot-*
~/Desktop/out/DEBUG=electron-packager ~/Desktop/out/electron-packager ~/code/electron-quick-start/ QuantumPilot --platform=all --icns="~/Desktop/QuantumPilot.icns"
-bash: /Users/quantum/Desktop/out/electron-packager: No such file or directory
~/Desktop/out/$DEBUG=electron-packager ~/Desktop/out/electron-packager ~/code/electron-quick-start/ QuantumPilot --platform=all --icns="~/Desktop/QuantumPilot.icns"
-bash: =electron-packager: command not found
~/Desktop/out/electron-packager
Usage: electron-packager <sourcedir> <appname> [options...]
Required options
sourcedir the base directory of the application source
Examples: electron-packager ./
electron-packager ./ --all
Optional options
appname the name of the app, if it needs to be different from the "productName" or "name"
in the nearest package.json
* All platforms *
all equivalent to --platform=all --arch=all
app-copyright human-readable copyright line for the app
app-version release version to set for the app
arch all, or one or more of: ia32, x64, armv7l (comma-delimited if multiple). Defaults
to the host arch
asar whether to package the source code within your app into an archive. You can either
pass --asar by itself to use the default configuration, OR use dot notation to
configure a list of sub-properties, e.g. --asar.unpackDir=sub_dir - do not use
--asar and its sub-properties simultaneously.
Properties supported:
- ordering: path to an ordering file for file packing
- unpack: unpacks the files to the app.asar.unpacked directory whose filenames
regex .match this string
- unpackDir: unpacks the dir to the app.asar.unpacked directory whose names glob
pattern or exactly match this string. It's relative to the <sourcedir>.
build-version build version to set for the app
deref-symlinks whether symlinks should be dereferenced. Defaults to true.
download a list of sub-options to pass to electron-download. They are specified via dot
notation, e.g., --download.cache=/tmp/cache
Properties supported:
- cache: directory of cached Electron downloads. Defaults to `$HOME/.electron`
- mirror: alternate URL to download Electron zips
- strictSSL: whether SSL certs are required to be valid when downloading
Electron. Defaults to true, use --download.strictSSL=false to disable checks.
icon the icon file to use as the icon for the app. Note: Format depends on platform.
ignore do not copy files into app whose filenames regex .match this string. See also:
https://github.com/electron-userland/electron-packager/blob/master/docs/api.md#ignore
and --no-prune.
no-prune do not run `npm prune --production` on the app
out the dir to put the app into at the end. defaults to current working dir
overwrite if output directory for a platform already exists, replaces it rather than
skipping it
platform all, or one or more of: darwin, linux, mas, win32 (comma-delimited if multiple).
Defaults to the host platform
tmpdir temp directory. Defaults to system temp directory, use --tmpdir=false to disable
use of a temporary directory.
version the version of Electron that is being packaged, see
https://github.com/electron/electron/releases
* darwin/mas target platforms only *
app-bundle-id bundle identifier to use in the app plist
app-category-type the application category type
For example, `app-category-type=public.app-category.developer-tools` will set the
application category to 'Developer Tools'.
extend-info a plist file to append to the app plist
extra-resource a file to copy into the app's Contents/Resources
helper-bundle-id bundle identifier to use in the app helper plist
osx-sign (OSX host platform only) Whether to sign the OSX app packages. You can either
pass --osx-sign by itself to use the default configuration, or use dot notation
to configure a list of sub-properties, e.g. --osx-sign.identity="My Name"
Properties supported:
- identity: should contain the identity to be used when running `codesign`
- entitlements: the path to entitlements used in signing
- entitlements-inherit: the path to the 'child' entitlements
protocol URL protocol scheme to register the app as an opener of.
For example, `--protocol=myapp` would register the app to open
URLs such as `myapp://path`. This argument requires a `--protocol-name`
argument to also be specified.
protocol-name Descriptive name of URL protocol scheme specified via `--protocol`
* win32 target platform only *
version-string an alias for win32metadata (deprecated)
win32metadata a list of sub-properties used to set the application metadata embedded into
the executable. They are specified via dot notation,
e.g. --win32metadata.CompanyName="Company Inc."
or --win32metadata.ProductName="Product"
Properties supported:
- CompanyName
- FileDescription
- OriginalFilename
- ProductName
- InternalName
~/Desktop/out/$DEBUG=electron-packager electron-packager ~/code/electron-quick-start/ QuantumPilot --platform=all --icns="~/Desktop/QuantumPilot.icns"
-bash: =electron-packager: command not found
~/Desktop/out/DEBUG=electron-packager electron-packager ~/code/electron-quick-start/ QuantumPilot --platform=all --icns="~/Desktop/QuantumPilot.icns"
electron-packager Electron Packager 8.0.0 +0ms
electron-packager Node v6.9.4 +3ms
electron-packager Host Operating system: darwin (x64) +1ms
electron-packager Packager Options: {"_":["/Users/quantum/code/electron-quick-start/","QuantumPilot"],"all":false,"deref-symlinks":true,"download":{"strictSSL":true},"overwrite":false,"prune":true,"platform":"all","icns":"~/Desktop/QuantumPilot.icns","dir":"/Users/quantum/code/electron-quick-start/","name":"QuantumPilot","protocols":[]} +0ms
electron-packager Target Platforms: darwin, linux, mas, win32 +0ms
electron-packager Target Architectures: x64 +0ms
electron-packager Inferring app-version from version in package.json +13ms
electron-packager Inferring target Electron version from electron-prebuilt dependency or devDependency in package.json +2ms
electron-packager Application name: QuantumPilot +0ms
electron-packager Target Electron version: 0.36.11 +0ms
electron-packager Ignored path regular expressions: +0ms [ '/node_modules/electron($|/)',
'/node_modules/electron-prebuilt($|/)',
'/node_modules/electron-packager($|/)',
'/\\.git($|/)',
'/node_modules/\\.bin($|/)' ]
electron-packager Downloading Electron with options {"strictSSL":true,"platform":"darwin","arch":"x64","version":"0.36.11"} +5ms
Packaging app for platform darwin x64 using electron v0.36.11
electron-packager Creating /var/folders/zq/87m8hhn908b8pwtnnmmjq73h0000gn/T/electron-packager/darwin-x64-template +7ms
electron-packager Extracting /Users/quantum/.electron/electron-v0.36.11-darwin-x64.zip to /var/folders/zq/87m8hhn908b8pwtnnmmjq73h0000gn/T/electron-packager/darwin-x64-template +1ms
electron-packager Initializing app in /var/folders/zq/87m8hhn908b8pwtnnmmjq73h0000gn/T/electron-packager/darwin-x64/QuantumPilot-darwin-x64 from /var/folders/zq/87m8hhn908b8pwtnnmmjq73h0000gn/T/electron-packager/darwin-x64-template template +963ms
electron-packager Ignored paths based on the out param: +1ms [ '/Users/quantum/Desktop/out/QuantumPilot-darwin-ia32',
'/Users/quantum/Desktop/out/QuantumPilot-darwin-x64',
'/Users/quantum/Desktop/out/QuantumPilot-darwin-armv7l',
'/Users/quantum/Desktop/out/QuantumPilot-linux-ia32',
'/Users/quantum/Desktop/out/QuantumPilot-linux-x64',
'/Users/quantum/Desktop/out/QuantumPilot-linux-armv7l',
'/Users/quantum/Desktop/out/QuantumPilot-mas-ia32',
'/Users/quantum/Desktop/out/QuantumPilot-mas-x64',
'/Users/quantum/Desktop/out/QuantumPilot-mas-armv7l',
'/Users/quantum/Desktop/out/QuantumPilot-win32-ia32',
'/Users/quantum/Desktop/out/QuantumPilot-win32-x64',
'/Users/quantum/Desktop/out/QuantumPilot-win32-armv7l' ]
electron-packager Running npm prune --production +617ms
electron-packager Renaming Electron to QuantumPilot in /var/folders/zq/87m8hhn908b8pwtnnmmjq73h0000gn/T/electron-packager/darwin-x64/QuantumPilot-darwin-x64/Electron.app/Contents/MacOS +3s
electron-packager Renaming Electron Helper to QuantumPilot Helper in /var/folders/zq/87m8hhn908b8pwtnnmmjq73h0000gn/T/electron-packager/darwin-x64/QuantumPilot-darwin-x64/Electron.app/Contents/Frameworks/Electron Helper.app/Contents/MacOS +1ms
electron-packager Renaming Electron Helper.app to QuantumPilot Helper.app in /var/folders/zq/87m8hhn908b8pwtnnmmjq73h0000gn/T/electron-packager/darwin-x64/QuantumPilot-darwin-x64/Electron.app/Contents/Frameworks +0ms
electron-packager Renaming Electron Helper EH to QuantumPilot Helper EH in /var/folders/zq/87m8hhn908b8pwtnnmmjq73h0000gn/T/electron-packager/darwin-x64/QuantumPilot-darwin-x64/Electron.app/Contents/Frameworks/Electron Helper EH.app/Contents/MacOS +0ms
electron-packager Renaming Electron Helper EH.app to QuantumPilot Helper EH.app in /var/folders/zq/87m8hhn908b8pwtnnmmjq73h0000gn/T/electron-packager/darwin-x64/QuantumPilot-darwin-x64/Electron.app/Contents/Frameworks +0ms
electron-packager Renaming Electron Helper NP to QuantumPilot Helper NP in /var/folders/zq/87m8hhn908b8pwtnnmmjq73h0000gn/T/electron-packager/darwin-x64/QuantumPilot-darwin-x64/Electron.app/Contents/Frameworks/Electron Helper NP.app/Contents/MacOS +1ms
electron-packager Renaming Electron Helper NP.app to QuantumPilot Helper NP.app in /var/folders/zq/87m8hhn908b8pwtnnmmjq73h0000gn/T/electron-packager/darwin-x64/QuantumPilot-darwin-x64/Electron.app/Contents/Frameworks +0ms
electron-packager Moving /var/folders/zq/87m8hhn908b8pwtnnmmjq73h0000gn/T/electron-packager/darwin-x64/QuantumPilot-darwin-x64 to /Users/quantum/Desktop/out/QuantumPilot-darwin-x64 +0ms
electron-packager Downloading Electron with options {"strictSSL":true,"platform":"linux","arch":"x64","version":"0.36.11"} +1ms
Packaging app for platform linux x64 using electron v0.36.11
electron-packager Creating /var/folders/zq/87m8hhn908b8pwtnnmmjq73h0000gn/T/electron-packager/linux-x64-template +2ms
electron-packager Extracting /Users/quantum/.electron/electron-v0.36.11-linux-x64.zip to /var/folders/zq/87m8hhn908b8pwtnnmmjq73h0000gn/T/electron-packager/linux-x64-template +0ms
electron-packager Initializing app in /var/folders/zq/87m8hhn908b8pwtnnmmjq73h0000gn/T/electron-packager/linux-x64/QuantumPilot-linux-x64 from /var/folders/zq/87m8hhn908b8pwtnnmmjq73h0000gn/T/electron-packager/linux-x64-template template +748ms
electron-packager Ignored paths based on the out param: +1ms [ '/Users/quantum/Desktop/out/QuantumPilot-darwin-ia32',
'/Users/quantum/Desktop/out/QuantumPilot-darwin-x64',
'/Users/quantum/Desktop/out/QuantumPilot-darwin-armv7l',
'/Users/quantum/Desktop/out/QuantumPilot-linux-ia32',
'/Users/quantum/Desktop/out/QuantumPilot-linux-x64',
'/Users/quantum/Desktop/out/QuantumPilot-linux-armv7l',
'/Users/quantum/Desktop/out/QuantumPilot-mas-ia32',
'/Users/quantum/Desktop/out/QuantumPilot-mas-x64',
'/Users/quantum/Desktop/out/QuantumPilot-mas-armv7l',
'/Users/quantum/Desktop/out/QuantumPilot-win32-ia32',
'/Users/quantum/Desktop/out/QuantumPilot-win32-x64',
'/Users/quantum/Desktop/out/QuantumPilot-win32-armv7l' ]
electron-packager Running npm prune --production +624ms
electron-packager Renaming electron to QuantumPilot in /var/folders/zq/87m8hhn908b8pwtnnmmjq73h0000gn/T/electron-packager/linux-x64/QuantumPilot-linux-x64 +2s
electron-packager Moving /var/folders/zq/87m8hhn908b8pwtnnmmjq73h0000gn/T/electron-packager/linux-x64/QuantumPilot-linux-x64 to /Users/quantum/Desktop/out/QuantumPilot-linux-x64 +1ms
electron-packager Downloading Electron with options {"strictSSL":true,"platform":"mas","arch":"x64","version":"0.36.11"} +1ms
Packaging app for platform mas x64 using electron v0.36.11
electron-packager Creating /var/folders/zq/87m8hhn908b8pwtnnmmjq73h0000gn/T/electron-packager/mas-x64-template +3ms
electron-packager Extracting /Users/quantum/.electron/electron-v0.36.11-mas-x64.zip to /var/folders/zq/87m8hhn908b8pwtnnmmjq73h0000gn/T/electron-packager/mas-x64-template +1ms
electron-packager Initializing app in /var/folders/zq/87m8hhn908b8pwtnnmmjq73h0000gn/T/electron-packager/mas-x64/QuantumPilot-mas-x64 from /var/folders/zq/87m8hhn908b8pwtnnmmjq73h0000gn/T/electron-packager/mas-x64-template template +773ms
electron-packager Ignored paths based on the out param: +2ms [ '/Users/quantum/Desktop/out/QuantumPilot-darwin-ia32',
'/Users/quantum/Desktop/out/QuantumPilot-darwin-x64',
'/Users/quantum/Desktop/out/QuantumPilot-darwin-armv7l',
'/Users/quantum/Desktop/out/QuantumPilot-linux-ia32',
'/Users/quantum/Desktop/out/QuantumPilot-linux-x64',
'/Users/quantum/Desktop/out/QuantumPilot-linux-armv7l',
'/Users/quantum/Desktop/out/QuantumPilot-mas-ia32',
'/Users/quantum/Desktop/out/QuantumPilot-mas-x64',
'/Users/quantum/Desktop/out/QuantumPilot-mas-armv7l',
'/Users/quantum/Desktop/out/QuantumPilot-win32-ia32',
'/Users/quantum/Desktop/out/QuantumPilot-win32-x64',
'/Users/quantum/Desktop/out/QuantumPilot-win32-armv7l' ]
electron-packager Running npm prune --production +599ms
WARNING: signing is required for mas builds. Provide the osx-sign option, or manually sign the app later.
electron-packager Renaming Electron to QuantumPilot in /var/folders/zq/87m8hhn908b8pwtnnmmjq73h0000gn/T/electron-packager/mas-x64/QuantumPilot-mas-x64/Electron.app/Contents/MacOS +2s
electron-packager Renaming Electron Helper to QuantumPilot Helper in /var/folders/zq/87m8hhn908b8pwtnnmmjq73h0000gn/T/electron-packager/mas-x64/QuantumPilot-mas-x64/Electron.app/Contents/Frameworks/Electron Helper.app/Contents/MacOS +0ms
electron-packager Renaming Electron Helper.app to QuantumPilot Helper.app in /var/folders/zq/87m8hhn908b8pwtnnmmjq73h0000gn/T/electron-packager/mas-x64/QuantumPilot-mas-x64/Electron.app/Contents/Frameworks +1ms
electron-packager Renaming Electron Helper EH to QuantumPilot Helper EH in /var/folders/zq/87m8hhn908b8pwtnnmmjq73h0000gn/T/electron-packager/mas-x64/QuantumPilot-mas-x64/Electron.app/Contents/Frameworks/Electron Helper EH.app/Contents/MacOS +0ms
electron-packager Renaming Electron Helper EH.app to QuantumPilot Helper EH.app in /var/folders/zq/87m8hhn908b8pwtnnmmjq73h0000gn/T/electron-packager/mas-x64/QuantumPilot-mas-x64/Electron.app/Contents/Frameworks +0ms
electron-packager Renaming Electron Helper NP to QuantumPilot Helper NP in /var/folders/zq/87m8hhn908b8pwtnnmmjq73h0000gn/T/electron-packager/mas-x64/QuantumPilot-mas-x64/Electron.app/Contents/Frameworks/Electron Helper NP.app/Contents/MacOS +0ms
electron-packager Renaming Electron Helper NP.app to QuantumPilot Helper NP.app in /var/folders/zq/87m8hhn908b8pwtnnmmjq73h0000gn/T/electron-packager/mas-x64/QuantumPilot-mas-x64/Electron.app/Contents/Frameworks +0ms
electron-packager Moving /var/folders/zq/87m8hhn908b8pwtnnmmjq73h0000gn/T/electron-packager/mas-x64/QuantumPilot-mas-x64 to /Users/quantum/Desktop/out/QuantumPilot-mas-x64 +1ms
electron-packager Downloading Electron with options {"strictSSL":true,"platform":"win32","arch":"x64","version":"0.36.11"} +1ms
Packaging app for platform win32 x64 using electron v0.36.11
electron-packager Creating /var/folders/zq/87m8hhn908b8pwtnnmmjq73h0000gn/T/electron-packager/win32-x64-template +1ms
electron-packager Extracting /Users/quantum/.electron/electron-v0.36.11-win32-x64.zip to /var/folders/zq/87m8hhn908b8pwtnnmmjq73h0000gn/T/electron-packager/win32-x64-template +1ms
electron-packager Initializing app in /var/folders/zq/87m8hhn908b8pwtnnmmjq73h0000gn/T/electron-packager/win32-x64/QuantumPilot-win32-x64 from /var/folders/zq/87m8hhn908b8pwtnnmmjq73h0000gn/T/electron-packager/win32-x64-template template +926ms
electron-packager Ignored paths based on the out param: +1ms [ '/Users/quantum/Desktop/out/QuantumPilot-darwin-ia32',
'/Users/quantum/Desktop/out/QuantumPilot-darwin-x64',
'/Users/quantum/Desktop/out/QuantumPilot-darwin-armv7l',
'/Users/quantum/Desktop/out/QuantumPilot-linux-ia32',
'/Users/quantum/Desktop/out/QuantumPilot-linux-x64',
'/Users/quantum/Desktop/out/QuantumPilot-linux-armv7l',
'/Users/quantum/Desktop/out/QuantumPilot-mas-ia32',
'/Users/quantum/Desktop/out/QuantumPilot-mas-x64',
'/Users/quantum/Desktop/out/QuantumPilot-mas-armv7l',
'/Users/quantum/Desktop/out/QuantumPilot-win32-ia32',
'/Users/quantum/Desktop/out/QuantumPilot-win32-x64',
'/Users/quantum/Desktop/out/QuantumPilot-win32-armv7l' ]
electron-packager Running npm prune --production +591ms
electron-packager Renaming electron.exe to QuantumPilot.exe in /var/folders/zq/87m8hhn908b8pwtnnmmjq73h0000gn/T/electron-packager/win32-x64/QuantumPilot-win32-x64 +2s
electron-packager Running rcedit with the options {"version-string":{},"product-version":"1.0.0"} +0ms
electron-packager Moving /var/folders/zq/87m8hhn908b8pwtnnmmjq73h0000gn/T/electron-packager/win32-x64/QuantumPilot-win32-x64 to /Users/quantum/Desktop/out/QuantumPilot-win32-x64 +6s
Wrote new apps to:
/Users/quantum/Desktop/out/QuantumPilot-darwin-x64
/Users/quantum/Desktop/out/QuantumPilot-linux-x64
/Users/quantum/Desktop/out/Quantu

Oops. I copy/pasted incorrectly. You shouldn't use ~/Desktop in the icon parameter - the ~ won't be expanded (and the parameter name should be spelled correctly). Try using:
electron-packager ~/code/electron-quick-start/ QuantumPilot --platform=all --icon=/Users/quantum/Desktop/QuantumPilot.icns
_By the way, that is a pretty old version of Electron you're using._
How do I update electron? @malept
This worked btw! On OSX at least.. The windows icon still shows a brown "EXE" picture but I think that's just because of mac
Update the Electron version in package.json. Please keep in mind that this may change the Chromium and/or Node version if the major/minor versions change, so you may need to modify your app accordingly.
The default icon still shows when I launch the app during development. I'm not using a package installer at this stage. I'm just running npm start from the command line. Changing the app icon use to work but this morning I upgraded Electron to the latest version (1.7.9) and the default always shows. I'm running this on a Mac.
I simply replaced the electron.icns file with my custom icon. This file is located under:
/usr/local/lib/node_modules/electron/dist/Electron.app/Contents/Resources/electron.icns
Restarting the app or my computer didn't help either. Interestingly, if I click on:
/usr/local/lib/node_modules/electron/dist/Electron.app
the icon shows in Finder's preview pane although the default icon is showing in the left pane next to the app's executable. My custom icon also shows if you bring up the Info pane for the app.
UPDATE:
I was able to solve this. When I converted my png file to icns, my png was 512 x 512. I then increased the size to 1024 x 1024 and then converted it to icns. It appears that something changed in electron since my previous version of electron that now requires a higher resolution image.
I spent a whole day messing around with this , finally i found out that the tool seems to have a cache, and every time build always use the old icon. The way avoid the cache is to change your productName field in package.json , this will determine the package name generated , and the new icon will work.
Electron Packager does not have an icon cache, macOS does.
Most helpful comment
The default icon still shows when I launch the app during development. I'm not using a package installer at this stage. I'm just running npm start from the command line. Changing the app icon use to work but this morning I upgraded Electron to the latest version (1.7.9) and the default always shows. I'm running this on a Mac.
I simply replaced the electron.icns file with my custom icon. This file is located under:
/usr/local/lib/node_modules/electron/dist/Electron.app/Contents/Resources/electron.icns
Restarting the app or my computer didn't help either. Interestingly, if I click on:
/usr/local/lib/node_modules/electron/dist/Electron.app
the icon shows in Finder's preview pane although the default icon is showing in the left pane next to the app's executable. My custom icon also shows if you bring up the Info pane for the app.
UPDATE:
I was able to solve this. When I converted my png file to icns, my png was 512 x 512. I then increased the size to 1024 x 1024 and then converted it to icns. It appears that something changed in electron since my previous version of electron that now requires a higher resolution image.