sgturner
Posts: 13
Joined: Wed Feb 20, 2013 9:53 pm

Custom Dialog with validation of string input

Hi,

I'm developing an installer where the user has to enter a license key into a dialog. I want to validate the key before we move to the nextstep. So I have an Edit control, where the user enters the key. The key goes into a Property, called KEY. I want to enable the "Next>" button only when the key contains certain things, but I can't seem to get it to work. I have tried Control Conditions on the Next button like (with the button starting diabled:

Condition
KEY ~<> "-VSC64-"

Action
Enable

Any help would be appreciated.

thanks
steev
Dan
Posts: 4529
Joined: Wed Apr 24, 2013 3:51 pm

Re: Custom Dialog with validation of string input

Hi Steev,

Please note that you need to add two Control Conditions for the Next dialog, one control condition to enable the related control and another one to disable it.

Please take a look on the Edit Condition Dialog article which may be useful to you.
Also, the Email ID validation forum thread may be useful to you as it debates a similar subject.

Should there be any difficulty you encounter implementing something, please do not hesitate to contact me and I will gladly assist.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sgturner
Posts: 13
Joined: Wed Feb 20, 2013 9:53 pm

Re: Custom Dialog with validation of string input

Hi Dan

Looked at the Email ID validation forum thread, and tried to implement what it said but had no success.

Again, I want to enable the "Next>" button, only when the Edit box contains the correct type of string.

My current "code" is:
- Custom Dialog with an Edit.
- Edit has Property RTX_ACTIVATION_CODE
- Next button has Control Condition - when RTX_ACTIVATION_CODE ~>< "-VSC64-" Action = Enable

thanks
steve
Dan
Posts: 4529
Joined: Wed Apr 24, 2013 3:51 pm

Re: Custom Dialog with validation of string input

Hi Steve,

I'm not sure why you encountered the this behavior.
In order to have a better view about this, can you please send us the .AIP (project file) to support at advancedinstaller dot com so we can investigate it? If it contains confidential information you can send us a small test project which reproduce this behavior.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sgturner
Posts: 13
Joined: Wed Feb 20, 2013 9:53 pm

Re: Custom Dialog with validation of string input

Hi Dan,

Sent you my AIP project.

thanks
Steve
sgturner
Posts: 13
Joined: Wed Feb 20, 2013 9:53 pm

Re: Custom Dialog with validation of string input

Hi dan,

Just checking if you got my API project

thanks
Steve
sgturner
Posts: 13
Joined: Wed Feb 20, 2013 9:53 pm

Re: Custom Dialog with validation of string input

Hi Dan,

Thanks for the advice on how to structure my conditions:

As I said, you need to have two control condition for the Next control:
1) when it is Enabled
2) when it is Disabled

To enable the Next control you have used the following control condition:
VSC_LICENSE_KEY ~>< "-RTX64-"

To disable it, this condition should not be true:
NOT (VSC_LICENSE_KEY ~>< "-RTX64-")

However, this does not seem to work as I expect. The value VSC_LICENSE_KEY does not seem to be updated from the Edit control when something is typed in.

thanks
Steve
Dan
Posts: 4529
Joined: Wed Apr 24, 2013 3:51 pm

Re: Custom Dialog with validation of string input

Hi Steve,
However, this does not seem to work as I expect. The value VSC_LICENSE_KEY does not seem to be updated from the Edit control when something is typed in.
Indeed, this is a Windows Installer limitation. The property will be updated as soon as the focus will be changed from the edit field control.

In order to overcome this limitation, you can enable the Enhanced User Interface from the Themes > Settings page.

Please let me know if the behavior still persist.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sgturner
Posts: 13
Joined: Wed Feb 20, 2013 9:53 pm

Re: Custom Dialog with validation of string input

This fixed the problem.
Thanks!
Dan
Posts: 4529
Joined: Wed Apr 24, 2013 3:51 pm

Re: Custom Dialog with validation of string input

You're always welcome,

If you have other questions, please let us know.

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

Return to “Building Installers”