如何使用 WiX 在 IIS7.5 中设置自定义错误 URL
我的第一个问题所以请友善。我的安装程序出现问题,这是安装程序日志中的错误。
MSI (s) (4C:64) [14:56:14:086]: Invoking remote custom action. DLL: C:\Windows\Installer\MSI6E35.tmp, Entrypoint: WriteIIS7ConfigChanges
CustomAction WriteIIS7ConfigChanges returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)
Action ended 14:56:15: InstallFinalize. Return value 3.
安装程序因错误退出并回滚。通过反复试验,我发现了 IIS 配置的问题,并将其范围缩小到自定义错误页面的设置(下面的示例),
<iis:WebSite Id="myWebService1" Description="myWebService" AutoStart="yes" StartOnInstall="yes" ConfigureIfExists="yes" Directory="WEBAPPDIR" ConnectionTimeout="360" >
<iis:WebAddress Id="myWebService_Bindings" IP="*" Port="9992" />
<iis:WebApplication Id="myWebService" Name="myWebService" WebAppPool="myWebService_Pool" ScriptTimeout="360" />
<iis:WebDirProperties Id="myWebService_Properties" AnonymousAccess="yes" WindowsAuthentication="no" DefaultDocuments="Default.ashx" Read="yes" Execute="yes" Script="yes" />
<iis:WebVirtualDir Id="myWebService_Download" Alias="download" Directory="FILEDOWNLOADDIR">
<iis:WebError ErrorCode="404" URL="/dostuff.ashx" SubCode="0"/>
</iis:WebVirtualDir>
</iis:WebSite>
我认为可能存在覆盖默认自定义错误页面的问题,因为它们是继承的,尽管似乎有在IIS6中就没有这样的问题了。我预计 WiX 的默认行为只是覆盖已经存在的内容,但情况似乎并非如此。我还尝试通过将包含自定义错误所需 xml 的 web.config 复制到下载文件夹来解决此问题,但当我尝试查看“错误页面”列表时,我在 IIS 中也遇到了冲突。
我非常感谢对此的帮助。
My first question so please be kind. I am having problems with my installer here is the error from the installer log.
MSI (s) (4C:64) [14:56:14:086]: Invoking remote custom action. DLL: C:\Windows\Installer\MSI6E35.tmp, Entrypoint: WriteIIS7ConfigChanges
CustomAction WriteIIS7ConfigChanges returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)
Action ended 14:56:15: InstallFinalize. Return value 3.
The installer quits with an error and rolls back. Through trial and error I have found the problem with the IIS configuration and have narrowed it down to the setup of the custom error page (example below)
<iis:WebSite Id="myWebService1" Description="myWebService" AutoStart="yes" StartOnInstall="yes" ConfigureIfExists="yes" Directory="WEBAPPDIR" ConnectionTimeout="360" >
<iis:WebAddress Id="myWebService_Bindings" IP="*" Port="9992" />
<iis:WebApplication Id="myWebService" Name="myWebService" WebAppPool="myWebService_Pool" ScriptTimeout="360" />
<iis:WebDirProperties Id="myWebService_Properties" AnonymousAccess="yes" WindowsAuthentication="no" DefaultDocuments="Default.ashx" Read="yes" Execute="yes" Script="yes" />
<iis:WebVirtualDir Id="myWebService_Download" Alias="download" Directory="FILEDOWNLOADDIR">
<iis:WebError ErrorCode="404" URL="/dostuff.ashx" SubCode="0"/>
</iis:WebVirtualDir>
</iis:WebSite>
I think there might be an issue overwriting the default custom error pages as they are inherited although there seems to be no such problem in IIS6. I would expect the default behaviour of WiX would be to just overwrite what was already there but does not seem to be the case. I have also tried to get around this by copying a web.config with the necessary xml for the custom error to the download folder but I also get a conflict in IIS when I try to view the "Error pages" list.
I would greatly appreciate some help with this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我遇到了完全相同的事情。我在此处找到了答案。
它在 web.config 文件中的处理如下:
I was running into the exact same thing. I found an answer for it here.
It's handled in the web.config file like this:
因此,为了解决这个问题,我需要创建自定义操作并以编程方式添加 HttpError。我在下面提供了一个方法来实现这一点。我最初很难让这个工作正常,因为在添加我自己的错误代码之前我没有删除现有的继承错误代码
希望如果您遇到同样的问题这会有所帮助。我有更多关于此的代码,因此如果您需要帮助,请询问。
So to get around this issue I needed to create custom action and programmatically add the HttpError. I have included a method below that does it. I initially struggled to get this working because I didn't remove the existing inherited error code before adding my own one
Hope this helps if you come across the same issue. I have more code around this so if you need help just ask.