windows 如何设置现有 .exe、.dll 的版本信息?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/284258/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do I set the version information for an existing .exe, .dll?
提问by Carl
As part of our build process I need to set the version information for all of our compiled binaries. Some of the binaries already have version information (added at compile time) and some do not.
作为我们构建过程的一部分,我需要为所有编译的二进制文件设置版本信息。有些二进制文件已经有版本信息(在编译时添加),有些没有。
I want to be able to apply the following information:
我希望能够应用以下信息:
- Company Name
- Copyright Notice
- Product Name
- Product Description
- File Version
- Product Version
- 公司名
- 版权声明
- 产品名称
- 产品描述
- 文件版本
- 产品版本
All of these attributes are specified by the build script and must be applied after compilation. These are standard binaries (not assemblies) compiled with C++ Builder 2007.
所有这些属性都由构建脚本指定,并且必须在编译后应用。这些是使用 C++ Builder 2007 编译的标准二进制文件(不是程序集)。
How can I do this?
我怎样才能做到这一点?
回答by UweBaemayr
While it's not a batch process, Visual Studio can also add/edit file resources.
虽然它不是批处理,但 Visual Studio 也可以添加/编辑文件资源。
Just use File->Open->File on the .EXE or .DLL. This is handy for fixing version information post-build, or adding it to files that don't have these resources to begin with.
只需在 .EXE 或 .DLL 上使用 File->Open->File。这对于在构建后修复版本信息或将其添加到没有这些资源的文件中非常方便。
回答by Danny Beckett
Unlike many of the other answers, this solution uses completely free software.
与许多其他答案不同,该解决方案使用完全免费的软件。
Firstly, create a file called Resources.rc
like this:
首先,创建一个名为Resources.rc
这样的文件:
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,0
PRODUCTVERSION 1,0,0,0
{
BLOCK "StringFileInfo"
{
BLOCK "040904b0"
{
VALUE "CompanyName", "ACME Inc.GoRC /fo Resources.res Resources.rc
"
VALUE "FileDescription", "MyProgResHacker -add MyProg.exe, MyProg.exe, Resources.res,,,
"
VALUE "FileVersion", "1.0.0.0$ rcedit "path-to-exe-or-dll" --set-version-string "Comments" "This is an exe"
$ rcedit "path-to-exe-or-dll" --set-file-version "10.7"
$ rcedit "path-to-exe-or-dll" --set-product-version "10.7"
"
VALUE "LegalCopyright", "? 2013 ACME Inc. All Rights Reservedverpatch /va foodll.dll %VERSION% %FILEDESCR% %COMPINFO% %PRODINFO% %BUILDINFO%
"
VALUE "OriginalFilename", "MyProg.exe#ifndef VERSION_H
#define VERSION_H
#define VER_FILEVERSION 0,3,0,0
#define VER_FILEVERSION_STR "0.3.0.0#include <windows.h>
#include "version.h"
VS_VERSION_INFO VERSIONINFO
FILEVERSION VER_FILEVERSION
PRODUCTVERSION VER_PRODUCTVERSION
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
BEGIN
VALUE "CompanyName", VER_COMPANYNAME_STR
VALUE "FileDescription", VER_FILEDESCRIPTION_STR
VALUE "FileVersion", VER_FILEVERSION_STR
VALUE "InternalName", VER_INTERNALNAME_STR
VALUE "LegalCopyright", VER_LEGALCOPYRIGHT_STR
VALUE "LegalTrademarks1", VER_LEGALTRADEMARKS1_STR
VALUE "LegalTrademarks2", VER_LEGALTRADEMARKS2_STR
VALUE "OriginalFilename", VER_ORIGINALFILENAME_STR
VALUE "ProductName", VER_PRODUCTNAME_STR
VALUE "ProductVersion", VER_PRODUCTVERSION_STR
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1252
END
END
"
#define VER_PRODUCTVERSION 0,3,0,0
#define VER_PRODUCTVERSION_STR "0.3.0.0e:\Work\Dev\StackOverflow\q000284258> sopr.bat
*** Set shorter prompt to better fit when pasted in StackOverflow (or other) pages ***
[prompt]> dir
Volume in drive E is Work
Volume Serial Number is 3655-6FED
Directory of e:\Work\Dev\StackOverflow\q000284258
2019-01-28 20:09 <DIR> .
2019-01-28 20:09 <DIR> ..
2016-11-03 09:17 5,413,376 cmake.exe
2019-01-03 02:06 5,479,424 ResourceHacker.exe
2019-01-28 20:30 496 ResourceHacker.ini
3 File(s) 10,893,296 bytes
2 Dir(s) 103,723,261,952 bytes free
[prompt]> set PATH=%PATH%;c:\Install\x64\CMake\CMake.6.3\bin
[prompt]> .\cmake --help >nul 2>&1
[prompt]> echo %errorlevel%
0
[prompt]> .\ResourceHacker.exe -help
[prompt]>
==================================
Resource Hacker Command Line Help:
==================================
-help : displays these abbreviated help instructions.
-help commandline : displays help for single commandline instructions
-help script : displays help for script file instructions.
[prompt]> echo %errorlevel%
0
"
#define VER_COMPANYNAME_STR "IPanera"
#define VER_FILEDESCRIPTION_STR "Localiza archivos duplicados"
#define VER_INTERNALNAME_STR "MyProject"
#define VER_LEGALCOPYRIGHT_STR "Copyright 2016 [email protected]"
#define VER_LEGALTRADEMARKS1_STR "All Rights Reserved"
#define VER_LEGALTRADEMARKS2_STR VER_LEGALTRADEMARKS1_STR
#define VER_ORIGINALFILENAME_STR "MyProject.exe"
#define VER_PRODUCTNAME_STR "My project"
#define VER_COMPANYDOMAIN_STR "www.myurl.com"
#endif // VERSION_H
"
VALUE "ProductName", "My Programe:\Work\Dev\StackOverflow\q000284258> sopr.bat
*** Set shorter prompt to better fit when pasted in StackOverflow (or other) pages ***
[prompt]> dir
Volume in drive E is Work
Volume Serial Number is 3655-6FED
Directory of e:\Work\Dev\StackOverflow\q000284258
2019-01-28 20:09 <DIR> .
2019-01-28 20:09 <DIR> ..
2016-11-03 09:17 5,413,376 cmake.exe
2019-01-03 02:06 5,479,424 ResourceHacker.exe
2019-01-28 20:30 496 ResourceHacker.ini
3 File(s) 10,893,296 bytes
2 Dir(s) 103,723,261,952 bytes free
[prompt]> set PATH=%PATH%;c:\Install\x64\CMake\CMake.6.3\bin
[prompt]> .\cmake --help >nul 2>&1
[prompt]> echo %errorlevel%
0
[prompt]> .\ResourceHacker.exe -help
[prompt]>
==================================
Resource Hacker Command Line Help:
==================================
-help : displays these abbreviated help instructions.
-help commandline : displays help for single commandline instructions
-help script : displays help for script file instructions.
[prompt]> echo %errorlevel%
0
"
VALUE "ProductVersion", "1.0.0.0[prompt]> :: Extract the resources into a file
[prompt]> .\ResourceHacker.exe -open .\ResourceHacker.exe -save .\sample.rc -action extract -mask VersionInfo,, -log con
[prompt]>
[28 Jan 2019, 20:58:03]
Current Directory:
e:\Work\Dev\StackOverflow\q000284258
Commandline:
.\ResourceHacker.exe -open .\ResourceHacker.exe -save .\sample.rc -action extract -mask VersionInfo,, -log con
Open : e:\Work\Dev\StackOverflow\q000284258\ResourceHacker.exe
Save : e:\Work\Dev\StackOverflow\q000284258\sample.rc
Success!
[prompt]> :: Modify the resource file and set our own values
[prompt]>
[prompt]> :: Compile the resource file
[prompt]> .\ResourceHacker.exe -open .\sample.rc -save .\sample.res -action compile -log con
[prompt]>
[28 Jan 2019, 20:59:51]
Current Directory:
e:\Work\Dev\StackOverflow\q000284258
Commandline:
.\ResourceHacker.exe -open .\sample.rc -save .\sample.res -action compile -log con
Open : e:\Work\Dev\StackOverflow\q000284258\sample.rc
Save : e:\Work\Dev\StackOverflow\q000284258\sample.res
Compiling: e:\Work\Dev\StackOverflow\q000284258\sample.rc
Success!
[prompt]> dir /b
cmake.exe
ResourceHacker.exe
ResourceHacker.ini
sample.rc
sample.res
"
}
}
BLOCK "VarFileInfo"
{
VALUE "Translation", 0x409, 1200
}
}
Next, use GoRCto compile it to a .res
file using:
接下来,使用GoRC将其编译为.res
文件:
[prompt]> :: Extract the resources into a file
[prompt]> .\ResourceHacker.exe -open .\ResourceHacker.exe -save .\sample.rc -action extract -mask VersionInfo,, -log con
[prompt]>
[28 Jan 2019, 20:58:03]
Current Directory:
e:\Work\Dev\StackOverflow\q000284258
Commandline:
.\ResourceHacker.exe -open .\ResourceHacker.exe -save .\sample.rc -action extract -mask VersionInfo,, -log con
Open : e:\Work\Dev\StackOverflow\q000284258\ResourceHacker.exe
Save : e:\Work\Dev\StackOverflow\q000284258\sample.rc
Success!
[prompt]> :: Modify the resource file and set our own values
[prompt]>
[prompt]> :: Compile the resource file
[prompt]> .\ResourceHacker.exe -open .\sample.rc -save .\sample.res -action compile -log con
[prompt]>
[28 Jan 2019, 20:59:51]
Current Directory:
e:\Work\Dev\StackOverflow\q000284258
Commandline:
.\ResourceHacker.exe -open .\sample.rc -save .\sample.res -action compile -log con
Open : e:\Work\Dev\StackOverflow\q000284258\sample.rc
Save : e:\Work\Dev\StackOverflow\q000284258\sample.res
Compiling: e:\Work\Dev\StackOverflow\q000284258\sample.rc
Success!
[prompt]> dir /b
cmake.exe
ResourceHacker.exe
ResourceHacker.ini
sample.rc
sample.res
(see my comment below for a mirror of GoRC.exe
)
(有关 的镜像,请参阅下面的评论GoRC.exe
)
Then use Resource Hackerin CLI mode to add it to an existing .exe
:
然后在 CLI 模式下使用Resource Hacker将其添加到现有的.exe
:
1 VERSIONINFO
FILEVERSION 3,1,4,1592
PRODUCTVERSION 2,7,1,8
FILEOS 0x4
FILETYPE 0x1
{
BLOCK "StringFileInfo"
{
BLOCK "040904E4"
{
VALUE "CompanyName", "Cristi Fati[prompt]> .\ResourceHacker.exe -open .\cmake.exe -save .\cmake.exe -res .\sample.res -action addoverwrite -mask VersionInfo,, -log con
[prompt]>
[28 Jan 2019, 21:17:19]
Current Directory:
e:\Work\Dev\StackOverflow\q000284258
Commandline:
.\ResourceHacker.exe -open .\cmake.exe -save .\cmake.exe -res .\sample.res -action addoverwrite -mask VersionInfo,, -log con
Open : e:\Work\Dev\StackOverflow\q000284258\cmake.exe
Save : e:\Work\Dev\StackOverflow\q000284258\cmake.exe
Resource: e:\Work\Dev\StackOverflow\q000284258\sample.res
Added: VERSIONINFO,1,1033
Success!
[prompt]> copy ResourceHacker.exe ResourceHackerTemp.exe
1 file(s) copied.
[prompt]> .\ResourceHackerTemp.exe -open .\ResourceHacker.exe -save .\ResourceHacker.exe -res .\sample.res -action addoverwrite -mask VersionInfo,, -log con
[prompt]>
[28 Jan 2019, 21:19:29]
Current Directory:
e:\Work\Dev\StackOverflow\q000284258
Commandline:
.\ResourceHackerTemp.exe -open .\ResourceHacker.exe -save .\ResourceHacker.exe -res .\sample.res -action addoverwrite -mask VersionInfo,, -log con
Open : e:\Work\Dev\StackOverflow\q000284258\ResourceHacker.exe
Save : e:\Work\Dev\StackOverflow\q000284258\ResourceHacker.exe
Resource: e:\Work\Dev\StackOverflow\q000284258\sample.res
Modified: VERSIONINFO,1,1033
Success!
[prompt]> del /f /q ResourceHackerTemp.*
[prompt]> dir
Volume in drive E is Work
Volume Serial Number is 3655-6FED
Directory of e:\Work\Dev\StackOverflow\q000284258
2019-01-28 21:20 <DIR> .
2019-01-28 21:20 <DIR> ..
2016-11-03 09:17 5,414,400 cmake.exe
2019-01-03 02:06 5,479,424 ResourceHacker.exe
2019-01-28 21:17 551 ResourceHacker.ini
2019-01-28 20:05 1,156 sample.rc
2019-01-28 20:59 792 sample.res
5 File(s) 10,896,323 bytes
2 Dir(s) 103,723,253,760 bytes free
"
VALUE "FileDescription", "20190128 - SO q000284258 demo[prompt]> .\ResourceHacker.exe -open .\cmake.exe -save .\cmake.exe -res .\sample.res -action addoverwrite -mask VersionInfo,, -log con
[prompt]>
[28 Jan 2019, 21:17:19]
Current Directory:
e:\Work\Dev\StackOverflow\q000284258
Commandline:
.\ResourceHacker.exe -open .\cmake.exe -save .\cmake.exe -res .\sample.res -action addoverwrite -mask VersionInfo,, -log con
Open : e:\Work\Dev\StackOverflow\q000284258\cmake.exe
Save : e:\Work\Dev\StackOverflow\q000284258\cmake.exe
Resource: e:\Work\Dev\StackOverflow\q000284258\sample.res
Added: VERSIONINFO,1,1033
Success!
[prompt]> copy ResourceHacker.exe ResourceHackerTemp.exe
1 file(s) copied.
[prompt]> .\ResourceHackerTemp.exe -open .\ResourceHacker.exe -save .\ResourceHacker.exe -res .\sample.res -action addoverwrite -mask VersionInfo,, -log con
[prompt]>
[28 Jan 2019, 21:19:29]
Current Directory:
e:\Work\Dev\StackOverflow\q000284258
Commandline:
.\ResourceHackerTemp.exe -open .\ResourceHacker.exe -save .\ResourceHacker.exe -res .\sample.res -action addoverwrite -mask VersionInfo,, -log con
Open : e:\Work\Dev\StackOverflow\q000284258\ResourceHacker.exe
Save : e:\Work\Dev\StackOverflow\q000284258\ResourceHacker.exe
Resource: e:\Work\Dev\StackOverflow\q000284258\sample.res
Modified: VERSIONINFO,1,1033
Success!
[prompt]> del /f /q ResourceHackerTemp.*
[prompt]> dir
Volume in drive E is Work
Volume Serial Number is 3655-6FED
Directory of e:\Work\Dev\StackOverflow\q000284258
2019-01-28 21:20 <DIR> .
2019-01-28 21:20 <DIR> ..
2016-11-03 09:17 5,414,400 cmake.exe
2019-01-03 02:06 5,479,424 ResourceHacker.exe
2019-01-28 21:17 551 ResourceHacker.ini
2019-01-28 20:05 1,156 sample.rc
2019-01-28 20:59 792 sample.res
5 File(s) 10,896,323 bytes
2 Dir(s) 103,723,253,760 bytes free
"
VALUE "FileVersion", "3.1.4.1592[prompt]> .\cmake --help >nul 2>&1
[prompt]> echo %errorlevel%
0
[prompt]> .\ResourceHacker.exe -help
[prompt]>
==================================
Resource Hacker Command Line Help:
==================================
-help : displays these abbreviated help instructions.
-help commandline : displays help for single commandline instructions
-help script : displays help for script file instructions.
[prompt]> echo %errorlevel%
0
"
VALUE "ProductName", "Colonel Panic[prompt]> .\cmake --help >nul 2>&1
[prompt]> echo %errorlevel%
0
[prompt]> .\ResourceHacker.exe -help
[prompt]>
==================================
Resource Hacker Command Line Help:
==================================
-help : displays these abbreviated help instructions.
-help commandline : displays help for single commandline instructions
-help script : displays help for script file instructions.
[prompt]> echo %errorlevel%
0
"
VALUE "InternalName", "100##代码##"
VALUE "LegalCopyright", "(c) Cristi Fati 1999-2999##代码##"
VALUE "OriginalFilename", "ResHack##代码##"
VALUE "ProductVersion", "2.7.1.8##代码##"
}
}
BLOCK "VarFileInfo"
{
VALUE "Translation", 0x0409 0x04E4
}
}
That's it!
就是这样!
回答by Ryan
Or you could check out the freeware StampVerfor Win32 exe/dll files.
It will only change the file and product versions though if they have a version resource already. It cannot add a version resource if one doesn't exist.
或者您可以查看Win32 exe/dll 文件的免费软件StampVer。
如果文件和产品版本已经有版本资源,它只会更改文件和产品版本。如果版本资源不存在,则无法添加版本资源。
回答by a paid nerd
rceditis relative new and works well from the command line: https://github.com/atom/rcedit
rcedit相对较新,在命令行中运行良好:https: //github.com/atom/rcedit
##代码##There's also an NPM modulewhich wraps it from JavaScript and a Grunt taskin case you're using Grunt.
回答by filofel
回答by Otherside
There is this tool ChangeVersion[1]
有这个工具ChangeVersion [1]
List of features (from the website):
功能列表(来自网站):
- command line interface
- support for .EXE, .DLL and .RES files
- update FileVersion and ProductVersion based on a version mask
- add/change/remove version key strings
- adjust file flags (debug, special, private etc)
- update project files ( .bdsproj | .bpr | .bpk | .dproj )
- add/change main application icon
- use ini file with configuration
- Windows Vista support (needs elevation)
- easy to integrate into a continuous build environment
- 命令行界面
- 支持 .EXE、.DLL 和 .RES 文件
- 根据版本掩码更新 FileVersion 和 ProductVersion
- 添加/更改/删除版本密钥字符串
- 调整文件标志(调试、特殊、私有等)
- 更新项目文件( .bdsproj | .bpr | .bpk | .dproj )
- 添加/更改主应用程序图标
- 使用带有配置的 ini 文件
- Windows Vista 支持(需要提升)
- 易于集成到持续构建环境中
Full Disclosure: I know the guy who wrote this tool, I used to work with him. But this also means that I know he makes quality software ;)
完全披露:我认识编写这个工具的人,我曾经和他一起工作。但这也意味着我知道他制作了高质量的软件;)
[1]the link is dead. There seems to be mirrored version at download.cnet.com.
[1]链接已死。download.cnet.com 上似乎有镜像版本。
回答by user3016543
I'm doing it with no additional tool. I have just added the following files to my Win32 app project.
我没有额外的工具就这样做了。我刚刚将以下文件添加到我的 Win32 应用程序项目中。
One header file which defines some constants than we can reuse on our resource file and even on the program code. We only need to maintain one file. Thanks to the Qt team that showed me how to do it on a Qt project, it now also works on my Win32 app.
一个定义了一些常量的头文件,我们可以在我们的资源文件甚至程序代码中重用这些常量。我们只需要维护一个文件。感谢 Qt 团队向我展示了如何在 Qt 项目中执行此操作,现在它也适用于我的 Win32 应用程序。
----[version.h]----
----[版本.h]----
##代码##----[MyProjectVersion.rc]----
----[MyProjectVersion.rc]----
##代码##回答by user581430
verpatch is good, but doesn't handle unicode characters...
try ResourceLib
verpatch 很好,但不能处理 unicode 字符......
试试ResourceLib
回答by CristiFati
There are multiple tools, mentioned by many great answers, I'm going to pick one.
有多种工具,许多很棒的答案都提到了,我将选择一个。
Resource Hacker
资源黑客
I downloaded latest version (5.1.7) from [AngusJ]: Resource Hacker. All the needed information can be found on that page (command line options, scripts, ...). In the following walkthrough I'm going to operate on 2 executables (lab rats) which (for obvious reasons) I've copied in my cwd:
我从[AngusJ]: Resource Hacker下载了最新版本 ( 5.1.7) 。所有需要的信息都可以在该页面上找到(命令行选项、脚本等)。在以下演练中,我将操作 2 个可执行文件(实验室老鼠),它们(出于显而易见的原因)我已复制到cwd 中:
- ResourceHacker.exe: I thought it would be interesting to operate on itself
- cmake.exe: random executable with no Version Infoset (part of v3.6.3installation on my machine)
- ResourceHacker.exe:我认为对自己进行操作会很有趣
- cmake.exe:没有版本信息集的随机可执行文件(我机器上v3.6.3安装的一部分)
Before going further, I want to mention that ResourceHackerhas a funny terminal output, and the the following copy / paste fragments might generate a bit of confusion.
在进一步讨论之前,我想提一下ResourceHacker有一个有趣的终端输出,下面的复制/粘贴片段可能会产生一些混乱。
1. Setup
1. 设置
This is more like a preliminary step, to get acquainted with the environment, to show there's no funky business going on, ...
这更像是一个初步步骤,熟悉环境,表明没有时髦的业务正在进行,......
##代码##
##代码##
As seen, the executables are OK, they run fine, and here's how their Details(that we care about) look like:
正如所见,可执行文件没问题,它们运行良好,下面是它们的详细信息(我们关心的)的样子:
2. Resources
2. 资源
Resource files are text files that contain resources. A resource (simplified) has:
资源文件是包含资源的文本文件。资源(简化)具有:
- Name
- Type
- Value
- 姓名
- 类型
- 价值
For more details check [MS.Docs]: About Resource Files. There are many tools (mentioned in existing answers) that facilitate resource file editing like:
有关更多详细信息,请查看[MS.Docs]:关于资源文件。有许多工具(在现有答案中提到)可以促进资源文件的编辑,例如:
- VStudiocreates a default one when starting a new project
- One can create such a file manually
But, since it's about Resource Hacker, and:
- It is able to extract resources from an existing executable
- It has resources embedded in it (as shown in the previous picture)
I'm going to use it for this step (
-action extract
)
- VStudio在开始一个新项目时会创建一个默认的
- 可以手动创建这样的文件
但是,因为它是关于Resource Hacker 的,并且:
- 它能够从现有的可执行文件中提取资源
- 它嵌入了资源(如上图所示)
我将在这一步中使用它 (
-action extract
)
Next, In order for a resource to be embedded into an .exe(.dll, ...) it must be compiledto a binary form, which fits into the PEformat. Again, there are lots of tools who can achieve this, but as you probably guessed I'm going to stick to Resource Hacker(-action compile
).
接下来,为了将资源嵌入到.exe( .dll, ...) 中,必须将其编译为适合PE格式的二进制形式。同样,有很多工具可以实现这一点,但正如您可能猜到的那样,我将坚持使用Resource Hacker( -action compile
)。
##代码##
##代码##
In your case saving and editing the resource file won't be necessary, as the file will already be present, I just did it for demonstrating purposes. Below it's the resource file after being modified (and thus before being compiled).
在您的情况下,不需要保存和编辑资源文件,因为该文件已经存在,我只是为了演示目的而这样做。下面是修改后(因此在编译之前)的资源文件。
sample.rc:
样本.rc:
##代码##3. Embed
3. 嵌入
This will also be performed by Resource Hacker(-action addoverwrite
). Since the .exes are already copied I'm going to edit their resources in place.
这也将由资源黑客( -action addoverwrite
) 执行。由于.exe已被复制,因此我将就地编辑它们的资源。
##代码##
##代码##
As seen, I had to d a little trick (gainarie) as I can't (at least I don't think I can) modify the .exewhile in use.
正如所见,我不得不做一些小技巧(Gainarie),因为我不能(至少我认为我不能)在使用时修改.exe。
4. Test
4. 测试
This is an optional phase, to make sure that:
这是一个可选阶段,以确保:
- The executables still work (they weren't messed up in the process)
- The resources have been added / updated
- 可执行文件仍然有效(它们在过程中没有搞砸)
- 资源已添加/更新
##代码##
##代码##
And their Details:
以及他们的详细信息:
回答by Tom Gordon
A little late to the party, but since I was looking for it (and I might need to find it again sometime), here's what I did to include version, company name, etc. into my C++ DLL under VS2013 Express:
聚会有点晚了,但由于我正在寻找它(我可能需要在某个时候再次找到它),这是我在 VS2013 Express 下将版本、公司名称等包含到我的 C++ DLL 中的操作:
- Created and edited a dllproj.rc file, as indicated previously.
- Added the line "rc.exe dllproj.rc" as a pre-build step in the DLL project.
- Added dllproj.res to the resource folder for the project.
- 如前所述,创建并编辑了 dllproj.rc 文件。
- 在 DLL 项目中添加了“rc.exe dllproj.rc”行作为预构建步骤。
- 将 dllproj.res 添加到项目的资源文件夹中。
Hope this helps!
希望这可以帮助!