Electron Packager - set App Icons for OSX & Windows
<p>I am building my electron application with electron packager for windows and OSX platform. </p>

<p><strong>package.json:</strong> </p>

<p><code>"build": "electron-packager . $npm_package_productName --out=dist --ignore='^/dist$' --prune --all --icon=icon.icns"</code></p>

<p>I run my build process with <code>npm run build</code>.</p>

<p><strong>Question:</strong></p>

<p>How can I use the electron packager script in my package.json to set the windows AND osx Icon?</p>

<p><strong>Problem:</strong></p>

<p>The above script sets the app icon for OSX only.<br>
It doesnt set the icon for the windows app (NPM throws failure). </p>

<p><strong>Solution:</strong></p>

<p>I had to install wine on my OSX. Otherwise it is not possible to build the windows exe with the --icon tag. Why? Because electron-packager uses node-rcedit for that, which requires wine.</p>

<p>in my package.json:</p>

<pre><code>"pack:osx": "electron-packager . $npm_package_productName --out=dist/osx --platform=darwin --arch=x64 --icon=assets/build/osx/icon.icns &amp;&amp; npm run codesign",
"pack:win32": "electron-packager . $npm_package_productName --out=dist/win --platform=win32 --arch=ia32",
"pack:win64": "electron-packager . $npm_package_productName --out=dist/win --platform=win32 --arch=x64 --version=0.36.2 app-version=1.0 --icon=assets/build/win/icon.ico",
"build": "npm run pack:osx &amp;&amp; npm run pack:win32 &amp;&amp; npm run pack:win64"
</code></pre>

<p><code>npm run build</code> to start the process..</p>