Verify installer even if it's downloaded
MODIFY
WalletWasabi/Services/UpdateManager.cs
WalletWasabi/Services/UpdateManager.cs
@@ -87,6 +87,8 @@ public class UpdateManager : IDisposable
var installerFilePath = Path.Combine(InstallerDir, installerFileName);
+ try
+ {
if (!File.Exists(installerFilePath))
{
EnsureToRemoveCorruptedFiles();
@@ -96,13 +98,12 @@ public class UpdateManager : IDisposable
Logger.LogInfo($"Trying to download new version: {newVersion}");
using HttpClient httpClient = new();
- try
- {
// Get file stream and copy it to downloads folder to access.
using var stream = await httpClient.GetStreamAsync(url, CancellationToken).ConfigureAwait(false);
Logger.LogInfo("Installer downloaded, copying...");
await CopyStreamContentToFileAsync(stream, installerFilePath).ConfigureAwait(false);
+ }
await VerifyInstallerHashAsync(installerFileName, installerFilePath, newVersion).ConfigureAwait(false);
}
catch (IOException)
@@ -110,7 +111,6 @@ public class UpdateManager : IDisposable
CancellationToken.ThrowIfCancellationRequested();
throw;
}
- }
return (installerFilePath, newVersion);
}

Verify installer even if it's downloaded