Dealing with check boxes properties - 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!

Tsuushin
Posts: 4
Joined: Fri May 29, 2009 8:05 pm

Dealing with check boxes properties

This post is a mix of a feature request, a rant and a question. All in one!

Please consider this scenario:

I have 6 check boxes controls, each having a property named "cbBINDING_XXX_XXXX" Image


If a check box is checked, the setup needs to write "true" in a xml file, or false if it's unchecked:
Image

In the first image, you'll notice I have to set up TWELVE events to handle setting the relevant properties to either "true" or "false".
I also need to have these properties initialized with a default value in the Install Parameters panel, or the setup will "forget" about their content by the time it gets to write the values in the XML file:
Image
  • Is this the most optimal way of doing something like this?
  • If I absolutely have to do it this way, then why, oh WHY can't I copy and paste the events? With the current editor, it's terribly inefficient to set these 12 events manually. Heck, it's faster to edit the .aip file and deal with the XML manually! Now imagine other (very real) scenarios where I have a page full of checkboxes.. it's a nightmare to set all of these events.
  • It would be nice to have a check box control which we could setup to assign a (different) value to its property when it's NOT checked, instead of the current behavior, which is deleting the property.
I understand that we can't have the same event twice, and I guess that might be why a copy paste feature was never implemented, but this could be worked around relatively easily by adding a duplicate button that creates a new event, opens the "Edit control event" form and pastes the data in there, allowing us to edit it.

P.S. Feel free to move this in the feature suggestions forums if it would be more appropriate.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Dealing with check boxes properties

Hi,
Is this the most optimal way of doing something like this?
No, the best approach is to use a custom action on the "Next" button of the custom dialog. Perhaps this how-to will help you. For example, in VBScript the code for a checkbox would look like this:

Code: Select all

If Session.Property("cbBINDING_LOC_SERVICE") = "" Then
  Session.Property("BINDING_LOC_SERVICE") = "false"
Else
  Session.Property("BINDING_LOC_SERVICE") = "true"
End If
If I absolutely have to do it this way, then why, oh WHY can't I copy and paste the events?
We didn't implement a copy/paste mechanism because most users don't need it. Also, it's redundant to have duplicate control events.
It would be nice to have a check box control which we could setup to assign a (different) value to its property when it's NOT checked, instead of the current behavior, which is deleting the property.
I'm afraid that this is not supported by Windows Installer.
I understand that we can't have the same event twice, and I guess that might be why a copy paste feature was never implemented, but this could be worked around relatively easily by adding a duplicate button that creates a new event, opens the "Edit control event" form and pastes the data in there, allowing us to edit it.
We will consider adding this improvement in a future version. Thank you for your suggestion.

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

Return to “Common Problems”