[wix-users] Issue with Default Web Site on uninstalling MSI

Ven H venh.123 at gmail.com
Thu Aug 16 08:57:08 PDT 2018

Thanks a lot for the details, Edwin. Unfortunately, I am not sure if they
would be OK with creating a different website. In my case, our application
will be installed on a dedicated server. So, what I am thinking is to store
the Physical Path (which is probably the main thing required) of the
Default Web Site in registry and read that during uninstall using a
deferred CA and create a Default Web Site and apply this path after
uninstall. Looks like that is my only option. I hope I will get the
registry values in my deferred CA using an immediate CA and pass over those
to the deferred CA after uninstall.


On Thu, Aug 16, 2018 at 9:12 PM, Edwin Castro <egcastr at gmail.com> wrote:

> 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
> alone.
> --
> 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"
>> KeyPath="yes">
>>         <iis:WebSite Id="DefaultWebSite" Description="Default Web Site"
>> ConfigureIfExists="yes" Directory="wwwroot" AutoStart="yes"
>> StartOnInstall="yes">
>>           <iis:WebAddress Id="DefaultWebSiteAddr" Secure="yes" Port="80"
>> />
>>         </iis:WebSite>
>>       </Component>
>> 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"
>> Directory="Data">
>>           <iis:WebApplication Id="Data" Name="Data"
>> WebAppPool="CustAppPool" />
>>         </iis:WebVirtualDir>
>>       </Component>
>> 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
>> http://www.firegiant.com/

More information about the wix-users mailing list