mirror of https://github.com/ppy/osu
Move environment variable logic to static bool in OsuGameDesktop
This commit is contained in:
parent
bf3597f711
commit
d451415d5c
|
@ -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", "");
|
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()
|
protected override UpdateManager CreateUpdateManager()
|
||||||
{
|
{
|
||||||
string? packageManaged = Environment.GetEnvironmentVariable("OSU_EXTERNAL_UPDATE_PROVIDER");
|
if (IsPackageManaged)
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(packageManaged))
|
|
||||||
return new NoActionUpdateManager();
|
return new NoActionUpdateManager();
|
||||||
|
|
||||||
return new VelopackUpdateManager();
|
return new VelopackUpdateManager();
|
||||||
|
|
|
@ -169,9 +169,7 @@ private static bool trySendIPCMessage(IIpcHost host, string cwd, string[] args)
|
||||||
|
|
||||||
private static void setupVelopack()
|
private static void setupVelopack()
|
||||||
{
|
{
|
||||||
string? packageManaged = Environment.GetEnvironmentVariable("OSU_EXTERNAL_UPDATE_PROVIDER");
|
if (OsuGameDesktop.IsPackageManaged)
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(packageManaged))
|
|
||||||
{
|
{
|
||||||
Logger.Log("Updates are being managed by an external provider. Skipping Velopack setup");
|
Logger.Log("Updates are being managed by an external provider. Skipping Velopack setup");
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue