zitt
asked on
Check for Admin rights?
I have used www.Youseful.com to create a custom setup program that was built using Delphi 3.02.
This setup program install a Win32 application that supports both Win9x and WinNT/2000.
I have had several ppl send me e-mail complaining that they can't install the program on WinNT/2000... I always ask the question:
"Do you have administrator rights on the computer your trying to install my program on?"
To which I always get a response simular to "No."
So, this brings me to my question:
Does anyone know how to programicly check NT to determine if the current user has administrator rights necessary to install software?
:::crossing fingers:::
John
This setup program install a Win32 application that supports both Win9x and WinNT/2000.
I have had several ppl send me e-mail complaining that they can't install the program on WinNT/2000... I always ask the question:
"Do you have administrator rights on the computer your trying to install my program on?"
To which I always get a response simular to "No."
So, this brings me to my question:
Does anyone know how to programicly check NT to determine if the current user has administrator rights necessary to install software?
:::crossing fingers:::
John
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
inthe (Barry),
Thanks... works like a charm. (at least on Win2000)
Mash,
I appreciate you answer; it's just inthe's was "plug-n-play".
John
Thanks... works like a charm. (at least on Win2000)
Mash,
I appreciate you answer; it's just inthe's was "plug-n-play".
John
Hmmm... Do you have to belong to the administrator group to have administrator rights? Can't you have administrator rights without belonging to the administrator group? In such a case (if it is possible) Barry's code wouldn't work.
Regards, Madshi.
Regards, Madshi.
ASKER
Sounds logical... I tested his code on my Win2k machine... for which I have administrator rights. It correctly reported that I had rights; however, I haven't yet tested it against a usr without rights.
How would you change the code?
How would you change the code?
I would use NetUserGetInfo, see my first comment... :-)
Value Meaning
USER_PRIV_GUEST Guest
USER_PRIV_USER User
USER_PRIV_ADMIN Administrator
Regards, Madshi.