Background: I have a Wix installer where a virtual directory gets created in an existing IIS website. The virtual directory is created (it doesn't exist before the install) but the IIS website should already be created (user just picks a website to install to in a ListBox).
The problem: On uninstall, the Physical Path of the IIS website that got installed to becomes blank, no value for that attribute. Below is a pared down version of my main wix file. I'm not sure why the uninstall is affecting the IIS website, but any thoughts are appreciated.
Notes: I'm on Wix 3.5 and Windows Server 2008 R2, IIS 7.
<Product>
<Property Id='WEBSITE_DESCRIPTION'>
<RegistrySearch Id='RememberPropertyWEBSITE_DESCRIPTION' Root='HKCU'
Key='SOFTWARE\Company\Product' Name='InstalledWebsiteDescription'
Type='raw' />
</Property>
<Property Id='WEBSITE_PORT'>
<RegistrySearch Id='RememberPropertyWEBSITE_PORT' Root='HKCU'
Key='SOFTWARE\Company\Product' Name='InstalledWebsitePort'
Type='raw' />
</Property>
<Component Id='PropertiesToSave' Directory='ApplicationFolder'>
<RegistryValue Root='HKCU' Key='SOFTWARE\Company\Product'
Name='InstalledWebsiteDescription' Value='[WEBSITE_DESCRIPTION]'
Type='string' />
<RegistryValue Root='HKCU' Key='SOFTWARE\Company\Product'
Name='InstalledWebsitePort' Value='[WEBSITE_PORT]'
Type='string' />
<RemoveFolder Id='CleanupApplicationFolder' On='uninstall' />
</Component>
<Directory Id='TARGETDIR' Name='SourceDir'>
<Component Id='TestWebVirtualDirComponent' Guid='12345678-6304-410E-A808-E3585379EADB'>
<CreateFolder />
<iis:WebVirtualDir Id='TestWebVirtualDir' Alias='[WEBSITE_VIRTUALDIR]' Directory='TARGETDIR' WebSite='MyWebsite'>
<iis:WebApplication Id='TestWebApplication' Name='Test' />
</iis:WebVirtualDir>
</Component>
</Directory>
<iis:WebSite Id="MyWebsite" Description="[WEBSITE_DESCRIPTION]" SiteId="*">
<iis:WebAddress Id="AllUnassigned" Port="[WEBSITE_PORT]" />
</iis:WebSite>
<Feature>
<ComponentRef Id='TestWebVirtualDirComponent'/>
<ComponentRef Id='PropertiesToSave'/>
</Feature>
</Product>