mli04
Posts: 23
Joined: Tue Mar 02, 2021 10:15 am

Validate the password input by the user

I want users to enter the database password when installing the software and verify that the entered password meets the following password complexity requirements:
a) One upper case alpha character; Uppercase characters of European languages (A through Z, with diacritic marks, Greek and Cyrillic characters)
b) one lower case alpha character; Lowercase characters of European languages (a through z, sharp-s, with diacritic marks, Greek and Cyrillic characters)
c) one numeric value ; Base 10 digits (0 through 9)
d) a special character (i.e., !, @, #, $, %, ^, &)

I have designed a custom dialog box. How can I verify that the password meets the complexity requirements?
Catalin
Posts: 6586
Joined: Wed Jun 13, 2018 7:49 am

Re: Validate the password input by the user

Hello and welcome to our forums,

You can achieve this through a "Custom Action".

For instance, you can have a script-type custom action that will validate the provided password.

When the user enters the password in the UI control, it is stored in a Windows Installer property. To see what is the property that stores the value, please go to "Dialogs" page --> select your dialog --> select the control --> on the right side, under "Property".
property.png
property.png (189.96 KiB) Viewed 3174 times
You can retrieve the property's value in your script and the do the validation.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mli04
Posts: 23
Joined: Tue Mar 02, 2021 10:15 am

Re: Validate the password input by the user

Thank you for your help. I implemented a custom Action and implemented a password verification function. But I have encountered some problems, how can I display different message boxes according to the verification results, so that the user can know the cause of the error.
Catalin
Posts: 6586
Joined: Wed Jun 13, 2018 7:49 am

Re: Validate the password input by the user

Hello,

You are always welcome!

You can either display the message box directly from your custom action or you can use our predefined "MessageBox" custom action.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mli04
Posts: 23
Joined: Tue Mar 02, 2021 10:15 am

Re: Validate the password input by the user

I used an exe as a Custom Action, how do I detect this return value in Advanced Instanller .
Catalin
Posts: 6586
Joined: Wed Jun 13, 2018 7:49 am

Re: Validate the password input by the user

Hello,

Unfortunately, the installer can not communicate with an EXE file through properties.

For more information about this, please have a look over the following thread:

Get error code returned by an EXE custom action

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”