Mutually Exclusive Subitems - Advanced Installer Community

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!

gknierim
Posts: 42
Joined: Wed Jan 18, 2012 3:57 pm

Mutually Exclusive Subitems

I have 2 subitems that I want the user to only be able to select one of them depending on the type of system they have. Please see attachment.

How can I add this validation so that only 1 sub item is selected?

Thanks,
Greg
Attachments
storesetup.png
storesetup.png (39.49 KiB) Viewed 6074 times
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Mutually Exclusive Subitems

Hi Greg,

You can try to add a Remove published event on the "Next" button from a dialog before CustomizeDlg:
http://www.advancedinstaller.com/user-g ... section141

You can condition this event by reading the following article:
http://www.advancedinstaller.com/user-g ... stall.html

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
gknierim
Posts: 42
Joined: Wed Jan 18, 2012 3:57 pm

Re: Mutually Exclusive Subitems

I understand that I can remove the feature when they click next but if they select both features, how can I tell which one they really want to install?

Is there a way I could see if both subfeatures are selected and check when they click the next button and display a messagebox telling them they need to select one or the other? That way would work for me.

Thanks,
Greg
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Mutually Exclusive Subitems

Hi Greg,
Is there a way I could see if both subfeatures are selected and check when they click the next button and display a messagebox telling them they need to select one or the other?

Code: Select all

&Feature=INSTALLSTATE_LOCAL
This condition will be true only if the feature "Feature" will be installed locally. If the feature is not selected for installation the condition is false.
For more related information, please read this article.

You can conditionally publish a "SpawnDialog" event when the user clicks the "Next" button:
http://www.advancedinstaller.com/user-g ... section137

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
gknierim
Posts: 42
Joined: Wed Jan 18, 2012 3:57 pm

Re: Mutually Exclusive Subitems

OK, on the Next button of my custom dialog, I added a Published Event SpawnDialog with the argument SpawnDialog and the condition as this:

&Radiant=INSTALLSTATE_LOCAL AND &Elo=INSTALLSTATE_LOCAL

However, when I run the installation and select both subfeatures and click the next button, the Spawn dialog doesn't appear and the VerfiyReadyDlg appears. There is also the NewDialog event with the argument VerifyReadyDlg and condition of AI_INSTALL on the next button as well and it is below my SpawnDialog.

Do I need to do something else to show the dialog?

Thanks,
Greg
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Mutually Exclusive Subitems

Hi Greg,

I have tested this and indeed the SpawnDialog event seems to be non-responsive to a feature action condition. This must be a Windows Installer limitation because any other condition works fine.
I recommended this kind of event because its default behavior is to stop the UI from jumping to the next dialog.

Here's what you ca try instead:
- use this article to create a message box UI Custom Action
- add a DoAction event for the message box custom action on the "Next" button of the CustomizeDlg using your condition
- add the negated condition to the NewDialog event that would show the next dialog in chain
I tested the above and it should work as expected.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
gknierim
Posts: 42
Joined: Wed Jan 18, 2012 3:57 pm

Re: Mutually Exclusive Subitems

So, I added a custom dialog but I'm not sure where to put it in the custom actions tree. I put it under the Install node. Is this correct?

Second, when I go to add the DoAction event on the next button, there is nothing in the Argument dropdown.

Third, I don't understand what the negated condition would be - is that my (@Feature1=INSTALL_LOCAL AND @Feature2=INSTALL_LOCAL) code?

Can you provide an example?

Thanks,
Greg
gknierim
Posts: 42
Joined: Wed Jan 18, 2012 3:57 pm

Re: Mutually Exclusive Subitems

OK, I've added the MessageBox to the UI Custom Action tree node in the Custom Actions section but 2 things now:

1) I see no way to customize the message text.
2) It doesn't work when I click the Next button.

An example would really help here.

Thanks,
Greg
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Mutually Exclusive Subitems

Hi Greg,
So, I added a custom dialog but I'm not sure where to put it in the custom actions tree. I put it under the Install node. Is this correct?
A custom dialog can be added from the Dialogs page using the dialog editor. Here we can discuss about "First Time Install" sequence.
An custom action can be added from the Custom Actions page. Here we can discuss about "Install" standard action.
Second, when I go to add the DoAction event on the next button, there is nothing in the Argument dropdown.
The custom action will appear in the argument combo box if it's added as an UI Custom Action in the Custom Actions page.

The negated condition of:

Code: Select all

@Feature1=INSTALL_LOCAL AND @Feature2=INSTALL_LOCAL
is:

Code: Select all

NOT ( @Feature1=INSTALL_LOCAL AND @Feature2=INSTALL_LOCAL )
This means that if the feature action of either "Feature1" or "Feature2" is different from "INSTALL_LOCAL" the negated condition will be resolved to true.
I see no way to customize the message text. It doesn't work when I click the Next button.
To customize the message text you should use CustomActionData property. Please carefully read and follow the message box article I posted previously( blue text ). The answer to these questions is clarified in the last paragraph of the article.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”