Regarding InstallTypeDialog - Advanced Installer Community
a.singh
Posts: 16
Joined: Wed Jan 11, 2017 10:38 am

Regarding InstallTypeDialog

Hi,

I wanted to know is there any way to dynamically set the "Selected" property of the Radio Button present on InstallTypeDialog using custom action or any other way.

Thanks :)
Sorin
Posts: 663
Joined: Mon May 08, 2017 1:03 pm

Re: Regarding InstallTypeDialog

Hello,

On the InstallTypeDialog predefined dialog there is a Radio Button Group containing two Radio Buttons. The selection works in the following way: The radio button group is associated with Ai_InstallPerUser property. Every radio button has a Value. In our case "Only for me" value is "1" and "Everybody (all users) value is "0". When the a radio button is selected, the property associated with the radio group will receive the button's value. For example for the first button Ai_InstallPerUser will receive "1" value.

In a similar manner you could set Ai_InstallPerUser property to either "1" or "0" using a set installer property custom action.

A property could also be referenced in a VBS/C#/C++ custom action. To achieve this please take a look on our article: How to set an installer property using custom actions

Please note that if you don't want to display "InstallTypeDlg" at all, you should manually call "AI_AuthorSinglePackage" - this custom action is specific to Advanced Installer and evaluates the value of "AI_InstalPerUser" property and sets the installation mode accordingly.
By default it is called through a published event placed on "Next" button on "InstallTypeDlg" dialog.

If you choose not to display "InstallTypeDlg" you also need to ensure that the user has sufficient privileges to do a per-machine install.

You could find more information regarding per-user and per-machine install in the following article: How do I make the package install per-user or per-machine?

Please let us know if this helped.


Best regards,
Sorin
Sorin Stefan - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
a.singh
Posts: 16
Joined: Wed Jan 11, 2017 10:38 am

Re: Regarding InstallTypeDialog

Thanks for your reply. But my question is different.

I want to select the radio button using Custom Action. For example when I navigate from Welcome Dialog to InstallTypeDialog then on the basis of few criteria I want to set the "Only for me" or "Everybody" radio Button selected. I don't want to set any radio button selected by default it has to be decided at runtime about which will be selected.

I mean I wanted to set the "Selected" Property of Radio Button to True or False Dynamically.

Is it possible?
Sorin
Posts: 663
Joined: Mon May 08, 2017 1:03 pm

Re: Regarding InstallTypeDialog

Hello,

Please note that in a radio button group one of the buttons must always be selected. Please take a look on our article : Radio Button Group. By default "Only for me" is selected, thus Ai_InstallPerUser is set to "1". You could evaluate a condition before the InstallTypeDlg is displayed and if it is true, set Ai_InstallPerUser to "0", thus selecting "Everybody (all users).

The behaviour you need could be obtained by creating a "Set Installer Property" custom action for Ai_InstallPerUser property. The execution of this custom action should be conditioned by your criteria.

This method could be implemented in the following way:

-go to "Custom Actions" page and create a new "Set installer property" without sequence. In the Property field enter "Ai_InstallPerUser" and "0" in the value field.
-go to WelcomeDlg, the dialog preceding the dialog containing the radio button group, select "Next" button and create a new published event associated with it. Select "Execute Custom" action from "Installer Actions" and your custom action from "Argument" listbox. In the condition field enter the condition that changes the install type to "per-machine install".

Please take a look on our article regarding Edit Condition Dialog. This explains how the condition should be formulated.

Best regards,
Sorin
Sorin Stefan - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
a.singh
Posts: 16
Joined: Wed Jan 11, 2017 10:38 am

Re: Regarding InstallTypeDialog

Thank you so much. This worked. :)
Sorin
Posts: 663
Joined: Mon May 08, 2017 1:03 pm

Re: Regarding InstallTypeDialog

You are welcome!

Best regards,
Sorin
Sorin Stefan - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”