Files
MRCC/launcher/PCL-CE/PCL.Core/App/IoC/LifecycleProcess.cs
T

27 lines
649 B
C#
Raw Normal View History

using System;
using System.Diagnostics;
namespace PCL.Core.App.IoC;
partial class Lifecycle
{
private static void _RunCurrentExecutable(string? arguments)
{
var fileName = Environment.ProcessPath!;
if (arguments is null) Process.Start(fileName);
else Process.Start(fileName, arguments);
}
private static void _KillCurrentProcess()
{
var psi = new ProcessStartInfo
{
FileName = "taskkill.exe",
Arguments = $"/f /t /pid {Environment.ProcessId}",
UseShellExecute = false,
CreateNoWindow = true
};
Process.Start(psi);
}
}