Skip to main content

COM+ Applications

The WiX toolset has a custom action library that allows the installer to create COM+ packages, add components to them and create and set roles.

NOTE: If you want IntelliSense for the COM+ custom actions in Visual Studio you need to copy the file "src\ca\pubca\pcaext\Xsd\pubca.xsd" from the source download to "\Program Files\Microsoft Visual Studio 8\Xml\Schemas" for Visual Studio 2005 or "\Program Files\Microsoft Visual Studio .NET 2003\Common7\Packages\schemas\xml" for Visual Studio 2003.

When you build the installation package, you have to compile and link it against the appropriate WiX library. The candle and light command lines to do this are:

candle -ext WixComPlusExtension Sample.wxs
light -ext WixComPlusExtension Sample.wixobj

You also need to reference the COM+ schema in your WiX source as follows:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:complus="http://schemas.microsoft.com/wix/ComPlusExtension">

To create a package (My COM+ Application) and add a standard COM DLL (MyCOM.dll) to the package:

<Component Id="MyCOM_dll" DiskId="1" Guid="YOURGUID-242F-4B82-BDC7-588E59E9F393">
  <File Id="MyCOM_dll" Name="MyCOM.dll" Source="MyCOM.dll" KeyPath="yes" Vital="yes" />
  <complus:ComPlusApplication Id="MyCOM" Name="My COM+ Application">
    <complus:ComPlusAssembly Id="MyComPlusAssembly" Type="native" DllPath="[#MyCOM_dll]">
      <complus:ComPlusComponent Id="MyCOM" CLSID="YOURCLSID-CA74-4DC7-BAEF-25AF03BC5F67" />
    </complus:ComPlusAssembly>
  </complus:ComPlusApplication>
</Component>

To create a package (My COM+ Application) and add a .Net assembly (MydotNet.dll) that is not in the GAC to the package:

<Component Id="MydotNet_dll" DiskId="1" Guid="YOURGUID-242F-4B82-BDC7-588E59E9F393">
  <File Id="MydotNet_dll" Name="MydotNet.dll" Source="MydotNet.dll" KeyPath="yes" Assembly="no" />
  <complus:ComPlusApplication  Id="MydotNet" Name="My COM+ Application">
    <complus:ComPlusAssembly Id="MyComPlusAssembly" DllPath="[#MydotNet_dll]" TlbPath="[#MydotNet_tlb]" Type=".net" RegisterInCommit="yes">
      <complus:ComPlusComponent Id="CheckInterface" CLSID="YOURCLSID-241E-4472-8C71-61A22BAF9914"/>
    </complus:ComPlusAssembly>
  </complus:ComPlusApplication>
</Component>

<Component Id="MydotNet_tlb" DiskId="1" Guid="YOURGUID-242F-4B82-BDC7-588E59E9F394">
  <File Id="MydotNet_tlb" Name="MydotNet.tlb" Source="MydotNet.tlb" KeyPath="yes" />
</Component>

To create a package (My COM+ Application) and add a .Net assembly (MydotNet.dll) that is in the GAC to the package:

<Component Id="MydotNet_dll" DiskId="1" Guid="YOURGUID-242F-4B82-BDC7-588E59E9F393">
  <File Id="MydotNet_dll" Name="MydotNet.dll" Source="MydotNet.dll" KeyPath="yes" Assembly=".net" />
  <complus:ComPlusApplication Id="MydotNet" Name="My COM+ Application">
    <complus:ComPlusAssembly Id="MyComPlusAssembly" TlbPath="[#MydotNet_tlb]" Type=".net" DllPathFromGAC="yes" RegisterInCommit="yes">
      <complus:ComPlusComponent Id="CheckInterface" CLSID="YOURCLSID-241E-4472-8C71-61A22BAF9914"/>
    </complus:ComPlusAssembly>
  </complus:ComPlusApplication>
</Component>

<Component Id="MydotNet_tlb" DiskId="1" Guid="YOURGUID-242F-4B82-BDC7-588E59E9F394">
  <File Id="MydotNet_tlb" Name="MydotNet.tlb" Source="MydotNet.tlb" KeyPath="yes" />
</Component>

Neil Sleightholm

register non .net com dll

I am facing problems while i use the above xml tags for registering my standard com dll.
I can register successfully my com dll,  using regsvr32 from the command prompt. But from WIX i am not able to.
can anyone please provide me a solution with an example how to proceed. Its very urgent!

Reply to comment | WiX Tutorial

Amazing! Its genuinely awesome post, I have got much clear idea concerning from this paragraph.