Why does regasm /regfile seem incomplete?
Asked Answered
C

2

4

I have a .NET assembly I need to register at install time. I'm noticing that the registry has subtle differences when regasm is used directly versus being installed via regasm's registry script.

Here's my test:

I export the original HKCR hive, then run: regasm my.dll

From there, I export the subsequent HKCR hive and performance a diff.

I then compare that diff with the output of regasm my.dll /regfile

There are a couple very important entries that get added via regasm my.dll that will never get added with the registry file output from the regasm command. Why?

From an install point-of-view, I'd very much hate to call regasm during the install process. I'd rather just run this .reg script. I'm using InstallShield now, which under the hood is also missing the extra registry entries (it seems like it embeds the registry changes outputted with the /regfile flag).

Crossquestion answered 1/2, 2013 at 18:11 Comment(4)
what entries are missing?Fernandafernande
It's very application specific (the GUID is not one of "ours", but probably pulled in by a dependency?): [HKEY_CLASSES_ROOT\CLSID\{xxxx}\Implemented Categories\{B56A7C42-83D4-11D2-A2E9-080009B6F22B}]Crossquestion
googleing it seems to have something to do with ESRI Mx Commands - what question do you want to know the answer to?Fernandafernande
Yes, it's related to that. My question: why doesn't regasm /regfile's output generate this entry? This registry entry is only present on the system after doing regasm directly.Crossquestion
A
4

Per Regasm.exe (Assembly Registration Tool) (Remarks Section)

You can use the /regfile option to generate a .reg file that contains the registry entries instead of making the changes directly to the registry. You can update the registry on a computer by importing the .reg file with the Registry Editor tool (Regedit.exe). Note that the .reg file does not contain any registry updates that can be made by user-defined register functions. Note that the /regfile option only emits registry entries for managed classes. This option does not emit entries for TypeLibIDs or InterfaceIDs.

InstallShield has a setting called ".NET COM Interop" that basically tells the build engine to perform a regasm /regfile and transform the results into the registry table before building the MSI. You can keep doing this if you want but you'll have to add the extra stuff statically.

Altimeter answered 2/2, 2013 at 2:39 Comment(0)
C
3

Additional registry manipulation is going on behind-the-scenes in methods decorated with the ComRegisterFunction attribute. Apparently these methods aren't invoked with the /regfile switch.

Crossquestion answered 1/2, 2013 at 18:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.