Radio Button VB script problems - 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!

scorro
Posts: 4
Joined: Sat Sep 10, 2011 8:22 am

Radio Button VB script problems

I have tried many things but cant get it to work properly. I get this error when i push next: There is a problem with this Windows Installer Package. A script required for this install could not be run. Contact your support personnel or package vendor.

I have made the FeatureAction.vbs like this:

' Set constants for the INSTALLSTATE_ABSENT and INSTALLSTATE_LOCAL feature states
Const msiInstallStateAbsent = 2
Const msiInstallStateLocal = 3

' Initialize the install states of the mutually exclusive features
' and set their states based on the radio button selection
Session.FeatureRequestState("PopMusic") = msiInstallStateAbsent
Session.FeatureRequestState("RockMusic") = msiInstallStateAbsent
Session.FeatureRequestState("DanceMusic") = msiInstallStateAbsent

If Session.Property("RADIO") = "RadioPopMusic" Then
Session.FeatureRequestState("RadioPopMusic") = msiInstallStateLocal
ElseIf Session.Property("RADIO") = "RadioRockMusic" Then
Session.FeatureRequestState("RadioRockMusic") = msiInstallStateLocal
ElseIf Session.Property("RADIO") = "RadioDanceMusic" Then
Session.FeatureRequestState("RadioTranceMusic") = msiInstallStateLocal
End If

It will give this error: Object required 'Session' code 800z0108 if i try to open FeatureAction.vbs on my pc.

I am using windows 7 Ultimate (x86).



Edit:

I am having another problem only with checkboxes. The problem is i have more features to install at once but some combinations are not allowed because they would overwrite each other. So i have to set that if a feature is installed some other features cant be installed and some features can.


Hope someone can help. :?
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Radio Button VB script problems

Hello,

Unfortunately it's not within our support boundaries to debug or create custom actions. However, you can try use MsgBox occurrences within the VBScript custom action to debug it yourself.
I am having another problem only with checkboxes. The problem is i have more features to install at once but some combinations are not allowed because they would overwrite each other. So i have to set that if a feature is installed some other features cant be installed and some features can.
If you haven't already done so, you can follow this how-to article to condition the installation of your features depending on UI public properties.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
scorro
Posts: 4
Joined: Sat Sep 10, 2011 8:22 am

Re: Radio Button VB script problems

mihai.petcu wrote:Hello,

Unfortunately it's not within our support boundaries to debug or create custom actions. However, you can try use MsgBox occurrences within the VBScript custom action to debug it yourself.
I am having another problem only with checkboxes. The problem is i have more features to install at once but some combinations are not allowed because they would overwrite each other. So i have to set that if a feature is installed some other features cant be installed and some features can.
If you haven't already done so, you can follow this how-to article to condition the installation of your features depending on UI public properties.

All the best,
Mihai
I have used that article indeed and got the code i use from that page but it seems that the code isnt complete. Since i know little about vbscript and trying for days to learn it but it seems to hard to get it to work. Are there no other ways besides the vbscript that could solve my problem? And is there a site that refers to this kind of vbscript with some examples?
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Radio Button VB script problems

Hi,
Are there no other ways besides the vbscript that could solve my problem? And is there a site that refers to this kind of vbscript with some examples?
Unfortunately, there is no other predefined documented way to achieve this. Nonetheless, you can search the Internet for an alternative.
If you are learning and also are looking for samples, here is a good place to start with VBScript custom actions.

The user guide article has been tested and should work if you follow it step by step. You can implement the functionality on a fresh clean project and assure of its functionality. After doing so, you can adapt it within your project to fit your needs.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”