Shared prerequisite between multiple features - Advanced Installer Community
prerak6962
Posts: 112
Joined: Mon Dec 08, 2014 5:26 pm

Shared prerequisite between multiple features

Hello,

In one of my project I have a prerequisite that needs to be installed.
The project has multiple features (A, B, C for the moment).

I want that prerequisite should be installed if the user selects Feature A or Feature B or both.
To achieve this, I added a feature based prerequisite and I could see this as a feature (Feature P for the moment) in the "Organisation" page.

Now, I moved Feature P as a sub feature of Feature A and if the user selects to install Feature A, the prerequisite is installed successfully.
However, I can not copy the Feature P as a sub feature of Feature B. If I move the feature P from Feature A to Feature B by holding the SHIFT key, it copies the components of Feature P, but the prerequisite is not installed when I run the installer.

Couple of solutions that I have in mind are:
1. Add same prerequisite two times and provide them to Feature A and Feature B. But this will have file duplication and the size of the installer will increase (prerequisite is embedded locally). Also, I am not sure, how will this work out if the user selects both Feature A and Feature B for installation.

2. Add the prerequisite installer as a temp file and invoke it using a custom action during "Install Execution Stage" and provide the feature installation state (both A and B) as the condition.

The solution 2 seems the good way to me for the moment but is there a straight forward way that this can be done using "Prerequisite" feature of the software?

Than you.
Prerak
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Shared prerequisite between multiple features

Hi Prerak,

Indeed, adding the prerequisite to your package twice will increase the size of the package and installing it through a custom action during the "Install Execution Stage" section will not work because it will conflict with the main package.

The recommended solution to achieve what you want, is to create a custom feature selection dialog where the user can choose which feature will be installed, then use the properties related to the features A and B as a condition for the prerequisite's feature in the "Organization" page.

Let me know if this helped or if you have other questions.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
prerak6962
Posts: 112
Joined: Mon Dec 08, 2014 5:26 pm

Re: Shared prerequisite between multiple features

Hi Eusebiu,

Thank you the reference link.

Is it completely necessary to build a custom feature selection dialog?

The prerequisite feature is marked as "Not Installed" in "Organisation" page. I tried setting the following condition in the "Installed If" field:

Code: Select all

((&FA = 3) AND NOT (!FA = 3)) OR ((&FB = 3) AND NOT (!FB = 3))
But it does not work as expected. Also, while setting the "Installed If" condition, in the condition building wizard, I was not able to see the predefined conditions for the features. Is it normal?

And will building a custom feature selection dialog allow me to do what I am trying to achieve?

Thank you.
Prerak
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Shared prerequisite between multiple features

Hi Prerak,

I'm afraid that you can achieve what you want only through a feature selection dialog. Setting a condition for a feature based on other features, does not work.

Can you please give more details about the way you set the condition that you are not able to see?

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
prerak6962
Posts: 112
Joined: Mon Dec 08, 2014 5:26 pm

Re: Shared prerequisite between multiple features

Hi Eusebiu,
I'm afraid that you can achieve what you want only through a feature selection dialog
I have the feature selection dialog in the installer. It is the default "ConfigureDlg". However, the prerequisite feature is hidden as it's a compulsory prerequisite so I don't want the user to deselect it.
Capture.PNG
Capture.PNG (19.22 KiB) Viewed 15168 times
Can you please give more details about the way you set the condition that you are not able to see?
When I click "More Options" under "Installation Behaviour" in "Organization" page for the feature under I get the dialog marked with 1 in the below image.
On double clicking the condition, I get the dialog marked with "2". Now to open the condition builder I click the button with 3 dots (...) which opens the dialog marked with 3.
In this dialog there is no predefined condition for Features or Components (in the area marked with Red box).
Capture2.PNG
Capture2.PNG (194.69 KiB) Viewed 15168 times
I hope it is clear now.

The article that you provided before tells to create a new dialog for the features (by adding check boxes and all). I am trying to avoid to create a new dialog and use the predefined dialog.

Prerak
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Shared prerequisite between multiple features

Hi Prerak,

Sorry, in the previous reply I wanted to say "custom feature selection dialog" as it is described in the article I sent. I'm afraid that it is the only solution.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
prerak6962
Posts: 112
Joined: Mon Dec 08, 2014 5:26 pm

Re: Shared prerequisite between multiple features

Okay. I'll give it a shot.

Thanks.
Prerak
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Shared prerequisite between multiple features

You're welcome Prerak.

If you have other questions, just let me know.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”