Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Detecting Admin privileges during install


6 replies to this topic

KeithC

KeithC
  • Members
  • 8 posts

Posted 23 February 2001 - 17:37

I'm installing an NT service that must log on as an account with administrator privileges and I prompt the end-user for this information during install time. Is there any function that can validate the specified account's privilege level?

I can't rely on USER_ADMINISTRATOR since there's no guarantee that the logged-on ID running the installer will be the same ID used for the service account.

Thanks,
Keith C.


Leigh Ravenhall

Leigh Ravenhall
  • Members
  • 269 posts

Posted 27 February 2001 - 00:09

I don't think that there is a built in function that you can call to authenticate the user.  One option available to you that I know of is to write a dll in C/C++ calling the LSA (Local Security Authority) API to authenticate the user, then call that dll function.  It's a bit of an effort, but it should work.

The other option is the one I chose, where I hope the user gets it right.

Leigh.


KeithC

KeithC
  • Members
  • 8 posts

Posted 27 February 2001 - 16:31

Thanks, Leigh. Trusting in the sage advice of a professional, I'll keep my fingers crossed that the users get it right. ;-)

Thanks again,
Keith C.


SteveP

SteveP
  • Members
  • 126 posts

Posted 02 March 2001 - 18:37

From the Windows Installer SDK:

"AdminUser Property
The installer sets the AdminUser property on Windows NT/Windows 2000 if the user has administrator privileges. This property is always set on Windows 95 and Windows 98."

This might help.


KeithC

KeithC
  • Members
  • 8 posts

Posted 02 March 2001 - 18:44

Thanks, Steve, but that only checks the value of the currently logged-in user. What we allow our clients to do is log in as "user a", and then specify that the NT service logs on as "user x". They would have to log on as "user x" in order to utilize the built-in Admin functions, and we're trying to make them jump through as few hoops as possible.

Appreciate the reply, though.


SteveP

SteveP
  • Members
  • 126 posts

Posted 02 March 2001 - 19:20

Check out the Privileged Property in the WI SDK.  There are some registry settings to deal with, but those can be handled with a VBScript when the installer is installed ... or by an Admin User if the installer is already in place.