Old 9th February 2012, 09:18   #1
bennaloz
Member
 
Join Date: Jan 2012
Location: Treviso
Posts: 61
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
bennaloz is offline   Reply With Quote
Old 9th February 2012, 10:10   #2
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
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.
MSG is offline   Reply With Quote
Old 9th February 2012, 10:17   #3
bennaloz
Member
 
Join Date: Jan 2012
Location: Treviso
Posts: 61
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?
bennaloz is offline   Reply With Quote
Old 9th February 2012, 11:15   #4
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
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.
MSG is offline   Reply With Quote
Old 9th February 2012, 12:26   #5
bennaloz
Member
 
Join Date: Jan 2012
Location: Treviso
Posts: 61
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)

Last edited by bennaloz; 9th February 2012 at 14:55.
bennaloz is offline   Reply With Quote
Old 9th February 2012, 15:43   #6
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,321
Why is your main installer "RequestExecutionLevel user"?

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 9th February 2012, 15:48   #7
bennaloz
Member
 
Join Date: Jan 2012
Location: Treviso
Posts: 61
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.
bennaloz is offline   Reply With Quote
Old 9th February 2012, 16:02   #8
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,321
You already said you need to elevate child process and you should only elevate once so why not just use requestexecutionlevel admin?

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 9th February 2012, 16:04   #9
bennaloz
Member
 
Join Date: Jan 2012
Location: Treviso
Posts: 61
Aaah... I want to be able to launch installers with admin rights request from a user level installer...
bennaloz is offline   Reply With Quote
Old 9th February 2012, 16:09   #10
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
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.
MSG is offline   Reply With Quote
Old 9th February 2012, 16:35   #11
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,321
Quote:
Originally Posted by bennaloz View Post
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?

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 10th February 2012, 07:15   #12
bennaloz
Member
 
Join Date: Jan 2012
Location: Treviso
Posts: 61
Quote:
Originally Posted by MSG View Post
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 is offline   Reply With Quote
Old 10th February 2012, 08:04   #13
bennaloz
Member
 
Join Date: Jan 2012
Location: Treviso
Posts: 61
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.
bennaloz 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