How would I go about elevating my running C# program only when necessary?
I come from Java and I see programs like IntelliJ only calling on their "elevator.exe"
when a task requires administrator privileges.
So, I am wondering how I would go about doing the same thing in C#, only elevating the current program when a task needs elevating (for example, an update), and then being able to run the specified task. It wouldn't bother me if I too had to make my own "elevator.exe"
, I would just like to know how it is done so that I may recreate it.
I'm not trying to just run another program with administrator privileges, I want to give admin access to the current program, to perform operations like updates, like IntelliJ does.