rmoc
Posts: 19
Joined: Tue Mar 14, 2017 8:27 pm

Feature-based prerequisite

Fri Oct 14, 2022 1:49 pm

I have some feature-based prerequisite.
featurebased.png
featurebased.png (14.96KiB)Viewed 2675 times
However, some of these should only be installed if a certain feature has been selected. In my example I want to install "IIS URL Rewrite 2.1 x64" with "Feature1" or "Feature2". But not if only "Feature3" is selected. Is it necessary to add "IIS URL Rewrite 2.1 x64" twice as a feature-based prerequisite or is there an easier way?
featurebased2.png
featurebased2.png (8.23KiB)Viewed 2675 times

Liviu
Posts: 1035
Joined: Tue Jul 13, 2021 11:29 am
Contact:  Website

Re: Feature-based prerequisite

Mon Oct 17, 2022 2:43 pm

Hello,

In order to achieve that, you need to create your own dialog. To create a custom feature dialog, you can have a look on our How to show a custom feature selection dialog article.

To automatically select a CheckBox when another one is selected you can check the Make checkboxs which can condition other checkboxes forum thread.

Attached you can find a sample project. In this sample the Adobe Reader feature-based prerequisite cannot be installed without "Feature3".

In addition to the changes in the above articles, you need to also follow these steps:

1. Add control conditions (disable and enable) for "Adobe Reader" checkbox. You can check these from the Control Conditions tab when you click on the "Adobe Reader" checkbox control.

When the Feature3 is selected the "Adobe Reader" checkbox is also selected and disabled (so the user cannot unselect this).

2. In the Organization page you can condition the feature installation based on the CheckBox controls selection. Please go to the Organization page and check the Installed if condition for these features.

Please test the attached project and let me know if you have any questions.

Best regards,
Liviu
Attachments
feature based.aip
(30.86KiB)Downloaded 143 times
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

rmoc
Posts: 19
Joined: Tue Mar 14, 2017 8:27 pm

Re: Feature-based prerequisite

Thu Nov 17, 2022 3:27 pm

Hi Liviu

Unfortunately, that is not an option for me. I have ~20 fetaures in several levels in my setup. I would not like to design a separate dialogue for this. The only solution I currently see is to add the prerequisites several times or to create a custom action. However, I have to take care of the version search etc. myself.

Regards
René

Liviu
Posts: 1035
Joined: Tue Jul 13, 2021 11:29 am
Contact:  Website

Re: Feature-based prerequisite

Fri Nov 18, 2022 1:14 pm

Hello René,

You can try the following solution:

1. Go to the Organization page, select the desired feature (in your case "IIS URL Rewrite 2.1 x64") and on the Feature Tree option select Not displayed.

2. Select the Not installed option from the Installation Behavior section.
feature.png
feature.png (107.61KiB)Viewed 2403 times

3. Go to the OptionalFeatsDlg dialog. Click on Next button and on the Published Events tab add the following event:

Event: Install one or more features locally
Argument: Feature2
(the identifier of the feature you hide at step 1).
Condition: ((&Feature3 = 3) AND NOT (!Feature3 = 3))

feature condition.png
feature condition.png (92.63KiB)Viewed 2403 times

In this way, Feature2 will be installed automatically when Feature3 is installed.

Attached you can find the sample project.

Let us know if you have any other questions.

Best regards,
Liviu
Attachments
feature based sample.aip
(31.32KiB)Downloaded 114 times
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”