【发布时间】:2015-01-06 10:44:55
【问题描述】:
我正在使用下面的代码在远程机器上安装 MSI。安装成功,但我想为安装步骤生成日志文件。请帮助我启用日志记录。
ManagementClass productClass = new ManagementClass(this.m_WorkingNamespace, new ManagementPath("Win32_Product"), new ObjectGetOptions());
try
{
object[] parameters = { msiFilePath, installOptions, allUsers };
UInt32 returnValue = (UInt32)productClass.InvokeMethod("Install", parameters);
if (returnValue > 0)
throw new Exception("Installation failed. error code = " + returnValue);
}
【问题讨论】:
标签: c# wmi windows-installer