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!

amorpeth
Posts: 18
Joined: Sat Feb 04, 2017 9:43 pm

Dialog Checkbox Value

Hey,

I have created a dialog with a checkbox. I have then assigned the checkbox to a property. It seems that when I un-check the box, the value saved is empty string / null. If I leave the check box checked as is the default, the the properties default value is saved. Is this not a Boolean true/false result? What result should I expect the saved result to be, and how can I write this is to an install condition that is TRUE when this check box is selected?

Also wondered if you can create properties with no default value?

Thanks,
Andrew
Attachments
Checkbox.jpg
Checkbox.jpg (56.11 KiB) Viewed 5461 times
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Dialog Checkbox Value

Hello Andrew,

Indeed, when the checkbox is selected, then the property attached to the related checkbox control is set, otherwise the property is empty.

The Condition field is a Windows Installer condition which is evaluated and the result determines if the custom action will be executed or not. If the condition is null or is evaluated to false, the custom action is not executed is not installed.

So, if the checkbox is not selected, then the property is not set (e.g. NOT IIS_HTTPS_FW_PORT ).

If the checkbox is selected, then the property is set (e.g. IIS_HTTPS_FW_PORT).

Please let us know if you have any questions.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
amorpeth
Posts: 18
Joined: Sat Feb 04, 2017 9:43 pm

Re: Dialog Checkbox Value

Hey Dan,

Thanks I'll give it a shot based on this.

Only thing I am unsure about - the associated property has a default value that I set as True (I guess this is just a string). If the checkbox is selected by default then this value of True is used. If I check check it then it becomes null as your described. Are you saying that the actual value of the property doesn't matter, and it is evaluated as follows?
null/emtpy = false
string = true

Also why do properties have to have default values? Is there any way to create a property with a default of empty string?

Thanks,
Andrew
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Dialog Checkbox Value

Hi Andrew,

Indeed, if the checkbox is selected, the property is set with the default value e.g. True. If the checkbox is not selected, then the property is not set.

By default, the MSI does not accept empty properties, but you can use the Set installer property value - SetProperty custom action to reset the property value.

Please let me know if you have any questions.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”