How do you register a Win32 COM DLL file in WiX 3?

I found an example of registering a DLL, Registering an assembly for COM Interop in an MSI file using the Windows Installer toolkit. and WiX complains about the AssemblyRegisterComInterop attribute.

I removed this and changed the "Assembly" attribute to win32, and it says that I need to specify the AssemblyManifest attribute, but what should I put there?

+32
dll com wix wix3
Dec 12 '08 at 21:21
source share
3 answers

The easiest way (and Rob M to rant and scold about how this is wrong) is to simply use SelfRegCost=1 in the File tag for the DLL.

This is incorrect, because we must explicitly control the registration of the DLL, not allowing it to simply run arbitrary code through the DllRegisterServer. The theory is that a DLL should not do anything but put the appropriate entries in the registry when calling DllRegisterServer. Unfortunately, many of them do more, so self-registration may be the only way to get your installation to work.

This is also wrong, because it means that the Windows installation system does not know anything about these registry keys, and what should and should not be. This means that the repair will not work, and perhaps its removal will not be properly cleaned, etc.

Otherwise, you can create the appropriate WiX code by specifying heat.exe in your DLL and integrating its output into your current WiX project. You will get many Class, ProgID, TypeLib, and Registry tags. You may need to manually edit this output to compile it.

I hope this helps.

+39
Dec 12 '08 at 21:31
source share

Not only will I rant and get angry about how SelfReg is evil. The MSI SDK gives you a list of seven reasons why you should not use SelfReg .

Example:

 <Component Id="Component" Guid="*"> <File Source="ComServer.dll"> <Class Id="PUT-CLSID-HERE" Context="InprocServer32" ThreadingModel="apartment" Description="Your server description"> <ProgId Id="Your.Server.1" Description="Your ProgId description"> <ProgId Id="Your.Server" Description="Your ProgId description" /> </ProgId> </Class> <Class Id="PUT-PROXY-CLSID-HERE" Context="InprocServer32" ThreadingModel="both" Description="Your server Proxies, assuming you have them"> <Interface Id="PUT-INTERFACEID-HERE" Name="IInterface1" /> <Interface Id="PUT-INTERFACEID-HERE" Name="IInterface2" /> <Interface Id="PUT-INTERFACEID-HERE" Name="IInterface3" /> <Interface Id="PUT-INTERFACEID-HERE" Name="IInterface4" /> </Class> </File> </Component> 

Ultimately, Troy's answer is all right.

+23
Dec 13 '08 at 0:18
source share

You can try using the heat.exe program and then reference the snippet in the wix code.

  heat.exe file <filename> -out <output wxs file> 

How in:

  heat.exe file my.dll -out my.wxs 
+13
Feb 27 '09 at 23:36
source share



All Articles