cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
peterbi
Level 7

CheckBox value not set properly

Hi,

I need a quick fix for a CheckBox problem: it is in the SetupCompleteSuccess dialog, and we set it's 'Property' to be 'MY_PROPERTY', during the installation, we read the value of 'MY_PROPERTY' and expect that value will be reflected in the checking status of the check box. But the check box is always checked (I believe that means it's 'Value' is set to 1), eventhough 'MY_PROPERTY' value has been confirmed to be 0.

Does anybody know where should I go to fix this? We don't change anything for the checkbox in our code. And the defined/default 'Value' for the checkbox is 1, but that is NOT the problem - I have changed it to 0 or empty, the problem still remains (checkbox checked disregarding MY_PROPERTY's value).

I need to have the fix ASAP, I know it could be an easy one for somebody who knows it, but I didn't play that much with dialogs/checkbox, so plese help.


Thanks,
Peter
Labels (1)
0 Kudos
(4) Replies
Sairen
Level 7

Actually, if you want it unchecked, you need to set the property to null, not 0. If the property has any value at all, the checkbox will be checked.

You can do this in code by
MsiSetProperty(hMSI, "PROPERTY", "");
and there are a few other ways, too.
0 Kudos
peterbi
Level 7

Thank you Sairen for your prompt reply.

If I understand you correctly, there is no way to make the checkbox to reflect the value of the property? What I want is: when MY_PROPERTY is 0, the checkbox is unchecked, if MY_PROPERTY is 1, it's checked.

What you said is kind of opposit to it: when the box is checked , the property is set to 1, if it's not checked it's set to null, right?

There will be an action (DoAction) triggered if the box is checked, and the property value is composed as port of the condition for triggering the action, so I can't change the value of property to just make the box unchecked. Do you know a workaround for that?


Thanks,
Peter
0 Kudos
Sairen
Level 7

I don't think it's opposite at all; in fact, you're very close.

Box is checked, Property = 1
Box is not checked, Property is NULL (not 0 - that's the only difference)

The condition you want, then, is not
MY_PROPERTY =0, but rather NOT MY_PROPERTY

if (MY_PROPERTY=1) ie, the checkbox is checked do something

if (NOT MY_PROPERTY) ie, the checkbox is not checked do something else or do not do something.

Is that what you needed?
0 Kudos
VinayIndia
Level 2

I found the solution after struggling for 3-4 times.

You need to do 1 important thing for this.
Bind your check box with Public property by using Upper case (Capital) letters which is defined in Property Manager section under Behavior and logic.
In Value section of your property in property manager Don't give any value (Neither 1 nor 0), instead just keep it blank.

Use the same property in your required dialog & Under Value section of you property in actual dialog assign value = 1. It signifies that when check box is checked, then it's value will be set to 1.

And now initially my check box is unchecked..!!
By doing so,my problem gets solved, Hope it will work for you..!!

Thanks,
Vinay India
0 Kudos