ListBox validation - 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!

Rigesh
Posts: 9
Joined: Thu Dec 22, 2011 9:32 am

ListBox validation

Hi,

Is there any way to validate the list box (Multiple selection) through advance installer?

My project has one List Box (Multiple selection) that populated drives through C++ dll. Is there any way to validate the selection of Listbox (Minimum selection 1 and Maximum selection 4 )? Without minimum selection, should not activate the 'Next' button and if maximum selection, should give some message and wait for the valid selection.

Thanks & Regards
Rigesh E
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: ListBox validation

Hi,

This is possible, but for this level of conditioning you will also need a small custom action, to perform the validation of the selections. The custom action
will be added as a "DoAction" event on the list, and will simply set a new public property, let's call it "MY_PROP", to "1" or "0" based on the selection made.
http://www.advancedinstaller.com/user-g ... te-ca.html

Then you need to select the "Next" button from the dialog and add two control condition, from "Control Conditions" tab, that enable and disable the button, based on the property's value.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Rigesh
Posts: 9
Joined: Thu Dec 22, 2011 9:32 am

Re: ListBox validation

Hi Bogdan,

Thanks for your quick reply. :)

The list box I need to validate is being populated system drives using through C++ Dll custom action. How i will get the information directly through advance installer that user selected more than 4 drive or selected none? As per your reply I got the number of selection using MsiGetProperty, and depend up on the selection the public property set to '1' and '0' using MsiSetProperty . In Next button control condition also made as per your reply. But the Next button always get disable. I am implement the selection validation custom action also on 'Next' button as below. Is there any provision to run an custom action directly on list box?

Next button Control Condition
----------------------------------
Condition : MY_PROP = 0
Action : Disable

Condition : MY_PROP = 1
Action : Enable


Thanks and Regards
Rigesh E
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: ListBox validation

Hi Rigesh,
Is there any provision to run an custom action directly on list box?
The Windows Installer list box cannot publish events directly but the Enhanced UI list box can. To run a custom action when the selection is changed inside a list box, you can try to enable the Enhanced UI from the Themes page, Settings tab. However, please keep in mind this project will build an .EXE instead of .MSI.
But the Next button always get disable.
I am not sure why you are getting this behavior. The way you implemented the control conditions clearly indicates the button will be disabled if MY_PROP = 0 and enabled if MY_PROP = 1.
You can try to debug your custom action to ensure the values are not altered.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Rigesh
Posts: 9
Joined: Thu Dec 22, 2011 9:32 am

Re: ListBox validation

Hi Mihai,

Can i get a sample .aip project for the list box validation ?

Thanks & Regards
Rigesh E
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: ListBox validation

Hi Rigesh,

Since our support boundaries don't cover creating or debugging custom actions, I cannot provide the custom action. That itself is the most relevant part of this functionality.
Instead, I can provide a sample .AIP that demonstrates what my colleague Bogdan mentioned in his above post:
http://www.advancedinstaller.com/forums ... 218#p49194
Let me know if you are interested.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Rigesh
Posts: 9
Joined: Thu Dec 22, 2011 9:32 am

Re: ListBox validation

Hi Mihai,

Thanks for the help.

I implemented the validation as per Bogdan reply. Its working fine.

Thanks & Regards
Rigesh E

Return to “Common Problems”