我使用以下代码安装Web应用程序。它可以很好地创建虚拟目录,但不会转换应用程序中的虚拟目录。我正在运行IIS 7 我已经搜索了很多但是找不到任何不同的东西才能创建虚拟目录的应用程序。有人能指出以下代码的错误吗?
<Component Id="WebAppVDirComponent"
Guid="C7A4B0E8-2389-4A2A-B285-96960BEE1C51"
KeyPath="yes">
<iis:WebVirtualDir Id="VDir"
Alias="[WEB_APP_NAME]"
Directory="INSTALLDIR"
WebSite="TheWebSite" >
<!-- Turn the Virtual Directory into a web application. -->
<iis:WebApplication Id="WebApplication"
Name="[WEB_APP_NAME])"
WebAppPool="TheAppPool"/>
</iis:WebVirtualDir>
<CreateFolder/>
</Component>
答案 0 :(得分:0)
试一试。这对我来说非常好。
<Component Id="VDProductCenter" Guid="493E3487-AA4C-4476-8CC0-4B1C763AF6F7" Permanent="no">
<File Id="Dummy" KeyPath="yes" Name="Dummy.txt" Source="Files/dummy.txt"></File>
<iis:WebVirtualDir Id="PCVDir" Alias="[VDNAME]" Directory="dir_Application_0" WebSite="PCWebSelectedWebSite">
<iis:WebApplication Id="PCWebApp" Name="[VDNAME]" />
</iis:WebVirtualDir>
<RegistryKey Root="HKLM" Action="createAndRemoveOnUninstall" Key="SOFTWARE\CompanyName\[ProductCode]\VirtualDirectory">
<RegistryValue Name="VDName" Type="string" Value="[VDNAME]"/>
</RegistryKey>
</Component>
<Component Id="PersistWebSiteValues" Guid="C3DAE2E2-FB49-48ba-ACB0-B2B5B726AE65" Permanent="no">
<File Id="Dummy1" KeyPath="yes" Name="Dummy1.txt" Source="Files/dummy.txt"></File>
<RegistryKey Root="HKLM" Action="createAndRemoveOnUninstall" Key="SOFTWARE\CompanyName\[ProductCode]\WebSiteValues">
<RegistryValue Name="WebSiteDescription" Type="string" Value="[WEB_WEBSITE_DESCRIPTION]"/>
<RegistryValue Name="WebSitePort" Type="string" Value="[WEB_WEBSITE_PORT]"/>
<RegistryValue Name="WebSiteIP" Type="string" Value="[WEB_WEBSITE_IP]"/>
<RegistryValue Name="WebSiteHeader" Type="string" Value="[WEB_WEBSITE_HEADER]"/>
</RegistryKey>
</Component>
<iis:WebSite Id="PCWebSelectedWebSite" Description="[PCWEB_WEBSITE_DESCRIPTION]">
<iis:WebAddress Id="AllUnassigned1" Port="[WEB_WEBSITE_PORT]" IP="[WEB_WEBSITE_IP]" Header="[WEB_WEBSITE_HEADER]" />
</iis:WebSite>
答案 1 :(得分:0)