From dddecc5a63baeedc792c0e852410824da222b9da Mon Sep 17 00:00:00 2001 From: Ferbez Date: Sat, 25 May 2024 18:04:24 +0600 Subject: [PATCH] Changes for silent launch --- src/XIVLauncher.Common/EnvironmentSettings.cs | 1 + src/XIVLauncher/App.xaml.cs | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/XIVLauncher.Common/EnvironmentSettings.cs b/src/XIVLauncher.Common/EnvironmentSettings.cs index 24c11be5..68caf8f4 100644 --- a/src/XIVLauncher.Common/EnvironmentSettings.cs +++ b/src/XIVLauncher.Common/EnvironmentSettings.cs @@ -10,6 +10,7 @@ public static class EnvironmentSettings public static bool IsNoRunas => CheckEnvBool("XL_NO_RUNAS"); public static bool IsIgnoreSpaceRequirements => CheckEnvBool("XL_NO_SPACE_REQUIREMENTS"); public static bool IsOpenSteamMinimal => CheckEnvBool("XL_OPEN_STEAM_MINIMAL"); + public static bool IsSilent => CheckEnvBool("XL_SILENT"); private static bool CheckEnvBool(string var) => bool.Parse(System.Environment.GetEnvironmentVariable(var) ?? "false"); } } diff --git a/src/XIVLauncher/App.xaml.cs b/src/XIVLauncher/App.xaml.cs index 5cb605b6..d9b7ede4 100644 --- a/src/XIVLauncher/App.xaml.cs +++ b/src/XIVLauncher/App.xaml.cs @@ -422,7 +422,14 @@ private void App_OnStartup(object sender, StartupEventArgs e) Log.Information("Starting update check..."); _updateWindow = new UpdateLoadingDialog(); - _updateWindow.Show(); + if (!EnvironmentSettings.IsSilent) + { + _updateWindow.Show(); + } + else + { + App.Settings.AutologinEnabled = true + } var updateMgr = new Updates(); updateMgr.OnUpdateCheckFinished += OnUpdateCheckFinished;