diff --git a/osu.Desktop/OsuGameDesktop.cs b/osu.Desktop/OsuGameDesktop.cs index f1427d2861..88c8a206c8 100644 --- a/osu.Desktop/OsuGameDesktop.cs +++ b/osu.Desktop/OsuGameDesktop.cs @@ -51,6 +51,8 @@ namespace osu.Desktop { protected override string LocateBasePath() { + Func checkExists = p => Directory.Exists(Path.Combine(p, "Songs")); + string stableInstallPath; try @@ -58,19 +60,19 @@ namespace osu.Desktop using (RegistryKey key = Registry.ClassesRoot.OpenSubKey("osu")) stableInstallPath = key?.OpenSubKey(@"shell\open\command")?.GetValue(String.Empty).ToString().Split('"')[1].Replace("osu!.exe", ""); - if (Directory.Exists(stableInstallPath)) + if (checkExists(stableInstallPath)) return stableInstallPath; } catch { } - stableInstallPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"osu!", "Songs"); - if (Directory.Exists(stableInstallPath)) + stableInstallPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"osu!"); + if (checkExists(stableInstallPath)) return stableInstallPath; - stableInstallPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".osu", "Songs"); - if (Directory.Exists(stableInstallPath)) + stableInstallPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".osu"); + if (checkExists(stableInstallPath)) return stableInstallPath; return null;