Archive: UAC plugin, return value from process


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


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.)


Um, don't you have to be admin to run vcredist_x86.exe?


Hahaha, good point, that. :)


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!

The UAC plugin is not for running things as admin. Use http://pastebin.com/EvMkyLLt


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!


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...