0

Is there any way to install JMF in silent mode using C#?

I have jmf.iss and JMF setup.exe and I'm having problems setting the silent parameter:

        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();
                    }

            }
Panagiotis Kanavos
  • 120,703
  • 13
  • 188
  • 236
user3313131
  • 583
  • 2
  • 7
  • 9
  • 2
    This isn't valid code to start an external process. Where is the code that passes the path of the executable and actually starts the process ? Are you getting an error or unexpected behavior? – Panagiotis Kanavos Feb 24 '14 at 09:01
  • You can see my code now. I editted. I am getting parameter error. – user3313131 Feb 24 '14 at 11:03
  • Instead of mixing up different executables and arguments, just use [Process.Start(string,string)](http://msdn.microsoft.com/en-us/library/h6ak8zt5(v=vs.110).aspx) to start one program at a time with its proper arguments. – Panagiotis Kanavos Feb 24 '14 at 11:10

0 Answers0