Добавлено ожидание процесса
All checks were successful
CI / build-test (push) Successful in 25s
Release / pack-and-publish (release) Successful in 27s

This commit is contained in:
2025-11-25 09:50:29 +03:00
parent d4977a8708
commit cc490c7112
3 changed files with 34 additions and 5 deletions

View File

@@ -1,4 +1,6 @@
using Updater.Core;
using System.Diagnostics;
using System.Security.Cryptography;
using Updater.Core;
namespace Updater;
@@ -22,6 +24,22 @@ internal sealed class Program
Thread.Sleep(options.UpdateDelayMs);
if (options.WaitProcess != null)
try
{
using (var proc = Process.GetProcessById(options.WaitProcess.Value))
{
logger.Info($"Waiting for the process to complete {options.WaitProcess}...");
proc.WaitForExit(); // блокирует выполнение до завершения процесса
logger.Info("Process is completed.");
}
}
catch (ArgumentException)
{
logger.Info($"Process with PID {options.WaitProcess} not found.");
}
var extractor = new ZipExtractor(logger);
var installer = new SafeFileInstaller(logger);
var procMgr = new ProcessManager(logger);