带有WIX 3.9及更高版本的自定义操作RegisterComPlus时出错



我们在Microsoft一直使用WIX工具集版本3.5.2519.0来为我们的产品构建安装程序和补丁,名为(系统中心服务管理器又名SCSM(。 最近我们需要更新到 WIX 工具集 3.14.0.1703,因为此版本支持 TLS1.2。

使用 WIX 工具集 3.14.0.1703 构建我们的项目运行良好,但在安装时,我收到以下错误:

然后我用所有WIX版本一一构建了产品,结果如下:

使用 WIX 工具集版本 3.8 及更低版本构建的产品 ar 精细和安装程序工作正常.
但是对于工具集 3.9 及更高版本,安装程序失败并显示错误: 执行自定义操作时出错 注册ComPlus

日志片段:

Action start 21:11:37: RegisterTypeLibraries.
MSI (s) (48:B0) [21:11:37:585]: Doing action: SelfRegModules
Action ended 21:11:37: RegisterTypeLibraries. Return value 0.
Action start 21:11:37: SelfRegModules.
MSI (s) (48:B0) [21:11:37:588]: Doing action: RegisterComPlus
Action ended 21:11:37: SelfRegModules. Return value 1.
MSI (s) (48:B0) [21:11:37:589]: Note: 1: 2205 2:  3: Complus 
MSI (s) (48:B0) [21:11:37:589]: Note: 1: 2228 2:  3: Complus 4: SELECT `ComponentId`,  `FileName`, `Component`.`Directory_`, `ExpType`, `Component`.`Action`, `Component`.`Installed`  FROM `Complus`, `Component`, `File` WHERE `Complus`.`Component_` = `Component` AND `Component`.`KeyPath` = `File`.`File` AND (`Action` = 1 OR `Action` = 2) 
Action start 21:11:37: RegisterComPlus.
MSI (s) (48:B0) [21:11:37:591]: Note: 1: 2265 2:  3: -2147287035 
MSI (s) (48:B0) [21:11:37:591]: Machine policy value 'DisableRollback' is 0
MSI (s) (48:B0) [21:11:37:592]: Note: 1: 1402 2: 
HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentVersionInstallerRollbackScripts 3: 2 
Action ended 21:11:37: RegisterComPlus. Return value 0.
MSI (s) (48:B0) [21:11:37:592]: Note: 1: 1402 2: 
HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentVersionInstallerRollbackScripts 3: 2 
MSI (s) (48:B0) [21:11:37:592]: No System Restore sequence number for this installation.
MSI (s) (48:B0) [21:11:37:592]: Unlocking Server
MSI (s) (48:B0) [21:11:37:602]: Note: 1: 2717 2: 
_Set_Rollback_RemoveCodeGroup.1CA03A32_06E0_4726_8E63_FEA4484D9D6F 
DEBUG: Error 2717:  Bad action condition or error calling custom action '_Set_Rollback_RemoveCodeGroup.1CA03A32_06E0_4726_8E63_FEA4484D9D6F'.
MSI (s) (48:74) [21:11:37:622]: I/O on thread 720 could not be cancelled. Error: 1168
MSI (s) (48:74) [21:11:37:622]: I/O on thread 1244 could not be cancelled. Error: 1168
MSI (s) (48:74) [21:11:37:622]: I/O on thread 3392 could not be cancelled. Error: 1168
MSI (s) (48:74) [21:11:37:622]: I/O on thread 928 could not be cancelled. Error: 1168
MSI (s) (48:74) [21:11:37:622]: I/O on thread 680 could not be cancelled. Error: 1168
MSI (s) (48:74) [21:11:37:622]: I/O on thread 4528 could not be cancelled. Error: 1168
MSI (s) (48:74) [21:11:37:622]: I/O on thread 2156 could not be cancelled. Error: 1168
MSI (s) (48:74) [21:11:37:622]: I/O on thread 2316 could not be cancelled. Error: 1168
MSI (s) (48:74) [21:11:37:622]: I/O on thread 3980 could not be cancelled. Error: 1168
MSI (s) (48:74) [21:11:37:622]: I/O on thread 5172 could not be cancelled. Error: 1168
MSI (s) (48:74) [21:11:37:622]: I/O on thread 2724 could not be cancelled. Error: 1168
MSI (s) (48:B0) [21:11:37:622]: Product: Microsoft System Center Service Manager -- The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2717. The arguments are: _Set_Rollback_RemoveCodeGroup.1CA03A32_06E0_4726_8E63_FEA4484D9D6F, ,

The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2717. The arguments are: _Set_Rollback_RemoveCodeGroup.1CA03A32_06E0_4726_8E63_FEA4484D9D6F, , 
Action ended 21:11:37: INSTALL. Return value 3.

WIX 工具集 3.9 及更高版本中所做的任何更改是否会破坏我的安装程序? 对此有什么解决方案吗?

嗯,到目前为止没有建议。这不是一个答案,而是一些建议,试图让你去帮助自己。对于部署问题,这种情况经常发生,因为它们很难调试或确定可用有限信息的情况。

在我看来,这可能不是COM+问题,因为看起来自定义操作可以正常完成:

Action ended 21:11:37: RegisterComPlus. Return value 0.

让我们尝试一些长镜头。请耐心等待,因为其中很多都会有点不合时宜。鱼雷。完全传播等等:-((为掩护而奔跑(:

  1. 比较痛苦- :-(:我可能会使用此处找到的比较方法比较工作 MSI 和新的 MSI。我不认为你会发现很多,但可能应该这样做。直接比较 MSI 并使用暗.exe进行反编译?后者在逻辑上没有什么意义,但我想看看 WiX 链接 MSI 的方式是否发生了变化。

  2. 消除复杂性:我喜欢取出复杂的部分,看看其余的设置是否安装正常。这可能是真正的浪费时间,但有时会有所启发。

    • 我会取出添加该自定义操作的合并模块,并验证包的其余部分是否按预期安装。有时,如果自定义操作正在进行高耦合(显然(,则这不起作用。

    • 您还可以为某些自定义操作设置条件以0。这应该会阻止自定义操作运行。如果存在现有条件,则可以添加AND 0

  3. 禁用回滚?:另一个远景。禁用 MSI 回滚并尝试在干净的虚拟上进行测试安装?只是为了查看回滚自定义操作中是否存在问题。我会使用 DISABLEROLLBACK 属性来禁用回滚。请注意,禁用回滚不是解决方案!(对于发现这一点的其他人必须提及(。

  4. 自定义操作
  5. 源访问:如果您有权访问自定义操作源代码,我将尝试使用 Visual Studio 以交互方式进行调试,如下所述:调试 C# 自定义操作。在调试模式下编译代码(因此在 MSI 中有调试 dll - 确保不要意外包含公开发布的代码!(并显示自定义操作中的消息框,然后附加 Visual Studio 调试器并单步执行代码。对于本机代码附加到msiexec.exe,对于托管代码附加到rundll32.exe

最新更新