PDA

View Full Version : Check for administrator privileges


rpetges
21st September 2002, 13:57
Hi all,

I'm currently running NSIS 2.0a7 and need to restrict the installation of a software to users that have Administrator rights on their WinNT/2000/XP machine.

How can I check if a user has these rights and block the installation for other users ?

Thank you for your help

Romain

kichik
21st September 2002, 14:04
Please read the FAQ (http://forums.winamp.com/showthread.php?s=&threadid=102650).

How can I make sure the user installing my software has admin rights?
Use the IsAdmin DLL to find out.

(there is a link in the faq too)

rpetges
21st September 2002, 14:11
I saw the section in the FAQ but I thought there was an easier way to check this out, maybe a built-in variable in NSIS.

On the other hand, where can I download the DLL as I didn't own a C/C++ compiler :-(

Romain

kichik
21st September 2002, 14:50
There is a compiled veresion in the ZIP file.

brainsucker
21st September 2002, 15:22
Sorry kichik, but it is not :)
Here it is...

By the way: there is a big problem opening NSIS project/workspace files with MSVC++ 7.0. Is says something like: "Cannot load project file due to corrupt project file". Somebody knows the solution (I'm not ready to create new VC7 project for every NSIS component yet :)?

kichik
21st September 2002, 15:28
That's weird... I was sure it was there before :weird:

Well, anyway, thanks for attaching it brainsucker.

rpetges
21st September 2002, 15:29
Many thanks for your help !

Romain

Joost Verburg
21st September 2002, 21:57
Is there also a DLL which can check for Power Users?

rpetges
22nd September 2002, 08:28
Maybe it is an idea to include a single function into v2.0a8 that returns the current privileges for the logged user.

Example: function GetPriviliges that returns User, PowerUser, Guest, Administrator... or only a well defined integer number.

That's the only thing I'm missing in NSIS. What do you think about it ?

Romain