vsb16
Posts: 14
Joined: Mon May 17, 2021 1:37 pm

Validate windows user credentials

Hello,

We install a windows service through the MSI. While installing we provide dialog for username and password. We use this username and password as Logon credentials for service.

We want to validate the username and password of windows users before proceeding further.

How can we validate it on dialogs next button?

Thank you !
Catalin
Posts: 6611
Joined: Wed Jun 13, 2018 7:49 am

Re: Validate windows user credentials

Hello,

For this, you could use our predefined "LogonInformationDlg" dialog, together with the "Check if user exists" custom action.

If you would like to create your own dialog, then you can proceed as it follows:

- create the dialog

- create a Custom Action that retrieves the values inserted by the users at install time and then validates them

Add the custom action as a "Published Event" on the "Next" button of your dialog.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
vsb16
Posts: 14
Joined: Mon May 17, 2021 1:37 pm

Re: Validate windows user credentials

Hello, Thanks for your help. we implement the "Check If user exist" with "LogonInformationDlg" and its absolutely working fine.
But we have given hard coded set DOMAIN_NAME value through Properties in Custom Behavior.

If we put DOMAIN_NAME property value empty, the "Check if user exist" does not work. We want to remove the dependency of DOMAIN_NAME property.
1)Can "Check if user exist" automatically does fetch the value of DOMAIN_NAME?
2)Can we remove the DOMAIN_NAME dependency for "Check if user exist"?
3) How we can internally fetch the DOMAIN_NAME property and set to use in "check if user exist"?
Catalin
Posts: 6611
Joined: Wed Jun 13, 2018 7:49 am

Re: Validate windows user credentials

Hello,
Thanks for your help. we implement the "Check If user exist" with "LogonInformationDlg" and its absolutely working fine.
I am glad to hear it works as expected.
2)Can we remove the DOMAIN_NAME dependency for "Check if user exist"?
I do not think there is any dependency regarding the domain in that custom action. In case you want to use that custom action for a local user account, then the "Domain" field should be left empty as per the article I've linked above.


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

Return to “Common Problems”