【发布时间】:2017-11-12 14:28:17
【问题描述】:
我正在尝试为工作中的 Web 应用程序编写 WiX 升级。安装程序将在 IIS 中创建一个可以正常工作的站点和应用程序池。升级时,它会在卸载 RTM 期间删除站点和应用程序池(这是正确的),但仅在安装升级期间重新创建站点,因为应用程序池创建失败。日志是这样写的:
MSI (s) (08:AC) [20:45:23:527]:调用远程自定义操作。 DLL:C:\Windows\Installer\MSI52F5.tmp,入口点:WriteIIS7ConfigChanges WriteIIS7ConfigChanges:错误 0x80070002:获取 httpErrors 部分失败 WriteIIS7ConfigChanges:错误 0x80070002:无法配置 IIS Asp 属性。 WriteIIS7ConfigChanges:错误 0x80070002:WriteIIS7ConfigChanges 失败。
疯狂的是……如果我打开 IIS 并观察应用程序池,它会起作用。我假设它无法获取此 IIS Asp 属性,但我不知道如何提供它。如果没有通过运行以下命令设置 IIS,我有一个自定义操作:
dism.exe /Online /Enable-Feature /FeatureName:IIS-ASPNET45 /FeatureName:IIS-HttpCompressionDynamic /All /NoRestart
然后这是我在 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>
我以前从未使用过 WiX,并从离开公司的人那里继承了它。除了这个,我已经弄清楚了升级需要做的所有事情。任何帮助将不胜感激。提前致谢!另外,如果我需要发布更多信息,我很乐意提供。
【问题讨论】:
-
我注意到,如果我让安装程序删除以前的 Web 应用程序和应用程序池,则它无法将其添加回来,但如果我在运行升级之前从 IIS 中手动删除它们,那么它会创建新的再次正确。我真的不想让我们的用户在运行我们的安装程序之前手动执行此操作。
标签: c# asp.net visual-studio iis wix