I want to set the application pool for a website that I'm installing, but there is no virtual directory or web application. The website is contained directly in the website
entry in IIS and I want wix to set the application pool for that website.
Is this possible?
Have you looked that the WebAppPool Element?
This article 'creating a web application installer ...' may provide you with some useful info e.g.
<!-- Define App Pool - identity if not set defaults to: ApplicationPoolIdentity -->
<iis:WebAppPool Id="AppPool" Name="[VD][WEBSITE_ID]" ManagedRuntimeVersion="v4.0"
IdleTimeout="0" RecycleMinutes="0" ManagedPipelineMode="integrated">
</iis:WebAppPool>
<iis:WebVirtualDir Id="VDir" Alias="[VD]"
Directory="INSTALLLOCATION"
WebSite="SelectedWebSite">
<iis:MimeMap Id="SilverlightMimeType" Extension=".xap"
Type="application/x-silverlight-app" />
<iis:WebApplication Id="MyWebAppApplication" WebAppPool="AppPool"
Name="[VD][WEBSITE_ID]" />
<iis:WebDirProperties Id="MyWebSite_Properties" AnonymousAccess="yes"
WindowsAuthentication="no" DefaultDocuments="Default.aspx" />
</iis:WebVirtualDir>
to connect them the iis:WebApplication/@WebAppPool
entry is used to reference the AppPool iis:WebAppPool/@Id
One other suggestion is to update the WebApplication of the WebSite like this e.g.
<Component Id="WebSite" Guid="PUT-YOUR-GUID-HERE">
<CreateFolder/>
<iis:WebSite Id="WebSite" Directory="WebSiteRoot" Description="[WEBSITEDESCRIPTION]" >
<iis:WebApplication Id="WebSiteApplication" Name="[WEBSITEDESCRIPTION]" WebAppPool="MyAppPool" />
</iis:WebSite>
<iis:WebAppPool Id="MyAppPool" Name="[APPPOOLNAME]" ManagedRuntimeVersion="v4.0"/>
</Component>
@user145400 said:
I've seen that question actually, and it comes to the conclusion that wix has an odd limitation: it can't set the app pool for the website, but it can do it for a virtual directory. I asked again because I thought maybe it has been fixed in a newer version. Having said that, that is why your answer doesn't actually answer my question
Yes you can set pool for WebSite element, do it like that:
<iis:WebAppPool Id="MyWebSite_AppPool"
Name="[POOLNAME]"
Identity="networkService"
ManagedRuntimeVersion="v4.0"
ManagedPipelineMode="integrated"/>
<!--define web site-->
<iis:WebSite Id="MyWebSite_Website"
Description="[WEBSITENAME]"
AutoStart="yes"
StartOnInstall="yes"
ConfigureIfExists="yes"
Directory="INSTALLDIR">
<iis:WebApplication Id="MY_WebApp"
Name="MY Web Site"
WebAppPool="MyWebSite_AppPool"
ScriptTimeout="360" />
</iis:WebSite>
As you can see using iis:WebApplication element
in iis:WebSite element with attribute WebAppPool its possible :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With