I have created a simple C# custom action.
[CustomAction]
public static ActionResult MySimpleAction(Session session)
{
MessageBox.Show("It works!");
return ActionResult.Success;
}
<Binary Id="myAction"
SourceFile="MyApp.CA.dll"/>
<CustomAction Id="myActionId"
BinaryKey="myAction"
DllEntry="MySimpleAction"
Execute="deferred"
Return="check" />
<InstallExecuteSequence>
<Custom Action="myActionId"
After="InstallInitialize">CHECKBOXCOPYPROP=1</Custom>
</InstallExecuteSequence>
I got error 2762, when I ran the installation.
When I run
<InstallExecuteSequence>
<Custom Action="myActionId"
Before="InstallFinalize">CHECKBOXCOPYPROP=1</Custom>
</InstallExecuteSequence>
I didn’t get the error. Why can’t I run after InstallInitialize? How is it run?
You must write:
With
Execute="deferred"it will not work.Besides this, in CusomAction.config it must be written: