gpt4 book ai didi

wix - 向项目添加新的自定义操作会阻止运行现有的自定义操作

转载 作者:行者123 更新时间:2023-12-02 22:32:39 26 4
gpt4 key购买 nike

我有一个自定义操作项目,其中包含我公司创建的安装程序使用的各种 CA,其中一些用于通过 Microsoft.Web.Administration API 操作 IIs7。

我添加了一个名为 SetApplicationAutoStart 的新自定义操作,该类包含与 II 相关的 CA。此自定义操作用于设置强制 II 预加载和启动 WCF 服务的 autoStart 属性,以便缩短初始响应时间。

添加此操作后,名为 SetAppPoolLoadUserProfileTrue 的现有 CA 停止工作。此 CA 会强制站点上的该设置为真,即使计算机上的默认站点已更改,因此此设置为假,所以我们确实需要它工作。

当操作失败时,日志文件包含以下行。

MSI (s) (A0:18) [15:02:43:639]: Executing op: ActionStart(Name=SetAppPoolLoadUserProfileTrue,,)
Action 15:02:43: SetAppPoolLoadUserProfileTrue.
MSI (s) (A0:18) [15:02:43:641]: Executing op: CustomActionSchedule(Action=SetAppPoolLoadUserProfileTrue,ActionType=3073,Source=BinaryData,Target=SetAppPoolLoadUserProfileTrue,CustomActionData=AppPoolName=xxxxx)
MSI (s) (A0:18) [15:02:43:670]: Creating MSIHANDLE (377) of type 790536 for thread 50712
MSI (s) (A0:C8) [15:02:43:670]: Invoking remote custom action. DLL: C:\Windows\Installer\MSIBD82.tmp, Entrypoint: SetAppPoolLoadUserProfileTrue
CustomAction SetAppPoolLoadUserProfileTrue returned actual error code 1154 (note this may not be 100% accurate if translation happened inside sandbox)
MSI (s) (A0:C8) [15:02:43:673]: Closing MSIHANDLE (377) of type 790536 for thread 50712
MSI (s) (A0:18) [15:02:43:674]: Note: 1: 1723 2: SetAppPoolLoadUserProfileTrue 3: SetAppPoolLoadUserProfileTrue 4: C:\Windows\Installer\MSIBD82.tmp
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 SetAppPoolLoadUserProfileTrue, entry: SetAppPoolLoadUserProfileTrue, library: C:\Windows\Installer\MSIBD82.tmp
MSI (s) (A0:18) [15:20:25:139]: Product: xxxxxxx -- 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 SetAppPoolLoadUserProfileTrue, entry: SetAppPoolLoadUserProfileTrue, library: C:\Windows\Installer\MSIBD82.tmp
Action ended 15:20:25: InstallFinalize. Return value 3.

这看起来像是从用于此操作的 PE 中提取 dotnet PE 的问题。二进制文件中的所有其他 CA 都可以正常工作,包括新的。

最佳答案

同样的事情发生在我身上。 “galets”已经指向正确的方向,让我走上正轨(抱歉,没有代表可以投票)。

简短版:

MakeSfxCA 生成的 native dll 不遵循导致观察到的行为的 PE/COFF 规范。

长版:

  1. 构建一个 CA,例如“HavocAction”,具有三个导出入口点(即标有“CustomAction”属性),分别命名为“HavocEntryPointa”、“HavocEntryPointB”、“HavocZappEntryPoint”(注意拼写准确)。这些方法可能只返回“ActionResult.Success”。
  2. 提出简单的设置,a) 仅调用“HavocEntryPointa”,b) 仅调用“HavocEntryPointB”
  3. ==> 设置“a)”会工作,设置“b)”会失败
  4. 取消注释“HavocZappEntryPoint”上的“CustomAction”属性,行为反转,即
  5. ==> 设置“a)”会失败,设置“b)”会工作

进一步分析

当你转储包装的 CA.dll 文件时

dumpbin/Exports HavocAction.CA.dll

你得到类似(摘录)的东西

125   7C 00003A36 
126 7D 00003A4C HavocEntryPointa
127 7E 00003A62 HavocEntryPointB
128 7F 00003A78 HavocZappEntryPoint
129 80 000042FC zzzEmbeddedUIHandler
130 81 000043B8 zzzInitializeEmbeddedUI
131 82 0000467F zzzShutdownEmbeddedUI
132 83 00003AA5 zzzzInvokeManagedCustomActionOutOfProcW

这是错误的(搜索“pecoff_v83.docx”,参见 Exported DLL functions not ordered lexically?)。这些条目应该(按 ASCII)排序,以便在从 dll 加载方法时进行二进制搜索(条目“HavocEntryPointa”和“HavocEntryPointB”互换)。

我有根据的猜测是,当从 dll 加载代码时,二进制搜索失败,导致错误。由于二进制搜索的性质,删除“HavocZappEntryPoint”会反转效果。

关于OP的备注

Kjartan 首先使用了“SetApplicationAutoStart”和“SetAppPoolLoadUserProfileTrue”,由于顺序错误,它们没有正确导出到 CA.dll;大写字母“P”出现在小写字母“l”之前,但这被 MakeSfxCA 互换了。他的后一个选择“ConfigureApplicationAutoStart”和“SetAppPoolLoadUserProfileTrue”是按照 PE/COFF 规范排序的。

PS:这是http://wixtoolset.org/issues/4502现在。

更新

PPS:从 WiX 3.9 RC3 版本开始,包含针对此问题的错误修复;一切都按预期工作。

关于wix - 向项目添加新的自定义操作会阻止运行现有的自定义操作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11974539/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com