开发者

Convert Virtual Directory to Web Application in WiX

I am creating a new WebSite whenever Feature A or B is installed:

<Component Id="IIS.HelloWorld" Guid="6FA5EF90-C9D9-463C-9CC7-0410670AFBD1" Directory="TARGETDIR">
  <iis:WebSite Id="IIS.HelloWorld" Description="Hello World for Web" Directory="INSTALLDIR">
    <开发者_运维百科iis:WebAddress Id="HelloWorldAddress" IP="*" Port="8080"/>
  </iis:WebSite>
</Component>

The WebSite is pointed to the INSTALLDIR (Say C:\MyFiles). Below the INSTALLDIR, I have 2 additional folders: Service (C:\MyFiles\Service) and Web (C:\MyFiles\Web)

Since the WebSite is pointed to INSTALLDIR, all sub-directories (Service and Web) were automatically treated as Virtual Directories (?) -- I can see them linked via IIS Management Console and I can access them via my browser.

However, they need to be "converted" to Applications (done manually by right-clicking the Virtual Directory and selecting "Convert to Application) in order for them to work properly (they contain ASPX and ASMX files).

So I've added the following component to try to convert them to "Applications":

<Component Id="IIS.HelloWorld.WebSite.VirtualDirectory" Guid="GUID-44D1-48D9-BB3C-4B0126FB83E5" Directory="TARGETDIR">
  <iis:WebVirtualDir Id="IIS.HelloWorld.WebSite.VirtualDirectory" Alias="Service" Directory="INSTALLDIR.WebSite" WebSite="IIS.HelloWorld">
    <iis:WebApplication Id="IIS.HelloWorld.WebSite.VirtualDirectory" Name="Service"/>
  </iis:WebVirtualDir>
</Component>

But the Virtual Directories wasn't converted to "Applications"; they are still just virtual directories.

Question: How do I convert virtual directories to applications in WiX? Or what is the proper way to handle this situation?

Thanks!


My bad. I was binding the wrong Virtual Directory Alias to the wrong Web Application Name.

This code works:

<Component Id="IIS.HelloWorld.WebSite.VirtualDirectory" Guid="GUID-44D1-48D9-BB3C-4B0126FB83E5" Directory="TARGETDIR">
  <iis:WebVirtualDir Id="IIS.HelloWorld.WebSite.VirtualDirectory" Alias="Web" Directory="INSTALLDIR.WebSite" WebSite="IIS.HelloWorld">
    <iis:WebApplication Id="IIS.HelloWorld.WebSite.VirtualDirectory" Name="Web"/>
  </iis:WebVirtualDir>
</Component>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