简体   繁体   English

通过WIX生成的MSI在卸载时不会删除应用程序根文件夹

[英]MSI generated through WIX does not delete application root folder on uninstall

I am having trouble getting the MSI delete my root application folder. 我无法让MSI删除我的根应用程序文件夹。 All files are correctly deleted on uninstall except the root folder. 除根文件夹外,所有文件在卸载时均已正确删除。 The MSI is generated by WIX Toolset. MSI由WIX Toolset生成。 Strange things is this happens only with MSIs dished out by our build server. 奇怪的是,这仅发生在我们的构建服务器发出的MSI上。 The MSIs generated on my local machine work fine and they do clean up application folder properly. 在我的本地计算机上生成的MSI可以正常工作,并且可以正确清理应用程序文件夹。 I ran the uninstall in verbose mode but could not find anything alarming. 我以详细模式运行了卸载,但是找不到任何令人震惊的东西。

In past, even my local machine MSIs were not working. 过去,甚至我的本地计算机MSI都不起作用。 But I added KeepEmptyDirectories="true" GenerateGuidsNow="true" in the .wixproj - if that is a useful information. 但是我在.wixproj中添加了KeepEmptyDirectories =“ true” GenerateGuidsNow =“ true”-如果这是有用的信息。 How can I troubleshoot this issue? 如何解决此问题? What are probable red flags that I should be looking for? 我应该寻找什么可能的危险信号?

I would be doing several things: 我会做几件事:

  1. Get a solid understanding of the component rules and their implications. 对组件规则及其含义有深入的了解。 (What goes wrong when you break them.) (当您破坏它们时出了什么问题。)

  2. Examining uninstall log files for clues on why Windows Installer choose not to remove the folder. 检查卸载日志文件,以获取有关Windows Installer为什么选择不删除文件夹的线索。

  3. Test on clean machines. 在干净的机器上测试。 (VM snapshot are the easiest.) (VM快照是最简单的。)

While some people can get lucky, I don't recommend using any sort of dynamic wxs code generation with the exception of a dynamic ProductCode to support major upgrades. 尽管有些人会很幸运,但我不建议使用任何形式的动态wxs代码生成,但动态ProductCode除外以支持主要升级。 This includes everything from dynamic guids on components to component harvesting (aka dynamic file linking). 这包括从组件的动态向导到组件收集(也称为动态文件链接)的所有内容。 These tend to eventually break the component rules with side effects including what you see here. 这些往往最终会破坏组件规则,并产生副作用,包括您在此处看到的内容。

That said, I understand the pain of authoring WiX XML by hand and I have an open source project on CodePlex called IsWiX . 就是说,我知道手工编写WiX XML的痛苦,并且我在CodePlex上有一个名为IsWiX的开源项目。 It consists of project templates (scaffolding) and graphical designers to greatly aid on authoring and maintaining a WiX project. 它由项目模板(脚手架)和图形设计器组成,可以极大地帮助创作和维护WiX项目。 You can then edit the XML by hand on an as needed basis to declare things that IsWiX does not yet handle. 然后,您可以根据需要手动编辑XML,以声明IsWiX尚未处理的内容。

Sounds like there is a lock on the folder itself. 听起来文件夹本身有锁。 Are you running any services that you are stopping as part of the uninstall? 您是否正在运行要在卸载过程中停止的任何服务? Are you running any custom actions that load files from the root folder as part of its operation? 您是否正在运行任何自定义操作,将其作为操作的一部分从根文件夹加载文件? Are you setting any custom permissioning on the root directory ACL? 您是否在根目录ACL上设置了任何自定义权限? Is the root folder an IIS folder? 根文件夹是IIS文件夹吗? Did you try to reboot after the uninstall to see if the folder is still there? 您是否在卸载后尝试重新启动以查看文件夹是否仍然存在?

The obvious first step would be to ensure that the service stops properly before being deleted on uninstall. 显而易见的第一步是要确保服务在卸载之前被删除之前正确停止。 This behavior could be different on different boxes (but it sounds like you test on the same box). 在不同的盒子上,此行为可能有所不同(但听起来您在同一个盒子上进行测试)。 See this thread: http://forum.installsite.net/index.php?showtopic=16458 看到这个线程: http : //forum.installsite.net/index.php?showtopic=16458

Next, try some diffing on the MSI files themselves and the folders they deliver / install to verify what could be different (if anything). 接下来, 尝试一些版本比较的MSI文件本身和安装他们提供/文件夹,以验证这可能是不同的(如果有的话)。

Try to use dark.exe from the Wix toolkit on the two different MSI files. 尝试在两个不同的MSI文件上使用Wix工具包中的 dark.exe This will decode them to Wix XML, then use a compare tool such as Beyond Compare , or a similar disk-diff tool, to determine if there are any significant differences between them. 这会将它们解码为Wix XML,然后使用比较工具(例如Beyond Compare或类似的磁盘差异工具)来确定它们之间是否存在任何重大差异。

Beyond Compare from http://www.scootersoftware.com/ - is hands down a brilliant tool (no affiliation obviously). 来自http://www.scootersoftware.com/的 Beyond Compare –是一个出色的工具(显然没有从属关系)。 I use it all the time, and its usefulness is immediate and a tool all professionals working with files would benefit from every day. 我一直在使用它,它的用处是立即的,并且所有使用文件的专业人员每天都会从中受益。 Try it . 试试吧 See a screenshot . 看截图

Also run a file diff on the installed folders to see if there are any obvious differences. 另外,在已安装的文件夹上运行文件差异以查看是否存在明显差异。 Pay special attention to config files and do a full binary level difference (not just CRC / hashes). 要特别注意配置文件,并进行完整的二进制级别差异(不仅仅是CRC /哈希)。

Export your registry hives from HKCU and HKLM (just for your application, not the whole registry) and compare them in before and after states too (4 exports). HKCUHKLM 导出注册表配置单元 (仅针对您的应用程序,而不是整个注册表),并在状态之前和之后进行比较(4个导出)。

As to the differences seen between machines - it sounds like you are using a test virtual, but I just want to add that the presence of visual studio on your box could affect things even if everything else is the same. 至于机器之间的差异-听起来您正在使用测试虚拟机,但是我只想补充一点,即使其他条件相同,盒子上Visual Studio的存在也会影响事物。 Other than that the hardware, network and firewall configuration sound like they are the same and that you are testing on a test box. 除此之外,硬件,网络和防火墙配置听起来都一样,并且您正在测试盒上进行测试。

Have you tried using dependency walker ? 您是否尝试过使用依赖行者 I have never used it for services, but the profiling option is useful for checking applications in general ( how-to ). 我从未将其用于服务,但概要分析选项对于检查常规应用程序( 方法 )非常有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM