We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

jderosa
Posts: 19
Joined: Wed Sep 28, 2016 8:27 pm

Pre-Requisite check after feature selection

Is there a way to check for a pre-req after feature selection ?
I have an application that may or may not have a web component installed, and if not it does not need IIS installed.

So I only want to check if it's installed after the features have been selected.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Pre-Requisite check after feature selection

Hello,

I'm afraid we don't have out of the box support for this requirement. All launch conditions are evaluated and triggered at the very beginning of the installation setup.

However, as a workaround, you can remove the IIS launch condition added in your project and create and use your own custom action to check if IIS is installed and save the result check into a property. Then you can add a "Display a specific child dialog" event on the [Next] button which will pop up while the related feature is selected and the IIS is not installed, thus preventing the installation without IIS installed.

As another approach, more straight forward, you can add IIS as a "Windows Feature Bundle" to your setup (this way will be installed by your setup package) and condition the IIS bundle to be installed only when the related feature is deployed. Just go to "Prerequisites" page and add a new "Windows Feature bundle" configured to enable the "IIS" Windows feature. Use in the "Condition" field a condition like this:

Code: Select all

((&MyWebFeature = 3) AND NOT (!MyWebFeature = 3))
Let us know if this helped, otherwise please give us more details about your scenario.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jderosa
Posts: 19
Joined: Wed Sep 28, 2016 8:27 pm

Re: Pre-Requisite check after feature selection

I think what I am going to try, is check for iis install with custom action, prior to the feature selection screen. And if it isn't installed the feature will be disabled, and I will display a message at the bottom of the feature selection screen.

Thanks for your help on this.
jderosa
Posts: 19
Joined: Wed Sep 28, 2016 8:27 pm

Re: Pre-Requisite check after feature selection

Ok I'm pretty close to having a solution.
I wrote a powershell custom action that correctly detects if IIS is installed and running and sets a parameter IIS_STATUS = to "True" or "False"

The issue I am having now, is getting the feature to be disabled if IIS_STATUS<> "True"

If I set the feature property to Installed, and set Not Installed to IIS_STATUS<> "True" the feature shows up and is unchecked
If I set the feature property to Installed, and set Disabled if IIS_STATUS<> "True" the feature is always disabled.

What I want, is if IIS_STATUS = "True" I want the feature to be installed, if it's false I want it to not be installed and be disabled.

What am I doing wrong here ??
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Pre-Requisite check after feature selection

Hello,

This happens because the conditions for feature actions (installed, disabled, not installed) are evaluated during "CostFinalize" standard action (part of the "Paths Resolution" action group). To achieve what you want you should just make sure your custom action is scheduled before the "Paths Resolution" action group.

For instance, you can add your custom action as a custom action with sequence before "Wizard Dialogs Stage -> Paths Resolution" action group. Then while keeping the [SHIFT] key pressed darg and drop the custom action under "Install Execution Stage" just before "Paths Resolution" action group. Under "Execution Stage Condition" click on the "Advanced execution scenarios..." hyperlink and select the "Skip action in Install Execution Stage if executed in Dialogs Stage" option.

Let me know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jderosa
Posts: 19
Joined: Wed Sep 28, 2016 8:27 pm

Re: Pre-Requisite check after feature selection

Ok this did more or less what I wanted, the "disabled" functionality didn't kick in, but at least

If IIS is installed the feature is turned on
If IIS is not installed the feature is turned off

What is interesting, is I have the same condition in Disabled and Not Installed ("IIS_STATUS="False")
The Not Installed appears to be working correctly
The Disabled does not appear to be changing at all

But this is good enough for now.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Pre-Requisite check after feature selection

Hello,

Please note that this is the default behavior. You should not use the same condition for "Not Installed" and "Disabled". The "Disabled" option will set the feature not to install and not to be displayed in the selection tree control. Therefore you should either use the "Not installed" option or the "Disabled" one for the same condition.

If you have anyq uestions just let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”