0

I'm creating an IsWix solution that creates an IIS with a static javascript website. The website is working as expected after the instalation when I enter to localhost:8080

The problem starts here, I'm unable to serve this website on a virtual directory.

I want to be able to use localhost/myApp to browse the app.

Anon
  • 59
  • 4

1 Answers1

1

In your main project under Code\IISMeta.wxs you'll find the markup that defines the IIS configuration. This file can express any valid WiX IIS meta as documented here:

https://wixtoolset.org/documentation/manual/v3/xsd/iis/

A basic example (needs some tweaking) would look something like this:

<Directory Id="webSites" Name="WebSites">
            <Component Id="webSite" Guid="PUT_GUID_HERE" KeyPath="yes" Permanent="yes">
              <CreateFolder />
              <iis:WebSite Id="DefaultWebSite" SiteId="*" Description="Default Web Site" Directory="webSites" ConfigureIfExists="no" >
                <iis:WebAddress Id="webSite" Port="80" />
                <iis:WebDirProperties Id="webSite" AnonymousAccess="yes" WindowsAuthentication="no" />
              </iis:WebSite>
            </Component>
          <Directory Id="webSiteUi" Name="UI">
            <Component Id="webSiteUi" Guid="PUT GUID HERE" KeyPath="yes">
              <iis:WebAppPool Id="webSiteUi" Name="WebSiteUI" Identity="networkService" ManagedRuntimeVersion="v4.0" ManagedPipelineMode="Classic" />
              <iis:WebVirtualDir Id="webSiteUi" Alias="Something" Directory="webSiteUi" WebSite="DefaultWebSite">
                <iis:WebDirProperties Id="webSiteUi" AnonymousAccess="yes" WindowsAuthentication="no" />
                <iis:WebApplication Id="webSiteUi" WebAppPool="webSiteUi" Name="Something" />
              </iis:WebVirtualDir>
            </Component>
          </Directory>
Christopher Painter
  • 54,556
  • 6
  • 63
  • 100
  • Hello. Your answer was pretty useful to understand better wix but I still have a problem with it. Found orphaned Component 'webSiteUi'. If this is a Product, every Component must have at least one parent Feature. To include a Component in a Module, you must include it directly as a Component element of the Module element or indirectly via ComponentRef, ComponentGroup, or ComponentGroupRef elements – Anon Jun 27 '19 at 16:08
  • 1
    You have to add a ComponentRef element to the ComponentGroup element like shown on lines 5-7 on https://github.com/iswix-llc/iswix-tutorials/blob/master/web-application/Installer/WebApp/Code/IISMeta.wxs – Christopher Painter Jun 27 '19 at 17:33
  • 1
    Look at line 16 of this to see how the componentgroup then gets referenced by the feature. https://github.com/iswix-llc/iswix-tutorials/blob/master/web-application/Installer/WebApp/Code/Features.wxs – Christopher Painter Jun 27 '19 at 17:34
  • It worked. Now I have the website and the virtual directory duplicated on the ISS but you solved my main question. I will work on that duplication. Thanks a lot. – Anon Jun 28 '19 at 09:23
  • Is the duplication on a clean machine or a machine that previously had an older build of your product? – Christopher Painter Jun 28 '19 at 11:31