简体   繁体   English

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

[英]How do I create or modify a VB6 exe Version resource block to make it Squirrel-Aware

I have this crazy idea to take a large VB6 app we are continually migrating to .NET and use the Squirrel for Windows installer.我有一个疯狂的想法,那就是使用我们不断迁移到 .NET 的大型 VB6 应用程序并使用Squirrel for Windows安装程序。 It seems I need to make the VB6 app Squirrel-Aware as described here -- add VALUE "SquirrelAwareVersion", "1" to the Version resource block.似乎我需要按照此处所述制作 VB6 应用程序 Squirrel-Aware - 将VALUE "SquirrelAwareVersion", "1"到版本资源块。

The problem is I'm very unfamiliar with rc files and there are only bits of documentation on the format, encodings, etc especially when working with VB6.问题是我对 rc 文件非常不熟悉,而且只有一些关于格式、编码等的文档,尤其是在使用 VB6 时。 I think I need a command line tool that can add this VALUE "SquirrelAwareVersion", "1" to the Version resource of an existing exe, OR figure out how to get VB6 to use a custom .res file with all the version data in it.我想我需要一个命令行工具,可以将此VALUE "SquirrelAwareVersion", "1"到现有 exe 的版本资源中,或者弄清楚如何让 VB6 使用包含所有版本数据的自定义.res文件.

Most tools only seem to modify basic resource info like icons, manifests, and strings.大多数工具似乎只修改基本资源信息,如图标、清单和字符串。 I would need something capable of modifying or replacing this version data.我需要能够修改或替换此版本数据的东西。

I've attempted to create a basic .rc .我试图创建一个基本的.rc I make an empty file with the name MyApp.rc.我创建了一个名为 MyApp.rc 的空文件。 Open the file with Visual Studio.使用 Visual Studio 打开文件。 Add a "Version" resource and attempt to compile it to .res with RC.exe but I get all sorts of errors from this file generated by Visual Studio.添加“版本”资源并尝试使用RC.exe将其编译为.res ,但我从 Visual Studio 生成的此文件中收到各种错误。 If I close and reopen the generated RC file, even Visual Studio can't open it.如果我关闭并重新打开生成的 RC 文件,即使 Visual Studio 也无法打开它。 Could be an encoding problem?可能是编码问题? I'm not sure how else to create a valid RC file.我不确定如何创建有效的 RC 文件。

You can use Resource Hacker utility in CLI mode to replace whatever resources you need to in your final executable.您可以在 CLI 模式下使用Resource Hacker 实用程序来替换最终可执行文件中所需的任何资源。 It can even compile .rc files to .res file with something like this:它甚至可以将 .rc 文件编译为 .res 文件,如下所示:

c:> ResourceHacker.exe -open Project1.rc -save Project1.res -action compile

Then use something like this on the command line to add new or replace existing resources from a .res file into your final executable:然后在命令行上使用类似的东西从 .res 文件中添加新资源或替换现有资源到你的最终可执行文件中:

c:> ResourceHacker.exe -open Project1.exe -save Project1.exe -action addoverwrite -resource Project1.res

Add -log NUL parameter to suppress console output if you need to.如果需要,添加-log NUL参数以抑制控制台输出。

Make a res file in VB6.用VB6制作res文件。 VB6 only allows editing of certain things. VB6 只允许编辑某些东西。 Use ResHacker to add anything else you want to the Res file.使用 ResHacker 将您想要的任何其他内容添加到 Res 文件中。 VB6 add it's own version so you may need to do it to the exe file. VB6 添加了它自己的版本,因此您可能需要将其添加到 exe 文件中。 http://www.angusj.com/resourcehacker/ http://www.angusj.com/resourcehacker/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM