For silent installation if the .net4 Framework is not available , I need to add the message to log saying installation can continue only if .net4framework is installed. Is this possible to implement via standard custom action which can be added to InstallExecuteSequence.
In the UI mode i use NETFRAMEWORK40FULL property to check the existence of dotnetframework
You can do it with custom action type 19. Looks like you stopped only one step from your goal:
<CustomAction Id="DotNet4PrerequisiteAssert" Error=".NET 4 is not installed"/>
<InstallExecuteSequence>
<Custom Action="DotNet4PrerequisiteAssert" After="AppSearch">NOT Installed AND NOT NETFRAMEWORK40FULL</Custom>
</InstallExecuteSequence>
But I'm not sure why don't you use LaunchCondition instead of manual custom action. It should work in both UI and silent mode:
<PropertyRef Id="NETFRAMEWORK40FULL"/>
<Condition Message='This setup requires the .NET Framework 4.0 client profile installed.' >
<![CDATA[Installed OR NETFRAMEWORK40FULL]]>
</Condition>