Possibility to add a custom icon on the generated package
I think it would be good if it can also add a custom icon for the exe file. I'm not sure if thats possible already but would be a good feature.
You can add resources (icon) to executables on Windows (ResourceHacker, etc) with pkg >4.0.
If you are asking about having a resource file that pkg can directly refer to it while building executable, may be @igorklopov can answer it.
@sharathbaddam yes it should be while building the executable. I haven't tried ResourceHacker myself, but would love to try it. Thanks for your suggestion.
Resource Hacker worked for me on pkg executables, however you have to make sure the ico you're using is a specific and valid size or the executable corrupts.
@sharathbaddam I don't understand the point you are making: since ResourceHacker is external to pkg and run after pkg has generated an executable, why would the version of pkg be important? why must it be > v4?
For osx: you can wrap the executable pkg makes in an app bundle like so and give it an icon that way. But if you're just scripting, it might be easier to just package the js itself like so...
@tonywoode I was referring to this issue #91 when i said pkg > v4.
thanks - yes my comments above about Resource Hacker should now be redundant then...great!
Need help in setting the customized icon during packaging on windows using pkg.
I am packaging node service into exe using pkg (pkg package.json --output ./dist/test.exe) It sets the icon as nodejs icon. I also tried with pkg package.json --icon ./src/testIcon.ico --output ./dist/test.exe But still it sets the icon as default nodejs icon.
Can you please help in setting the customized icon while packaging using pkg.
I tried with ResourceHacker, it corrupts my exe.
@soniagandhi please understand that to "overwrite" the current iconset, you need to prepare an "iconset.ico" with the same "dimensions" (otherwise you'll overwrite also part of the real executable, corrupting it).
Currently the default "iconset.ico" is composed by the following dimensions:
- 16x16
- 32x32
- 48x48
- 64x64
- 128x128
If you create a new "iconset.ico"with different dimensions you corrupt the executable.
I used the following URL to create an "iconset.ico" with the correct dimensions.
After creating a correct "iconset.ico" I changed the icon using node-resourcehacker For example:
...
resourceHacker({
operation: 'addoverwrite',
input: 'PathToOriginalExe',
output: 'PatToUpdatedExe',
resource: 'PathToNew_iconset.ico',
resourceType: 'ICONGROUP',
resourceName: '1'
},
error => {
... callback to call when everything is done ...
}
);
I hope this can help you!
P.S. the ability to configure icon/details just using directly pkg would be very nice!
This is possible if you edit the node base binary in .pkg-cache with ResourceHacker (not the executable) and then build your app again.
You can also edit stuff like manufacturer, etc. (Version Info).
The cache folder should be located in C:\Users\<username>\.pkg-cache\<version>\ be sure to edit the node binary, that you specified in --targets.
This was initially discussed here.
This issue is stale because it has been open 90 days with no activity. Remove the stale label or comment or this will be closed in 5 days. To ignore this issue entirely you can add the no-stale label
This issue is now closed due to inactivity, you can of course reopen or reference this issue if you see fit.
This is possible if you edit the node base binary in
.pkg-cachewith ResourceHacker (not the executable) and then build your app again. You can also edit stuff like manufacturer, etc. (Version Info). The cache folder should be located inC:\Users\<username>\.pkg-cache\<version>\be sure to edit the node binary, that you specified in --targets. This was initially discussed here.
But the binary gets replaced as soon as you run the pkg command, since it downloads a new version of it. Thus reverting back to the green icon.
I only managed to change the icon in recent versions using the Icon Maker - Icon Changer software. It seems there is a new 256x256 dimension which messed things
I only managed to change the icon in recent versions using the Icon Maker - Icon Changer software. It seems there is a new 256x256 dimension which messed things
Hey, may I have the link of these softwares you are using? Thank you.
It would be wonderful if we could just remove the Node icon. In most cases I think it's better not to have an icon than to have the Node icon
I only managed to change the icon in recent versions using the Icon Maker - Icon Changer software. It seems there is a new 256x256 dimension which messed things
Hey, may I have the link of these softwares you are using? Thank you.
This one https://www.icon-maker.com/download.htm
@soniagandhi please understand that to "overwrite" the current iconset, you need to prepare an "iconset.ico" with the same "dimensions" (otherwise you'll overwrite also part of the real executable, corrupting it).
Currently the default "iconset.ico" is composed by the following dimensions:
- 16x16
- 32x32
- 48x48
- 64x64
- 128x128
If you create a new "iconset.ico"with different dimensions you corrupt the executable.
I used the following URL to create an "iconset.ico" with the correct dimensions.
After creating a correct "iconset.ico" I changed the icon using node-resourcehacker For example:
... resourceHacker({ operation: 'addoverwrite', input: 'PathToOriginalExe', output: 'PatToUpdatedExe', resource: 'PathToNew_iconset.ico', resourceType: 'ICONGROUP', resourceName: '1' }, error => { ... callback to call when everything is done ... } );I hope this can help you!
P.S. the ability to configure icon/details just using directly pkg would be very nice!
What do I put in input and output ?
@soniagandhi please understand that to "overwrite" the current iconset, you need to prepare an "iconset.ico" with the same "dimensions" (otherwise you'll overwrite also part of the real executable, corrupting it). Currently the default "iconset.ico" is composed by the following dimensions:
- 16x16
- 32x32
- 48x48
- 64x64
- 128x128
If you create a new "iconset.ico"with different dimensions you corrupt the executable. I used the following URL to create an "iconset.ico" with the correct dimensions. After creating a correct "iconset.ico" I changed the icon using node-resourcehacker For example:
... resourceHacker({ operation: 'addoverwrite', input: 'PathToOriginalExe', output: 'PatToUpdatedExe', resource: 'PathToNew_iconset.ico', resourceType: 'ICONGROUP', resourceName: '1' }, error => { ... callback to call when everything is done ... } );I hope this can help you! P.S. the ability to configure icon/details just using directly pkg would be very nice!
What do I put in
inputandoutput?
You can put the path where you want to print.
Example, input -> Put the path to keep original exe "./original" output -> Updated exe file "./updated"
So you need to mkdir them first.
ok thanks @cayank !
ok thanks @cayank !
You're welcome.
Hello @cayank, Using your method in changing the compiled pkg icon doesn't seem to work. :/