卸载时删除文件和文件夹
我正在学习 WIX 来为我的应用程序构建安装程序,但我一直在删除文件。我的问题是如何在卸载时删除文件和文件夹。当我单击删除按钮时,安装程序创建的所有文件和文件夹在卸载时不会删除。
I am learning WIX to build installer for my app but I am stuck with removing files. My question is how can I remove files and folders on uninstall. When I click on remove button, all the files and folders which the installer created doesn't remove on uninstall.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
答案在上面的注释中,但为了将来参考,当文件未被删除时,首先要检查两件事:
确保您没有 Component/@Guid=""。在“专门设置为空字符串 (Guid="")”中,告诉 Windows 安装程序忽略此组件中内置的所有内容。注意:WiX v3.6+ 您可以完全保留 Component 元素的 Guid 属性,这很好(将生成稳定的 GUID)。
确保您没有 Component/@Permanent="yes"。显然,这告诉 Windows Installer 不要卸载这些东西。
The answer is in the comments above but for future reference there are two things to check first when files are not being removed:
Ensure that you do not have Component/@Guid="". In Specifically setting to an empty string (Guid="") tells the Windows Installer ignore all the stuff built into this Component. Note: WiX v3.6+ you can leave the Guid attribute of the Component element completely and that is fine (a stable GUID will be generated).
Ensure the you do not have Component/@Permanent="yes". Obviously, that tells the Windows Installer to not uninstall the stuff.