<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:iis="http://schemas.microsoft.com/wix/IIsExtension">
<Product Id="e6c96829-cb0e-443c-843d-50f9c497f0b6" Name="Sample"
Language="1033" Version="1.0.0.0" Manufacturer="Me"
UpgradeCode="b3b0a43f-5a27-4974-b9d4-87364345aec0">
<Package InstallerVersion="200" Compressed="yes" />
<Media Id="1" Cabinet="WixSample.cab" EmbedCab="yes" />
<iis:WebSite Id='DefaultWebSite' Description='Default Web Site'>
<iis:WebAddress Id='AllUnassigned' Port='80' />
</iis:WebSite>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="INSTALLDIR" Name="Sample">
<Directory Id="MyWebSiteDir" Name="MyWebSite" />
</Directory>
</Directory>
<Feature Id="SampleFeature" Title="Sample" Level="1">
</Feature>
</Product>
</Wix>
这是我运行的代码。它没有显示任何错误。但是当我运行 MSI 时,站点并没有在 IIS 中创建。IIS 版本是 7。WIX 版本是 3.6。即使我尝试了http://www.wintellect.com/cs/blogs/jrobbins/archive/2011/01/25/install-a-new-virtual-directory-to-default-web-site-with-中的代码wix.aspx仍然无法正常工作