Control conditions for radiobuttons - 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!

Phobos
Posts: 85
Joined: Fri Sep 08, 2006 11:52 am
Location: Germany

Control conditions for radiobuttons

Hi,

I created a custom dialog that contains a radiobutton group and a combobox. Depending on the value of the combobox I want a specific radiobutton selected.
So if e.g. the combobox is empty I want radiobutton "A" to be selected when the dialog appears for the first time.

Can this be done? Thanks!
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

You need to create a "Published Event" on the "Next" button of the dialog that it's in front of the dialog that contains the combobox, like this:
Event: SetProperty and type [RADIO_PROP] (the property of the Radio Group)
Argument: 1 (the value of the first ration button, A)
Condition: NOT COMBO_PROP (the combo is empty)

Also you can create another published event to select other radio button if the combo is not empty.

Best Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
Phobos
Posts: 85
Joined: Fri Sep 08, 2006 11:52 am
Location: Germany

Hi Gigi,

Thanks for the reply. I just tested this but it is not working the way I want it to. I created those two published events on the "Next" button, but when I press it the next dialog always has radiobutton A selected, even if the combobox contains values.
So what I want to achieve is, if there is no selection possible in the combobox I want radiobutton A selected, otherwise radiobutton B.
Could it be a problem that the event that is populating the combobox is on the same "Next" button?

Thanks.
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

In the script that populates the combo you can set a property with a value (for example: "FALSE" means the combo is empty, "TRUE" otherwise):

Code: Select all

Session.Property("COMBO_EMPTY") = "TRUE"
Now condition the published events from my previous post with this property.

Best Regards,
Gigi
_______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
Luxor
Posts: 3
Joined: Wed Jun 27, 2007 1:34 pm
Contact: ICQ

Hi, i have a some troble with custom dialog:
During initialization I check registry keys of application(there are may be 3 variants of installed application 1st - GeoMedia, 2nd - GeoMediaObject and 3d - GeoMediaProfessional)if there are only one of this application installed, then installation continues. How can I check RadioButton on the next Custom Dialog?may be radiobutton is not best variant.
example: there are radiogroup with 3 radiobuttons - GeoMedia, GeoMediaObject, GeoMediaProfessional. If on initialization there are GeomediaObjects keys in registry, then on custom dialog we must message to user, that there are GeomediaObjects installed on his machine.May be i have to use message dialog instead of custom dialog?
Please help...
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,
If on initialization there are GeomediaObjects keys in registry, then on custom dialog we must message to user, that there are GeomediaObjects installed on his machine.May be i have to use message dialog instead of custom dialog?
This can be done by using a search and custom action.

Here are the steps:
- in this example the "GeoMedia", "GeoMediaObject" and "GeoMediaProfessional" registry values will look like this:

Code: Select all

GeoMedia = geomedia
GeoMediaObject = geomediaobject
GeoMediaProfessional = geomediaprofessional
- in the "Search" page you create three searches with the location set to "Registry"
- these searches will be named GEOMEDIA, GEOMEDIA_OBJECT and GEOMEDIA_PROFESSIONAL
- you set these searches to retrieve the raw values of the "GeoMedia", "GeoMediaObject" and "GeoMediaProfessional" registry values
- you can read more about the "Search" page here:
http://advancedinstaller.com/user-guide/search.html
- in the "Custom Actions" page you create a new "Script Inline" custom action scheduled under the "UI Custom Actions" sequence
- you set the "Script Text" field of the custom action to:

Code: Select all

MsgBox "GeoMedia products are already installed on your computer!"
- you can read more about custom actions here:
http://advancedinstaller.com/user-guide ... -page.html
- in the "Dialogs" page in your custom dialog you select the "Next" button
- in the "Published Events" tab you create a new "DoAction" control event that looks like this:

Code: Select all

DoAction     ScriptInline     AI_INSTALL AND (GEOMEDIA="geomedia" OR GEOMEDIA_OBJECT="geomediaobject" OR GEOMEDIA_PROFESSIONAL="geomediaprofessional")
This condition will make the custom action to run only when at least one of the three registry values has been found.

You can read more about control events here:
http://advancedinstaller.com/user-guide ... ditor.html

Let me know if you encounter any problems.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Luxor
Posts: 3
Joined: Wed Jun 27, 2007 1:34 pm
Contact: ICQ

Thanks to you cosmin, but i need a custom dialog, not MessageBox.
On custom dialog i have radiogroup with 3 radiobuttons.
In dependence of a product which installed on machine in radio group will be checked a radiobutton and other 2 radiobuttons will be disabled...
ex.:
I start the installer and found registry keys of GeoMedia Professional, then will be message dialog and then i push button "Next" on the welcome dialog, after that will be Cutomdialog with 3 radiobuttons. One of the button will be checked - it will be GeoMedia Professional, and others will be disabled.
Is it possible in AI. May be i have to write inline script, which will be change property "Selected" on "True" of "False".
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,
One of the button will be checked - it will be GeoMedia Professional, and others will be disabled.
Note that you cannot disable a radio button because it is not an independent control. This can be done only for a Radio Buttons Group control.

However, you can use checkboxes instead of radio buttons:
- on the custom dialog you create a checkbox with the "Text" field set to "GeoMedia Professional"
- you set the "Value" field to a distinct value (for example "Professional")
- you set the "Default Value" field to 1 (this way the checkbox will be selected by default)
- you set the "Property Name" field to a distinct value (for example PROFESSIONAL)
- in the "Control Conditions" tab (in the "Control" section) you create this control event:

Code: Select all

NOT GEOMEDIA_PROFESSIONAL                      Disable
where GEOMEDIA_PROFESSIONAL is the result of the registry search (like I explained in my previous post)
- you repeat the steps above for the other two products (GeoMedia and GeoMediaObject) so in the end you will have three checkboxes in the custom dialog.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Luxor
Posts: 3
Joined: Wed Jun 27, 2007 1:34 pm
Contact: ICQ

Thanks cosmin. Everything is clear. AI great product.)))

Return to “Common Problems”