mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2025-05-30 06:25:22 -04:00
[GUI] Ensure update has been prepared before attempting to install it
This commit is contained in:
parent
6a8579787d
commit
dac7c664d9
1 changed files with 3 additions and 1 deletions
|
@ -16,6 +16,7 @@ namespace DiscordChatExporter.Gui.Services
|
||||||
private readonly SettingsService _settingsService;
|
private readonly SettingsService _settingsService;
|
||||||
|
|
||||||
private Version? _updateVersion;
|
private Version? _updateVersion;
|
||||||
|
private bool _updatePrepared;
|
||||||
private bool _updaterLaunched;
|
private bool _updaterLaunched;
|
||||||
|
|
||||||
public UpdateService(SettingsService settingsService)
|
public UpdateService(SettingsService settingsService)
|
||||||
|
@ -40,6 +41,7 @@ namespace DiscordChatExporter.Gui.Services
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await _updateManager.PrepareUpdateAsync(_updateVersion = version);
|
await _updateManager.PrepareUpdateAsync(_updateVersion = version);
|
||||||
|
_updatePrepared = true;
|
||||||
}
|
}
|
||||||
catch (UpdaterAlreadyLaunchedException)
|
catch (UpdaterAlreadyLaunchedException)
|
||||||
{
|
{
|
||||||
|
@ -56,7 +58,7 @@ namespace DiscordChatExporter.Gui.Services
|
||||||
if (!_settingsService.IsAutoUpdateEnabled)
|
if (!_settingsService.IsAutoUpdateEnabled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (_updateVersion == null || _updaterLaunched)
|
if (_updateVersion == null || !_updatePrepared || _updaterLaunched)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
try
|
try
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue