如何从 AppData\Roaming 文件夹中删除应用程序文件

发布于 2025-01-03 20:25:01 字数 174 浏览 2 评论 0 原文

我正在使用 Windows 安装程序来创建安装项目。

卸载应用程序时,如何从 AppData\Roaming 文件夹中删除/删除应用程序文件。

我尝试添加一个特殊文件夹并将 DefaultLocaltion 设置为 [AppDataFolder] 但它不起作用。

我还需要做其他事情吗?

I am using windows installer to create setup project.

How I can remove/delete application files from AppData\Roaming folder when application uninstalled.

I tried added a special folder and set DefaultLocaltion to [AppDataFolder] but it didn't working.

Do I need to do anything else?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

神经暖 2025-01-10 20:25:01

我需要了解您想要做什么才能给您具体的建议。一般来说,您尝试做的事情是可以从 CommonAppDataFolder 中删除文件,但不能从 AppDataFolder 中删除文件,因为尝试从多个用户配置文件中删除用户数据并不是最佳实践。此外,尝试清理漫游配置文件用户数据是完全不可能的,因为其他用户尚未登录。

您需要阅读:

管理漫游用户数据部署指南 MSI

假设您正在尝试执行我认为的操作,您将需要一个在卸载时留下的清理脚本/exe,以及一个在卸载期间写入注册表的自定义操作( 本身无法执行此操作)来调用该脚本/EXE。您需要利用此处描述的主动安装技巧:

使用活动安装程序修复用户设置

其工作方式是卸载后留下 EXE 和注册表项,这样当用户登录时,它的漫游数据就会从服务器上拉下来到本地和活动安装程序意识到它尚未运行该脚本。该脚本运行(一次)并且数据被删除。当用户注销时,数据将在服务器上复制/删除。然后他们再次登录,它不再运行。

I'd need to understand what you are trying to do to give you specific advice. In general what you are trying to do would be OK removing files from CommonAppDataFolder but not AppDataFolder as trying to clanup user data from multiple user profiles is not a best practice. Additionally trying to cleanup Roaming Profile User data is outright impossible because the other users aren't logged on.

You'll want to read:

Managing Roaming User Data Deployment Guide

Assuming you are trying to do what I think you are, you'll need a cleanup script / exe that you leave behind on uninstall and a custom action to write to the registry during uninstall ( MSI can't do this natively ) to call that script/EXE. You'll want to leverage the Active Setup trick as described here:

Using Active Setup to Repair User Settings

The way it'll work is your uninstall leaves the EXE and registry entry behind so that when a user logs on it's roaming data gets pulled down from the server to local and Active Setup realizes it hasn't run the script yet. The script runs (once) and the data is deleted. When the user logs off the data is replicated / deleted on the server. Then they log on again it doesn't run again.

紙鸢 2025-01-10 20:25:01

默认情况下,Windows Installer 在安装后不会删除应用程序创建的文件。为此,您需要编写自己的自定义操作(将在卸载时运行),或者根据用于创作 MSI 的工具,您可以使用内置选项来清理应用程序位置,因为某些工具具有此支持。

By default Windows Installer does not remove the files created by your application, after the installation. To do that you need to either write your own custom action, that will run upon uninstall, or depending on the tool used for authoring the MSI, you can use built-in options for cleaning the application locations, as some tools have this support.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文