I'm currently developing a .NET project which uses CSharpCodeProvider to build an executable during runtime.

I would like to show some custom values in Properties/Details tab of the built exe so I did a lot of research on the topic. I found out that these values are read by Windows Explorer shell from resources embedded in the executable. Next steps were to create a .RC file according to specification, adding my custom values in the StringFileInfo section, compiling it to .RES using Resource Compiler from MS and then embedding it into exe using /win32res compiler option (it is just like opening Project Properties and choosing .RES file on the Application tab in Visual Studio).

I thought that this will be a pretty working solution - but unfortunatelly it isn't. My Windows 7 Explorer shell isn't showing custom values... What I did wrong? Is it possible to achieve this that way at all?

EDIT: My .RC file content is here.

有帮助吗?

解决方案

Windows will not display your custom values in the details pane of the properties dialog. The values that are displayed are hard-coded in the shell and the shell simply will not parse your resource and look for values that it knows nothing about. So, what you are attempting to do is doomed to failure I am afraid.

As an aside, you do need to null-terminate strings in your resource script. So instead of:

VALUE "FileDescription", "Test file"
VALUE "FileVersion", "1.0.0.0"
// etc.

you need:

VALUE "FileDescription", "Test file\0"
VALUE "FileVersion", "1.0.0.0\0"
// etc.
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top