registry COM dll

Jul 15, 2016 at 11:58 AM
How Registry COM dll in Wix#. In Wix toolset i use heat.exe.
<Component Id="AxCVS1.dll" Guid="{64B778A3-361D-4B60-AF62-E1842E206CA4}">
        <File Id="AxCVS1.dll" KeyPath="yes" Source="G:\TFS\Cameras\Cameras\SetupCameras\DllforReg\AxCVS1.dll">
          <TypeLib Id="{11B2DD15-5613-4EAB-9D46-CF9B52EB5C0B}" Description="AxCVS1 1.0 Type Library" HelpDirectory="CommonFilesFolder" Language="0" MajorVersion="1" MinorVersion="0">
            <AppId Description="AxCVS1" Id="{EBFD3E6B-9613-48DE-857F-234390A76082}">
              <Class Id="{1ACEA3EB-6681-496E-9878-DFC4D0481AF7}" Context="InprocServer32" Description="axcvs Class" ThreadingModel="apartment" Version="1.0" Programmable="yes" SafeForScripting="yes" SafeForInitializing="yes" Control="yes">
                <ProgId Id="AxCVS1.axcvs.1" Description="axcvs Class">
                  <ProgId Id="AxCVS1.axcvs" Description="axcvs Class" />
            <Interface Id="{2406F45E-19C8-4475-896A-7E923AD3CC22}" Name="Iaxcvs" ProxyStubClassId32="{00020424-0000-0000-C000-000000000046}" />
            <Interface Id="{79B62A3A-CB3B-41E7-8D1E-EB4F13CBF354}" Name="_IAxCVSEvents" ProxyStubClassId32="{00020420-0000-0000-C000-000000000046}" />
        <RegistryValue Root="HKCR" Key="AppID\AxCVS1.DLL" Name="AppID" Value="{EBFD3E6B-9613-48DE-857F-234390A76082}" Type="string" Action="write" />
        <RegistryValue Root="HKCR" Key="CLSID\{1ACEA3EB-6681-496E-9878-DFC4D0481AF7}\MiscStatus\1" Value="131473" Type="string" Action="write" />
        <RegistryValue Root="HKCR" Key="CLSID\{1ACEA3EB-6681-496E-9878-DFC4D0481AF7}\MiscStatus" Value="0" Type="string" Action="write" />
        <RegistryValue Root="HKCR" Key="CLSID\{1ACEA3EB-6681-496E-9878-DFC4D0481AF7}\ToolboxBitmap32" Value="[#AxCVS1.dll], 103" Type="string" Action="write" />
Jul 16, 2016 at 9:46 AM
WiX doesn't provide direct support for COM registration And Wix# does rely what WiX offers for COM handling neither.

This means that you will need to rely on WiX recommended approaches mapped to Wix#:
  • Running regsvr32
    • You can run is as WixQuietExecAction. Have a look at "WixQuietExecAction" sample
    • You can run it as C# Process.Start. Have a look at ManagedCA sample or even better run it in BeforeInstall ManagedProject event.
  • Merging heat.exe emitted wxs fragment with main wxs file.
    • You can do this with Project.AddWixFragment:
var comWxs = "<your heat.exe generated wxs file>";
project.AddWixFragment("Wix/Product", XElement.Load(comWxs));
I wouldn't mind even to provide a simple interface for heat.exe. Even prototyped it:
var wxs = Tasks.EmmitComWxs(dll);
However I quickly realized that heat interface is a bit flaky. It immediately emitted:
The harvest type was not found in the list of loaded Heat extensions.
The error was logged in 2013 ( but it seems at it came back. Thus until it's fixed or some work around found I cannot really integarate it.