Добавьте файлы проекта.

This commit is contained in:
2025-11-25 07:39:25 +03:00
parent ed6a7e1938
commit 5bbcfb1e76
21 changed files with 793 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
using System.Diagnostics;
namespace Updater.Core;
public sealed class ProcessManager : IProcessManager
{
private readonly ILogger _log;
public ProcessManager(ILogger log) => _log = log;
public void StartApp(string installPath, string appExe, int delayMs)
{
var appPath = Path.Combine(installPath, appExe);
if (!File.Exists(appPath))
throw new FileNotFoundException("Executable not found after install", appPath);
if (delayMs > 0)
{
_log.Info($"Waiting {delayMs} ms before restart...");
Thread.Sleep(delayMs);
}
_log.Info($"Starting '{appExe}'...");
Process.Start(new ProcessStartInfo
{
FileName = appPath,
UseShellExecute = true,
WorkingDirectory = installPath
});
}
}