Reputation: 103
I try to add a custom action to a Installer Project. I added a Custom Action Project with following code:
public class CustomActions
{
[CustomAction]
public static ActionResult CustomAction1(Session session)
{
session.Log("Begin CustomAction1");
return ActionResult.Success;
}
}
In my installer Project, I added a reference to the CustomAction_project and added following entry to Custom Actions -> Install:
Name: Primary output from CustomAction (Active) EntryPoint: CustomAction1 InstallerClass: False SourcePath: Path to CustomAction.dll
Now, if I try to Build my Installer Project I get following Error:
ERROR: Entry point 'CustomAction1' not found in module 'PATH\CustomAction.dll' for custom action 'Primary output from CustomAction (Active)'.
What do I wrong? The Custom Action code was automatically generated by Visual Studio 2013!
Upvotes: 1
Views: 14628
Reputation: 65
If you want to use CustomActions from Microsoft.Deployment.WindowsInstaller (not the Installer Class) you need to :
Happy Installing... :)
Upvotes: 0
Reputation: 20780
You've built a managed code custom action project that's intended for WiX setups. You need an installer class custom action if you are using a native Visual Studio installer project. These might help:
https://msdn.microsoft.com/en-us/library/vstudio/d9k65z2d(v=vs.100).aspx
http://vbcity.com/forums/t/145818.aspx
Basically you add an installer class to your project, and override the install method.
Upvotes: 1