- NSIS Discussion
- How Can I make show up UAC with ExecWait?
Archive: How Can I make show up UAC with ExecWait?
bennaloz
9th February 2012 09:18 UTC
How Can I make show up UAC with ExecWait?
My setup needs administrator rights to be executed.
In my setup I need to launch many .exe files showing the request Yes or No from UAC. Not necessarily with the request of admin username and password.
I saw the UAC plugin but it should be only ansi and I'm using unicode nsis.
I want to make sure that the UAC request if you want really execute that file for every file that needs admin rights that I execute.
mmm ok I think that's all.
Sorry again for my bad english :(
Waiting for your reply
Bennaloz
MSG
9th February 2012 10:10 UTC
If your installer is running at admin level, all child processes will also be running at admin level. If you want a yes/no popup, you can simply use the MessageBox command before you execwait.
bennaloz
9th February 2012 10:17 UTC
I saw it. When I say yes the first time uac won't ask me again. So Isn't it possible to make the uac asks for execution confirm of a child process?
MSG
9th February 2012 11:15 UTC
No, not for an admin-level child process. You are correct that it is possible if you execute them at userlevel using the UAC plugin or the ShellExecAsUser plugin.
..but seriously, why on earth would you want to bother your clients with loads of UAC popups? The whole point of UAC is that once it's elevated you don't need to worry anymore. If I let an installer get admin level, I don't want it to keep asking me whether I'm really sure I want to give it admin access...
In my opinion, your idea will only confuse the users. They don't expect new UAC popups from your installer, so they might think that some other application (virus?) is suddenly popping up and demanding admin access.
bennaloz
9th February 2012 12:26 UTC
No ok..."Problem changed"
Ok no I'm sorry misunderstood what the problem was. I'am executing the main setup with RequestExecutionLevel user and I need to exec some setups that required admin rights from it. Now those setups don't start. I have to be able to run as user some others setups with admin rights request. Nsis runAs admin plugin I don't think is what I need because for that I need to know login data and I don't know them. Anyway I didn't found any docs about it. So I need to be able to launch executable with admin rights request from a user environment.
How to do it?
I need something like
RequestExecutionLevel user
ExecWait '"myapp.exe" runAsAdmin <parameters>' $0 ;myapp can be executed only by admins
Sorry for the wrong thread title and for the wrong explanation of the problem but really I didn't understood what I needed
Edit: I should be able to do something as admin from a user account. (Write reg key, install files etc)
Anders
9th February 2012 15:43 UTC
Why is your main installer "RequestExecutionLevel user"?
bennaloz
9th February 2012 15:48 UTC
Just trying if it's possible do the installation from a simple user. But it's hard. I don't understand how runAs works. And a user can't do so much. I am looking for a way to do the same things maybe without asking login data. If it's possible... or maximum asking them once.
Anders
9th February 2012 16:02 UTC
You already said you need to elevate child process and you should only elevate once so why not just use requestexecutionlevel admin?
bennaloz
9th February 2012 16:04 UTC
Aaah... I want to be able to launch installers with admin rights request from a user level installer...
MSG
9th February 2012 16:09 UTC
If you want to install your app at userlevel, and you need to install additional apps at admin level, either create two installers or use the UAC plugin or ShellExecAsUser plugin.
Anders
9th February 2012 16:35 UTC
Originally posted by bennaloz
Aaah... I want to be able to launch installers with admin rights request from a user level installer...
This does not answer my question! Why does the main installer have to stay at user level?
bennaloz
10th February 2012 07:15 UTC
Originally posted by MSG
If you want to install your app at userlevel, and you need to install additional apps at admin level, either create two installers or use the UAC plugin or ShellExecAsUser plugin.
I already saw UAC plugin but the unicode dll miss in the zip. And ShellExecAsUser I will try it I already saw it but I think it doesn't wait and I need that wait for the end of the process. And anyway seems to miss also here the unicode plugin.
@Anders...
Just testing the potential of nsis at the end. Why? If I can ask you this.
bennaloz
10th February 2012 08:04 UTC
Done. I found out a version of ExecShell with waiting for the end of the proc in http://nsis.sourceforge.net/StdUtils_plug-in that can launch installers at admin level from an installer with user level.
In this way having the main installer with RequestExecutionLevel user I can launch flash player prerequisite showing UAC request only for that process -.-''. I wanted to run my installer without UAC request but if I need installing prerequisites showing UAC request for their launch.