1

这两者有什么区别?

MsiInstallProductInstaller.InstallProduct。从我读过的内容来看,唯一的区别是第一个返回一个 int 来指示安装是否成功。

我目前正在使用 DTF (WiX) 来调用Installer.InstallProduct. 问题是,这个函数的返回类型是 void。

Installer.InstallProduct问题:通过DTF调用时如何判断安装是否成功?

4

1 回答 1

2

正如您所注意到的,MsiInstallProduct 只是返回错误或成功,没有更多信息。Installer.InstallProduct 不返回任何内容。DTF 什么也不返回。

为什么有区别?MsiInstallProduct 是旧式 C/C++,您会在其中返回错误代码。其他的是新学校,而不是你提出例外。然后,您的代码会捕获异常以知道存在问题。

于 2011-01-21T16:03:36.420 回答