通过C#以静默方式安装JMF

时间:2014-02-24 07:59:54

标签: c# jmf silent

有没有办法使用C#在静默模式下安装JMF?

我有jmf.iss和JMF setup.exe,我在设置silent参数时遇到问题:

        string[] programArray = {"SETUP.exe","Java-jre-7u45-windows-i586"};
        foreach (string path in programArray)
        {

                using (Process p = new Process())
                {
                    string arg = "passive";


                    if (path.Contains("SETUP"))
                    {

                        arg = "s /f1" + AppDomain.CurrentDomain.BaseDirectory + @"jmf.iss";
                    }



                    else if (path.Contains("Java"))
                    {
                        arg = "s";
                    }



                    p.StartInfo = new ProcessStartInfo(Application.StartupPath + "\\" + path);

                    p.StartInfo.Arguments = string.Format("/" + arg, path);
                    p.Start();

                    //p.WaitForExit(); 
                    while (!p.HasExited)
                    {
                        Application.DoEvents();
                    }

            }

0 个答案:

没有答案