title: How to initialize IIS web app's Physical Path Credentials property in WiX
body: <p><em>Update: probably an IIS or MSI version dependency</em></p>
  
  <p>The issue appears on this configuration:</p>
  
  <p>Windows Server 2008 R2 Standard Version 6.1 (build 7600), IIS 7.5.7600.16385, MSI v5.0.7600.16385</p>
  
  <p>On this second configuration the same MSI works pretty fine:</p>
  
  <p>Vista Enterprise SP2, IIS 7.0.6000.16386, MSI v4.5.6002.18005</p>
  
  <p><em>Original question:</em></p>
  
  <p>I have created WiX installer package for the new project I am working on and have a little unresolved issue related to proper registering the web application into IIS7.</p>
  
  <p>The problem is that my web application is registered with incorrect Physical Path credentials property value (this property can be accessed through IIS7 by focusing the web app node and then opening its Advanced settings dialog box). After installation of my application the value is set to a 'specific user' with username 'name'. Such user of course does not exist in my environment, which causes the web app to fail on 500.19 when trying to open it in the browser.</p>
  
  <p>So, after installing the app I have to open IIS and reset the Physical Path Credentials property to 'application user (pass-through authentication)', in order to force the web app to access its virtual directory using application pool's identity. This manual change of that property solves the problem..</p>
  
  <p>Does anyone know how to change WiX behavior, so that Physical Path Credentials is set to 'application user' right out-from-the-box without any need to manually repair the value?</p>
  
  <p>This is the fragment I use for configuring the IIS part of my solution:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
   xmlns:iis="http://schemas.microsoft.com/wix/IIsExtension"
        xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"&gt;
  
    &lt;Fragment&gt;
      &lt;!-- Install to default web site --&gt;
      &lt;iis:WebSite Id="DefaultWebSite" Description='Default Web Site'&gt;
        &lt;iis:WebAddress Id="AllUnassigned" Port="80" /&gt;
      &lt;/iis:WebSite&gt;
  
      &lt;DirectoryRef Id="WebSiteContentDir"&gt;
        &lt;!-- Configuring app pool --&gt;
        &lt;Component Id="ApplicationPoolComponent" Guid="{MY-GUID}" KeyPath="yes"&gt;
          &lt;util:User Id="ApplicationPoolUser" CreateUser="no"
                 Domain="MYDOMAIN" Name="MYUSER"
                 Password="MYPWD" /&gt;
  
          &lt;iis:WebAppPool Id="ApplicationPool" Name="MyApp" Identity="other" User="ApplicationPoolUser"
                      ManagedPipelineMode="classic" ManagedRuntimeVersion="v4.0" /&gt;
        &lt;/Component&gt;
  
        &lt;!-- Configuring virtual dir --&gt;
        &lt;Component Id="VirtualDirComponent" Guid="{MY-GUID}" KeyPath="yes" &gt;
          &lt;iis:WebVirtualDir Id="VirtualDir" Alias="MyApp" Directory="WebSiteContentDir" WebSite="DefaultWebSite"&gt;
            &lt;iis:WebDirProperties Id="VirtualDirProperties" WindowsAuthentication="yes" /&gt;
            &lt;iis:WebApplication Id="WebApplication" Name="MyApp" WebAppPool="ApplicationPool" /&gt;
          &lt;/iis:WebVirtualDir&gt;        
        &lt;/Component&gt;
  
      &lt;/DirectoryRef&gt;
    &lt;/Fragment&gt;
  &lt;/Wix&gt;
  </code></pre>
  
  <p>Ww have already run into this issue on other projects and always solved using a powershell script fixing that property value that was executed automatically during the installation. I believe there must be a way to make WiX install it the requested way and hope to find an answer. Thanks in advance.</p>