我有一个简单的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!
推荐答案注册表表是为此目的而设计的: msdn.microsoft/en-us/library/aa371168(VS.85).aspx
The Registry table is designed for this: msdn.microsoft/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.
-卸载组件时,将删除所有具有其值和子项的键(如果存在).
更多推荐
在卸载过程中删除注册表项
发布评论