change the .exe file icon in pkg library

Viewed 2416

I have mean stack app to create executable file by using npm pkg. It converted successfully (and is running too). After changing icon and version of .exe file using rcedit library or resource hacker, file is not running properly and it throws an error like pkg: Error reading from file

Please guide me to change icon of .exe file

2 Answers

You need to using pkg version 4.3.6.

You can use node-recedit for editing Windows Executable.

Example:

const rcedit = require('rcedit')

async rcedit("./myExecutable.exe", {
  icon: "./myIcon.ico"
})

here myExecutable.exe should be replaced by path to your .exe file, and myIcon.ico is the icon you want to use in .ico format.

Note - rcedit only works for windows executables.

Related