在卸载过程中删除注册表项 [英] Remove registry key during uninstall

查看:108
本文介绍了在卸载过程中删除注册表项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的C#应用​​程序,它允许用户指定它应该(或不应该)从Windows启动.可以通过设置(或删除)注册表项(即... \ Software \ Microsoft \ CurrentVersion \ Run \ MyApplicationHere)来实现.

I have a simple C# application that allows users to specify that it should be (or should not be) started with Windows; it does so by setting (or deleting) a registry key (namely, ...\Software\Microsoft\CurrentVersion\Run\MyApplicationHere).

我正在使用VS安装项目来为此程序创建安装程序.我不希望安装程序创建此密钥.仅当用户从程序中选择选项时才创建它.

I am using a VS setup project to create the installer for this program. I don't want the installer to create this key; it should only be created when the user selects the option from within the program.

这是问题所在:我希望卸载程序删除该密钥(如果存在),最好不要诉诸任何黑客手段;如果有一个简单的内置"解决方案,我很想听听.谢谢!

Here is the issue: I would like the uninstaller to delete this key if it exists, preferably without resorting to any sort of hackery; if there is a simple "built-in" solution I would love to hear it. Thanks!

推荐答案

注册表表是为此目的而设计的:
http://msdn.microsoft.com/en-us/library/aa371168(VS.85).aspx

The Registry table is designed for this:
http://msdn.microsoft.com/en-us/library/aa371168(VS.85).aspx

尤其是在名称"的描述下:
如果值"列为Null,则下表中名称"列中显示的字符串具有特殊的意义.

See especially under the description of "Name":
If the Value column is Null, then the strings shown in the following table in the Name column have special significance.

-卸载组件时,将删除所有具有其值和子项的键(如果存在).

这篇关于在卸载过程中删除注册表项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