1

我的第一个问题,请善待。我的安装程序有问题,这是安装程序日志中的错误。

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 中也出现了冲突。

我将非常感谢一些帮助。

4

2 回答 2

1

我遇到了完全相同的事情。我在这里找到了答案。

它在 web.config 文件中处理,如下所示:

<system.webServer>
    <httpErrors>
        <remove statusCode="404" subStatusCode="-1" />
        <error statusCode="404" prefixLanguageFilePath="" path="filePath.aspx" responseMode="ExecuteURL"/>
    </httpErrors>
于 2012-01-11T17:51:42.270 回答
0

所以为了解决这个问题,我需要创建自定义操作并以编程方式添加 HttpError。我在下面包含了一个方法。我最初很难让它工作,因为在添加自己的错误代码之前我没有删除现有的继承错误代码

private static void ConfigureHTTPError(long _ErrorCode, string _URL, string _SubCode, System.DirectoryServices.DirectoryEntry VDir)
{
    string searcherr = _ErrorCode.ToString() + "," + _SubCode;
    string customerr = searcherr + ",URL," + _URL;

    for (var i = 0; i < VDir.Properties["HttpErrors"].Count; i++)
    {
        if (VDir.Properties["HttpErrors"][i].ToString().IndexOf(searcherr) == 0)
        {
            //must remove the existing error code first
            VDir.Properties["HttpErrors"].RemoveAt(i);
            VDir.CommitChanges();
            VDir.Properties["HttpErrors"].Add(customerr);
            VDir.CommitChanges();
        }
    }
}

如果您遇到相同的问题,希望这会有所帮助。我有更多关于此的代码,所以如果您需要帮助,请询问。

于 2011-12-09T16:22:46.950 回答