卸载后程序文件中存在空目录 [英] Empty directories are present in programfiles after uninstall

查看:29
本文介绍了卸载后程序文件中存在空目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在卸载 MSI 软件包时,有一堆未从 ProgramFiles 中删除的空文件夹.有没有一种方法可以确保在卸载后删除所有空目录以及 InstallDir.

While uninstalling a MSI package, there are a bunch of empty folders which are not removed from the ProgramFiles. Is there a way Wix in which I can make sure all the empty directories are removed after uninstallation along with InstallDir.

推荐答案

RemoveFile/RemoveFolder:除了实现自己的自定义操作(不推荐),还有RemoveFile/RemoveFolder 概念.在 MSI 文件中,这映射到 RemoveFile 表.在 WiX 中,它使用 RemoveFile Element删除文件夹元素.

RemoveFile / RemoveFolder: Besides implementing your own custom action (which is not recommended), there is the RemoveFile / RemoveFolder concept. In an MSI file this maps to the RemoveFile table. And in WiX it is implement using the RemoveFile Element and the RemoveFolder Element.

RemoveFolderEx:还有另一个可用元素,它是 Util 命名空间中的自定义 WiX 扩展.它被称为 RemoveFolderEx 元素.此元素还可以删除子目录 - 如此处所述.您可以在此处找到简要示例(注意顶部的 xmlns:util 命名空间).而且总是有 github.com 可以搜索.

RemoveFolderEx: There is also another element available which is a custom WiX extension in the Util namespace. It is called RemoveFolderEx Element. This element can also remove sub-directories - as explained here. You can find a brief sample here (notice the xmlns:util namespace on top). And there is always github.com to search.

空文件夹:通常空文件夹表示组件引用问题,或通过自定义操作或应用程序本身在正常运行期间创建的文件夹.我猜你是后者?

Empty folders: Typically empty folders indicate a component reference problem, or folders created via custom actions or by the application itself during its normal operation. My guess is that the latter is the case for you?

一些链接:

这篇关于卸载后程序文件中存在空目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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