简体   繁体   中英

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. It seems I need to make the VB6 app Squirrel-Aware as described here -- add VALUE "SquirrelAwareVersion", "1" to the Version resource block.

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. 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.

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 . I make an empty file with the name MyApp.rc. Open the file with 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. If I close and reopen the generated RC file, even Visual Studio can't open it. Could be an encoding problem? I'm not sure how else to create a valid RC file.

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

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

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

Make a res file in VB6. VB6 only allows editing of certain things. Use ResHacker to add anything else you want to the Res file. VB6 add it's own version so you may need to do it to the exe file. http://www.angusj.com/resourcehacker/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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