admin管理员组文章数量:1293886
There are lots of questions relating to setting icons using electron-packager
but none of the answers have worked for me – maybe the answers are out of date or not clear – but I need to ask again.
I am building on OSX for OSX & Windows. I've tried at least 20 variations on specifying the icon for electron-packager
(the full cmd set is below). I've tried referencing icons withing the app folder (app/assets/WIN_logo.icns) as well as in an "icons" folder at the project root (icons/assets/WIN_logo.icns); I've tried using quotation marks, leaving off the extension and other stuff I can't even recall.
So please, can someone tell me, given the directory structure below, how I specify the icon for electron-packager
to use.
-icon=assets/WIN_logo.icns
-icon=assets/WIN_logo.ico
"package-mac": "electron-packager . --overwrite --tmpdir=false --platform=darwin --arch=x64 --prune=true --out=release-builds -icon=assets/WIN_logo.icns",
"package-win": "electron-packager . --overwrite --tmpdir=false --platform=win32 --arch=ia32 --asar=true --prune=true --out=release-builds -icon=assets/WIN_logo.ico"
There are lots of questions relating to setting icons using electron-packager
but none of the answers have worked for me – maybe the answers are out of date or not clear – but I need to ask again.
I am building on OSX for OSX & Windows. I've tried at least 20 variations on specifying the icon for electron-packager
(the full cmd set is below). I've tried referencing icons withing the app folder (app/assets/WIN_logo.icns) as well as in an "icons" folder at the project root (icons/assets/WIN_logo.icns); I've tried using quotation marks, leaving off the extension and other stuff I can't even recall.
So please, can someone tell me, given the directory structure below, how I specify the icon for electron-packager
to use.
-icon=assets/WIN_logo.icns
-icon=assets/WIN_logo.ico
"package-mac": "electron-packager . --overwrite --tmpdir=false --platform=darwin --arch=x64 --prune=true --out=release-builds -icon=assets/WIN_logo.icns",
"package-win": "electron-packager . --overwrite --tmpdir=false --platform=win32 --arch=ia32 --asar=true --prune=true --out=release-builds -icon=assets/WIN_logo.ico"
Share
Improve this question
asked Feb 14, 2017 at 21:20
springspring
18.5k17 gold badges86 silver badges167 bronze badges
3 Answers
Reset to default 5For mac
1/ verify that the name of the icon is icon.icns 2/ verify that the icon size is at least 512x512px 3/ change --out=release-builds by --out=build
For windows
1/ verify that the name of the icon is icon.ico 2/ verify that the icon size is at least 256x256px 3/ change --out=release-builds by --out=build
source : https://www.electron.build/icons
these steps works for me.
Change -icon=assets/...
to --icon=./assets/...
The icon argument should have two hyphens at the start and the path should start with ./
.
[1] Icon path: The icon path is not relative to the project directory, but to the current location. (For me, the problem was that I assumed the former, as I thought it made sense with less redundancy.) In any case, one has to run either:
electron-packager projectDirPath outputName ... --icon=projectDirPath/iconPath/icon.png
Or if you are in the project directory:
electron-packager . outputName ... --icon=iconPath/icon.png
[2] Icon format: For macOS, both icon.png and icon.icns is accepted. For Windows, both icon.png and icon.ico is accepted.
[3] Icon size: For macOS, the dimensions must be at least 512x512px. For Windows, the dimensions must be at least 256x256px.
本文标签: javascriptElectronpackager not setting iconsStack Overflow
版权声明:本文标题:javascript - Electron-packager not setting icons - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741592462a2387207.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论