2

I want to capture what regsvr32 mycomthingie.dll does into a .reg file. I downloaded Microsoft Visual Studio Installer Projects, and trying to use regcap.exe for this purpose. It simply quits without an error message and no reg file is created. I tried in both normal and admin cmd prompts. I suspect the problem is that the target dll is 64bit but regcap.exe is a 32bit executable.

I couldn't find a 64-bit version of this tool, so my question is, what can I do if the only version of the DLL I have is compiled as 64bit (PE32+)

  • [Been a while since I looked at COM](https://stackoverflow.com/a/55459208/129130). Might look more later, but please have a look here: https://github.com/nirbar/WixHeatATLHarvesterExtension (this is for WiX, but the code might help you - or you could translate the entries to *.reg - or maybe locate a 32-bit version of the dll - if it exists - and see if the GUIDs match? Just off the top of my head - not that carefully reasoned. [Trial versions of commercial MSI tools](https://stackoverflow.com/a/50229840/129130) could help you? They would be able to extract the data? – Stein Åsmul Dec 11 '20 at 14:18
  • Hi again, I added a suggestion below. Please have a look (unless you have found another solution). – Stein Åsmul Dec 12 '20 at 01:18

1 Answers1

1

UPDATE: How to open a Windows binary as a resource in Visual Studio 2019 (use Visual Studio to extract *.RGS files from a COM binary - see comments below).


Despite little testing, let me add this for the record.

WixHeatATLHarvesterExtension: Try to download the WixHeatATLHarvesterExtension: https://github.com/nirbar/WixHeatATLHarvesterExtension

This will extend WiX's normal heat.exe tool with a new command:

heat atlcom "c:\vsFlex8n.ocx" -out vsFlex8n_COM.wxs

This appears to work for 64-bit COM files. What you get is an exported WiX source file and not a reg file though - sorry. You can construct a reg file manually though? Based on the WiX source you can convert to reg? Or just switch to using WiX if you don't already? Wix quick start link collection.

Procedure:

  1. Build: To get to this you need to download and build the solution above.
  2. Install: Once built you install the ATLHarvester.msi and this will put the components in place in the WiX installation directory. You need to download and install the WiX toolkit first though.
  3. Configure: Now you can also add the WiX bin folder to your environment path, but that is not necessary if you use the full path to heat.exe (last part untested). You should also be able to use the WIX environment variable: %WIX%\bin\heat.exe (type set in a cmd.exe to see the WIX variable path).

If you upload the dll somewhere with dependencies I can try it. These 64-bit COM files have been a serious grief before for me too.


Also found these projects that didn't work properly for me outright:

Stein Åsmul
  • 34,628
  • 23
  • 78
  • 140
  • I didn't have time to try your solution, but it does looks promising and yes my original goal was to use `heat` in a 64-bit COM DLL. I ended up using https://www.nirsoft.net/utils/registry_changes_view.html to snapshot the registry and use `regsvr32` and compare the snapshots, export a reg file then use heat in the reg file. – János Illés Dec 14 '20 at 14:28
  • Sounds good. I suppose we should also mention that you can locate the [*.RGS source files](https://www.codeproject.com/Articles/6319/Registry-Map-for-RGS-files) if you have access to the source for the 64-bit COM components. As an option for others who find this. – Stein Åsmul Dec 14 '20 at 15:29
  • Now that I think about it: you should be able to get to the *.RGS content by opening the binary as a resource in Visual Studio. Just copy the text and dump into notepad or equivalent. If nothing else, as a form of control and double checking. – Stein Åsmul Dec 14 '20 at 15:31
  • [How to open a Windows binary as a resource in Visual Studio 2019](https://www.youtube.com/watch?v=a_xcKg7WM4Y). – Stein Åsmul Dec 14 '20 at 17:07