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!

jstuardo
Posts: 88
Joined: Mon Nov 09, 2015 10:44 pm

Is there a way to have mutually exclusive features?

Hello,

suppose I have 2 features that appear in CustomizeDlg: Feature A and Feature B. The fact is that application cannot use both features at the same time. So, I need that when installation, if the user selects Feature A, Feature B should be unchecked if it is already checked. And vice versa.

Is it possible?

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

Re: Is there a way to have mutually exclusive features?

Hi Jaime,

In order to achieve this you need to create your own dialog as described in the second part of the "How to show a custom feature selection dialog" article.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jstuardo
Posts: 88
Joined: Mon Nov 09, 2015 10:44 pm

Re: Is there a way to have mutually exclusive features?

Thanks... it will work if I use radio buttons, however, that way, I need to add those features separated of the other several features application has, because these mutually exclusive features are among all other normal features.

I am thinking about other solution. To validate the dialog just when a user clicks "Next" button. Is this possible? in CustomizeDlg I only see a checkbox list called CUSTOMIZEDLGQUICKSELECTIONTREE_1_PROP. Is it possible, by mean of a script or whatever, get the checked state of 2 controls inside that list and if both are true, not allow to press "Next"?

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

Re: Is there a way to have mutually exclusive features?

Hi Jaime,

In order to check if a feature is selected for installation, you can use a condition like follows: ((&Feature1 = 3) AND NOT (!Feature1 = 3))

If the above condition is true, it means that the feature will be installed.

Just let me know if you need more details.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jstuardo
Posts: 88
Joined: Mon Nov 09, 2015 10:44 pm

Re: Is there a way to have mutually exclusive features?

Thanks, but I have the question about the control where to add the condition.

i have a new dialog called ChooseFeaturesDlg which is a clone of CustomizeDlg. That dialog has a "Next" button. I have placed the following condition in "Control Conditions" tab when "Next" button is selected:

((&A= 3) AND NOT (!A = 3)) AND (&B = 3) OR ((&B = 3) AND NOT (!B = 3)) AND (&A = 3)

The action, when the above condition is true, will be Disable.

That could be read as: Disable"Next" button when "A" feature will be installed locally and "B" feature will also be installed locally, or, when "B" feature will be installed locally and "A" feature will also be installed locally. That is, when both features are selected to be installed locally, "Next" button will be disabled.

It looks good, however, when I run the installeer, "Next" button is replaced by an "Install" button. I saw that this dialog has an initial condition that only changes button text, but the control itself remains the same. So, what is wrong with that condition? When I choose both features, button remains enabled.,
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Is there a way to have mutually exclusive features?

Hi,

I'm afraid that it is not possible to disable the "Next" button when both features are selected. This can be achieved only if you add another button with a published event that refreshes the dialog.

However, you can display a message box, as described in the "How to make sure an edit box is not empty" tutorial, that does not let the user go to the next dialog if those two features are both selected.

By the way, the correct condition is as follows: ((&A = 3) AND NOT (!A = 3)) AND ((&B = 3) AND NOT (!B = 3))

The text of the "Next" button is changed to "Install" if no other dialogs comes between the "ChooseFeaturesDlg" dialog and the "ProgressDlg" dialog.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jstuardo
Posts: 88
Joined: Mon Nov 09, 2015 10:44 pm

Re: Is there a way to have mutually exclusive features?

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

Re: Is there a way to have mutually exclusive features?

You're welcome Jaime. I'm glad you got this working.

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

Return to “Building Installers”