Replicating Visual Studio COM registration with a WiX Installer Replicating Visual Studio COM registration with a WiX Installer windows windows

Replicating Visual Studio COM registration with a WiX Installer


You should use Heat (WIX 3.0) located in the bin directory of the version you are using.Have a look at this blog post, we use it here to register all our COM objects, by creating a wix fragment...

something like

heat file MyComExposedLibrary.dll -out MyComExposedLibrary.wxs

After, reading your edit, I would create a basic msi with wix that installs the com object only, see if that works ... then you'll know which battlefield to attack ...


I recently ran into this issue, and the simplest workaround I could find follows these steps on the development machine:

  1. Run: Regasm MyDLL.dll /tlb:MyDLL.tlb
  2. Run: Heat file MyDLL.dll -out MyDll-1.wxs
  3. Run: Heat file MyDll.tlb -out MyDll-2.wxs

MyDll-2.wxs contains a <Typelib> element that you will want to copy and nest inside the <File> element that was generated in MyDll-1.wxs. This will give you a complete <Component> element that you can use in the installer project.


To extract the COM information, tallow will use the regasm.exe tool included with the .NET framework. It is likely that visual studio uses the same tool to register assemblies when you enable "register for COM interop".

The difference is that tallow will use the regasm /regfile switch to send the information to a .reg file instead of actually registering the assembly. Unfortunately the .reg file generated by regasm.exe is not complete. It skips the typelib entries which it does write to the registry during a real registration. This may be a bug in regasm.

To get your installer working you have three options:

  1. Add the missing registry keys to thetallow output manually. The tallowoutput is intended to be editedmanually and saved along with yourother wxs files anyway. You seem tobe trying to fully automatically generatea working wxs file but I believe that wasnever a design goal of tallow.

  2. Use a custom action to invoke regasm from your installer. This is slightly evil because you may lose some of the strong transactional guarantees provided by the windows installer engine. I'm thinking of rollbacks triggered by a failure halfway during the install here.

  3. Avoid the registration altogether bymaking use of registration-free COM.This will require the creation ofmanifest files for both theapplication and the COM library.