Question

I am using the following code to install a web application. It creates the virtual directory just fine, but doesn't convert the virtual directory in application. I am running IIS 7 I have searched a lot but couldn't find anything different in order to make an application of virtual directory. Can someone point what's wrong with the following code?

    <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>
Was it helpful?

OTHER TIPS

Try this out. This is working perfectly fine for me.

<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>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top