我需要能够在最终用户计算机上安装水晶报告,但是网络安全不允许它在正常的用户登录上,所以它必须作为一个不同的用户运行在每个桌面上。
我正在尝试创建一个小型应用程序,允许任何用户安装水晶报告。到目前为止,我已经:
Process p = new Process();
p.StartInfo.FileName = @"C:\cabs\CRRuntime_32bit_13_0_5.msi";
p.StartInfo.Arguments = "/i \"C:\\Application.msi\"/qn";
p.StartInfo.UserName = uname;
p.StartInfo.Password = pword;
p.StartInfo.Domain = domain;
p.StartInfo.UseShellExecute = false;
try
{
p.Start();
}
catch(Exception er)
{
MessageBox.Show(er.Message);
}
当我尝试运行此代码时,我看到消息“指定的可执行文件不是此OS平台的有效应用程序”。
我错过了什么吗?
干杯
发布于 2016-11-09 07:10:32
MSI不是windows中的可执行文件。您应该以msi文件作为参数调用msiexec
。
Process p = new Process();
p.StartInfo.FileName = @"C:\Windows\System32\msiexec.exe";
p.StartInfo.Arguments = @"C:\cabs\CRRuntime_32bit_13_0_5.msi";
p.StartInfo.UserName = uname;
p.StartInfo.Password = pword;
p.StartInfo.Domain = domain;
p.StartInfo.UseShellExecute = false;
https://stackoverflow.com/questions/40501582
复制相似问题