Checkbox or Radio Button on Features List - 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!

tehsquirly
Posts: 22
Joined: Fri Apr 20, 2007 4:16 am

Checkbox or Radio Button on Features List

Hi,

I am trying to make an installer that will install a selected printer driver. The user will select the printer type at the feature screen so then it will install that selected printer driver.

The user having to click the X, and change it to “install this feature” might be seen as confusing to the user, as I think some kind of checkbox or radio button would make it seem a lot more user friendly.

Can someone please help me with this,

Thanks,

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

Hi Riley,

There is a similar discussion on the forum, please see:
http://www.advancedinstaller.com/forums ... php?t=2177

Regards,
Gigi
__________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
tehsquirly
Posts: 22
Joined: Fri Apr 20, 2007 4:16 am

Hi Gigi,

I was able to get the radio buttons to work for when the feature uses a custom action, so it launches that features EXE file to install the printer driver.

I although am not able to get the radio button to work to install the Driver, that does not have a custom action. I have added the driver from the Drivers page, and it has a feature named Feature2. If I set the InstallLevel to 1 it will install the driver, but then it installs the driver no matter what radio button I select, I need it to only install the driver if that driver is selected ( P300 ).

The Features have no conditions, P110i and P120i are installing correctly when the radio button is clicked, but P300 will not install the driver even if I add the conditional Level RADIOBUTTON = 3 to the Feature(RADIOBUTTON being the property of the radio button group and 3 being the value of the radio button).

I have added the Execution Condition RADIOBUTTON = 1 to p110i and RADIOBUTTON = 2 to p120i in the Custom Actions.

The only way I could get P110i and P120i to work is make the VBS file like so -

Code: Select all

if Session.Property("RADIOBUTTON") = 1 then
    Session.FeatureRequestState("Feature") = 2
    Session.FeatureRequestState("Feature1") = 2
    Session.FeatureRequestState("Feature2") = 2
end if
Here are some screen shots -



I have attached some screenshots -

Image

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

Hi,

Here is the VBS code example on how to do that:

Code: Select all

selFeature = Session.Property("RADIOGROUP_PROP")

Session.FeatureRequestState("Feature1") = 2
Session.FeatureRequestState("Feature2") = 2

if selFeature = "1" then
  Session.FeatureRequestState("Feature1") = 3
end if

if selFeature = "2" then
  Session.FeatureRequestState("Feature2") = 3
end if
This example is with two features so you need to change it in order to fit your needs. Add this as a custom action under "UI Custom Actions" section, and add this custom action as control event under "Install" button of "VerifyReadyDialog".

Hope this helps.

Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
tehsquirly
Posts: 22
Joined: Fri Apr 20, 2007 4:16 am

Hi Gigi,

Do I put it under the install button as "DoAction" ?

I added that vbs in with also a Feature3, and Feature3 is the driver and still it isn't installing it. What do I do with the other VBS file that has the code -

Code: Select all

if Session.Property("RADIOBUTTON") = 1 then
    Session.FeatureRequestState("Feature") = 2
    Session.FeatureRequestState("Feature1") = 2
    Session.FeatureRequestState("Feature2") = 2
end if
I have left that , and then added the VBS you said to add. It is still not installing the driver for Feature3.

Here is the code you gave me that I changed it to -

Code: Select all

selFeature = Session.Property("RADIOBUTTON")

Session.FeatureRequestState("Feature1") = 2
Session.FeatureRequestState("Feature2") = 2
Session.FeatureRequestState("Feature3") = 2

if selFeature = "1" then
  Session.FeatureRequestState("Feature1") = 3
end if

if selFeature = "2" then
  Session.FeatureRequestState("Feature2") = 3
end if

if selFeature = "3" then
  Session.FeatureRequestState("Feature3") = 3
end if
Do you know why it isn't installing the driver?

-Riley
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi Riley,

Remove the old custom action and add the new one under "UI Custom Actions" section. Add a new published event under "Install" button of the "VerifyReadyDialog" like this:

Name: DoAction
Argument: select the custom action

Let me know if you encounter any problems.

Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
tehsquirly
Posts: 22
Joined: Fri Apr 20, 2007 4:16 am

Hi Gigi,

Still getting the same problem. I think I know what the problem is. I think even when I install feature 1 or feature 2, which uses EXE custom actions, the feature itself is not installing. Only the custom action is being run, because it has the condition RADIOBUTTON = value, so it will execute the exe which is what I need it to do.

But for Feature3 which needs to install a driver, it dosen't have a custom action to look for, so the feature itself isn't getting installed. It must not be checking the features or something.

I have done this -

Code: Select all

Remove the old custom action and add the new one under "UI Custom Actions" section. Add a new published event under "Install" button of the "VerifyReadyDialog" like this:

Name: DoAction
Argument: select the custom action

Let me know if you encounter any problems. 
There are no other custom actions, only this 1 vbs. Code is -

Code: Select all

selFeature = Session.Property("RADIOBUTTON")

Session.FeatureRequestState("Feature1") = 2
Session.FeatureRequestState("Feature2") = 2
Session.FeatureRequestState("Feature3") = 2

if selFeature = "1" then
  Session.FeatureRequestState("Feature1") = 3
end if

if selFeature = "2" then
  Session.FeatureRequestState("Feature2") = 3
end if

if selFeature = "3" then
  Session.FeatureRequestState("Feature3") = 3
