What are the UAC implementation best practices? (.NET)

I'm thinking about developing an application that should run as standard user most of the time, but for certain operations, elevated administrative access will be required. The user expecience should be like in Windows Explorer when copying something into a protected folder.

Now the question is, how should this be implemented in .NET? I know that only entire processes or maybe some COM instances can be elevated, not single functions. But that would be exactly what I need. What path should I go? Write two executables, one with a manifest and the other without; programmatically run the same process elevated a second time; use some COM thing? Then I have the added privileges, but how to tell the other process what to do? Use .NET remoting (which is deprecated/complicated?); implement my own IPC thing using sockets/pipes/whatever? That elevated task may need to ask the user something in the middle of the process. And it must be cancellable.

There's a lot that tells me how UAC is working in the inside or how system administrators can configure it, but I haven't found anything that answers these basic questions.

13
задан ygoe 10 May 2011 в 08:53
поделиться