CustomActionData – quick reference

“Look I know about msi’s, just remind me how to do it with an example!”

Ok I hear you – most web references either don’t give an example or force you to read all the theory first!  Here you go …

1. Create a type 51 custom action to store the property you want to reuse in deferred execution.  It’s property name (Source column) must be the same as the custom action name that will use it later in deferred execution:

Action Name Type Source Target
StoreUSERNAME 51 vbsDisplayUsername [USERNAME]

2. Put the new type 51 action with immediate execution in the InstallExecuteSequence somewhere.

3. Custom action in deferred execution references the stored information.  It’s Action Name must be the same as property being set in the type 51 action (Source column):

Action Name Type Source Target
vbsDisplayUsername 1062 MsgBox "->" & Session.Property("CustomActionData") & "<-"

4. Put the second deferred action after the first in the sequence and the embedded VBScript should display the content of the property, in this example the username.

If you want detail about how and why this works – get Googling!

Posted in Work | Leave a comment

Leave a Reply