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!

goldenbelly
Posts: 6
Joined: Mon Jan 24, 2011 2:39 pm

Check If User Exists

I am finding Advanced Installer non-intuitive.

I want to 'Check If User Exists'. I have added a custom predefined action. The help says "The custom action uses the following properties: USER_NAME, etc"

Where/how do I set the properties and where/how do I get the result of the action? How do I branch the code depending on the result?

Please can your Help system actually provide Help, rather than just a list of features with no clue how to use them.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Check If User Exists

Hello and welcome to the Advanced Installer Forums,
Where/how do I set the properties
As our user guide says the USER_NAME and DOMAIN_NAME properties are associated with the "User Name" and "Domain" edit controls on "LogonInformationDlg". After adding this dialog you can simply add the "Check If User Exists" custom action as a DoAction published control event on its [ Next ] button. If you don't want to use the LogonInformationDlg, you can set the properties with the help of the "Property Set with Formatted" custom action.
where/how do I get the result of the action?
After running the custom action the AI_USER_EXISTS property will be set to "Yes" if the user account exists or to "No" otherwise.

Regards,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
goldenbelly
Posts: 6
Joined: Mon Jan 24, 2011 2:39 pm

Re: Check If User Exists

Even more confused now!
If you don't want to use the LogonInformationDlg, you can set the properties with the help of the "Property Set with Formatted" custom action.
Where does your Help or Tutorials deal with this?

Why manually set properties? The CheckIfUserExists action should set the property.

Please explain how to do the psuedo code below:

Code: Select all

CheckIfUserExists('mihai')

if AI_USER_EXISTS=yes then
     continue with installation
else
     quit installation

goldenbelly
Posts: 6
Joined: Mon Jan 24, 2011 2:39 pm

Re: Check If User Exists

Any help please from the developers? Is your system capable of doing what I want? I may have to look to your competition if you cannot help.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Check If User Exists

Hello,
Where does your Help or Tutorials deal with this?
Usually, our support team references our user guide in URL links( blue text ). To be a little more clear so I can properly answer your question, I will extract the "Property Set with Formatted" link from my previous post:
http://www.advancedinstaller.com/user-g ... #section24
Why manually set properties? The CheckIfUserExists action should set the property.
The "Check If User Exists" custom action needs to have its input properties set either in the predefined "LogonInformationDialog"( as explained in the user guide ) or from another section or custom action from your project. The input properties need to be set either by the user or by you before the custom action is executed. As an example, you can have a "Property Set with Formatted" custom action set the USER_NAME public property to "mihai" as opposed to having the user type "mihai" in the "User Name:" text field from the "LogonInformationDialog".
Please explain how to do the psuedo code below:
  • add the "Check If User Exists" custom action in the Custom Actions page as an UI Custom Action. For more information about the steps of adding a "Check If User Exists" here is the link from our user guide : http://www.advancedinstaller.com/user-g ... check-user
  • add an "Error message"( "Error message" user guide link: http://www.advancedinstaller.com/user-g ... #section18 ) custom action as an UI Custom Action
    Picture of first two steps:
    Picture of first two steps:
    1.jpg (11.68 KiB) Viewed 10106 times
  • add the LogonInformationDialog from the Dialogs page
  • on the "Next" button add a "Do Action" published event with the argument set to:

    Code: Select all

    ErrorMessage
    and the condition set to:

    Code: Select all

    AI_USER_EXISTS="No"
  • set the existing "NewDialog" published event's condition to

    Code: Select all

    AI_USER_EXISTS="Yes"
    Picture of last three steps:
    Picture of last three steps:
    2.jpg (86.46 KiB) Viewed 10106 times
Since you are new, I strongly recommend you read our tutorials for a better understanding of how to use Advanced Installer to efficiently deploy your products.This will also help you better understand support team's suggestions now and in the future. The Simple and Professional tutorials are especially important.

Regards,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
goldenbelly
Posts: 6
Joined: Mon Jan 24, 2011 2:39 pm

Re: Check If User Exists

Thank you for your suggestions.

I take your point about needing to learn your product, but it is difficult when using intuition only.

Please also appreciate that your tutorials are not 100% accurate. I am doing the Professional tutorial but section 10 is wrong - the screenshots have no relation to what actually happens. Sections 7 & 8 also seem to have steps missing. And I haven't even finished the tutorial yet.

Are the tutorial screenshots from a previous version of your product?
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Check If User Exists

Hello,
Sections 7 & 8 also seem to have steps missing.
Thank you for your suggestion, I have forwarded your complaint to our technical writing team.
Are the tutorial screenshots from a previous version of your product?
Yes, this is correct. Some modifications outside the Professional tutorial's guidance have been brought and we are aware of this. We have planned to synchronize the screenshots with the application in the 8.1 release.

Best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
goldenbelly
Posts: 6
Joined: Mon Jan 24, 2011 2:39 pm

Re: Check If User Exists

I have followed your suggestions, but I still cannot get this function to work. I have previously stated that I do not want the user to logon and I have no need to use the LogonInformationDialog (and your docs state I do not need to use it).

Please can you review the attached project file and let me know where I am going wrong. I want to check the 'administrator' user exists, because some of my customers rename this account and it causes problems elsewhere.
CheckUser.aip
(8.96 KiB) Downloaded 347 times
Many thanks.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Check If User Exists

Hello,

I have looked into your AIP file and to solve this you will need to move all the "Next" button published events from the PrepareDlg to the "Next" button on the WelcomeDlg. You should leave the PrepareDlg unchanged. I am suggesting this because the "Next" button on the PrepareDlg is never pressed( the dialog is displayed for a brief moment only ). The first dialog displayed during the install is the WelcomeDlg.

Regards,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
goldenbelly
Posts: 6
Joined: Mon Jan 24, 2011 2:39 pm

Re: Check If User Exists

Thank you. I now have the CheckIfUserExists action working.

If actions cannot be assigned to buttons on PrepareDlg, perhaps you may want to consider removing the facility to modify PrepareDlg. This would have saved me (and others) a lot of time. Why allow something that will never work?
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Check If User Exists

Hello,
Why allow something that will never work?
The PrepareDlg is a Windows Installer mandatory standard dialog as explained in our user guide under this link from my previous post:
http://www.advancedinstaller.com/user-g ... alogs.html

Also, its functionality could be that of a first dialog if its "Modal" attribute is set to true and the "Next" button has a NewDialog ( with the WelcomeDlg argument for example ) published event.

Best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”