0

我有一个 WIX DTF 自定义操作间歇性失败并出现 Rundll32 错误:

SFXCA:RUNDLL32 返回错误代码:-1073740771

这是在自定义操作成功完成所有工作之后。我看到一个日志条目,表明该方法一直运行到最后并返回成功。这已接近 MSI 的结尾,并且已经执行了 12 个其他托管自定义操作。日志中没有任何内容表明输入了 catch 块。

这可能是 DTF 代码中的错误吗?我将 Wix 工具集 3.11.0.1701 与 Visual Studio 2017 一起使用。

我查看了“注意:1:2265”的含义,显然 Windows 安装程序错误 2265 是“无法提交存储”。我不确定这指的是哪种存储。

这是自定义操作代码(简化和编辑):

[CustomAction]
public static ActionResult MyAction(Session session)
{
    ILogger logger = new Logger(session);
    string actionMethodName = MethodBase.GetCurrentMethod().Name;
    ActionResult customActionSuccess = ActionResult.Failure;

    try
    {
        logger.LogInfo("Begin {0} custom action", actionMethodName);

        Worker worker = new Worker();
        worker.DoWork();

        customActionSuccess = ActionResult.Success;
        logger.LogInfo("Exiting {0} custom action", actionMethodName);
    }
    catch (Exception ex)
    {
        string msg = string.Format("An error has occurred in {2}: {0}{0}{1}", Environment.NewLine, ex.ToString(), actionMethodName);
        logger.LogError(msg);
        throw;
    }

    return customActionSuccess;
}

这是 Windows 安装程序日志的相关部分:

MSI (s) (D4:60) [11:43:39:783]: Executing op: ActionStart(Name=MyAction,,)
MSI (s) (D4:E4) [11:43:39:783]: Invoking remote custom action. DLL: C:\WINDOWS\Installer\MSIFE04.tmp, Entrypoint: MyAction
SFXCA: Extracting custom action to temporary directory: C:\Users\user\AppData\Local\Temp\MSIFE04.tmp-\
SFXCA: Binding to CLR version v4.0.30319
Calling custom action CAAssembly.DTFCA!CAAssembly.DTFCA.CustomActions.MyAction

***** INFORMATION ***** Begin MyAction custom action
(Additional log entries here indicate custom action completed successfully)
***** INFORMATION ***** Exiting MyAction custom action

SFXCA: RUNDLL32 returned error code: -1073740771
CustomAction MyAction returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)
MSI (s) (D4:60) [11:47:29:028]: Note: 1: 2265 2:  3: -2147287035 
Action ended 11:47:28: InstallExecute. Return value 3.
4

0 回答 0