From c75f14317ce3f05693cd29168ad72d8ddd53ac5d Mon Sep 17 00:00:00 2001 From: wceuppens Date: Tue, 1 May 2018 18:17:55 +0200 Subject: [PATCH] * Fixed an issue with updates being checked twice when running automatically as an administrator --- MemPlus/Views/Windows/MainWindow.xaml.cs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/MemPlus/Views/Windows/MainWindow.xaml.cs b/MemPlus/Views/Windows/MainWindow.xaml.cs index fddd5c2..9383ff4 100644 --- a/MemPlus/Views/Windows/MainWindow.xaml.cs +++ b/MemPlus/Views/Windows/MainWindow.xaml.cs @@ -89,6 +89,18 @@ public MainWindow() try { + if (!Utils.IsAdministrator()) + { + if (Properties.Settings.Default.RunAsAdministrator) + { + Utils.RunAsAdministrator(_logController); + } + else if (Properties.Settings.Default.AdministrativeWarning) + { + MessageBox.Show("MemPlus might not function correctly without administrative rights!", "MemPlus", MessageBoxButton.OK, MessageBoxImage.Information); + } + } + _logController.AddLog(new ApplicationLog("Checking for application updates")); if (Properties.Settings.Default.AutoUpdate) { @@ -105,18 +117,6 @@ public MainWindow() WindowState = WindowState.Minimized; } - if (!Utils.IsAdministrator()) - { - if (Properties.Settings.Default.RunAsAdministrator) - { - Utils.RunAsAdministrator(_logController); - } - else if (Properties.Settings.Default.AdministrativeWarning) - { - MessageBox.Show("MemPlus might not function correctly without administrative rights!", "MemPlus", MessageBoxButton.OK, MessageBoxImage.Information); - } - } - if (Properties.Settings.Default.StartupMemoryClear) { ClearMemory(0);