codelove
codelove

Reputation: 1386

C#, UAC, installer, Windows 7

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

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?

Upvotes: 0

Views: 762

Answers (1)

Anders
Anders

Reputation: 101656

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)

Upvotes: 3

Related Questions