diff --git a/src/MaaWpfGui/ViewModels/UI/SettingsViewModel.cs b/src/MaaWpfGui/ViewModels/UI/SettingsViewModel.cs index 566c9aa7bc..e56979bbee 100644 --- a/src/MaaWpfGui/ViewModels/UI/SettingsViewModel.cs +++ b/src/MaaWpfGui/ViewModels/UI/SettingsViewModel.cs @@ -3890,6 +3890,24 @@ namespace MaaWpfGui.ViewModels.UI if (value) { MessageBoxHelper.Show(LocalizationHelper.GetString("MuMu12ExtrasEnabledTip")); + + // 读取mumu注册表地址 并填充GUI + #if WINDOWS + if (string.Empty.Equals(EmulatorPath)) + { + try + { + RegistryKey driverKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MuMuPlayer-12.0"); + string result = (String)driverKey.GetValue("UninstallString"); + // MessageBoxHelper.Show(result.Substring(1, result.IndexOf("\\uninstall.exe") - 1)); + EmulatorPath = result.Substring(1, result.IndexOf("\\uninstall.exe") - 1); + } + catch(Exception e) + { + // 暂不处理 + } + } + #endif } Instances.AsstProxy.Connected = false; @@ -3909,7 +3927,7 @@ namespace MaaWpfGui.ViewModels.UI get => _emulatorPath; set { - if (!Directory.Exists(value)) + if (!Directory.Exists(value) && _enable) { MessageBoxHelper.Show("MuMu Emulator 12 Path Not Found"); value = string.Empty;