dorehill
Posts: 3
Joined: Tue Jul 12, 2011 2:39 pm

Install Feature Based on Condition

Hi,

I am trying to use the parameter "Install based on condition" which is in the "Feature Properties" pane. I want to install features based on what the user has selected using radio buttons (set a property).

I have a dialog with a RADIO_GROUP control and 3 radio buttons each with the values ("Client", "Server", "Processing"). The default is RADIO_GROUP="Client". I have 3 features:

1) Client Feature - I set the Install condition to "RADIO_GROUP="Client"
2) Server Feature - I set the install condition to "RADIO_GROUP="Server"
3) Processing Feature - I set the install condition to "RADIO_GROUP="Processing"

If I run the installer and use defaults then the client feature install correctly. If I run and click on the "Server" radio button then all features install?!?!

I have checked in the log and the RADIO_GROUP property is changed correctly on the selection dialog. It just doesn't seem to be used correctly by the feature install condition.

Any ideas?

Many Thanks,

Rob.
Bogdan
Posts: 2794
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Install Feature Based on Condition

Hi Rob,

As our user-guide mentions, I'm afraid you cannot set a condition on the feature using properties set from the MSI dialogs.

The solution for you is to use a custom feature selection dialog, like explained in the following article.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
dorehill
Posts: 3
Joined: Tue Jul 12, 2011 2:39 pm

Re: Install Feature Based on Condition

Hi,

Thanks for your reply.

I did try that and couldn't get it to work. I kept getting the error:

Error 1720. There is a problem with this Windows Installer package. A script required for this install to complete could not be run. Contact your support personnel or package vendor. Custom action SetFeatureStates script error -2146828275, Microsoft VBScript runtime error: Type mismatch: 'Session.FeatureRequestState' Line 3, Column 1,
MSI (c) (30:34) [15:45:22:680]: Product: Verint Interface Application -- Error 1720. There is a problem with this Windows Installer package. A script required for this install to complete could not be run. Contact your support personnel or package vendor. Custom action SetFeatureStates script error -2146828275, Microsoft VBScript runtime error: Type mismatch: 'Session.FeatureRequestState' Line 3, Column 1,

The script looks like:

' Initialize the install states of the mutually exclusive features
' and set their states based on the radio button selection
Session.FeatureRequestState("Client") = msiInstallStateAbsent
Session.FeatureRequestState("Server") = msiInstallStateAbsent
Session.FeatureRequestState("Processing") = msiInstallStateAbsent

If Session.Property("RADIO_GROUP") = "ClientRadioButton" Then
Session.FeatureRequestState("Client") = msiInstallStateLocal
ElseIf Session.Property("RADIO_GROUP") = "ServerRadioButton" Then
Session.FeatureRequestState("Server") = msiInstallStateLocal
ElseIf Session.Property("RADIO_GROUP") = "ProcessingRadioButton" Then
Session.FeatureRequestState("Processing") = msiInstallStateLocal
End If

Many Thanks,

Robert.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Install Feature Based on Condition

Hi Robert,

Does your script initialize the install state constants?

Code: Select all

Const msiInstallStateAbsent = 2
Const msiInstallStateLocal  = 3
If they are not initialized, they are not recognized when compared with Session.FeatureRequestState result. If they are initialized in your script, can you please send it to use along with your .AIP (project) file to support at advancedinstaller dot com so we can investigate them?

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
dorehill
Posts: 3
Joined: Tue Jul 12, 2011 2:39 pm

Re: Install Feature Based on Condition

Great. that worked great.

It would be good if you could update the example as that piece of code was missing from the "Use radio buttons to select which features will be installed" section on the the article http://www.advancedinstaller.com/user-g ... ature.html

Thanks again.

Rob.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Install Feature Based on Condition

Hi Rob,

The help will be updated in the next version. Thank you for bringing this to our attention.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
invalidptr
Posts: 79
Joined: Thu Nov 18, 2010 7:10 pm

Re: Install Feature Based on Condition

We can't upgrade yet so if you're still on an old version you'll need to use the Internet Wayback machine to reveal the old method.
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Install Feature Based on Condition

Hello,

Please keep in mind that in order to read the corresponding help articles(i.e. "Show a custom feature selection dialog" article) of a specific Advanced Installer version you can proceed like this:
- Open the related Advanced Installer version and press F1.
- In the Advanced Installer Help go to:
  • Tutorials, How To's, Q&A -> How To's -> User Interface -> Show a custom feature selection dialog
All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
invalidptr
Posts: 79
Joined: Thu Nov 18, 2010 7:10 pm

Re: Install Feature Based on Condition

Thanks Daniel, good to be mindful of that.

I'm curious, I convinced myself "Install Behavior" -> "Install based on condition" would do what instead I had to do via "Show a custom feature selection dialog". What does this feature do in 8.1 of AI?
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Install Feature Based on Condition

Hello,

In the related "Condition" field, from "Organization" -> "Features Properties" right pane, you can set a condition based on which the selected feature will be installed or not.

Please keep in mind that you cannot use a property set from User Interface of the installation process in the "Condition" field because this condition is evaluated (during CostFinalize standard action) before the MSI dialogs start. However, starting with version 9.3 of Advanced Installer we have added a predefined support for this, so you can use a property set from User Interface in the related "Condition" filed from "Organization" page.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
AnneTheAgile
Posts: 61
Joined: Wed Jun 08, 2011 9:53 pm

Re: Install Feature Based on Condition

Thank you so much for this Install Feature Based on Condition in 9.3 (2012-06)! I had tried to do this in an earlier version and it was very difficult for me. The new selection is incredibly helpful. AIP's frequent, significant updates are a huge blessing.
checkwa
Posts: 15
Joined: Wed May 14, 2014 5:38 am

Re: Install Feature Based on Condition

Hi,

I'm using 11.2 version, and i'm trying to achieve "install feature based on condition" using customdialog. I'm referring on this tutorial http://www.advancedinstaller.com/user-g ... ature.html but i can't see where to find the condition as mentioned below. Can't you shed some light for me here.

> in the end you'll need to define the features for your project in the Organization Page:
"Feature 1" with the Identifier Feature1 and condition CHECK1
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Install Feature Based on Condition

Hello,

In order to install a feature based on a condition (e.g. a property value) you can proceed like this:
- in the "Feature Properties" right pane -> "Installation Behavior" section select the "Not Installed" radio button
- click on the "Add Install -time Conditions" hyperlink and add the desired condition in the "Installed if" field
- build and run your project

If you have any question let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
checkwa
Posts: 15
Joined: Wed May 14, 2014 5:38 am

Re: Install Feature Based on Condition

thanks, i'll try that and will let you know.
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Install Feature Based on Condition

You're welcome.

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

Return to “Common Problems”