[wix-users] Issue with Default Web Site on uninstalling MSI
egcastr at gmail.com
Thu Aug 16 08:42:24 PDT 2018
I haven't done this in like 5 years but you the behavior you are describing
sounds just like the behavior I remember.
We didn't try to determine if the behavior was correct or not. Instead we
recognized that sharing (and modifying) a resource we did not create would
lead to problems. Some other MSI could come along and modify/configure the
default web site in a way that breaks us and we wouldn't know. So we
decided to create a website for each web service we installed. Uninstall is
now easy! Just remove the website.
Note, if you insist in configuring the default web site, then you are
respilonsible for detecting the original values for the settings you are
configuring and saving the original values somewhere you can read them
later, like during uninstall. WiX will not do that for you.
Of course, for that to be beneficial you must have the ability to tell
iis:WebSite to *not* remove the website at uninstall. I haven't checked but
my memory was you couldn't do that. iis:WebSite effectively takes ownership
of the default web site. Suppose you have two MSI installing a multiple
virtualdirs in the default web site. You will still delete the default
website when you uninstall any of those MSI regardless of the order.
You can have shared websites if that is something you want but you need a
shared component that only configures the website and all MSI that install
that shared component must do it exactly yue same way (same guid, key path,
etc.) because you really, really have to follow the component rules
correctly so that reference counting works correctly.
My recomendation create your own website and leave the default website
Edwin G. Castro
On Thu, Aug 16, 2018, 07:29 Ven H via wix-users <
wix-users at lists.wixtoolset.org> wrote:
> I have an MSI through which I am configuring the Default Web site in IIS.
> The markup looks like below.
> <Component Id="cmpDefaultWebSite"
> Guid="4E02DA37-61AE-4648-97A2-3130E7FE50D8" Directory="APP_DIR"
> <iis:WebSite Id="DefaultWebSite" Description="Default Web Site"
> ConfigureIfExists="yes" Directory="wwwroot" AutoStart="yes"
> <iis:WebAddress Id="DefaultWebSiteAddr" Secure="yes" Port="80" />
> Basically, we are adding some virtual directories and applications in the
> Default Web Site, by referring to its Id, like below. There are many
> components like below.
> <Component Id="cmpData" Guid="3A0FC121-533F-4637-ACC8-465730EB6378"
> Directory="APP_DIR" KeyPath="yes">
> <iis:WebVirtualDir Id="Data" WebSite="DefaultWebSite" Alias="Data"
> <iis:WebApplication Id="Data" Name="Data"
> WebAppPool="CustAppPool" />
> Everything works fine as expected. But, when we uninstall the MSI, the
> Default Web Site also seems to be getting removed, although the MSI is only
> configuring the Default Web Site during installation and not creating it.
> So, during uninstall, the expectation is that, it will only rollback its
> changes and not remove the Default Web Site.
> Can anyone please advise what could be wrong and how to fix it?
> WiX Toolset Users Mailing List provided by FireGiant
More information about the wix-users