0

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"?

Petronius
  • 428
  • 4
  • 12

1 Answers1

0

Looks like you are not creating the user “AnonymousUser7” since you are setting the CreateUser property as “no”.

But in the Iis:Webapppool element you are trying to set the user as AnonymousUser7 which doesn’t exist. This will default the AppPool to use the default user which ever is setup and in your case it’s “DefaultAppPool”.

Can you update the below and test it?

>     <util:User Id="AnonymousUser7" CreateUser="Yes” Domain="[MY_DOMAIN]" Name="[MY_ADMIN_USER_NAME]"
> Password="[MY_ADMIN_PASSWORD]" UpdateIfExists="yes"
> LogonAsService="yes" />
Isaiah4110
  • 9,855
  • 1
  • 40
  • 56
  • Hi @isaiah4110. Thank you for your suggestion. “AnonymousUser7” is a way to give the admin privileges to webPool and dir access, and the reason for setting CreateUser="no" is, I want the user's account (domain admin user) already exists. Since I had no clue, although I knew setting it to "yes" wouldn't work, I tried as you suggested. As I expected, since the user account already exists, it failed and the installation was aborted. – Petronius Oct 07 '19 at 13:58