rcedit icon indicating copy to clipboard operation
rcedit copied to clipboard

doesn't work with .NET exe/dll files

Open Vasilich opened this issue 8 years ago • 6 comments

i have tested with several files written in c# - this tool just removes all strings from such files, leaving only VersionInfo binary block.

Vasilich avatar Jun 27 '16 23:06 Vasilich

I'm having this problem, too. I've been trying to figure out why this is happening and fix it as well.

I think the problem is with serializing the data to be written out. There seem to be false assumptions being made in ResourceUpdater::SerializeVersionInfo regarding the order of values in the VersionStampValues reference that is passed into the method. Specifically, the method assumes that the StringFileInfo always comes before VarFileInfo, whereas in the .NET executable I tried it with, VarFileInfo comes before StringFileInfo, so the serialization method messes up.

RaptDept avatar Jul 18 '16 15:07 RaptDept

Fixed by #26 and released in 0.6.0.

kevinsawicki avatar Aug 18 '16 20:08 kevinsawicki

I don't think this is 100% fixed. It no longer clears everything out when setting the icon but it does still clear out any previous file description when only setting the icon.

smbecker avatar Aug 18 '16 20:08 smbecker

@smbecker can you provide the command you are running?

kevinsawicki avatar Aug 18 '16 20:08 kevinsawicki

I am using the programmatic API

rcedit(exePath, {
    icon: iconPath
}, cb);

smbecker avatar Aug 19 '16 12:08 smbecker

@smbecker Did you ever resolve your issue? I can't reproduce it.

This is what I tried:

I created a very simple .rc file with version information in it which includes a file description. I also included a string table entry for good measure. I compiled it with the standard Windows resource compiler. I added it to a .NET executable by compiling a very simple C# program with /win32res:<file>. I confirmed that the file description was present in the file via https://github.com/katahiromz/RisohEditor. I created a Node.js project, installed rcedit via npm, and then added an .ico file to that executable with the programmatic API. After examining the executable with RisohEditor again, I see that all of the icons are added. However, the file description in the version information and the string table remain intact.

Is this a valid way to test the issue? If not, can you provide more details? For example, alternate steps or a link to a project which suffered from the issue.

Thank you!

chuckrector avatar Jan 24 '22 21:01 chuckrector