S h o r t S t o r i e s

// Tales from software development

WiX: Registering a .NET COM Interop assembly

leave a comment »

I needed to register a .NET COM Interop assembly as part of a deployment but the WiX documentation doesn’t give explicit details on how to do this. Searching for an answer shows that a few people are using custom actions to invoke RegAsm at install time. This approach is wrong for several reasons but let’s stick with the idea that the Windows Installer won’t know it needs to unregister the assembly on an uninstall as being one of the more significant.

The solution is fairly simple: generate the TLB for the interop assembly using RegAsm and then run Heat against the assembly and the TLB:

RegAsm.exe InteropAssembly.dll /tlb
Heat.exe file InteropAssembly.dll /out asm_fragment.wxs
Heat.exe file InteropAssembly.tlb /out tlb_fragment.wxs

Copy the two WiX fragments in the .wxs files to your WiX source and edit them as required.


Written by Sea Monkey

December 24, 2009 at 8:00 am

Posted in Deployment

Tagged with

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: