SPT-AKI-Installer/Aki.Helper/ProcessHelper.cs

36 lines
854 B
C#
Raw Normal View History

2022-05-13 22:41:15 +01:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.IO;
using System.Diagnostics;
namespace Installer.Aki.Helper
{
public class ProcessHelper
{
private Process _process;
/// <summary>
/// Starts process with path and file name including include .exe,
/// sets working directory too
/// </summary>
public void StartProcess(string exeDir, string workingDir)
{
_process = new Process();
_process.StartInfo.FileName = exeDir;
_process.StartInfo.WorkingDirectory = workingDir;
_process.Start();
}
/// <summary>
/// Kills the Process
/// </summary>
public void EndProcess()
{
_process.Kill();
}
}
}