Minanath
Posts: 8
Joined: Wed Apr 29, 2020 5:24 am

Install Prerequisite base on dialogue selected value condition

We have created an AI project with some dialogue in it.
We have provided a dropdown list in the dialogue to select the feature to install.
On its selection, we want to decide which requisite needs to be install.
But we are not able to get this option in the install prerequisite based on the condition (AI Prerequisite -> Pre-install -> install condition feature)
Please help with this.
thanks in advance
Catalin
Posts: 6592
Joined: Wed Jun 13, 2018 7:49 am

Re: Install Prerequisite base on dialogue selected value condition

Hello and welcome to Advanced Installer forums,

In order to condition the installation of a feature based on your dialog control, you will need to use the control's property.

Every control has a property in Advanced Installer. The property stores the values of your controls.

For instance, in your case, you mentioned you are using a dropdown control. This control is a ComboBox control.

combobox.png
combobox.png (187.42 KiB) Viewed 4673 times

As you can see in the attached screenshot, the combobox (in a default project) has the COMBOBOX_1_PROP property.

Additionally, we have added two default values to it - Feature1 & Feature2.

If you want to install a feature based on the selection, you can use a condition as it follows:

Code: Select all

COMBOBOX_1_PROP = "Feature1"
in the "Installation behavior" section of your feature.

Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Minanath
Posts: 8
Joined: Wed Apr 29, 2020 5:24 am

Re: Install Prerequisite base on dialogue selected value condition

Thanks, Catalin for the reply.
We are doing the same as you mentioned in the comment.
We are using Prerequisite -> feature-based installation -> Install condition.
and last install prerequisite based on the condition
But we are not able to add the condition which you mentioned in the comment
It has some list of options to add a condition like product code, registry ket exists, registry value exist, etc.
But I am not able to see the option for adding the above condition.
and also not able to see
Installation behavior section.

Some more details,
We want to install .net framework 4.5.2 if the system does not have the same or above version.
Only on one condition, if we select the right drop-down value (e.g. Yes, install).

Let us know your comment on the same.

Thanks,
Minanath
Catalin
Posts: 6592
Joined: Wed Jun 13, 2018 7:49 am

Re: Install Prerequisite base on dialogue selected value condition

Hello Minanath,
We want to install .net framework 4.5.2 if the system does not have the same or above version.
Please note that .NET Framework can not be installed as a feature-based prerequisite. For more information about this, please have a look over our "Why does .NET Framework fails as a feature-based prerequisite" article.

With that being said, if you want to install .NET Framework with your setup package, pelase add it as a pre-install prerequisite.

When doing so, our .EXE bootstrapper will spawn some additional dialogs, letting the user know that .NET Framework is required:
prerequisiteAnnouncement.png
prerequisiteAnnouncement.png (130.92 KiB) Viewed 4647 times

and will let the user decide whether he wants to install the prerequisite or not:
prerequisiteSelection.png
prerequisiteSelection.png (39.19 KiB) Viewed 4647 times

Based on that, the .NET Framework will either be installed or not.

Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Minanath
Posts: 8
Joined: Wed Apr 29, 2020 5:24 am

Re: Install Prerequisite base on dialogue selected value condition

Thanks for your reply Catalin,
We got your point to install the .net framework as a pre-install prerequisite.
But as I discussed in my initial comment. We want to install this prerequisite only when the user selects a particular value from drop-down list.
For certain values in the drop-down, it is mandatory to have .net framework 4.5.2 or above.
If we add this installation as a pre-install prerequisite., we are not able to add a selection condition.
Because I'm seeing pre-install prerequisite. -> install condition () -> Install Pre requisite based on condition does not have provision for the same. It has values like product code, registry ket exists, registry value exist, etc.

Let's take an example,
We have dialogue for some version of the software MSI package (e.g. ABC1.0, ABC2.0, ABC3.0). We have given dropdown value to select which version the user wants to install.
Before installing the version ABC2.0, it is mandatory to install .net framework 4.5.2. and the rest of the version (i.e. ABC1.0, ABC3.0) does not require this version.
We want to add a condition, if the user has selected ABC2.0 and the system does not have .net framework 4.5.2 or above version in the system
then and then only prerequisite .net4.5.2 installation is required. We are able to detect the .net framework version installed by using condition registry value with the specified condition.
But we not getting, how to add a condition to install it only when ABC22.0 is selected.

Please let us know how can we proceed?

Please let us know your comment on the same.

