To check the precondition after selecting a function, you can use a custom action. In this custom action, you can check whether this function is selected, and according to this, you can use the registry search to get information about the necessary conditions and pre-processing actions.
To get the whole function in a custom action, you can use this code example:
foreach (FeatureInfo fi in session.Features) { if (fi.RequestState == InstallState.Local || fi.RequestState == InstallState.Source || fi.RequestState == InstallState.Default) { if (fi.Name == "Feature1") { //check for prerequisite for Feature1 } if (fi.Name == "JobService") { //check for prerequisite for Feature2 } } }
If the precondition is not set, set some session variable to display the message in the user interface
source share