Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using WiX to create an IIS virtual directory

Tags:

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

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

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

like image 642
user75467 Avatar asked Mar 09 '09 03:03

user75467


People also ask

How do I create a virtual directory website?

Right-click the Web site that you want (for example, Default Web Site), point to New, and then click Virtual Directory. On the Welcome to the Virtual Directory Creation Wizard page, click Next. On the Virtual Directory Alias page, type the alias that you want (for example, Sales), and then click Next.

How do I create a folder in Wix?

Go to My Sites in your Wix account. Click Create New Folder at the top right. Enter a name for the folder and click Create.

What is the folder location for IIS virtual directory?

Here I'm going to create a virtual directory in IIS for the web application which is located in the path: “G:\DotNetExamples\AllInOne”, Step 1: Open IIS. To open IIS, press windows key + R key, which opens “Run” window and type “inetmgr” and press enter, which opens the IIS.


1 Answers

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>
like image 130
Eric Smith Avatar answered Oct 25 '22 02:10

Eric Smith