Showing results for 
Show  only  | Search instead for 
Did you mean: 
Level 5

How to add custom action to a feature ?


I'm doing Basic MSI project, with 3 features(eg: Feature A, B & C). I would like to run a custom action whenever one of the feature is installed(eg Feature A).
Currently, I add the custom action to run After InstallFinalize and set condition as Not Installed (to avoid the action run when uninstallation). It works fine if i install Feature A at the 1st installation, but if i install Feature B & C first, then only go to modify to install Feature A, the custom action won't run.
So, is there anyway to tie the custom action to Feature A, instead of set in exec sequence?
If you have other better solution, please suggest.

Thanks & Regards,
Labels (1)
0 Kudos
(3) Replies
Level 3

Try the condition stated here -
0 Kudos
Level 16

Take a look at the help topic conditional expressions and note the & Feature Action State Evaluator.

Also, after InstallFinalize is probably not the proper place to put this CA. Inside the transaction before InstallFinaize with a execution context of Defferred with System ( no imperonation ) is probably more approriate. Also you may need to have an immeadiate CA to process your business logic and feed the commands to the deferred CA.

Check out my blog and go to the must read link. You'll find a really good article on InstallSite that talks about all of this.
0 Kudos
Level 5

Thank you so much. It works. 😄
0 Kudos