在 WiX 中将虚拟目录转换为 Web 应用程序

发布于 2024-09-24 01:25:05 字数 1333 浏览 0 评论 0原文

每当安装功能 A 或 B 时,我都会创建一个新的 WebSite

<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>

该 WebSite 指向 INSTALLDIR(例如 C:\MyFiles)。在 INSTALLDIR 下,我有 2 个附加文件夹:Service (C:\MyFiles\Service) 和 Web (C:\MyFiles\Web)

因为网站指向 INSTALLDIR ,所有子目录(ServiceWeb)都自动被视为虚拟目录(?)——我可以看到它们通过 IIS 管理控制台链接,并且可以通过以下方式访问它们:我的浏览器。

但是,它们需要“转换”为应用程序(通过右键单击虚拟目录并选择“转换为应用程序”手动完成)才能正常工作(它们包含 ASPX 和 ASMX 文件)。

所以我添加了以下组件尝试将它们转换为“应用程序”:

<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>

但虚拟目录并未转换为“应用程序”;它们仍然只是虚拟目录

问题:如何将虚拟目录转换为 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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

贪了杯 2024-10-01 01:25:05

我的不好。我将错误的虚拟目录别名绑定到错误的 Web 应用程序名称。

这段代码的工作原理:

<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>

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>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文