TomD
Posts: 19
Joined: Wed Mar 11, 2009 10:26 pm

Radio list without VBS

Hi!

I had the idea to create radio list functions without the need of VBS.

I created a radio list

OPTIONSLIST
- Option1
- Option2
- Option3

I opened "Organization" --> Option1 (Feature) --> Condition install level and declared

OPTIONSLIST = Option1 | Level 1
OPTIONSLIST <> Option1 | Level 0

OPTIONSLIST = Option2 | Level 1
OPTIONSLIST <> Option2 | Level 0

OPTIONSLIST = Option3 | Level 1
OPTIONSLIST <> Option3 | Level 0

But it does not seem to work!?
Is that possible?


Greets
Tom
TomD
Posts: 19
Joined: Wed Mar 11, 2009 10:26 pm

Re: Radio list without VBS

Okay... I think, that's not possible...
The conditional install level is called at starting the installation, right?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Radio list without VBS

Hi,

Yes, the conditional install level is evaluated before the installation dialogs are shown. However, you can use a custom action to set the feature actions. Our User Guide uses a VBScript custom action, but you could also try using the MsiSetFeatureState function in a C++ DLL custom action.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
TomD
Posts: 19
Joined: Wed Mar 11, 2009 10:26 pm

Re: Radio list without VBS

I did that.

I need to change two states. But it seems that my VBS ist not working.
I works if just change ONE state.

Also if I remove the "And" between the two states, I get an error.

Code: Select all

' Set contants 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("video_mt_pal") = msiInstallStateAbsent
Session.FeatureRequestState("video_mw_pal") = msiInstallStateAbsent
Session.FeatureRequestState("video_mt_ntsc") = msiInstallStateAbsent
Session.FeatureRequestState("video_mw_ntsc") = msiInstallStateAbsent
Session.FeatureRequestState("videomain") = msiInstallStateAbsent

If Session.Property("ProductLanguage") = "2057" And Session.Property("sig_Selection") = "MT32" And Session.Property("vidm_Selection") = "VidSigNo" Then
  Session.FeatureRequestState("video_mt_pal") = msiInstallStateLocal And Session.FeatureRequestState("videomain") = msiInstallStateLocal
ElseIf Session.Property("ProductLanguage") = "2057" And Session.Property("sig_Selection") = "MT33" And Session.Property("vidm_Selection") = "VidSigNo" Then
  Session.FeatureRequestState("video_mt_pal") = msiInstallStateLocal And Session.FeatureRequestState("videomain") = msiInstallStateLocal
ElseIf Session.Property("ProductLanguage") = "2057" And Session.Property("sig_Selection") = "MT34" And Session.Property("vidm_Selection") = "VidSigNo" Then
  Session.FeatureRequestState("video_mw_pal") = msiInstallStateLocal And Session.FeatureRequestState("videomain") = msiInstallStateLocal

ElseIf Session.Property("ProductLanguage") = "1031" And Session.Property("sig_Selection") = "MT32" And Session.Property("vidm_Selection") = "VidSigNo" Then
  Session.FeatureRequestState("video_mt_pal") = msiInstallStateLocal And Session.FeatureRequestState("videomain") = msiInstallStateLocal
ElseIf Session.Property("ProductLanguage") = "1031" And Session.Property("sig_Selection") = "MT33" And Session.Property("vidm_Selection") = "VidSigNo" Then
  Session.FeatureRequestState("video_mt_pal") = msiInstallStateLocal And Session.FeatureRequestState("videomain") = msiInstallStateLocal
ElseIf Session.Property("ProductLanguage") = "1031" And Session.Property("sig_Selection") = "MT34" And Session.Property("vidm_Selection") = "VidSigNo" Then
  Session.FeatureRequestState("video_mw_pal") = msiInstallStateLocal And Session.FeatureRequestState("videomain") = msiInstallStateLocal
  
ElseIf Session.Property("ProductLanguage") = "1033" And Session.Property("sig_Selection") = "MT32" And Session.Property("vidm_Selection") = "VidSigNo" Then
  Session.FeatureRequestState("video_mt_ntsc") = msiInstallStateLocal And Session.FeatureRequestState("videomain") = msiInstallStateLocal
