mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Improved duplicates check
This commit is contained in:
parent
303133fcef
commit
64ab3280a0
@ -1,9 +1,8 @@
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using Artemis.Utilities;
|
|
||||||
using Artemis.Utilities.LogitechDll;
|
|
||||||
using Artemis.ViewModels;
|
using Artemis.ViewModels;
|
||||||
using Autofac;
|
using Autofac;
|
||||||
using Caliburn.Micro;
|
using Caliburn.Micro;
|
||||||
@ -39,8 +38,8 @@ namespace Artemis
|
|||||||
|
|
||||||
private void CheckDuplicateInstances()
|
private void CheckDuplicateInstances()
|
||||||
{
|
{
|
||||||
var processes = Process.GetProcesses();
|
if (Process.GetProcesses().Count(p => p.ProcessName.Contains(Assembly.GetExecutingAssembly()
|
||||||
if (processes.Count(p => p.ProcessName == "Artemis") < 2)
|
.FullName.Split(',')[0]) && !p.Modules[0].FileName.Contains("vshost")) < 2)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
MessageBox.Show("An instance of Artemis is already running (check your system tray).",
|
MessageBox.Show("An instance of Artemis is already running (check your system tray).",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user