views:

56

answers:

2

I have a client-side app that downloads a Nullsoft installer from the server and runs the installer as an external process with verb set to "runas". Nullsoft installer also has a line in the script that requests elevated privileges. On Windows 7, this works sometimes -- Windows displays the UAC dialog, clicking ok allows the installer to run. But other times, the UAC dialog never shows up and as a result the installer never launches. If I manually double-click the same installer, it always works, i.e. the UAC dialog shows up, etc. The most confusing part is this behavior being inconsistent, on the same machine with the exact same UAC settings this works sometimes and hangs the other times. I have tried different UAC levels too, still it is hit-or-miss. Any ideas?

+1  A: 

What did you set RequestExecutionLevel to? Just setting it to "RequestExecutionLevel admin" should be enough, no need to use the runas verb, just start the process with ShellExecute. (RequestExecutionLevel only deals with Vista and later when UAC is on, use the userinfo nsis plugin to cover those other cases)

Anders
A: 

I did figure out what was going on. I was already setting RequestExecutionLevel to admin in the install script, but I had the ShellExecute turned off. Turning it on fixed the problem.

codelove