"Register .Net assembly for COM interoperability" - Advanced Installer Community
psf
Posts: 43
Joined: Wed Jun 04, 2014 11:00 am

"Register .Net assembly for COM interoperability"

Hello. I am a bit confused by the behaviour of this option available from the Properties context menu for a .net assembly file I am delivering as part of my setup.
Does it actually cause regasm.exe to be run on the target machine where the setup is being installed?
I think it must be interrogating the assembly on the build machine, because the registry settings for the assembly are displayed in the 'registry' page of AI, but does it also run regasm at install time, or does it just copy in those registry settings it has detected at build time?

On a related issue, I have a 32-bit setup project and a 64-bit setup project. However, if in the 64-bit setup project I set up regasm.exe in the "External Tools" dialog to point to the 64-bit regasm, if I then switch to my 32-bit setup project, this also now points to the 64-bit regasm, i.e. the setting is not stored per-project. Which seems to make it difficult to build both 32 and 64-bit setups that deliver .net asemblies that need registering, on the same build machine?
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: "Register .Net assembly for COM interoperability"

Hello,
I think it must be interrogating the assembly on the build machine, because the registry settings for the assembly are displayed in the 'registry' page of AI, but does it also run regasm at install time, or does it just copy in those registry settings it has detected at build time?
It just copy in those registry settings it has detected at build time.
Advanced Installer attempts to find the RegAsm tool from the build machine in order to extract the registry entries required for COM interoperability, so it does not run the RegAsm at run time on the target machine.

It is recommended to synchronize the registration if you make changes to the assembly that affects the COM interface or assembly attributes. The available Synchronization options are:
  • Disable - Registration data is read from the file only once and stored, if the file will change the registration data will not be updated.
  • Enable - Registration data is read from the file when the project is opened and before build, and stored.
  • Buildtime - Registration data will be read only as part of the build process; it will not be displayed in the Registry page or stored in the project.
On a related issue, I have a 32-bit setup project and a 64-bit setup project. However, if in the 64-bit setup project I set up regasm.exe in the "External Tools" dialog to point to the 64-bit regasm, if I then switch to my 32-bit setup project, this also now points to the 64-bit regasm, i.e. the setting is not stored per-project. Which seems to make it difficult to build both 32 and 64-bit setups that deliver .net asemblies that need registering, on the same build machine?
There is no preferred version .e.g. 86-bit or 64-bit for the RegAsm version. Both should have the same result. Just make sure that the 64-bit Component flag from the component properties of the registry entries is marked accordingly.

Please let me know if you have other questions.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
psf
Posts: 43
Joined: Wed Jun 04, 2014 11:00 am

Re: "Register .Net assembly for COM interoperability"

OK, I think that reinforces the need for us to invoke regasm as a custom action, because we define ComRegisterFunctions which perform some extra configuration setup when they get invoked as a consequence of regasm registering our assembly.

Return to “Common Problems”