June 07, 2006

InstallScript, meet CustomActionData

I've made a small contribution to InstallSite entitled:


"Decode the CustomActionData Property in InstallScript"


Now that InstallScript CA's running in Deferred/Commit/Rollback execution don't have access to the MSI handle via IDriver we must follow the same rules that other CA's must follow. One of these rules is that we only have access to a limited number of MSI Properties.

This contribution is designed to illustrate how to use an immediate Type51 Property Custom Action to assign an array of properties to the CustomActionData property (such as /PROPA=1 /PROPB=2 /PROPC=3) and then from within InstallScript decode the value of PROPA, PROPB or PROPC.

I hope this helps people making the transition to the new InstallScript runtime environment.

1 comment:

Christopher Painter said...

I've been considering refactoring this pattern to use XML for data storage and XPath for enumeration but this adds some runtime dependencies and plumbing overhead that most people probably don't really need.

Still, if you find this pattern can't scale to your data set requirements, please leave a comment and I'll start coding it.