|
|
#1 |
|
Junior Member
Join Date: Aug 2010
Posts: 1
|
I have NSIS/Unicode script that installs my application.
The installation requires admin privileges, which I get by setting up the privilege level At the end of the installation, I want to launch my application. My problem is that the application launches in Admin mode. I'd like to launch it in user mode, just as if a user double clicked its icon. Nothing I tried worked. Even setting down the level before launching wouldn't help. What can I do? |
|
|
|
|
|
#2 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 2,784
|
I'd love to hear what you did when you tried "setting down the level" since such a thing is not possible.
The easy solution: Disable the run checkbox on the finish page The hard solution: Use the UAC plugin IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
#3 | |
|
Senior Member
Join Date: Mar 2006
Location: Dallas
Posts: 442
|
Anders,
Quote:
I have not yet found where they tell how to revert to lower privileges. Don |
|
|
|
|
|
|
#4 |
|
Major Dude
Join Date: Jun 2001
Posts: 1,173
|
Is the reverse even true? I.e. can a process elevate itself mid-run? I was under the impression that it can't; that, at best, you can start a new process with the appropriate privileges.
There's some discussions out there on how to run an app as user from a higher elevation... one using the Task Scheduler ( http://www.codeproject.com/KB/vista-...aElevator.aspx ), one doing crazy things by getting the desktop (which it presumes to be non-elevated) and spawning a new process using that desktop's security tokens ( http://blogs.msdn.com/b/aaron_margos...vated-app.aspx <- http://blogs.microsoft.co.il/blogs/s...d-process.aspx ) and another that looks entirely like hieroglyphics after gazing at it for 2 minutes ( http://brandonlive.com/2008/04/27/ge...ou-part-2-how/ ). But they're all about starting new processes - in which case, the UAC plugin should work quite well within the NSIS context and would be more flexible. |
|
|
|
|
|
#5 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 2,784
|
That's right, there are several hacky code samples out there that claim to "ride the elevator back down" but they are all hacks and will fail in certain configurations.
IntOp $PostCount $PostCount + 1 |
|
|
|
![]() |
|
|||||||
| Tags |
| nsis security |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|