I am installing the IIS website with the port # 8888, and this website needs to access HKLM. So I created Web AppPool "MyTestWebPool" with the domain administrator account. I also need this website appears at the same level as "Default Web Site" (meaning not under "Default Web Site") so I use iis:WebSite, and below is the WIX code to achieve it.
<Component Id="Test_WebSite_IIS7" Guid="*" >
<CreateFolder/>
<util:User Id="AnonymousUser7" CreateUser="no" Domain="[MY_DOMAIN]" Name="[MY_ADMIN_USER_NAME]" Password="[MY_ADMIN_PASSWORD]" UpdateIfExists="yes" LogonAsService="yes" />
<iis:WebAppPool Id="MyTestWebPool" Identity="other" Name="Test AppPool" ManagedPipelineMode="integrated" ManagedRuntimeVersion="v4.0" User="AnonymousUser7" />
<iis:WebSite Id="TestWebSite7" Description="TestWebSite" Directory="INSTALLDIR" AutoStart="yes" SiteId="8888" >
<iis:WebAddress Id="AllUnassigned" Port="8888" />
<iis:WebVirtualDir Id="TestWeb_VirtualDir7" Alias="Test" Directory="="INSTALLDIR" >
<iis:WebApplication Id="TestWebApplication7" Name="Test" WebAppPool="MyTestWebPool" />
<iis:WebDirProperties Id="TestWeb_DirProperties7" Read="yes" LogVisits="yes" Index="yes" Script="yes" AnonymousAccess="yes" AnonymousUser="AnonymousUser7" />
</iis:WebVirtualDir>
</iis:WebSite>
</Component>
However, when I check this web site with IIS Manager, its application pool isn't set to "MyTestWebPool" but to "DefaultAppPool". Do you know why it is set to "DefaultAppPool" and how to do set it to "MyTestWebPool"?