开发者

Using UAC elevation for executing several installers

开发者 https://www.devze.com 2023-03-28 00:55 出处:网络
I am trying to determine the correct way to use UAC elevation in the following situation: I have a c# app which runs in the systemtray and installs other programs. While my app itself only does stuff

I am trying to determine the correct way to use UAC elevation in the following situation:

I have a c# app which runs in the systemtray and installs other programs. While my app itself only does stuff that may not need elevation (Reading registry at HKLM, writing its own files to a path that is always allowed - C:\Users\User\AppData\Local), the programs that are installed by my app may require elevation.

My question is: If I add a manifest to my app, and set it to require elevation, does this mean that:

  • the elevation also applies for other installers executed by my app?
  • the elevation is remembered and not asked again for the installers executed by m开发者_JS百科y app?

Thank you in advance for clarifying.


If your application is elevated, it remains elevated for its entire lifetime. There is no going back. Any application that it runs itself will also be elevated. There is no way to directly launch a non-elevated program from an elevated one.

You might want to read this article for some ways of dealing with elevation.

0

精彩评论

暂无评论...
验证码 换一张
取 消