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

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

问题描述

我会在WiX邮件列表上问这个问题,但似乎已经失败了。

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

我有一个应用程序既是桌面应用程序又是web应用程序在本地运行。我已经创建了几个基本的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.

A奖金将在机器上启用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天全站免登陆