Determine if user is admin user. - 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!

Laurin
Posts: 58
Joined: Thu Jun 12, 2008 4:27 pm

Determine if user is admin user.

Hi

I added a custom dialog. But this button should not be displayed everytime. If the user is no admin this dialog should not be displayed. So I added a condition to the event - or... i wanted to do so....

How can i check in a normal condition statement if the current setup executing user has admin privilegues. I found a AdminProperties property... hm... how to use this? Normally windows installer knows a property calld AdminUser... but it seems to be always not set....

can you please help me?
thanks in advance

kind regards
Ionut
Posts: 605
Joined: Tue Nov 22, 2005 11:29 am
Contact: Website

Re: Determine if user is admin user.

Hi,

You can use either the AdminUser or Privileged Properties, but it is recommended that you use the Privileged Property (which indicated whether the installation is performed with elevated privileges).

A tutorial on how to conditionally display a dialog is available here.

Please let me know if you still encounter problems.

Regards,
Ionut
Denis Toma
Advanced Installer Team
http://www.advancedinstaller.com/
Laurin
Posts: 58
Joined: Thu Jun 12, 2008 4:27 pm

Re: Determine if user is admin user.

thank you. It now worked with the AdminUser Property - it is case sensitive :roll:

Can you tell me what possible contents of the privileged property is?

How do I check if the user has admin right with this property?

Just NOT PRIVILEGED will say that the user isn't admin?

thanks in advance

kind regards
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Determine if user is admin user.

Hi,
Can you tell me what possible contents of the privileged property is?
The property is set to "1" if the user has administrator privileges, if the application has been assigned by a system administrator, or if both the user and machine policies AlwaysInstallElevated are set to true. If none of these conditions is met, the property is empty.
How do I check if the user has admin right with this property?
The condition Privileged will execute a control event only when the user is an Administrator. Also, the condition NOT Privileged will execute the control event when the user is not an Administrator.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Laurin
Posts: 58
Joined: Thu Jun 12, 2008 4:27 pm

Re: Determine if user is admin user.

thank you. seems to work great.

Return to “Common Problems”