Reputation: 3667
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.
Upvotes: 4
Views: 3645
Reputation: 12092
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.
Upvotes: 5
Reputation: 31928
You cannot create entry points in dlls using C#, the only way to create managed dll with custom entry points is to use Managed C++ (CLI).
You can use the DTF (Deployment Tools Foundation) to create managed custom actions that can be called from WIX.
Upvotes: 1