darasan
20th April 2011 11:11 UTC
UAC plugin, return value from process
Hi,
I searched the forums about this but couldnt find any information.
I am using the UAC plugin with my NSIS script.
To install the Visual Studio 2010 Redistributable, I call this function:
!insertmacro UAC_AsUser_ExecShell "" "vcredist_x86.exe" "" "" ""
I want to be able to check the return value of this exe. I looked at the macro itself and it
calls ExecShell, but I want it to call ExecWait instead and return the value to my script.
I tried to modify it to do this, but I can't get it to work.
Has anybody tried this before?
Thanks,
Daire
MSG
20th April 2011 17:34 UTC
Try making a function that execwaits, and call that function as user. (Note that variables like $TEMP might be different between the inner and outer processes.)
Anders
20th April 2011 19:07 UTC
Um, don't you have to be admin to run vcredist_x86.exe?
MSG
20th April 2011 21:02 UTC
Hahaha, good point, that. :)
darasan
27th April 2011 10:55 UTC
Hi, thanks for your replies.
Try making a function that execwaits, and call that function as user. (Note that variables like $TEMP might be different between the inner and outer processes.)
So you mean to just call a function, containing an ExecWait command, in the usual NSIS way? Not using any of the UAC plug-in macros? Doesn't this defeat the purpose of using the plug-in?
And if I need to be admin to install the vcredist package, what command should I use?
I can only see a macro for UAC_AsUser_ExecShell...
Sorry for my lack of understanding, I can't find any documentation on this?
Many thanks for your help!
Anders
27th April 2011 12:01 UTC
The UAC plugin is not for running things as admin. Use http://pastebin.com/EvMkyLLt
darasan
28th April 2011 11:09 UTC
OK, so I've misunderstood the purpose of this plugin.
The main page description says:
"For example, you can have an admin level installer launch another process at a user level. Or you can have an admin level installer create shortcuts at a user level."
Why would I want to do this? Why not run everything at the admin level (using RequestExecutionLevel admin), when installing?
Would that make un-installing more difficult? Thanks!
Anders
28th April 2011 11:24 UTC
First off, I did not write the wiki page so I can't really comment on its content.
The only real purpose of the UAC plugin is to handle the run checkbox on the finish page. People use it for other things, and yes, it makes it harder to uninstall if you do that...