2012-08-30 55 views
0

方案1时: 我从运行Windows服务的代码和它失败的Windows事件日志:。 msi文件失败,“产品:XXX配置失败”之称

“产品:XXX - 配置失败”

方案2: 我运行这个作为一个普通的EXE和它的作品。

代码我想:

var installerFilePath = <Path of msi>; 
System.Diagnostics.Process installerProcess;      
installerProcess = System.Diagnostics.Process.Start(installerFilePath, " /q"); 
while (installerProcess.HasExited == false) 
{ 
    System.Threading.Thread.Sleep(250); 
} 

我尝试安装Windows MSIInstaller额外的记录,但它并没有记录任何。

请指教。

KG

+0

是什么让你认为你可以从会话0安装这个软件包? –

+0

建议在 http://stackoverflow.com/questions/2991286/visual-studio-packaging-another-version-of-this-product-is-already-installed固定它 – user1621026

+0

该主题不讨论安装包在会话0中。即使可以在会话0中安装包,也可能无法安装该包。你的服务以什么用户身份运行? –

回答

0

msi只是一个数据库。在您的代码中,尝试使用适当的参数调用msiexec

msiexec.exe位于您的System32目录中。打开命令提示符并键入msiexec /?以获取参数列表。

+0

谢谢。我也使用/ qn/i参数尝试了msiexec.exe。如上所述,它失败了。 – user1621026

+0

看起来像安装在系统帐户中,即使我从控制面板卸载,似乎会导致此问题。“此产品的另一个版本已安装,此版本的安装无法继续。” – user1621026