Linking Data instead of making new copies, checking if EZPPClient is running, added Desktop Shortcut
This commit is contained in:
33
EZPPClient Installer/ProcessUtil.cs
Normal file
33
EZPPClient Installer/ProcessUtil.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EZPPClient_Installer
|
||||
{
|
||||
class ProcessUtil
|
||||
{
|
||||
public static bool ProgramIsRunning(string FullPath)
|
||||
{
|
||||
string FilePath = Path.GetDirectoryName(FullPath);
|
||||
string FileName = Path.GetFileNameWithoutExtension(FullPath).ToLower();
|
||||
bool isRunning = false;
|
||||
|
||||
Process[] pList = Process.GetProcessesByName(FileName);
|
||||
|
||||
foreach (Process p in pList)
|
||||
{
|
||||
if (p.MainModule.FileName.StartsWith(FilePath, StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
isRunning = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return isRunning;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user