Search code examples
c#dllwixentry-point

Creating an entry point in a C# DLL to call from WIX


I am trying to find a way to create an entry point for my C# DLL. I am aware of how to call other DLL's in C# but cannot find how to create one. I need this in order to call it in my WiX installer as a customer action.


Solution

  • All you need to do is mark your method up with the CustomAction attribute.

    So:

    [CustomAction] 
    public static ActionResult MyThing(Session session) 
    { 
      // do your  stuff...
      return ActionResult.Success; 
    }

    As you are already calling other C# assemblies from WiX, it sounds like you have WiX 3.0, which supports the managed wrappers.