Skip to content

Commit c75f143

Browse files
committed
* Fixed an issue with updates being checked twice when running automatically as an administrator
1 parent f1295eb commit c75f143

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

MemPlus/Views/Windows/MainWindow.xaml.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,18 @@ public MainWindow()
8989

9090
try
9191
{
92+
if (!Utils.IsAdministrator())
93+
{
94+
if (Properties.Settings.Default.RunAsAdministrator)
95+
{
96+
Utils.RunAsAdministrator(_logController);
97+
}
98+
else if (Properties.Settings.Default.AdministrativeWarning)
99+
{
100+
MessageBox.Show("MemPlus might not function correctly without administrative rights!", "MemPlus", MessageBoxButton.OK, MessageBoxImage.Information);
101+
}
102+
}
103+
92104
_logController.AddLog(new ApplicationLog("Checking for application updates"));
93105
if (Properties.Settings.Default.AutoUpdate)
94106
{
@@ -105,18 +117,6 @@ public MainWindow()
105117
WindowState = WindowState.Minimized;
106118
}
107119

108-
if (!Utils.IsAdministrator())
109-
{
110-
if (Properties.Settings.Default.RunAsAdministrator)
111-
{
112-
Utils.RunAsAdministrator(_logController);
113-
}
114-
else if (Properties.Settings.Default.AdministrativeWarning)
115-
{
116-
MessageBox.Show("MemPlus might not function correctly without administrative rights!", "MemPlus", MessageBoxButton.OK, MessageBoxImage.Information);
117-
}
118-
}
119-
120120
if (Properties.Settings.Default.StartupMemoryClear)
121121
{
122122
ClearMemory(0);

0 commit comments

Comments
 (0)