卸载时如何删除设置 [英] How to remove Settings when uninstalling

查看:68
本文介绍了卸载时如何删除设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的程序与 Visual Studio 安装项目一起安装.该程序在运行时会在其默认位置创建一个 user.config 文件,因为我使用的是 设置.卸载时,如何让卸载程序删除该 user.config 文件?另外,如何让卸载程序删除 %AppData% 中的文件夹?

My program is installed with a Visual Studio Setup project. The program, when run, creates a user.config file in its default location since I'm using Settings. When uninsalling, how do I get the uninstaller to remove that user.config file? Also, how do I cause the uninstaller to remove a folder in %AppData%?

推荐答案

您需要为此编写自定义任务 - 默认(和设计)安装程序只会删除它安装的内容,之后添加的任何内容都不是一部分安装事务.您可以尝试为 user.config 安装一个虚拟文件,并且您应该能够将 AppData 文件夹添加到安装中(尽管如果您在卸载时添加了文件,它不会被删除).

You will need to write a custom task for that - by default (and design) the installer will only remove what it installed, anything that added afterwards is not part of the install transaction. You could maybe try installing a dummy file for the user.config, and you should be able to add the AppData folder in to the install (although it won't be removed if you have added files sitting in it at uninstall time).

这篇关于卸载时如何删除设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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