Check if User exists - 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!

Matt
Posts: 109
Joined: Tue Oct 19, 2010 4:54 pm

Check if User exists

Hi,

I am trying to get advanced installer to check if a user account exists when installing our product as we use Windows Authentication we want to check that the user account exists before the product is installed so it prevents the user being locked out. Is there anyway of doing this without using the LogonInformationDlg?

We also support Forms Authentication aswell so if the user selects Forms Authentication at the start of the wizard we would like to not check if the user exists is that possible?

Matt
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Check if User exists

Hi Matt,

You can add a "Check If User Exists" predefined custom action anywhere in the dialog sequence, just make sure you set its required properties accordingly. Also, you can add any execution condition you need to it.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Matt
Posts: 109
Joined: Tue Oct 19, 2010 4:54 pm

Re: Check if User exists

Hi,

Do I need to edit any properties? and do we need to get the user to enter their password and Domain? Also Do I just create the check if user exists custom action and an error message custom action then associate them to the next button? We currently have a custom action to stop the user clicking next if any of the fields are empty will this cause problems for the check if user exists action?

Matt
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Check if User exists

Hi Matt,
Do I need to edit any properties?
The properties required by this predefined custom action are described in the link from my previous post( blue text ). This is how we usually reference user guide articles.
Please follow the instructions accordingly, perhaps familiarize with the functionality in a test project and contact us if you have any related doubts.
We currently have a custom action to stop the user clicking next if any of the fields are empty will this cause problems for the check if user exists action?
The "DoAction" event will be published when the Next button is clicked.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Matt
Posts: 109
Joined: Tue Oct 19, 2010 4:54 pm

Re: Check if User exists

Hi,

I have read the link but can you just clarify for me that I need to use all of the Properties? As at the moment we only use the 'USERNAME' Property.

Matt
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Check if User exists

Hi Matt,

The decision to omit certain properties completely depends on the search complexity you need. The custom action works fine for example if you only specify the USER_NAME property for a user from the localhost domain.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Matt
Posts: 109
Joined: Tue Oct 19, 2010 4:54 pm

Re: Check if User exists

Hi,

We have created our own Dialog page and set the user name edit box's property to USER_NAME. We have then tried to set it to not let you onto the next dialong until you have enterd a correct username but this does not work. Can you send me some clear instrcutions on how to do this as the link you have referd me to is a bit vague and I can't make any sense of what you would like me to do.

I have also tried to do the same on a test project with the same issues.

Matt
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Check if User exists

Hi Matt,

I have attached a sample project that demonstrates this in "UserDialog" and displays a message box in case the user does not exist:
test.aip
(15.43 KiB) Downloaded 563 times
To customize the message box, simply modify the CustomActionData like described in the following article:
http://www.advancedinstaller.com/user-g ... e-box.html

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Matt
Posts: 109
Joined: Tue Oct 19, 2010 4:54 pm

Re: Check if User exists

Hi,

Thanks for sending the aip that has made things a lot easier to understand. The only problem I am having now is that it is having problems checking if my user account exists it just says that It can't find it. Will this custom action support User accounts in an Active Directory Domain?

Matt
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Check if User exists

Hi Matt,

The custom action should support all domains if they are provided.

Like described in the article, it is very easy to implement:
- set the USER_NAME
- set the DOMAIN_NAME
- run the predefined custom action

Can you please specify the show stoppers you found when implementing this functionality in your project? What errors you got or what didn't work specifically?

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Matt
Posts: 109
Joined: Tue Oct 19, 2010 4:54 pm

Re: Check if User exists

Hi,

We would preferably not like to get the user to specify the domain as it is not needed by our application so wouldnt serve much of a point on the page. It is not a show stopper but would be good if we could get it to work without specifying the domain.

In the test project I made I try my domain logon (without the domain\ at the start) and I got an error saying the user account does not exist. I then tried the local admin account on my machine and it worked ok with no problems. I can try and get you a screen shot of the error message if it is needed.

Matt
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Check if User exists

Hi Matt,

As I mentioned above, for the custom action to work without specifying the domain, the user must be on the localhost domain. In any other cases you have to assign the domain name to the DOMAIN_NAME property and nowhere else( e.g. appending it to the USER_NAME property ) before calling the custom action.

This is how the predefined custom action is designed. If this does not suite your requirements, you can always implement the desired functionality from within your own custom action.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Matt
Posts: 109
Joined: Tue Oct 19, 2010 4:54 pm

Re: Check if User exists

Hi,

Thanks for the help.

Matt

Return to “Common Problems”