问题
My msi install and uninstall a shared resource: IIS virtual directory "MyTeamServices". And it works very well except it removes that virtual directory during uninstall process even if somebody have created nested virtual directories (not by using installers, just "by hands"). When I expect to see standard behavior of WiX processing HDD folders : if there are "unaccounted" files inside - do not remove folder.
Could you get me ideas how to solve this little problem (and not by using "permanent" attribute)?
Particularly:
1) How to work with WiX sources to understand what is standard behavior during uninstall of WebVirtualDir (and may be patch it)? I see the ParseWebVirtualDirElement but that not make me closer to IIS management actions. Where they are, how to dig out them?
2) I could also write custom action that could alarm if virtual directory contains something unexpected "inside", but where to call it, and how then skip WebVirtualDir uninstall ? Component can be uninstalled but the actions of WebVirtualDir uninstall process should be skipped... Or I should play there with msi "features",e.g Move this component to feature and then somehow to skip feauture's uninstallation?
回答1:
See the answer in the linked question. It brings reference count into IIS virtual directory - they won't be deleted if it is used by another product.
来源:https://stackoverflow.com/questions/13077205/wix-how-to-skip-removing-of-iiswebvirtualdir-if-virtual-directory-contains-nes