From bdf6f028f2333fdfdb9e24441b38905cd6c403f5 Mon Sep 17 00:00:00 2001 From: cgl Date: Fri, 10 Jun 2022 16:19:28 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=97=A0=E6=B3=95=E5=B8=A6?= =?UTF-8?q?=E5=91=BD=E4=BB=A4=E5=90=AF=E5=8A=A8=E6=A8=A1=E6=8B=9F=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MeoAsstGui/ViewModels/SettingsViewModel.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/MeoAsstGui/ViewModels/SettingsViewModel.cs b/src/MeoAsstGui/ViewModels/SettingsViewModel.cs index badf44eb6f..d34be9f4de 100644 --- a/src/MeoAsstGui/ViewModels/SettingsViewModel.cs +++ b/src/MeoAsstGui/ViewModels/SettingsViewModel.cs @@ -218,12 +218,16 @@ namespace MeoAsstGui public void TryToStartEmulator() { if (!StartEmulator - || EmulatorPath.Length == 0 - || !File.Exists(EmulatorPath)) + || EmulatorPath.Length == 0) { return; } - System.Diagnostics.Process.Start(EmulatorPath); + Process emuProcess = new Process(); + emuProcess.StartInfo.FileName = "cmd.exe"; + emuProcess.StartInfo.RedirectStandardInput = true; + emuProcess.StartInfo.UseShellExecute = false; + emuProcess.Start(); + emuProcess.StandardInput.WriteLine(EmulatorPath); int delay = 0; if (!int.TryParse(EmulatorWaitSeconds, out delay)) {