mirror of
https://github.com/osukey/osukey.git
synced 2025-07-29 14:15:27 +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");
|
Logger.Log("Trying to find stable in registry");
|
||||||
|
|
||||||
string stableInstallPath;
|
try
|
||||||
|
{
|
||||||
|
string stableInstallPath;
|
||||||
|
|
||||||
using (RegistryKey key = Registry.ClassesRoot.OpenSubKey("osu"))
|
using (RegistryKey key = Registry.ClassesRoot.OpenSubKey("osu"))
|
||||||
stableInstallPath = key?.OpenSubKey(@"shell\open\command")?.GetValue(string.Empty).ToString().Split('"')[1].Replace("osu!.exe", "");
|
stableInstallPath = key?.OpenSubKey(@"shell\open\command")?.GetValue(string.Empty).ToString().Split('"')[1].Replace("osu!.exe", "");
|
||||||
|
|
||||||
if (ipcFileExistsInDirectory(stableInstallPath))
|
if (ipcFileExistsInDirectory(stableInstallPath))
|
||||||
return stableInstallPath;
|
return stableInstallPath;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user