简体   繁体   English

授予管理员卸载程序的权限

[英]Giving admin rights to uninstall a program

I want to delete a registry key while uninstall the program. 我要在卸载程序时删除注册表项。 It can be done when run the visual studio as administrator and uninstalling using visual studio. 当以管理员身份运行Visual Studio并使用Visual Studio卸载时,可以完成此操作。 But it doesn't happen, if I uninstall it using control panel. 但是,如果我使用控制面板将其卸载,则不会发生。 So is there any way to delete registry key while uninstalling the program. 因此,有什么方法可以在卸载程序时删除注册表项。

You'll need to have an application manifest and just change the "requestedExecutionLevel" to Admin like below. 您将需要一个应用程序清单,然后将“ requestedExecutionLevel”更改为Admin,如下所示。

 <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />

This is based on if you've made the installer as a seperate application. 这基于您是否将安装程序作为单独的应用程序进行。 Also, when uninstalling, it will request for confirmation with a UAC popup. 另外,在卸载时,它将要求通过UAC弹出窗口进行确认。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM