rpetges
21st September 2002 14:57 UTC
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
kichik
21st September 2002 15:04 UTC
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)
rpetges
21st September 2002 15:11 UTC
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 15:50 UTC
There is a compiled veresion in the ZIP file.
brainsucker
21st September 2002 16:22 UTC
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 :)?
kichik
21st September 2002 16:28 UTC
That's weird... I was sure it was there before :weird:
Well, anyway, thanks for attaching it brainsucker.
rpetges
21st September 2002 16:29 UTC
Many thanks for your help !
Romain
Joost Verburg
21st September 2002 22:57 UTC
Is there also a DLL which can check for Power Users?
rpetges
22nd September 2002 09:28 UTC
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