Video Screencast Help
Symantec to Separate Into Two Focused, Industry-Leading Technology Companies. Learn more.

Setting the default value for a checkbox to 'false' (unchecked)

Created: 20 Jan 2013 | 6 comments

Hi

I added a checkbox to a dialog and assigned it to a Property, which has a value of 0.

However, when i run the installer for the first time, the checkbox appears in the 'checked' (i.e 'true') state.

From what i have read in various documentation, it was my understanding that the value that i set in the Property would determine what the defautl value/state of the cehckbox would be when the dialog is loaded, therefore i would have assumed that the checkbox would initially load in the 'unchecked' state because my Property value was 0

Is my understanding correct, and if so, why wouldn't it be working for me in this instance?

Thanks

Discussion Filed Under:

Comments 6 CommentsJump to latest comment

VBScab's picture

Produce a verbose log of each installation type and note what the property value gets set to: it may not be '0' or '1'.

How and where are you setting the new property value? If using the command line to set the property value, are you using all upper-case for the property name (non-public properties on the command line are ignored)?

Don't know why 'x' happened? Want to know why 'y' happened? Use ProcMon and it will tell you.
Think about using http://www.google.com before posting.

Anthony Lisbona's picture

The property value is being set to 0 in the Property manager in Wise. I am not setting it to any other value during the install process other than when e checkbox gets unticked/ticked. The property name is a mix of uppercase and underscore.

Screenshot: http://screencast.com/t/Z1Rg2TQEDZ

AngelD's picture

Unchecked checkbox usually is a non existing property and a checked has any value for the property.

Anthony Lisbona's picture

If i leave the property value empty (instead of entering 0, as per my screenshot in the above post), when i try to compile Wise, i get the error:

"Did not write blank property: ADMIN_INSTALLDOTNET35ONWIN8"
 
And, the property gets deleted from the Property table.
 
AngelD's picture

The property should not exist in the Property table.

When the checkbox gets checked it will be created instead.

Then you could use it as a condition with either:

ADMIN_INSTALLDOTNET35ONWIN8

or

NOT ADMIN_INSTALLDOTNET35ONWIN8

Anthony Lisbona's picture

I ended up using a Radio Button instead of a checkbox, as it was behaving as i expected. 

I had one radio button called 'Enable .Net 3.5' with a value of 1 and another radio button called 'Do not enable .Net 3.5' with a value of 0. I then assigned a property to that checkbox control, and depending on what the initial value of that property was, controlled whether the 'Enable' or 'Do not enable' radiop button was initially selected when the dialog loaded.