0

our team is at delivery state for an MVC Web Application - ASP.NET with Wix toolset V3.11 and Wix Extension (Votive) for VS2019. The requirement is that the clients will only need to install the website on their side using .msi provided by us and are able to browse from their IIS Manager.

I'm struggling to configure IIS properly (with port, IP, etc...) within Product.wxs.

After installing from .msi created by Wix setup project, a website is created in IIS Manager, but when I browse the site, the page shows "Access is denied". Given that I'd assigned all permissions to "IUSR" as suggested by others.

In addition, our website pages also support windows authentication and authorization, how could I specify that in Product.wxs?

I am a newbies in Windows, Wix installer universe.

EDIT: After I uninstall and reinstall, give permission for "IUSR" to the folder, verify that ApplicationPool is correct, browse the web and "HTTP Error 503: Service is unavailable" occurs.

What am I missing?

<Component Id="IISConfigure" Guid="[GUID]" KeyPath="yes" Directory="INSTALLFOLDER">
  <util:User Id="MyWebsite_AppPoolUser" Name="domainusername" Password="pwd"/>

  <!--define application pool-->
  <iis:WebAppPool Id="MyWebsite_AppPool" Name="MyWebsiteApplication"
                  Identity="other" User="MyWebsite_AppPoolUser"
                  RecycleMinutes="120" />

  <!--define web site-->
  <iis:WebSite Id="MyWebsite_Website" Description="[Descript]"
               AutoStart="yes" StartOnInstall="yes" ConfigureIfExists="yes"
               Directory="INSTALLFOLDER" ConnectionTimeout="360" >

    <iis:WebAddress Id="AllUnassigned" IP="*" Port="81" />
    <iis:WebApplication Id="MyWebsite_WebApp" Name="MyWebsite" WebAppPool="MyWebsite_AppPool"
                        ScriptTimeout="360" />
    <iis:WebDirProperties Id="MyWebsite_Properties" AnonymousAccess="yes" WindowsAuthentication="no"
           DefaultDocuments="[path]\Index.cshtml" />
  </iis:WebSite>
</Component>

1 Answer 1

0

For setting windows authentication, you need to write a custom action:

    <CustomAction Id="SetWindowsAuthentication"
              Execute="deferred"
              Impersonate="no"
              Return="check"
              Directory="TARGETDIR"
              ExeCommand="appcmd.exe set config "MyWebsite" -section:system.webServer/security/authentication/windowsAuthentication /enabled:"True" /commit:apphost" />

<InstallExecuteSequence>
    <Custom Action="SetWindowsAuthentication" Before="InstallFinalize"><![CDATA[NOT Installed]]></Custom>
</InstallExecuteSequence>

This custom action should be deferred and must be executed between InstallInitialize and InstallFinalize.

Sign up to request clarification or add additional context in comments.

3 Comments

Thank you for your suggestion. I will try this out. If possible, do you have an idea why IIS Manager set AppPool for my website as 'DefaultAppPool'? I defined <iis:WebAppPool /> as above but I have to manually set it back to the desired app pool in IIS Manager.
Code seems ok but you should watch msi log for this issue first.
I found out why the website's AppPool is set as 'Default...'. I added <iis:WebVirtualDir> and put <iis:WebApplication> inside. Now I bring <iis:WebApplication> back outside of WebVirtualDir (inside <iis:WebSite>) and have WebVirtualDir reference the WebApplication. It works.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.