mirror of
https://github.com/ppy/osu.git
synced 2025-02-20 09:03:00 +08:00
try-catch registry lookup to avoid crashes on non-windows platforms
This commit is contained in:
parent
2d121b4e3d
commit
fc31d49629
@ -238,13 +238,19 @@ namespace osu.Game.Tournament.IPC
|
||||
{
|
||||
Logger.Log("Trying to find stable in registry");
|
||||
|
||||
string stableInstallPath;
|
||||
try
|
||||
{
|
||||
string stableInstallPath;
|
||||
|
||||
using (RegistryKey key = Registry.ClassesRoot.OpenSubKey("osu"))
|
||||
stableInstallPath = key?.OpenSubKey(@"shell\open\command")?.GetValue(string.Empty).ToString().Split('"')[1].Replace("osu!.exe", "");
|
||||
using (RegistryKey key = Registry.ClassesRoot.OpenSubKey("osu"))
|
||||
stableInstallPath = key?.OpenSubKey(@"shell\open\command")?.GetValue(string.Empty).ToString().Split('"')[1].Replace("osu!.exe", "");
|
||||
|
||||
if (ipcFileExistsInDirectory(stableInstallPath))
|
||||
return stableInstallPath;
|
||||
if (ipcFileExistsInDirectory(stableInstallPath))
|
||||
return stableInstallPath;
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user