/// <summary> /// Launch the legacy application with some options set. /// </summary> public static void LaunchCommandLineApp(string app, string parameters) { // Use ProcessStartInfo class ProcessStartInfo startInfo = new ProcessStartInfo { CreateNoWindow = false, UseShellExecute = true, FileName = app, WindowStyle = ProcessWindowStyle.Minimized, Arguments = @parameters }; UpdateStatusText("Launch: " + startInfo); Process exeProcess = Process.Start(startInfo); if (app == Properties.Settings.Default.MakeMKVPath) { while (!exeProcess.HasExited) { // Discard cached information about the process. exeProcess.Refresh(); Thread.Sleep(2000); } if (exeProcess.ExitCode == 0) { RenameFiles(); if (Properties.Settings.Default.ConvWithHandbrake == true) { Convert.AddTitleToConvvertList(); Convert.ConvertWithHandbrake(); } if (Properties.Settings.Default.FinalPath != "") { MoveFilesToFinalDestination(); } Properties.Settings.Default.LastRipTitle = Properties.Settings.Default.CurrentTitle; SMTPSender.Main(true); SaveSettings(); OpenOrCloseCDDrive.Open(); Application.Exit(); return; } else { SMTPSender.Main(false); CleanupFailedRip(); OpenOrCloseCDDrive.Open(); Application.Exit(); return; } } return; }
private void button1_Click_1(object sender, EventArgs e) { Ripping.SaveSettings(); SMTPSender.Main(true); this.Refresh(); }