Persisting Checkbox state during upgrade - 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!

GlennWilson
Posts: 33
Joined: Wed Sep 01, 2010 2:22 pm

Persisting Checkbox state during upgrade

Hi,

During my installation, I obtain information from the user by presenting a user interface with some edit boxes and check boxes. When a user installs the application, I maintain these values in an ini file so that when an upgrade is run, the user interface persists the values the user used during the initial installation. All this works fine except for the Checkbox state which is not being maintained between upgrades. I use a property which I store in the ini file as "true" or "false" depending on whether the checkbox is ticked or not. In the Init Events I set the Property name I have used in the check box based on the value of the property in the ini file. This doesn't seem to work.

How can I persist checkbox values between upgrades using the Search feature and and ini file?

Glenn
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Persisting Checkbox state during upgrade

Hi Glenn,

Installer properties are either set to a value or they are empty. "true" and "false" are just values, for Windows Installer they are the same as "value1" and "value2".

Your control event should set the checkbox property only if "true" was read. Otherwise, it can set it to:

Code: Select all

{}
This value will make the property empty, so the checkbox associated with it will be unchecked.

In the future a good approach would be to save the property value in your INI only if that property is set. If it's not set, you don't save anything. This way an installation which reads the INI can either leave the property empty or set it to a value.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”