Old 20th January 2010, 12:50   #1
robbertdam
Junior Member
 
Join Date: Jul 2009
Posts: 8
"Elevation" on Windows XP: not always working

Hi,

I have an installer that needs to be run as administrator.

On Vista: no problem, I get an elevation prompt.

On XP: it works sometimes:

-> When creating a simple local user with no rights on an XP machine, an login prompt shows up when I run the installer. This allows me to login as admin
-> When logged in on a domain with a domain user (no admin rights), the installer just start to run (and then bumps into a security error).

How come? How can I always force this login prompt to show up on XP?

Thanks for you help!
robbertdam is offline   Reply With Quote
Old 20th January 2010, 15:42   #2
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
Why didn't you try searching the forums before you asked? This question has been asked hundreds of times before.

requestexecutionlevel admin and/or UserInfo plugin.
MSG is offline   Reply With Quote
Old 20th January 2010, 19:47   #3
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,449
Quote:
Originally posted by MSG
requestexecutionlevel admin and/or UserInfo plugin.
UserInfo plugin and optionally requestexecutionlevel (Meaning, if you use requestexecutionlevel admin, you MUST also use UserInfo to deal with UAC off, < NT6 etc)

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 21st January 2010, 06:19   #4
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
Err, oops. Thanks for the fix, Anders.
MSG is offline   Reply With Quote
Old 21st January 2010, 07:51   #5
robbertdam
Junior Member
 
Join Date: Jul 2009
Posts: 8
Quote:
Originally posted by MSG
Why didn't you try searching the forums before you asked? This question has been asked hundreds of times before.

requestexecutionlevel admin and/or UserInfo plugin.
I DID search the forums before I asked.

The doc says about "RequestExecutionLevel":
"Specifies the requested execution level for Windows Vista and Windows 7."

My question is about XP.

I already use the UserInfo plugin, so I can determine if I am admin or not. However I want to give this login prompt automatically, not a box saying "please run as admin".

So why the inconsistent behaviour on XP? How to get it working?
robbertdam is offline   Reply With Quote
Old 21st January 2010, 08:08   #6
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
You can use the UAC plugin to elevate in .onInit, that will runas a second instance of the installer, as admin. That should automatically display the login. (What do you currently use to get the login screen on XP? I don't think I've ever seen XP do that automatically.)
MSG is offline   Reply With Quote
Old 25th January 2010, 07:55   #7
robbertdam
Junior Member
 
Join Date: Jul 2009
Posts: 8
Thanks, I'm now looking into the UAC plugin.

It appears that the Windows XP I was using for my test has *something* installed on it, so the elevation prompt is automatically shown.
robbertdam is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump