diff --git a/src/MaaWpfGui/Res/Localizations/en-us.xaml b/src/MaaWpfGui/Res/Localizations/en-us.xaml index 98ccbda870..4fef326043 100644 --- a/src/MaaWpfGui/Res/Localizations/en-us.xaml +++ b/src/MaaWpfGui/Res/Localizations/en-us.xaml @@ -155,6 +155,7 @@ Error in ADB detection\nPlease use administrator privileges to open this software\nor set connection manually No emulator detected\nPlease use administrator privileges to open this software\nor set connection manually Too many emulators detected\nPlease shutdown not needed emulators \nor set connection manually + Failed to start the emulator\nPlease open this software with administrator privileges \nor start the emulator manually. Switch Language Language The language settings have been changed, restart the app now? diff --git a/src/MaaWpfGui/Res/Localizations/ja-jp.xaml b/src/MaaWpfGui/Res/Localizations/ja-jp.xaml index 261851a80b..cb503ebfc0 100644 --- a/src/MaaWpfGui/Res/Localizations/ja-jp.xaml +++ b/src/MaaWpfGui/Res/Localizations/ja-jp.xaml @@ -155,6 +155,7 @@ ADB検出エラー\nこのソフトウェアを開くには管理者権限を使用するか\n手動で接続を設定してください エミュレータが検出されない\n管理者権限でこのアプリを開くか\n手動で接続設定を行ってください 複数のシミュレータが検出されたため\n不要なエミュレータを閉じるか\n手動で接続設定を行ってください + エミュレータの起動に失敗しました\n管理者権限でこのソフトウェアを開いていただくか\n手動でエミュレータを起動してください。 言語を切り替える 言語 言語設定が変更されました、今すぐMAAを再起動して言語設定を適用しますか? diff --git a/src/MaaWpfGui/Res/Localizations/ko-kr.xaml b/src/MaaWpfGui/Res/Localizations/ko-kr.xaml index b8873515e1..261c95a1de 100644 --- a/src/MaaWpfGui/Res/Localizations/ko-kr.xaml +++ b/src/MaaWpfGui/Res/Localizations/ko-kr.xaml @@ -155,6 +155,7 @@ ADB를 찾을 수 없었습니다.\n관리자 권한으로 실행하거나\n수동으로 연결을 설정해 주세요 에뮬레이터를 찾을 수 없습니다.\n관리자 권한으로 실행하거나\n수동으로 연결을 설정해 주세요 여러 에뮬레이터가 실행 중입니다.\n사용하지 않는 에뮬레이터를 종료하거나\n수동으로 연결을 설정해 주세요 + 모의기를 시작하지 못했습니다.\n사용하지 않는 에뮬레이터를 종료하거나\n또는 에뮬레이터를 수동으로 시작하십시오. 언어 전환 언어 언어가 변경되었습니다. 지금 MAA를 재실행하여 새 설정을 적용하시겠습니까? diff --git a/src/MaaWpfGui/Res/Localizations/zh-cn.xaml b/src/MaaWpfGui/Res/Localizations/zh-cn.xaml index c6ffa630f6..943b4b1c40 100644 --- a/src/MaaWpfGui/Res/Localizations/zh-cn.xaml +++ b/src/MaaWpfGui/Res/Localizations/zh-cn.xaml @@ -155,6 +155,7 @@ 检测ADB出错\n请使用管理员权限打开本软件\n或手动设置连接 未检测到任何模拟器\n请使用管理员权限打开本软件\n或手动设置连接 检测到多个模拟器\n请关闭不需要的模拟器\n或手动设置连接 + 未能成功启动模拟器\n请使用管理员权限打开本软件\n或手动启动模拟器 切换语言 语言 语言设置已更改,是否现在重启 MAA 以应用语言设置? diff --git a/src/MaaWpfGui/Res/Localizations/zh-tw.xaml b/src/MaaWpfGui/Res/Localizations/zh-tw.xaml index 5ab64ff5fd..350f5906e2 100644 --- a/src/MaaWpfGui/Res/Localizations/zh-tw.xaml +++ b/src/MaaWpfGui/Res/Localizations/zh-tw.xaml @@ -155,6 +155,7 @@ 檢測 ADB 出錯\n請使用系統管理員身分執行本軟體\n或手動設定連接 未檢測到任何模擬器\n請使用系統管理員身分執行本軟體\n或手動設定連接 檢測到多個模擬器\n請關閉不需要的模擬器\n或手動設定連接 + 無法成功啟動模擬器\n請使用管理員權限開啟本軟體\n或手動啟動模擬器。 切換語言 語言 語言設定已變更,是否現在重開 MAA 以套用語言設定? diff --git a/src/MaaWpfGui/ViewModels/UI/SettingsViewModel.cs b/src/MaaWpfGui/ViewModels/UI/SettingsViewModel.cs index 8dac82e11e..c8a62b6e55 100644 --- a/src/MaaWpfGui/ViewModels/UI/SettingsViewModel.cs +++ b/src/MaaWpfGui/ViewModels/UI/SettingsViewModel.cs @@ -1081,13 +1081,31 @@ namespace MaaWpfGui.ViewModels.UI _logger.Information("Start emulator error, try to start using the default: \n" + "EmulatorPath: " + EmulatorPath + "\n" + "EmulatorAddCommand: " + EmulatorAddCommand); - if (EmulatorAddCommand.Length != 0) + try { - Process.Start(EmulatorPath); + if (EmulatorAddCommand.Length != 0) + { + Process.Start(EmulatorPath); + } + else + { + Process.Start(EmulatorPath, EmulatorAddCommand); + } } - else + catch (Exception e) { - Process.Start(EmulatorPath, EmulatorAddCommand); + if (e is Win32Exception win32Exception && win32Exception.NativeErrorCode == 740) + { + Execute.OnUIThread(() => Instances.TaskQueueViewModel.AddLog( + LocalizationHelper.GetString("EmulatorStartFailed"), UiLogColor.Warning)); + + _logger.Warning("Insufficient permissions to start the emulator:\n" + + "EmulatorPath: " + EmulatorPath + "\n"); + } + else + { + _logger.Warning("Emulator start failed with error: " + e.Message); + } } }