使用 WiX 创建 IIS 虚拟目录 [英] Using WiX to create an IIS virtual directory

查看:25
本文介绍了使用 WiX 创建 IIS 虚拟目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我会在 WiX 邮件列表上询问这个问题,但似乎已关闭.

I'd ask this on the WiX mailing list, but it seems to be down.

我有一个应用程序,它既是桌面应用程序,又是本地运行的网络应用程序.我已经创建了几个基本的 WiX 安装程序,但还没有使用 IIS 扩展在 IIS 下创建虚拟目录.我一直没能找到一个简单的例子来说明如何做到这一点.我需要做的就是创建虚拟目录,设置其端口,然后将其指向我正在与安装程序的其余部分一起创建的真实目录.

I have an application which is both a desktop app and a web app which runs locally. I've created a couple of basic WiX installers, but haven't yet used the IIS extension to create a virtual directory under IIS. I haven't been able to find a simple example of how to do this. All I need to do is create the virtual directory, set its port, and point it at a real directory which I'm creating with the rest of the installer.

如果尚未启用 IIS,则会在机器上启用 IIS,但我猜这是不可能的,而且无论如何对我来说都不是交易破坏者.

A bonus would be enabling IIS on the machine if it's not already enabled, but I'm guessing that's not possible, and isn't a dealbreaker for me anyway.

如果有关系,这个安装程序只能在 Vista 机器上运行.

If it matters, this installer will only be run on Vista machines.

推荐答案

由于 David 提到的文章好像丢了,这里举个例子.这也会在虚拟目录中创建一个应用程序.

Since the article mentioned by David seems lost, here is an example. This also creates an application in the virtual directory.

<?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="6f2b2358-YOUR-GUID-HERE-aa394e0a73a2" Name="WixProject" Language="1033" Version="1.0.0.0" Manufacturer="WixProject" UpgradeCode="225aa7b2-YOUR-GUID-HERE-110ef084dd72">
        <Package InstallerVersion="200" Compressed="yes" />

        <Media Id="1" Cabinet="media1.cab" EmbedCab="yes" />

        <!-- Reference existing site at port 8080 -->
        <iis:WebSite Id="My.Site" Description="My Site">
            <iis:WebAddress Id="My.Web.Address" Port="8080"/>
        </iis:WebSite>

        <Directory Id="TARGETDIR" Name="SourceDir">
            <Directory Id="ProgramFilesFolder">
                <Directory Id="INSTALLLOCATION" Name="WixProject">
                    <Component Id="IIS.Component" Guid="{6FAD9EC7-YOUR-GUID-HERE-C8AF5F6F707F}" KeyPath="yes">
                        <iis:WebVirtualDir Id="My.VirtualDir" Alias="foo" Directory="INSTALLLOCATION" WebSite="My.Site">
                            <iis:WebApplication Id="My.Application1" Name="Web Application 1"/> 
                        </iis:WebVirtualDir>
                    </Component>

                </Directory>
            </Directory>
        </Directory>

        <Feature Id="ProductFeature" Title="WixProject" Level="1">
            <ComponentRef Id="IIS.Component" />
        </Feature>
    </Product>
</Wix>

这篇关于使用 WiX 创建 IIS 虚拟目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