简体   繁体   中英

How to add AppPool to IIS on WiX Major Upgrade?

I am trying to write a WiX upgrade for our Web Application at work. The Installer will create a site and app pool in IIS which works fine. On upgrade it removes both the site and app pool during the un-installation of the RTM (which is correct), but only re-creates the site during install of the upgrade because the app pool creation fails. Here is what the log says:

MSI (s) (08:AC) [20:45:23:527]: Invoking remote custom action. DLL: C:\\Windows\\Installer\\MSI52F5.tmp, Entrypoint: WriteIIS7ConfigChanges WriteIIS7ConfigChanges: Error 0x80070002: Failed get httpErrors section WriteIIS7ConfigChanges: Error 0x80070002: Failed to configure IIS Asp property. WriteIIS7ConfigChanges: Error 0x80070002: WriteIIS7ConfigChanges Failed.

The crazy thing is... It will work if I have IIS open and watching the app pools. I'm assuming it is having trouble getting this IIS Asp property, but I don't know how to provide it. I have a custom action that sets up IIS if it isn't set up by running this command:

dism.exe /Online /Enable-Feature /FeatureName:IIS-ASPNET45 /FeatureName:IIS-HttpCompressionDynamic /All /NoRestart

And then here is what I'm attempting to do in IIS:

<?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:fire="http://schemas.microsoft.com/wix/FirewallExtension">
<Fragment>
<Property Id="APP_POOL_NAME" Value="BlahAppPool" Secure="yes"></Property>

<DirectoryRef Id="INSTALLFOLDER">
  <Component Id="BlahAppPool" Guid="{46BEB5E3-BD0C-4161-B8A4-10A1E106E0C7}" KeyPath="yes">
    <iis:WebAppPool Id="BlahAppPool"
                    Name="[APP_POOL_NAME]" 
                    Identity="applicationPoolIdentity"
                    ManagedPipelineMode="Integrated" 
                    ManagedRuntimeVersion="v4.0" />
  </Component>      
      <Component Id="InstallWebsite" Guid="{3423D559-A1C8-4764-BE0C-524AFB47508C}" KeyPath="yes">       
        <iis:WebVirtualDir Id="BlahWebsite"
                       Directory="INSTALLFOLDER"
                       Alias="[WEBAPPNAME]"
                       WebSite="DefaultWebSite">
      <!-- Turn the virtual directory into a web application -->
      <iis:WebApplication Id="BlahWebApplication" Name="Blah Web App" WebAppPool="BlahAppPool" />
    </iis:WebVirtualDir>
    <!-- This is pretty important. If the CreateFolder isn’t there the 
             WebVirtualDir won’t get created as there’s no files in this 
             component. 
             http://www.mail-archive.com/wix-users@lists.sourceforge.net/msg03483.html -->
    <CreateFolder/>
  </Component>

</DirectoryRef>

<!-- Reference the default web site. Outside a component means the website element is a locator/search. Inside 
     a component means it’s a creator.-->
<iis:WebSite Id="DefaultWebSite"
             Description="Default Web Site"
             Directory="INSTALLFOLDER">
  <iis:WebAddress Id="AllUnassigned" Port="80" />
</iis:WebSite>
<ComponentGroup Id="BlahSiteIisConfiguration">
  <ComponentRef Id="BlahAppPool" />
  <ComponentRef Id="InstallWebsite" />
</ComponentGroup>
</Fragment>
</Wix>

I've never used WiX before and inherited this from someone who left the company. I've figured out just about everything I need to do for the upgrade except for this. Any help would be greatly appreciated. Thanks in advance! Also, if I need to post more information I'll gladly provide it.

Well, after much research, I believe this is currently just a bug with WiX 3.10, see here

I am going to continue trying to find a work around, but of course that isn't ideal.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM