如何创建或修改 VB6 exe 版本资源块以使其成为 Squirrel-Aware

bzu*_*ith 4 vb6 embedded-resource squirrel.windows

我有一个疯狂的想法,那就是使用我们不断迁移到 .NET 的大型 VB6 应用程序并使用Squirrel for Windows安装程序。似乎我需要按照此处所述制作 VB6 应用程序 Squirrel-Aware - 添加VALUE "SquirrelAwareVersion", "1"到版本资源块。

问题是我对 rc 文件非常不熟悉,而且只有一些关于格式、编码等的文档,尤其是在使用 VB6 时。我想我需要一个命令行工具,可以将其添加VALUE "SquirrelAwareVersion", "1"到现有 exe 的版本资源中,或者弄清楚如何让 VB6 使用.res包含所有版本数据的自定义文件。

大多数工具似乎只修改基本资源信息,如图标、清单和字符串。我需要能够修改或替换此版本数据的东西。

我试图创建一个基本的.rc. 我创建了一个名为 MyApp.rc 的空文件。使用 Visual Studio 打开文件。添加一个“版本”资源并尝试将其编译为.reswithRC.exe但我从 Visual Studio 生成的这个文件中收到各种错误。如果我关闭并重新打开生成的 RC 文件,即使 Visual Studio 也无法打开它。可能是编码问题?我不确定如何创建有效的 RC 文件。

wqw*_*wqw 6

You can use Resource Hacker utility in CLI mode to replace whatever resources you need to in your final executable. It can even compile .rc files to .res file with something like this:

c:> ResourceHacker.exe -open Project1.rc -save Project1.res -action compile
Run Code Online (Sandbox Code Playgroud)

Then use something like this on the command line to add new or replace existing resources from a .res file into your final executable:

c:> ResourceHacker.exe -open Project1.exe -save Project1.exe -action addoverwrite -resource Project1.res
Run Code Online (Sandbox Code Playgroud)

Add -log NUL parameter to suppress console output if you need to.