[英]How to add AppPool to IIS on WiX Major Upgrade?
I am trying to write a WiX upgrade for our Web Application at work. 我正在尝试为工作中的Web应用程序编写WiX升级。 The Installer will create a site and app pool in IIS which works fine. 安装程序将在IIS中创建一个可以正常运行的站点和应用程序池。 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. 升级时,它会在卸载RTM时删除站点和应用程序池(这是正确的),但由于创建应用程序池失败,因此只会在升级安装过程中重新创建站点。 Here is what the log says: 日志显示如下:
MSI (s) (08:AC) [20:45:23:527]: Invoking remote custom action. MSI(s)(08:AC)[20:45:23:527]:调用远程自定义操作。 DLL: C:\\Windows\\Installer\\MSI52F5.tmp, Entrypoint: WriteIIS7ConfigChanges WriteIIS7ConfigChanges: Error 0x80070002: Failed get httpErrors section WriteIIS7ConfigChanges: Error 0x80070002: Failed to configure IIS Asp property. DLL:C:\\ Windows \\ Installer \\ MSI52F5.tmp,入口点:WriteIIS7ConfigChanges WriteIIS7ConfigChanges:错误0x80070002:无法获取httpErrors部分WriteIIS7ConfigChanges:错误0x80070002:无法配置IIS Asp属性。 WriteIIS7ConfigChanges: Error 0x80070002: WriteIIS7ConfigChanges Failed. WriteIIS7ConfigChanges:错误0x80070002:WriteIIS7ConfigChanges失败。
The crazy thing is... It will work if I have IIS open and watching the app pools. 疯狂的事情是...如果我打开IIS并查看应用程序池,它将起作用。 I'm assuming it is having trouble getting this IIS Asp property, but I don't know how to provide it. 我以为它很难获取此IIS Asp属性,但是我不知道如何提供它。 I have a custom action that sets up IIS if it isn't set up by running this command: 我有一个自定义操作,如果未通过运行以下命令进行设置,则会设置IIS:
dism.exe /Online /Enable-Feature /FeatureName:IIS-ASPNET45 /FeatureName:IIS-HttpCompressionDynamic /All /NoRestart dism.exe /在线/启用功能/功能名称:IIS-ASPNET45 /功能名称:IIS-HttpCompressionDynamic /全部/否重新启动
And then here is what I'm attempting to do in IIS: 接下来是我要在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. 我以前从未使用过WiX,而是从离开公司的人那里继承来的。 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. 另外,如果我需要发布更多信息,我们将很乐意提供。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.