public static void CheckOs() { if (!File.Exists(Paths.GetVerPath()) && Paths.GetExeDir().ToLower().Contains("temp")) { MessageBox.Show("You seem to be running Flowframes out of an archive.\nPlease extract the whole archive first!", "Error"); IoUtils.TryDeleteIfExists(Paths.GetDataPath()); Application.Exit(); } string[] osInfo = OsUtils.TryGetOs().Split(" | "); string version = osInfo[0].Remove("Microsoft").Trim(); if (Is32Bit() && !Config.GetBool("allow32Bit", false)) { MessageBox.Show("This application is not compatible with 32 bit operating systems!", "Error"); Application.Exit(); } if (string.IsNullOrWhiteSpace(version)) { return; } if (!version.ToLower().Contains("windows 10") && !version.ToLower().Contains("windows 11") && !Config.GetBool("ignoreIncompatibleOs", false)) { MessageBox.Show($"This application was made for Windows 10/11 and is not officially compatible with {version}.\n\n" + $"Use it at your own risk and do NOT ask for support as long as your are on {version}.", "Warning"); } }
static bool Is32Bit() { string osInfoStr = OsUtils.TryGetOs(); if (string.IsNullOrWhiteSpace(osInfoStr)) { return(false); // If it fails, assume we are on 64bit } string[] osInfo = osInfoStr.Split(" | "); string arch = osInfo[1].Trim(); return(arch.Contains("32")); }
static bool IsWin10Or11() { string osInfoStr = OsUtils.TryGetOs(); if (string.IsNullOrWhiteSpace(osInfoStr)) { return(true); // If it fails, assume we are on Win10 } string[] osInfo = osInfoStr.Split(" | "); string version = osInfo[0].Remove("Microsoft").Trim(); return(version.ToLower().Contains("windows 10") || version.ToLower().Contains("windows 11")); }