在广告包后静默安装应用程序时,msiexec 忽略 属性 值(命令行参数)

The msiexec ignore the property values(commandline arguments) when installing app silently after advertising the package

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 正确读取它们

问题可能是 属性 需要声明为安全的="yes"。