" /> " /> "/>

Move Typelib into a C# custom action code

31 views Asked by At

I have a WiX project with below piece of code to register a library:

  <Fragment>
    <ComponentGroup Id="COMObjectComponent"
                    Directory="APPLICATIONFOLDER">
      <Component Id="myCOMObject.lib"
                 Guid="{AB4304B8-C9BA-49C7-5423-112CB1210000}">
        <File Id="myCOMObject.exe"
              KeyPath="yes"
              Source="$(var.myCOMDir)\myCOMObject.exe">
          <TypeLib Id="{86000350-400E-00F1-00DF-6F00F0CD0BBC}"
                   Description="myCOMObjectLib"
                   HelpDirectory="APPLICATIONFOLDER"
                   Language="0"
                   MajorVersion="1"
                   MinorVersion="0"
                   Advertise="yes">
            <Class Id="{4326682B-657B-4DFE-A68D-47252874C000}"
                   Context="LocalServer32"
                   Description="myCOMObject Class"
                   ThreadingModel="apartment"
                   Version="1.0" />
            <Interface Id="{225E49AF-4575-4876-A53B-81A5AB281111}"
                       Name="ImyCOMObject"
                       ProxyStubClassId32="{00020424-0000-0000-C000-000000000046}" />
            <Interface Id="{24592647-A858-5555-B01F-BE4DCB8C86A1}"
                       Name="ImyCOMObjectCallbacks"
                       ProxyStubClassId32="{11120424-1111-0000-C000-000000000046}" />
          </TypeLib>
        </File>
      </Component>
    </ComponentGroup>
  </Fragment>

This works fine. Now I am downloading above File via a custom action in C# from a remote file server so the File is no longer provided/embeded within the WiX MSI file.

So what I am trying to do is after download the File in the custom action, I want to register it the same as I do with the above TypeLib section. So how can I translate that TypeLib section into C# code so I can execute it from the custom action?

Any help will be highly appreciated.

0

There are 0 answers