简体   繁体   中英

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

I am having trouble getting the MSI delete my root application folder. All files are correctly deleted on uninstall except the root folder. The MSI is generated by WIX Toolset. Strange things is this happens only with MSIs dished out by our build server. The MSIs generated on my local machine work fine and they do clean up application folder properly. I ran the uninstall in verbose mode but could not find anything alarming.

In past, even my local machine MSIs were not working. But I added KeepEmptyDirectories="true" GenerateGuidsNow="true" in the .wixproj - if that is a useful information. 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.

  3. Test on clean machines. (VM snapshot are the easiest.)

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. 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 . It consists of project templates (scaffolding) and graphical designers to greatly aid on authoring and maintaining a WiX project. You can then edit the XML by hand on an as needed basis to declare things that IsWiX does not yet handle.

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? Is the root folder an IIS folder? 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

Next, try some diffing on the MSI files themselves and the folders they deliver / install to verify what could be different (if anything).

Try to use dark.exe from the Wix toolkit on the two different MSI files. 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.

Beyond Compare from http://www.scootersoftware.com/ - is hands down a brilliant tool (no affiliation obviously). 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).

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).

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. 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 ).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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