THanks,
Minanath
Catalin
Posts: 6592
Joined: Wed Jun 13, 2018 7:49 am

Re: Install Prerequisite base on dialogue selected value condition

Hello Minanath,

Thank you for the explanation.

I understand what you want to achieve here, but unfortunately that is not possible.

Pre-install prerequisites can not be installed based on user selection.

As explained in the "How to conditionally install a prerequisite based on the user selection?", only feature-based and post-install prerequisites can be installed based on the user selection.

The main reason for this is the fact that the user selection happens after the prerequisite is installed.

The user selection happens in the UI of the main package, while the pre-install prerequisites are handled by our EXE bootstrapper and have a different UI seuquence.

Please let me know if there is anything else I could help you with and I will be glad to assist.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Minanath
Posts: 8
Joined: Wed Apr 29, 2020 5:24 am

Re: Install Prerequisite base on dialogue selected value condition

Thanks for the clarification.
I got your point.
Can we add .net framework installation in the MSI?
For the above-explained example.
ABC1.0, ABC2.0, ABC3.0 all are the MSI package created in AI.
So if we could add the .net framework as a prerequisite for ABC2.0.
So eventually, when we try to install ABC2.0 after selection, it will automatically install the .net framework along with ABC2.0 MSI.
It will resolve our problem.
We tried it at our end, but what we found, we can not add a prerequisite for the MSI package.
Please let us know your comment.

THanks,
Minanath
Catalin
Posts: 6592
Joined: Wed Jun 13, 2018 7:49 am

Re: Install Prerequisite base on dialogue selected value condition

Hello Minanath,

You are always welcome!

It is always my pleasure to help.

In what regards this:
ABC1.0, ABC2.0, ABC3.0 all are the MSI package created in AI.
As explained above, the .NET Framework should be added as a pre-install prerequisite. The pre-install prerequisites are handled by our .EXE bootstrapper, therefore when you add a pre-install prerequisite, the main package (in our case here, ABC2.0) will be turned into an EXE.

Additionally, I am not quite sure this would work anyway. Still, the .NET in this case will be installed in the "feature-based" stage of the main package, which will most probably turn into an error.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Minanath
Posts: 8
Joined: Wed Apr 29, 2020 5:24 am

Re: Install Prerequisite base on dialogue selected value condition

Thanks for the reply Catalin.
I got your point. I want to implement this functionality.
So I am thinking of a way around to do it.
As we are adding/ checking the .net framework installed on the system using install condition from pre-requisite->pre-install->install condition.
By checking registry value with specified content, so when it condition fails .net framework is getting install.
On the same line, can we add one condition with checking product version (by product code)?. If it is available, then only install the .net framework.
Means .Net framework should be installed when
1. the first condition fails- .Net 4.5.2 framework and above find
2. Second condition success - Search Product version (by product code) find
Can we add a second condition? We are able to add the first condition. Because we have the option to install prerequisites when all conditions failed.
For adding the second condition, we are not able to find the option to install the prerequisite when the second condition passed.

Please help us with this.

Thanks,
Minanath
Catalin
Posts: 6592
Joined: Wed Jun 13, 2018 7:49 am

Re: Install Prerequisite base on dialogue selected value condition

Hello Minanath,

Please allow me to explain how the prerequisite's install conditions work:

- first of all, the conditions are verified before the installation of the prerequisite. At this point, depending on the option used (either one condition to be false or all conditions), the condition(s) must be false.

- after the prerequisite is installed, the condition(s) is/are checked once again. In this case, the condition(s) must be true.

With this in mind, I'm afraid the your scenario to install a prerequisite if a condition is false and another one is true is not possible. In order for the prerequisite to be installed, both (or all) the conditions must be false.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Minanath
Posts: 8
Joined: Wed Apr 29, 2020 5:24 am

Re: Install Prerequisite base on dialogue selected value condition

Thanks for the reply,
Does it applicable for the Prerequisite install condition only? or Does it applicable to organisation level condition for feature-based pre-requisite also?
Let us know your comment on the same.

Thanks,
Minanath
Catalin
Posts: 6592
Joined: Wed Jun 13, 2018 7:49 am

Re: Install Prerequisite base on dialogue selected value condition

Hello Minanath,

What I have explained above refers to the prerequisite's install conditions ("Prerequisites" page --> "Install Conditions" tab).
or Does it applicable to organisation level condition for feature-based pre-requisite also?
No, it does not apply for the condition you use in the "Organization" page for your features.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”