electron / rcedit

Command line tool to edit resources of exe
MIT License
1.68k stars 185 forks source link

fix: cleanup old icons correctly. #109

Open chuckrector opened 2 years ago

chuckrector commented 2 years ago

This updates the correct field rather than assigning the new max icon ID to a local variable. Previously, if you had set an icon with ten images and then later set a new icon with only one image, nine old images would linger in the executable. If you revised your icon over time and reduced the number of images each time, old icons from multiple different passes would linger in the executable.

This bug was introduced by af37f5f which landed after the fix to a similar bug that was described in issue #27.

tttony commented 2 years ago

I tested this and keeps the old icon data, I'm updating a .NET exe with 10 icons and tried to add a new one with 4 icons in it and the file size increased of the new icon