Fix auto-update exit crash after download (Application.Exit from async).
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
d80953baad
commit
2c4479bec3
@ -80,7 +80,8 @@ namespace Электронная_Фармация
|
||||
dlg.ShowDialog(this);
|
||||
}
|
||||
|
||||
Application.Exit();
|
||||
// Жёстко завершаем процесс, чтобы updater смог заменить exe.
|
||||
Environment.Exit(0);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@ -53,8 +53,10 @@ namespace Электронная_Фармация.HelpForms
|
||||
{
|
||||
await AutoUpdater.ApplyUpdateAsync(_result, progress);
|
||||
lblMessage.Text = "Обновление скачано. Перезапуск...";
|
||||
// Нельзя звать Application.Exit() из async continuation — падает
|
||||
// «коллекция была изменена». Закрываем диалог; Form1 завершит процесс.
|
||||
DialogResult = DialogResult.OK;
|
||||
Application.Exit();
|
||||
Close();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// Можно задать все значения или принять номера сборки и редакции по умолчанию
|
||||
// используя "*", как показано ниже:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.13.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.13.0")]
|
||||
[assembly: AssemblyVersion("1.0.14.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.14.0")]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user