Archive: Check for administrator privileges


Check for administrator privileges
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


Please read the FAQ.

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)


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


There is a compiled veresion in the ZIP file.


IsAdmin
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 :)?


That's weird... I was sure it was there before :weird:

Well, anyway, thanks for attaching it brainsucker.


Many thanks for your help !

Romain


Is there also a DLL which can check for Power Users?


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