How to initialize the IIS physical path credential property for a web application on WiX

Update: Possibly Dependency IIS or MSI Version

The problem appears in this configuration:

Standard version of Windows Server 2008 R2 version 6.1 (build 7600), IIS 7.5.7600.16385, MSI v5.0.7600.16385

In this second configuration, the same MSI works very well:

Vista Enterprise SP2, IIS 7.0.6000.16386, MSI v4.5.6002.18005

The original question:

I have created a WiX installer package for a new project that I am working on and have a small unresolved issue related to properly registering the web application in IIS7.

The problem is that my web application is registered with the wrong value of the Physical Path credential property (this property can be obtained through IIS7 by focusing the node web application and then opening the Advanced Settings dialog box). After installing my application, the value is set to "specific user" with the username "name". Such a user, of course, does not exist in my environment, which causes the web application to crash at 500.19 when trying to open it in a browser.

So, after installing the application, I need to open IIS and reset the Physical Path Credentials property for the application user (pass-through authentication) 'to force the web application to access its virtual directory using the application pool identity. This manual change of this property solves the problem.

Does anyone know how to change the behavior of WiX, so that the accounts of the physical path have an “application user” installed right out of the box without having to manually correct the value?

This is the snippet that I use to configure the IIS part of my solution:

<?xml version="1.0" encoding="UTF-8"?> <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"> <Fragment> <!-- Install to default web site --> <iis:WebSite Id="DefaultWebSite" Description='Default Web Site'> <iis:WebAddress Id="AllUnassigned" Port="80" /> </iis:WebSite> <DirectoryRef Id="WebSiteContentDir"> <!-- Configuring app pool --> <Component Id="ApplicationPoolComponent" Guid="{MY-GUID}" KeyPath="yes"> <util:User Id="ApplicationPoolUser" CreateUser="no" Domain="MYDOMAIN" Name="MYUSER" Password="MYPWD" /> <iis:WebAppPool Id="ApplicationPool" Name="MyApp" Identity="other" User="ApplicationPoolUser" ManagedPipelineMode="classic" ManagedRuntimeVersion="v4.0" /> </Component> <!-- Configuring virtual dir --> <Component Id="VirtualDirComponent" Guid="{MY-GUID}" KeyPath="yes" > <iis:WebVirtualDir Id="VirtualDir" Alias="MyApp" Directory="WebSiteContentDir" WebSite="DefaultWebSite"> <iis:WebDirProperties Id="VirtualDirProperties" WindowsAuthentication="yes" /> <iis:WebApplication Id="WebApplication" Name="MyApp" WebAppPool="ApplicationPool" /> </iis:WebVirtualDir> </Component> </DirectoryRef> </Fragment> </Wix> 

Ww has already encountered this problem in other projects and has always decided using a powershell script to fix this property value, which was done automatically during installation. I believe there should be a way to get WiX to install it in the requested way and hope to find an answer. Thanks in advance.

+4
source share

All Articles