Conditional Install Levels - 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!

Laurin
Posts: 58
Joined: Thu Jun 12, 2008 4:27 pm

Conditional Install Levels

Hi guys,

I can not use the default SetupTypeDlg. I have to simplify it. Okey, i build a dialog with a radio option group. Install for Reporting-user and Install for MDB User, anyway. Now i need the install different features depending on the selected radio button. So first I tried to set the PropertyName Property on the Radio Button Group on INSTALLLEVEL and set on the radio button complete its value to 1000. On the other radio button i set the INSTALLLEVEL to 3.
Then i went to the features organization and set the option 'Install only if property INSTALLLEVEL is greater than:' on some features. I set there the value to 3.

So for my understanding this should work.. but it won't work. The features which should follow the install level are never installed.
I tried a second approach. I set the radio button group a property called MDB_INSTALLTYPE. And i set this to complete or reporting. Then i went to the Conditional Install Levels... dialog and added a condition MDB_INSTALLTYPE = reporting and set the install level there to 3.

Can anybody help me? My claim is quite simple. I want install different features depending on the selcted radio button on a form.
Thank you in advance,

kind regards
laurin
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Conditional Install Levels

Hi Laurin,

A similar issue has been encountered by a user and has been discussed in the following thread:
http://www.advancedinstaller.com/forums ... vel#p26238

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
Laurin
Posts: 58
Joined: Thu Jun 12, 2008 4:27 pm

Re: Conditional Install Levels

Thank you. The explanation there makes sense to me.
But here is my problem (quote just found in your help):

You cannot condition the installation of a feature by using a property set in the User Interface of the installation.

What else can i do?

Kind regards

Appendix:
I tried it now in the published events of the next button on my dialog. I tried AddLocal and took my feature MDB with the condition MDB_INSTALLTYPE = "complete" (which is set by the radio button). But... it does not work. Im really stranded... :-(
Why is it so difficult to install a feature or not depending of a state of a control??
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Conditional Install Levels

Hello,

You can try using our guide which explains how to achieve this:
http://www.advancedinstaller.com/user-g ... ature.html

I hope this helps.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
Laurin
Posts: 58
Joined: Thu Jun 12, 2008 4:27 pm

Re: Conditional Install Levels

Hi,

Thank you. Don't know what's going on here...
That's the content of my vbs script. I followed exactly the instructions in your help.

Code: Select all

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

If Session.Property("MDB_INSTALLTYPE") = "complete" Then
  Session.FeatureRequestState("MDB") = msiInstallStateLocal
End If
Don't wonder - one if is enough, there is only another radio button which should install everthing except the MDB feature.

But this is my message:
There is a problem with this Windows Installer package. A script required for this install to complete could not be run.
Contact your support personell or package vendor.


And yes... Windows Scripting host is active. Other advanced installer setups with vbs scripts work fine...

can you please help me?
kind regards
laurin
Laurin
Posts: 58
Joined: Thu Jun 12, 2008 4:27 pm

Re: Conditional Install Levels

Okey... it seems there is an error in your vbs script.
If i replace the content with MsgBox ("Hi") - the messagebox appears properly...
Laurin
Posts: 58
Joined: Thu Jun 12, 2008 4:27 pm

Re: Conditional Install Levels

Okey... it's getting late... my fault... sorry!!
Didn't copy the const sections....

everything works. thank you!
Your support is great!
Laurin
Posts: 58
Joined: Thu Jun 12, 2008 4:27 pm

Re: Conditional Install Levels

Okey sorry for my multiple post, but.... it does not work!
ARGH!!

The feature never get's installed. Okey, i set it to disabled on the feature organization page. But if i change it to install by default - it is always installed. What means my script does not take any effect!!

I changed the script that way:

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("MDB") = msiInstallStateAbsent
MsgBox ("Set MDB absent")

If Session.Property("MDB_INSTALLTYPE") = "complete" Then
  MsgBox ("Set MDB present")
  Session.FeatureRequestState("MDB") = msiInstallStateLocal
End If
The GUI seems to work correctly. MDB absent is always shown, if i checked my complete radio button afterwards the MDB present message appears!
So what's going on here???

I'm really getting a little frustrated....
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Conditional Install Levels

Hello,

I am not sure how the script is affecting your installer as I do not have the .aip project file.
Please send it and the vbs file to support at advancedinstaller dot com so we can take a look at them.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Conditional Install Levels

Hi,

The custom action doesn't work because the feature is disabled from the Feature Properties pane in the "Organization" page. Try using the "Installed by default" option for your feature and let me know if the problem persists.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Laurin
Posts: 58
Joined: Thu Jun 12, 2008 4:27 pm

Re: Conditional Install Levels

Now it works thank you!

Return to “Common Problems”