ElseIf Session.Property("ProductLanguage") = "1033" And Session.Property("sig_Selection") = "MT33" And Session.Property("vidm_Selection") = "VidSigNo" Then
  Session.FeatureRequestState("video_mt_ntsc") = msiInstallStateLocal And Session.FeatureRequestState("videomain") = msiInstallStateLocal
ElseIf Session.Property("ProductLanguage") = "1033" And Session.Property("sig_Selection") = "MT34" And Session.Property("vidm_Selection") = "VidSigNo" Then
  Session.FeatureRequestState("video_mw_ntsc") = msiInstallStateLocal And Session.FeatureRequestState("videomain") = msiInstallStateLocal
End If
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Radio list without VBS

Hi,

Please note that the instructions executed in an IF statement need to be placed on different lines. The correct code is:

Code: Select all

' Set contants 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("video_mt_pal")  = msiInstallStateAbsent
Session.FeatureRequestState("video_mw_pal")  = msiInstallStateAbsent
Session.FeatureRequestState("video_mt_ntsc") = msiInstallStateAbsent
Session.FeatureRequestState("video_mw_ntsc") = msiInstallStateAbsent
Session.FeatureRequestState("videomain")     = msiInstallStateAbsent

If Session.Property("ProductLanguage") = "2057" And Session.Property("sig_Selection") = "MT32" And Session.Property("vidm_Selection") = "VidSigNo" Then
  Session.FeatureRequestState("video_mt_pal")  = msiInstallStateLocal
  Session.FeatureRequestState("videomain")     = msiInstallStateLocal
ElseIf Session.Property("ProductLanguage") = "2057" And Session.Property("sig_Selection") = "MT33" And Session.Property("vidm_Selection") = "VidSigNo" Then
  Session.FeatureRequestState("video_mt_pal")  = msiInstallStateLocal
  Session.FeatureRequestState("videomain")     = msiInstallStateLocal
ElseIf Session.Property("ProductLanguage") = "2057" And Session.Property("sig_Selection") = "MT34" And Session.Property("vidm_Selection") = "VidSigNo" Then
  Session.FeatureRequestState("video_mw_pal")  = msiInstallStateLocal
  Session.FeatureRequestState("videomain")     = msiInstallStateLocal

ElseIf Session.Property("ProductLanguage") = "1031" And Session.Property("sig_Selection") = "MT32" And Session.Property("vidm_Selection") = "VidSigNo" Then
  Session.FeatureRequestState("video_mt_pal")  = msiInstallStateLocal
  Session.FeatureRequestState("videomain")     = msiInstallStateLocal
ElseIf Session.Property("ProductLanguage") = "1031" And Session.Property("sig_Selection") = "MT33" And Session.Property("vidm_Selection") = "VidSigNo" Then
  Session.FeatureRequestState("video_mt_pal")  = msiInstallStateLocal
  Session.FeatureRequestState("videomain")     = msiInstallStateLocal
ElseIf Session.Property("ProductLanguage") = "1031" And Session.Property("sig_Selection") = "MT34" And Session.Property("vidm_Selection") = "VidSigNo" Then
  Session.FeatureRequestState("video_mw_pal")  = msiInstallStateLocal
  Session.FeatureRequestState("videomain")     = msiInstallStateLocal
  
ElseIf Session.Property("ProductLanguage") = "1033" And Session.Property("sig_Selection") = "MT32" And Session.Property("vidm_Selection") = "VidSigNo" Then
  Session.FeatureRequestState("video_mt_ntsc") = msiInstallStateLocal
  Session.FeatureRequestState("videomain")     = msiInstallStateLocal
ElseIf Session.Property("ProductLanguage") = "1033" And Session.Property("sig_Selection") = "MT33" And Session.Property("vidm_Selection") = "VidSigNo" Then
  Session.FeatureRequestState("video_mt_ntsc") = msiInstallStateLocal
  Session.FeatureRequestState("videomain")     = msiInstallStateLocal
ElseIf Session.Property("ProductLanguage") = "1033" And Session.Property("sig_Selection") = "MT34" And Session.Property("vidm_Selection") = "VidSigNo" Then
  Session.FeatureRequestState("video_mw_ntsc") = msiInstallStateLocal
  Session.FeatureRequestState("videomain")     = msiInstallStateLocal
End If
Also, if the instructions use a logical operator between them only the first instruction is executed and the entire line is evaluated as a boolean expression.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”