1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 10:07:52 +08:00

Show an error message on startup when attempting to run on an unsupported version of windows

A lot of sentry error reports are coming from realm / EF failures due to the host operating system being too old. Let's give the user some proper feedback rather than a silent crash and error report hitting our logging.
This commit is contained in:
Dean Herbert 2022-07-12 15:42:20 +09:00
parent 9e40e50d93
commit 10a14f39ed

View File

@ -14,6 +14,7 @@ using osu.Framework.Platform;
using osu.Game;
using osu.Game.IPC;
using osu.Game.Tournament;
using SDL2;
using Squirrel;
namespace osu.Desktop
@ -29,7 +30,19 @@ namespace osu.Desktop
{
// run Squirrel first, as the app may exit after these run
if (OperatingSystem.IsWindows())
{
var windowsVersion = Environment.OSVersion.Version;
if (windowsVersion.Major < 6 || (windowsVersion.Major == 6 && windowsVersion.Minor <= 1))
{
SDL.SDL_ShowSimpleMessageBox(SDL.SDL_MessageBoxFlags.SDL_MESSAGEBOX_ERROR,
"Your operating system is too old to run osu!",
"This version of osu! requires at least Windows 8 to run.\nPlease upgrade your operating system or consider using an older version of osu!.", IntPtr.Zero);
return;
}
setupSquirrel();
}
// Back up the cwd before DesktopGameHost changes it
string cwd = Environment.CurrentDirectory;