右键单击 DLL 中的版本资源不可见
我正在尝试做一些在常规 MSVC 中很容易完成但在 VC++ Express 中不容易支持的事情。
VC++ Express 中没有资源编辑器。 因此,我将一个名为 version.rc 的文件添加到我的 DLL 项目中。 该文件具有以下内容,由资源编译器编译并添加到最终的DLL中。 使用 reshacker 可在 DLL 中查看此资源,但在 Windows 资源管理器中右键单击 DLL 时则看不到该资源。
我的 RC 文件中缺少什么才能使其在右键单击时出现?
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,1
PRODUCTVERSION 1,0,0,1
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "FileDescription", "something Application"
VALUE "FileVersion", "1, 0, 0, 1"
VALUE "InternalName", "something"
VALUE "LegalCopyright", "Copyright (C) 2008 Somebody"
VALUE "OriginalFilename", "something.exe"
VALUE "ProductName", "something Application"
VALUE "ProductVersion", "1, 0, 0, 1"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
I'm trying to do something which is very easy to do in the regular MSVC, but not supported easily in VC++ Express.
There is no resource editor in VC++ Express. So I added a file named version.rc into my DLL project. The file has the below content, which is compiled by the resource compiler and added to the final DLL. This resource is viewable in the DLL using reshacker, though not when right-clicking the DLL in Windows Explorer.
What is missing from my RC file to make it appear when right-clicking?
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,1
PRODUCTVERSION 1,0,0,1
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "FileDescription", "something Application"
VALUE "FileVersion", "1, 0, 0, 1"
VALUE "InternalName", "something"
VALUE "LegalCopyright", "Copyright (C) 2008 Somebody"
VALUE "OriginalFilename", "something.exe"
VALUE "ProductName", "something Application"
VALUE "ProductVersion", "1, 0, 0, 1"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我能够(使用 reshacker)看到我的资源和右键单击时出现的资源之间的一个区别,那就是资源的名称。 所以我把VS_VERSION_INFO改为1; 现在右键单击该资源即可看到。
I was able to see (using reshacker) one difference between my resource and resources that appear on right-click, and that was the name of the resource. So I changed VS_VERSION_INFO to 1; and now the resource is visible on right-click.
正确的解决方案是添加到 .rc 文件的顶部:
The correct solution is to add to the top of your .rc file:
尝试将您的资源更改为
和
:
Try changing your resources to:
and
and
我将根据以下内容扩展@Stefan的答案:StringFileInfo BLOCK语句< /a>
我的情况是我使用了错误的
lang-charset
,这就是版本详细信息未显示版本信息的原因,这是正确的一:此处语言代码列表和字符集
I will expand @Stefan answer, according to: StringFileInfo BLOCK statement
My case is that I was using the wrong
lang-charset
and that's why the version details was not showing the version info, this is the correct one:Here the list of language codes and character set