ewanb
Posts: 28
Joined: Mon Jun 05, 2006 1:53 pm
Location: Glasgow

Custom action condition from checkbox

Hi,

I have a custom action (exe) that backs up some existing files before new files are installed. I'm trying to make the action conditional on a checkbox but can't quite figure out how to do it.

I have a check box that displays caption "Backup existing files" and I want my custom action to run if the user checks it. I have assigned a custom property to the check box but not sure what I should put in the value entries to get the behaviour I want.

Thanks,
Ewan
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

Condition the custom action with the property used for the check box. The condition looks like this:

Code: Select all

CHECK_PROP = 1
Where CHECK_PROP is the property of the check box and 1 it's value.

Regards,
Gigi
_________________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
ewanb
Posts: 28
Joined: Mon Jun 05, 2006 1:53 pm
Location: Glasgow

I have managed to get my custom action to run correctly based on the value of my custom BACKUP_LICENSE property by adding a new published event to the checkbox with the following values:

Event = [BACKUP_LICENSE]
Argument = Y
Condition = AI_INSTALL

Then making the custom action condition:

BACKUP_LICENSE = "Y"

But I have noticed that if I tick the check box and then change my mind I can't uncheck it? How do I make it possible for the user to uncheck the box if they click it by accident?
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

You don't need a published event to change the property value of the checkbox. When the control is checked then the property value is the value specified in the "Properties" list. Have you try my suggestion from the previous post?

Also note that the property of the checkbox must be in upper case because only public properties are pased from the User Interface to the Execute sequence.

You can learn more here:
http://www.advancedinstaller.com/user-g ... ditor.html

Regards,
Gigi
__________________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com

Return to “Common Problems”