mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
try-catch registry lookup to avoid crashes on non-windows platforms
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user