MSI 安装失败 - 错误 1723

MSI Install Failed - Error 1723

我在安装 VS2015 内置的 .msi 时在某些机器上安装我们的软件时遇到问题。

没有 VS2015,我在日志文件中得到这个:

MSI (s) (24:64) [11:21:22:095]: Doing action: InstallFinalize
Action 11:21:22: InstallFinalize.
Action start 11:21:22: InstallFinalize.
MSI (s) (24:64) [11:21:22:095]: User policy value 'DisableRollback' is 0
MSI (s) (24:64) [11:21:22:095]: Machine policy value 'DisableRollback' is 0
Action 11:21:22: RollbackCleanup. Removing backup files
MSI (s) (24:64) [11:21:22:585]: Creating MSIHANDLE (13) of type 790536 for thread 8036
MSI (s) (24:74) [11:21:22:595]: Invoking remote custom action. DLL: C:\Windows\Installer\MSIAE3F.tmp, Entrypoint: _KSTInstallSC@4
MSI (s) (24:74) [11:21:22:595]: Generating random cookie.
MSI (s) (24:74) [11:21:22:645]: Created Custom Action Server with PID 1160 (0x488).
MSI (s) (24:5C) [11:21:22:765]: Running as a service.
MSI (s) (24:5C) [11:21:22:775]: Hello, I'm your 32bit Elevated Non-remapped custom action server.
CustomAction _3F7B94EF_231A_421E_BF8B_C0760F3B266E returned actual error code 1157 (note this may not be 100% accurate if translation happened inside sandbox) MSI (s) (24:74) [11:21:22:975]: Closing MSIHANDLE (13) of type 790536 for thread 8036
MSI (s) (24:64) [11:21:22:975]: Note: 1: 1723 2: _3F7B94EF_231A_421E_BF8B_C0760F3B266E 3: _KSTInstallSC@4 4: C:\Windows\Installer\MSIAE3F.tmp
MSI (s) (24:64) [11:21:22:975]: Note: 1: 2262 2: Error 3: -2147287038
MSI (c) (8C:0C) [11:21:22:975]: Note: 1: 2262 2: Error 3: -2147287038
DEBUG: Error 2835: The control ErrorIcon was not found on dialog ErrorDialog The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2835. The arguments are: ErrorIcon, ErrorDialog,
Error 1723. There is a problem with this Windows Installer package. A DLL required for this install to complete could not be run. Contact your support personnel or package vendor. Action _3F7B94EF_231A_421E_BF8B_C0760F3B266E, entry: _KSTInstallSC@4, library: C:\Windows\Installer\MSIAE3F.tmp
MSI (s) (24:64) [11:21:25:796]: Note: 1: 2262 2: Error 3: -2147287038
MSI (s) (24:64) [11:21:25:796]: Product: KST -- Error 1723. There is a problem with this Windows Installer package. A DLL required for this install to complete could not be run. Contact your support personnel or package vendor. Action _3F7B94EF_231A_421E_BF8B_C0760F3B266E, entry: _KSTInstallSC@4, library: C:\Windows\Installer\MSIAE3F.tmp

我查看了 Visual Studio 并且没有匹配日志文件中任何内容的自定义操作。

需要注意的是,在测试PC上安装VS2015后,安装工作正常,所以肯定是缺少DLL之类的。但是在我们所有客户的机器上安装 VS2015 是不切实际的。

有什么方法可以将所需的文件与 msi 一起打包吗?如果是这样,我如何找到依赖的 DLL 文件的名称?

根据您构建此包的方式,可能有更好的方法在项目中跟踪它。但是让我们假装我们收到了这个包裹并且想要让它在有故障的情况下工作。

你知道入口点是 _KSTInstallSC@4,这让你可以使用你最喜欢的 MSI 编辑程序在内置 MSI 的 CustomAction table 的目标列中寻找一些东西。 table 中的记录应通过其源列引用包含 DLL 的二进制文件 table 中的一行。提取该 DLL 后,您可以使用任何显示依赖关系的工具,例如 Dependency Walker、CFF Explorer,甚至 dumpbin /imports.

至于如何解决,单机安装依赖即可。但是要在包中修复它,您可能必须更改 DLL 的构建方式。例如,您可以让它静态导入 C++ 运行 时间,这样它就没有异常的外部 运行 时间依赖性。

您已经完成了与 KST 产品相关的操作,它是一个 C++ 应用程序,显然您是 运行 作为自定义操作,无论是有意还是通过包含合并模块。错误 1157 表示加载失败,因此它必须依赖于至少一个未安装的其他 Dll。

根据附加到自定义操作名称的 GUID (3F7B94EF_231A_421E_BF8B_C0760F3B266E) 判断,我会说您的 package/project 中包含一个合并模块,即运行此自定义操作,正如 Phil 提到的那样。

我最近遇到了同样的问题,在我的例子中是 Windows Defender 在 MSI 日志中作为 DLL 提到的 tmp 文件误报寻找。 Defender 将其识别为病毒并在 MSI 程序包可以使用它之前删除了该文件。

因此,请尝试禁用 Defender/any 其他防病毒软件,然后重试。