msiexec.exe在广告后静默安装msi时忽略属性值。 这是我的情景。我的Windows服务使用以下代码通告msi:
//Advertising the msi file
Process process = new Process
{
StartInfo =
{
FileName = @"msiexec.exe",
Arguments = string.Format(@"/jm ""E:\MyApp.msi"""),
UseShellExecute = false,
RedirectStandardInput = true,
RedirectStandardOutput = true,
RedirectStandardError = true,
CreateNoWindow = false
}
};
process.Start();
process.WaitForExit();
然后,服务调用远程应用程序以提升权限安装应用程序,但msiexec忽略我传递给命令的任何命令行选项:
Process process = new Process
{
StartInfo =
{
FileName = @"msiexec.exe",
Arguments = string.Format(@"/i ""E:\MyApp.msi"" /q UPDATING_AUTOMATICALLY=1"),
UseShellExecute = false,
RedirectStandardInput = true,
RedirectStandardOutput = true,
RedirectStandardError = true,
CreateNoWindow = false
}
};
process.Start();
process.WaitForExit();`
UPDATING_AUTOMATICALLY = 1被忽略,但是我运行安装程序时没有先做广告,一切正常,msiexec正确读取
答案 0 :(得分:2)
问题可能是财产需要被宣布为安全="是"。