diff --git a/osu.Desktop/OsuGameDesktop.cs b/osu.Desktop/OsuGameDesktop.cs index c75a3f0a1a..46bd894c07 100644 --- a/osu.Desktop/OsuGameDesktop.cs +++ b/osu.Desktop/OsuGameDesktop.cs @@ -95,11 +95,11 @@ public OsuGameDesktop(string[]? args = null) return key?.OpenSubKey(WindowsAssociationManager.SHELL_OPEN_COMMAND)?.GetValue(string.Empty)?.ToString()?.Split('"')[1].Replace("osu!.exe", ""); } + public static bool IsPackageManaged => !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("OSU_EXTERNAL_UPDATE_PROVIDER")); + protected override UpdateManager CreateUpdateManager() { - string? packageManaged = Environment.GetEnvironmentVariable("OSU_EXTERNAL_UPDATE_PROVIDER"); - - if (!string.IsNullOrEmpty(packageManaged)) + if (IsPackageManaged) return new NoActionUpdateManager(); return new VelopackUpdateManager(); diff --git a/osu.Desktop/Program.cs b/osu.Desktop/Program.cs index 78a20e32dc..6e0234f387 100644 --- a/osu.Desktop/Program.cs +++ b/osu.Desktop/Program.cs @@ -169,9 +169,7 @@ private static bool trySendIPCMessage(IIpcHost host, string cwd, string[] args) private static void setupVelopack() { - string? packageManaged = Environment.GetEnvironmentVariable("OSU_EXTERNAL_UPDATE_PROVIDER"); - - if (!string.IsNullOrEmpty(packageManaged)) + if (OsuGameDesktop.IsPackageManaged) { Logger.Log("Updates are being managed by an external provider. Skipping Velopack setup"); return;