1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00

Don't show UI when silently updating

This commit is contained in:
Robert 2023-03-26 13:05:19 +02:00
parent 834212737f
commit 494c5b4054
2 changed files with 10 additions and 14 deletions

View File

@ -95,8 +95,8 @@ public class ApplicationStateManager
private void UtilitiesOnUpdateRequested(object? sender, UpdateEventArgs e) private void UtilitiesOnUpdateRequested(object? sender, UpdateEventArgs e)
{ {
List<string> argsList = new(StartupArguments); List<string> argsList = new(StartupArguments);
if (e.Silent) if (e.Silent && !argsList.Contains("--minimized"))
argsList.Add("--autorun"); argsList.Add("--minimized");
// Retain startup arguments after update by providing them to the script // Retain startup arguments after update by providing them to the script
string script = Path.Combine(Constants.UpdatingFolder, "installing", "scripts", "update.ps1"); string script = Path.Combine(Constants.UpdatingFolder, "installing", "scripts", "update.ps1");

View File

@ -46,7 +46,7 @@ public class RootViewModel : ActivatableViewModelBase, IScreen, IMainWindowProvi
{ {
Router = new RoutingState(); Router = new RoutingState();
WindowSizeSetting = settingsService.GetSetting<WindowSize?>("WindowSize"); WindowSizeSetting = settingsService.GetSetting<WindowSize?>("WindowSize");
_coreService = coreService; _coreService = coreService;
_settingsService = settingsService; _settingsService = settingsService;
_windowService = windowService; _windowService = windowService;
@ -56,17 +56,17 @@ public class RootViewModel : ActivatableViewModelBase, IScreen, IMainWindowProvi
_defaultTitleBarViewModel = defaultTitleBarViewModel; _defaultTitleBarViewModel = defaultTitleBarViewModel;
_sidebarVmFactory = sidebarVmFactory; _sidebarVmFactory = sidebarVmFactory;
_lifeTime = (IClassicDesktopStyleApplicationLifetime) Application.Current!.ApplicationLifetime!; _lifeTime = (IClassicDesktopStyleApplicationLifetime) Application.Current!.ApplicationLifetime!;
mainWindowService.ConfigureMainWindowProvider(this); mainWindowService.ConfigureMainWindowProvider(this);
mainWindowService.HostScreen = this; mainWindowService.HostScreen = this;
DisplayAccordingToSettings(); DisplayAccordingToSettings();
Router.CurrentViewModel.Subscribe(UpdateTitleBarViewModel); Router.CurrentViewModel.Subscribe(UpdateTitleBarViewModel);
Task.Run(() => Task.Run(() =>
{ {
if (_updateService.Initialize()) if (_updateService.Initialize())
return; return;
coreService.Initialize(); coreService.Initialize();
registrationService.RegisterBuiltInDataModelDisplays(); registrationService.RegisterBuiltInDataModelDisplays();
registrationService.RegisterBuiltInDataModelInputs(); registrationService.RegisterBuiltInDataModelInputs();
@ -110,14 +110,10 @@ public class RootViewModel : ActivatableViewModelBase, IScreen, IMainWindowProvi
bool showOnAutoRun = _settingsService.GetSetting("UI.ShowOnStartup", true).Value; bool showOnAutoRun = _settingsService.GetSetting("UI.ShowOnStartup", true).Value;
if ((autoRunning && !showOnAutoRun) || minimized) if ((autoRunning && !showOnAutoRun) || minimized)
{ return;
// TODO: Auto-update
} ShowSplashScreen();
else _coreService.Initialized += (_, _) => Dispatcher.UIThread.InvokeAsync(OpenMainWindow);
{
ShowSplashScreen();
_coreService.Initialized += (_, _) => Dispatcher.UIThread.InvokeAsync(OpenMainWindow);
}
} }
private void ShowSplashScreen() private void ShowSplashScreen()