cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Tim_Mayert
Level 9

Question about CustomActionData properties?

I just want to be sure I understand correctly about calling functions that have to access property data during the Deferred Execute sequence.

Now we have to create/set a property that has the same name as the custom action that needs to be called during a Deferred Execute event.
In the custom action code we then use the following call to get the property value:
uiReturn = MsiGetProperty(hModule, TEXT("CustomActionData"), szCustomActionData, &dwCount);

This is fine and works good, but my main question is what happens if you have other properties you need to access at different times and through different custom action calls?

I know that you can set the CustomActionData property to contain many values with ";" between them, but then they would be used for a specific custom action function.

I just want to verify that if you set other properties to other custom action call names and access them through this process that it is a totally seperate from the other calls and the information retrieved would be the correct information and not the information that may have been set from any other Deferred custom action that also needs to use the CustomActionData property.

Thanks,
Labels (1)
0 Kudos
(3) Replies
MichaelU
Level 12 Flexeran
Level 12 Flexeran

Each deferred action can read a property called CustomActionData which has been populated when the deferred action was encountered in the immediate traversal of the execute sequence. This property is populated with the value of the property named the same as the action being deferred. So yes, each deferred action gets its own CustomActionData property value.
0 Kudos
Tim_Mayert
Level 9

Thanks Michael,

I figured that that was how it worked, but I just had to confirm so that I did not get into any issues later on when I get more and more custom actions that need to be triggered in Deferred mode.

Thanks again.
0 Kudos
Christopher_Pai
Level 16

You can also have 1 immediate CA setup the CustomActionData property for multiple deferred CA's as long as it's scheduled before all of the various deferred execution CA's.

For example you might have the CA's:

CustomDoSomething_CAD
: Query CustomSomething table
: Evaluate Component Conditions
: Generate CustomDoSomething_Uninstall CAD property
: Generate CustomDoSomething_Rollback CAD property
: CustomDoSomething_Install CAD property
: CustomDoSomething_Commit CAD property

CustomDoSomething_Uninstall
: Read CAD property and uninstall something

CustomDoSomething_Rollback
: Read CAD property and rollback something

CustomDoSomething_Install
: Read CAD property and install something

CustomDoSomething_Commit
: Read CAD property and commit something
0 Kudos