I've recently posted Custom action condition to run for a new or upgraded product., but I found that the custom action doesn't always call executable.
I removed any custom action conditions, but it still doesn't always produced the same result
I had to install ORCA, and found that my Custom Action has source _5C6AF63299974A76AD78EA44FCE751A6 (reference to MSIAssembly table ) and type 1042(Custom Action Type 18 + msidbCustomActionTypeInScript 1024)
The CustomAction guid key has entry in InstallExecuteSequence table with condition $C__5C6AF63299974A76AD78EA44FCE751A6>2 and sequence 5999.
According to Conditional Statement Syntax. $component-action >2 means Action state of the component.is installed locally or run from the source.
It means that sometimes installer doesn't recognize that a component is installed( I still don't understand the pattern??).
Actually according to Custom Action Tutorial Custom Action runs only when the component is being added(or deleted).