You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2020/12/02 14:31:30 UTC

[GitHub] [cordova-electron] Jahrenski commented on issue #97: Windows icons not set

Jahrenski commented on issue #97:
URL: https://github.com/apache/cordova-electron/issues/97#issuecomment-737265760


   To fix this problem I use this custom hook :
   
   ```
   module.exports = function(context) {
     
     console.log('[HACK] Copy of all electron icons');
   
     //Prevent this running for other platforms.
     if ( context.opts.platforms.indexOf('electron') < 0 ) {
       return;
     }
   
     var fs   = require('fs'),
         path = require('path')
   
     const iconsPath = path.join(context.opts.projectRoot, 'resources/electron/icon/icon.png');
     const destination = path.join(context.opts.projectRoot, 'platforms/electron/build-res/icon.png');
   
     fs.createReadStream(iconsPath).pipe(fs.createWriteStream(destination));
   };
   ```
   
   And then call it from your Config.xml file
   
   ```
   <platform name="electron">
           <hook src="hooks/copy-icons.js" type="after_prepare" />
           <icon src="resources/electron/icon/icon.png" />
   </platform>
   ```
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org