/// <inheritdoc /> public override async Task <string> DownloadInstallerAsync(UpdateManifest manifest) { try { var path = Path.Combine(Globals.AppDataFolder, Globals.Updates.TempFolder); if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } var fileName = Path.Combine(path, $"Micser-{manifest.Version}.msi"); using (var webClient = new WebClient()) { await webClient.DownloadFileTaskAsync(manifest.FileName, fileName).ConfigureAwait(false); } return(fileName); } catch (Exception ex) { Logger.Error(ex); return(null); } }
/// <inheritdoc /> public virtual bool IsUpdateAvailable(UpdateManifest manifest) { if (manifest == null) { return(false); } var updateVersion = new Version(manifest.Version); var currentVersion = Assembly.GetEntryAssembly()?.GetName().Version; return(updateVersion > currentVersion); }
/// <inheritdoc /> public abstract Task <string> DownloadInstallerAsync(UpdateManifest manifest);