4

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.

StayOnTarget
  • 11,743
  • 10
  • 52
  • 81
Ben Zuill-Smith
  • 3,504
  • 3
  • 25
  • 44

2 Answers2

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

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.

wqw
  • 11,771
  • 1
  • 33
  • 41
0

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/

fred
  • 1