cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jeanmarc78
Level 5

radio box for features - Basic MSI

Hi,

Does someone know how to make a radio button for the features?
It's for:
SQL:
- SQL Express 2008
- SQL Express 2005

if the customer select one, the other is deselected. it's not a problem if there is no radio button...
Labels (1)
0 Kudos
8 Replies
ChandanOmkar
Level 8

You can achieve this by usin the following function :


AskOptions(EXCLUSIVE,......)

it will create a dialog with the option which you will pass in the above function's parameter. Go through the help files for its parameters.
0 Kudos
cbragg
Level 7

There is aready quite a nice dialog box you can use for feature selection by using the customsetup dialog, you can also use this in conjunction with the setuptype dialog if you wish.

However if you need to create your own for whatever reason then you when you create a radio box it asks for a property name, the values set for each radio button becomes the value of your property for whichever one is selected by the user.

Then your features can be conditioned to install based on that property
0 Kudos
jeanmarc78
Level 5

I'm doing a basic msi project and I really don't know installscript...

can't we make a condition that when we select one SQL version the other is unselected ?
0 Kudos
cbragg
Level 7

ChandanOmkar's comment referred to installscript and mine was to MSI. I'll try to explain what I meant more clearly, because it does do what you were asking for, sorry for that. 😮

-Create a new dialog (you can insert that into your sequence later, i won't cover that)
-On your dialog, add a radio button group control (icon looks like 2 radio buttons, not the single button) and when prompted enter a property name e.g. MYPROPERTY
-In the radio group box you just created, add a radio button (icon looks like 1 radion button). Only one button from this radio group can be selected by the user at a time without you having to do any more work to enable that functionality (this is the purpose of the radio group)
-In the properties of each of your radio buttons set 'Text' to label the button, this is what the user sees
-In the properties of each of your radio buttons set 'Value' to be whatever you like e.g. 1,2 and 3 or SQLOptionA, SQLOptionB and SQLOptionC, whatever you like as long as you know what each radio buttons value is.

Now here's the magic..... if your user selects the radio button and that radio button's value was say SQLOptionB then the property created earlier called MYPROPERTY will have a value of SQLOptionB and if a user chose a different value it could be SQLOptionA or SQLOptionC for instance.

Ok so now we have the users selected option sorted.. now we have to link that to which features we want to install, this will need some explanation of install levels.

In the property table will be a property called INSTALLLEVEL which is defaulted to 100. Each of the features will also have an install level you can set which is usually defaulted to 1. Any feature with an install level lower than or equal to the value of INSTALLLEVEL will get installed.

Ok back to setting up our features...
-Set all the feature's install levels to a value above the INSTALLLEVEL property so that nothing gets installed.
-Go to the conditions of each feature and add a new one. You will see a row asking for two values. The first one is the install level if the condition is true so set this to something lower than or equal to the INSTALLLEVEL value. The second is the condition. This will be something like MYPROPERTY="SQLOptionA".

So none of our features gets installed by default but... if the user selects the radio button (which sets MYPROPERTY) to say SQLOptionA then the condition will be true and it will set the install level to something which will mean it gets installed after all.

Please note if you have, for instance, 5 features and 2 always get installed regardless of your options then don't worry about setting their install levels or conditioning them, just set them lower or equal to INSTALLLEVEL in the first place

Hope this helps more
0 Kudos
jeanmarc78
Level 5

Thanks a lot, it works very well for the radio buttons.

But now i have a new problem with checkbox.
in the dialog I created, I let the user choose wich documents he will install. He does this with checkbox. Each document has his own feature with install level >100 . for each feature I put a condition, for exemple: level 1 and DOCA=1 for the doc "a", for witch I set the property "DOCA" and the value 1 in the dialog page. In the property manager, I deleted the value of my property cause i want theme unchecked at runtime.
The probleme is that during the install, he install all documents even if there are unchecked...
I tried with "True" in my condition but it had work one day but now doesn't work anymore... I think it was just a mistake but I can't find where ! i tried many many things ...
0 Kudos
cbragg
Level 7

Ok your reply was a little hard to understand but i think i get the crux of the issue. If i'm right in understanding you, you are trying to use something like the following conditions to check if your checkbox is ticked:

MYCHECKBOX=0 or MYCHECKBOX=1 or MYCHECKBOX=True or MYCHECKBOX=False

What installer does with a checkbox is not assign two different values to the property, it actually just creates the property if it's checked and deletes it if it's unchecked.

Therefore your condition should be either:

MYCHECKBOX for checked and Not MYCHECKBOX for unchecked

If you want to default your box to checked then add the property to the property table with any value you want. If you want it to default to unchecked then just remove the property
0 Kudos
jeanmarc78
Level 5

Hello again,

thanks to you, i was able to do what i wanted, sorry for making my explanations that hard ^^'

Now I'm confused: i wanted to restore the custom install page, i didn't deleted before so i just had to put it back in the sequence and delete my custom page i created (with the feature's conditions). The problem is when i test the interface or when i try to run my install: the custom install page appears as i want but the installation interrupts brutally! just after the beginning. I really don't know where it would come from because I didn't change anything but the dialog page and the conditions... really strange...
0 Kudos
jeanmarc78
Level 5

I forgot to tell you something:
to have a clean installation, I tried to start from scratch it seems that everything works except when it comes to the SQL script:
"my_script.sql execution error line 1. a system assertion check has failed. check the sql server log for details. Typically, an assertion failure is caused by a software bug or a data corruption. to check for database corruption, consider running..."
always confusing because its the same files, the same Database and on the same computer.

I hope you already met this before !
0 Kudos