Create x Radio Buttons based on registry entries - Advanced Installer Community
philbo
Posts: 11
Joined: Mon May 04, 2015 12:33 pm

Create x Radio Buttons based on registry entries

Hi,

I would like to generate radio button based on registry entries.

In detail I would like to check if there are keys under 2 different locations:
1) hklm:\SYSTEM\CurrentControlSet\services\IANSPROTOCOL\Parameters\Adapter -> Available HW NIC
2) hklm:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCard -> Available MS Teaming Interfaces

And if there are some go into the keys and show the radio buttons (number of buttons is based on the found keys):
-) Display text of the radio button should be taken from description (HW NIC) or AdapterName (Teaming NIC) value of each key
-) Value for the radio button should be taken from ServiceName (HW NIC) or MiniportBindingList (Teaming NIC) value of each key

An additional problem is, that the Teaming interfaces have different values in each registry key - so I would need to

Can I achieve this via Advanced Installer or do I need to write a separate script to extract this values and make them available for Advanced Installer. If so how can I pass this values and labels to the radio buttons?

Thank you in advance!

BR,

Philipp
Irina
Posts: 113
Joined: Mon Apr 27, 2015 11:42 am

Re: Create x Radio Buttons based on registry entries

Hello Philipp,

Unfortunately, we do not have support neither for the search you are wanting to do, nor for the dynamic creation of the radio buttons.

A possible workaround would be to make a custom action that will use the output of your own search, and write the found values in properties.
Then, use these properties to populate a combobox or a listbox.

Kind regards,
Irina
Ecaterina Irina Grosu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
philbo
Posts: 11
Joined: Mon May 04, 2015 12:33 pm

Re: Create x Radio Buttons based on registry entries

Hi,

thank you for your quick answer.

I have created a powershell script, which is extracting the values into a public property using a custom action ("Run Windows Powershell Script")

Code: Select all

AI_SetMsiProperty NICCOMBOBOX "NICCOMBOBOX|Test1#value1|Test2#value2"
When i set the property name of the Combox to NICCOMBOBOX, the Combobox shows the value Test1#value1|Test2#value2, but not a list. From my understanding it should create a combobox with 2 entries, not the whole string :/.

Could you tell what is going wrong here?

I have also created a second custom action ("Populate Combobox), however I do not know how to use this one from the Powershell script. From my understanding I should Invoke this custom action (populate) there, but with what command?

BR,

Philipp
Irina
Posts: 113
Joined: Mon Apr 27, 2015 11:42 am

Re: Create x Radio Buttons based on registry entries

Hi Philipp,

In your script the property that has to be set is AI_COMBOBOX_DATA, as seen in the combobox working guide.
So, the line should be

Code: Select all

AI_SetMsiProperty AI_COMBOBOX_DATA "NICCOMBOBOX|Test1#value1|Test2#value2"
The PopulateCombobox custom action will look in AI_COMBOBOX property to see if is set.

After that, an "Execute custom action" event created on a dialog will trigger the PopulateCombobox custom action.

So, as an example for your case, after creating the PopulateCombobox custom action, you should go to the "Init Events" tab of the dialog that the combobox belongs to.
Here, you will have to set an "Execute custom action" event for the PopulateCombobox action.

Let me know if you have any more questions.

Kind regards,
Irina
Ecaterina Irina Grosu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
philbo
Posts: 11
Joined: Mon May 04, 2015 12:33 pm

Re: Create x Radio Buttons based on registry entries

Hi Irina,

thank you very much for your help.

I have already tried it with the AI_COMBOBOX_DATA property in the PS script, however I have choosen the wrong populate functionality -> populateListBox instead of populateCombobox. This was the error in my case :).

Anyhow big thanks!

Now I need to figure out why my PS script only returns my hardcoded values and not the extracted ones from the registry :/. When I execute it locally everything seems to work - are there some functional limitations in AI when using the Powershell? Are there some debugging possibilities in combination with a Powershell custom action?

Greetings,

Philipp
philbo
Posts: 11
Joined: Mon May 04, 2015 12:33 pm

Re: Create x Radio Buttons based on registry entries

Hi,

I have found the error :).

This does not work:

Code: Select all

AI_SetMsiProperty AI_COMBOBOX_DATA "NICCOMBOBOX|"+$comboxboxString;
This one works:

Code: Select all

$comboxboxString = "NICCOMBOBOX|"+$comboxboxString
AI_SetMsiProperty AI_COMBOBOX_DATA $comboxboxString;
Greetings,

Philipp
Irina
Posts: 113
Joined: Mon Apr 27, 2015 11:42 am

Re: Create x Radio Buttons based on registry entries

Hi Philipp,

I am glad you got this working by yourself.
If you have other questions, please let us know.

Kind regards,
Irina
Ecaterina Irina Grosu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”