public void Main(MgaProject project, MgaFCO currentobj, MgaFCOs selectedobjs, ComponentStartMode startMode) { var exePath = Path.Combine(META.VersionInfo.MetaPath, @"bin\PETBrowser.exe"); if (File.Exists(exePath) == false) { exePath = Path.Combine(META.VersionInfo.MetaPath, @"src\PETBrowser\bin\Release\PETBrowser.exe"); } ProcessStartInfo info = new ProcessStartInfo() { FileName = exePath, // Arguments = WorkingDirectory = project.GetProjectDirectoryPath(), UseShellExecute = false, RedirectStandardError = true }; using (Process p = new Process()) { p.StartInfo = info; p.Start(); p.WaitForInputIdle(10 * 1000); if (p.HasExited) { var err = p.StandardError.ReadToEnd(); GMEConsole.Error.WriteLine(err); } } }