end if
Do you know why it isn't checking the feature and installing the feature based on the radio button choice?

-Riley
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi Riley,
I think even when I install feature 1 or feature 2, which uses EXE custom actions, the feature itself is not installing. Only the custom action is being run, because it has the condition RADIOBUTTON = value, so it will execute the exe which is what I need it to do.
A custom action does not belong to a feature. You can condition the execution of a custom action depending on the feature state/action.
Do you know why it isn't checking the feature and installing the feature based on the radio button choice?
From on of the screenshots I see that the P300 feature (with Feature2 identifier) has "Install Level" set to 0 (which means that the feature is disabled). You need to set the "Install Level" to 1 (Install on typical). The state of the feature is conditioned in the custom action according to the selected radio button.

Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
tehsquirly
Posts: 22
Joined: Fri Apr 20, 2007 4:16 am

Hi Gigi,

I think I got it working.

Another thing I was curious about is , on the custom page by default there is for example, a "location" where it shows the user where the product will install, and it also tells the user how much space it is going to take for the product to be installed.

When it is setup like this, those fields do not show the path, or the size of the feature that is clicked. Is there a way to get these working, or should I just delete these features from the dialog box?

-Riley
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi Riley,

I'm afraid don't fully understand your question. At what page are your referring? Please give me more details.

If you referring at the "CustomizeDlg" dialog the "Location" indicates the path where the package will be installed. In the right group box the description and required size on disk of the selected Feature are displayed.

Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
tehsquirly
Posts: 22
Joined: Fri Apr 20, 2007 4:16 am

Hi Gigi,

I am having problems now. Please see the attached screens so you know how I have it setup -

Image

Image

The custom action I have set to execute only if RADIOBUTTON = 6. Feature 1-5 are all using drivers to install, but feature 6 I want to use an EXE. I am using the vbs file for the Install button like this -

Code: Select all

selFeature = Session.Property("RADIOBUTTON")

Session.FeatureRequestState("Feature1") = 2
Session.FeatureRequestState("Feature2") = 2
Session.FeatureRequestState("Feature3") = 2
Session.FeatureRequestState("Feature4") = 2
Session.FeatureRequestState("Feature5") = 2
Session.FeatureRequestState("Feature6") = 2


if selFeature = "1" then
  Session.FeatureRequestState("Feature1") = 3
end if

if selFeature = "2" then
  Session.FeatureRequestState("Feature2") = 3
end if

if selFeature = "3" then
  Session.FeatureRequestState("Feature2") = 3
end if

if selFeature = "4" then
  Session.FeatureRequestState("Feature2") = 3
end if

if selFeature = "5" then
  Session.FeatureRequestState("Feature2") = 3
end if

if selFeature = "6" then
  Session.FeatureRequestState("Feature2") = 3
end if

When I select C30 on the custom page (value is 6) it gives me this error during install -

Image

Not sure why it's doing this now, I changed around everything because I am creating a different installation, but I kept the VBS in place and just using a different EXE, same settings as I was before, but now it comes up with this error.

-Riley
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi Riley,

The CA script is not correct. If the selFeature variable is "6" then you need to set the state of the Feature6 to 3 (not Feature2).

So you need to change the VBS code to this:

Code: Select all

selFeature = Session.Property("RADIOBUTTON")

Session.FeatureRequestState("Feature1") = 2
Session.FeatureRequestState("Feature2") = 2
Session.FeatureRequestState("Feature3") = 2
Session.FeatureRequestState("Feature4") = 2
Session.FeatureRequestState("Feature5") = 2
Session.FeatureRequestState("Feature6") = 2


if selFeature = "1" then
  Session.FeatureRequestState("Feature1") = 3
end if

if selFeature = "2" then
  Session.FeatureRequestState("Feature2") = 3
end if

if selFeature = "3" then
  Session.FeatureRequestState("Feature3") = 3
end if

if selFeature = "4" then
  Session.FeatureRequestState("Feature4") = 3
end if

if selFeature = "5" then
  Session.FeatureRequestState("Feature5") = 3
end if

if selFeature = "6" then
  Session.FeatureRequestState("Feature6") = 3
end if
Also as a suggestion, if that EXE (that you execute with a custom action to install a driver) is not required to be copied in the application folder (you want only to execute it) my suggestion is to use an "Attached Custom Action" instead of an "Installed Custom action".

Hope this helps.

Best Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
tehsquirly
Posts: 22
Joined: Fri Apr 20, 2007 4:16 am

Hi Gigi,

What a careless mistake I made, thanks a lot. I should of noticed that.

That seemed to fix the problem.

Thanks,

Riley
tehsquirly
Posts: 22
Joined: Fri Apr 20, 2007 4:16 am

Hi Gigi,

I have autorun enabled and I burned the package folder to a disk, and it automatically launches the folder, but I want it to automatically launch the installer file. Is there a easy way to go upon doing this?

-Riley
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi Riley,

Here is how you can do that:

In the "Autorun Commands" list ("CD\DVD Autorun" page) choose "Add->Package Autorun->Install the package" from the context menu. You can type "Install" in the "Display Text" field.

To set this command to be executed when the CD/DVD is inserted use "AutoPlay command" or "Default command" option.

You can read more about how to use "Autorun" in AI here:
http://www.advancedinstaller.com/user-g ... torun.html

Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com

Return to “Common Problems”