diff --git a/README.md b/README.md index 71cac0c3..dc5f4b10 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@ # nUpdate - .NET Update Solution -[![Release](https://img.shields.io/badge/release-v3.1.5-blue.svg)](https://github.com/ProgTrade/nUpdate/releases) -[![NuGet](https://img.shields.io/badge/nuget%20nUpdate.ProvideTAP-v3.1.5-red.svg)](https://www.nuget.org/packages/nUpdate.ProvideTAP/) -[![NuGet](https://img.shields.io/badge/nuget%20nUpdate.WithoutTAP-v3.1.5-red.svg)](https://www.nuget.org/packages/nUpdate.WithoutTAP/) +[![Release](https://img.shields.io/badge/release-v3.1.8-blue.svg)](https://github.com/ProgTrade/nUpdate/releases) +[![NuGet](https://img.shields.io/badge/nuget%20nUpdate.ProvideTAP-v3.1.8-red.svg)](https://www.nuget.org/packages/nUpdate.ProvideTAP/) +[![NuGet](https://img.shields.io/badge/nuget%20nUpdate.WithoutTAP-v3.1.8-red.svg)](https://www.nuget.org/packages/nUpdate.WithoutTAP/) [![Issues](https://img.shields.io/github/issues/ProgTrade/nUpdate.svg)](https://github.com/ProgTrade/nUpdate/issues) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/ProgTrade/nUpdate/master/LICENSE) [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=dominic%2ebeger%40hotmail%2ede&lc=DE&item_name=nUpdate&no_note=0¤cy_code=EUR&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHostedGuest) @@ -39,13 +39,13 @@ You can get the necessary libraries and applications from the current [releases] If you want to use nUpdate with the Taskbased Asynchronous Pattern including `async` and `await`, then install this package: ``` -PM> Install-Package nUpdate.ProvideTAP -Version 3.1.5 +PM> Install-Package nUpdate.ProvideTAP -Version 3.1.8 ``` Otherwise, if you want to use the Eventbased Asynchronous Pattern only, make sure to install this package: ``` -PM> Install-Package nUpdate.WithoutTAP -Version 3.1.5 +PM> Install-Package nUpdate.WithoutTAP -Version 3.1.8 ``` ## Web diff --git a/nUpdate.Administration/Program.cs b/nUpdate.Administration/Program.cs index 41ce8c60..9314e4b6 100644 --- a/nUpdate.Administration/Program.cs +++ b/nUpdate.Administration/Program.cs @@ -54,7 +54,7 @@ public static class Program /// /// The version string shown in all dialog titles. /// - public static string VersionString => "nUpdate Administration v3.1.5"; + public static string VersionString => "nUpdate Administration v3.1.8"; public static string AesKeyPassword => "VZh7mLRPNI"; public static string AesIvPassword => "cOijH2vgwR"; diff --git a/nUpdate.Administration/Properties/AssemblyInfo.cs b/nUpdate.Administration/Properties/AssemblyInfo.cs index 50d965c1..ffa22ec9 100644 --- a/nUpdate.Administration/Properties/AssemblyInfo.cs +++ b/nUpdate.Administration/Properties/AssemblyInfo.cs @@ -38,6 +38,6 @@ // übernehmen, indem Sie "*" eingeben: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("3.1.5.0")] -[assembly: AssemblyFileVersion("3.1.5.0")] +[assembly: AssemblyVersion("3.1.8.0")] +[assembly: AssemblyFileVersion("3.1.8.0")] [assembly: NeutralResourcesLanguage("")] \ No newline at end of file diff --git a/nUpdate.Administration/UI/Dialogs/InfoDialog.Designer.cs b/nUpdate.Administration/UI/Dialogs/InfoDialog.Designer.cs index 18e0be94..ecde6b49 100644 --- a/nUpdate.Administration/UI/Dialogs/InfoDialog.Designer.cs +++ b/nUpdate.Administration/UI/Dialogs/InfoDialog.Designer.cs @@ -105,7 +105,7 @@ private void InitializeComponent() this.label13.Name = "label13"; this.label13.Size = new System.Drawing.Size(75, 13); this.label13.TabIndex = 20; - this.label13.Text = "v3.1.5"; + this.label13.Text = "v3.1.8"; // // controlPanel1 // diff --git a/nUpdate.Client.GuiInterface/Properties/AssemblyInfo.cs b/nUpdate.Client.GuiInterface/Properties/AssemblyInfo.cs index 6b9c9a75..b3e8e4fe 100644 --- a/nUpdate.Client.GuiInterface/Properties/AssemblyInfo.cs +++ b/nUpdate.Client.GuiInterface/Properties/AssemblyInfo.cs @@ -38,4 +38,4 @@ // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("3.1.0.0")] -[assembly: AssemblyFileVersion("3.1.5.0")] +[assembly: AssemblyFileVersion("3.1.8.0")] diff --git a/nUpdate.Test/Properties/AssemblyInfo.cs b/nUpdate.Test/Properties/AssemblyInfo.cs index 0e93446d..ad5dea81 100644 --- a/nUpdate.Test/Properties/AssemblyInfo.cs +++ b/nUpdate.Test/Properties/AssemblyInfo.cs @@ -37,5 +37,5 @@ // durch Einsatz von '*', wie in nachfolgendem Beispiel: // [Assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("3.1.5.0")] -[assembly: AssemblyFileVersion("3.1.5.0")] +[assembly: AssemblyVersion("3.1.8.0")] +[assembly: AssemblyFileVersion("3.1.8.0")] diff --git a/nUpdate.UpdateInstaller/Properties/AssemblyInfo.cs b/nUpdate.UpdateInstaller/Properties/AssemblyInfo.cs index 74c329fa..20e1d1d6 100644 --- a/nUpdate.UpdateInstaller/Properties/AssemblyInfo.cs +++ b/nUpdate.UpdateInstaller/Properties/AssemblyInfo.cs @@ -37,5 +37,5 @@ // übernehmen, indem Sie "*" eingeben: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("3.1.5.0")] -[assembly: AssemblyFileVersion("3.1.5.0")] +[assembly: AssemblyVersion("3.1.8.0")] +[assembly: AssemblyFileVersion("3.1.8.0")] diff --git a/nUpdate/Properties/AssemblyInfo.cs b/nUpdate/Properties/AssemblyInfo.cs index 083b3331..ec5ed094 100644 --- a/nUpdate/Properties/AssemblyInfo.cs +++ b/nUpdate/Properties/AssemblyInfo.cs @@ -37,5 +37,5 @@ // übernehmen, indem Sie "*" eingeben: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("3.1.5.0")] -[assembly: AssemblyFileVersion("3.1.5.0")] \ No newline at end of file +[assembly: AssemblyVersion("3.1.8.0")] +[assembly: AssemblyFileVersion("3.1.8.0")] \ No newline at end of file diff --git a/nUpdate/Resources/nUpdate UpdateInstaller.exe b/nUpdate/Resources/nUpdate UpdateInstaller.exe index 8dd62a0b..f708dbb9 100644 Binary files a/nUpdate/Resources/nUpdate UpdateInstaller.exe and b/nUpdate/Resources/nUpdate UpdateInstaller.exe differ diff --git a/nUpdate/Resources/nUpdate UpdateInstaller.pdb b/nUpdate/Resources/nUpdate UpdateInstaller.pdb index 293ed682..3f2a450a 100644 Binary files a/nUpdate/Resources/nUpdate UpdateInstaller.pdb and b/nUpdate/Resources/nUpdate UpdateInstaller.pdb differ diff --git a/nUpdate/UI/Dialogs/UpdateDownloadDialog.cs b/nUpdate/UI/Dialogs/UpdateDownloadDialog.cs index 41e1346e..1e74b3dc 100644 --- a/nUpdate/UI/Dialogs/UpdateDownloadDialog.cs +++ b/nUpdate/UI/Dialogs/UpdateDownloadDialog.cs @@ -62,8 +62,7 @@ public void CloseDialog(object state) protected virtual void OnCancelButtonClicked() { - if (CancelButtonClicked != null) - CancelButtonClicked(this, EventArgs.Empty); + CancelButtonClicked?.Invoke(this, EventArgs.Empty); } public void ShowModalDialog(object dialogResultReference) @@ -133,6 +132,14 @@ public void Failed(object sender, FailedEventArgs e) DialogResult = DialogResult.Cancel; } + public void StatisticsEntryFailed(object sender, FailedEventArgs e) + { + Invoke(new Action(() => Popup.ShowPopup(this, SystemIcons.Warning, + "Error while adding a new statistics entry.", + e.Exception, PopupButtons.Ok))); + DialogResult = DialogResult.OK; + } + public void Finished(object sender, EventArgs e) { DialogResult = DialogResult.OK; diff --git a/nUpdate/Updating/UpdateManager.cs b/nUpdate/Updating/UpdateManager.cs index f37d8a29..8a9beda8 100644 --- a/nUpdate/Updating/UpdateManager.cs +++ b/nUpdate/Updating/UpdateManager.cs @@ -317,13 +317,11 @@ public bool SearchForUpdates() } TotalSize = updatePackageSize; - if (_searchCancellationTokenSource.Token.IsCancellationRequested) - { - Cleanup(); - throw new OperationCanceledException(); - } + if (!_searchCancellationTokenSource.Token.IsCancellationRequested) + return true; - return true; + Cleanup(); + throw new OperationCanceledException(); } /// @@ -450,20 +448,14 @@ public void DownloadPackages() if (!updateConfiguration.UseStatistics || !IncludeCurrentPcIntoStatistics) continue; - try - { - var response = - new WebClient {Credentials = HttpAuthenticationCredentials}.DownloadString( - $"{updateConfiguration.UpdatePhpFileUri}?versionid={updateConfiguration.VersionId}&os={SystemInformation.OperatingSystemName}"); // Only for calling it - if (!string.IsNullOrEmpty(response)) - throw new StatisticsException(string.Format( - _lp.StatisticsScriptExceptionText, response)); - } - catch (Exception ex) - { - OnStatisticsEntryFailed(ex); - throw new StatisticsException(ex.Message); - } + var response = + new WebClient {Credentials = HttpAuthenticationCredentials}.DownloadString( + $"{updateConfiguration.UpdatePhpFileUri}?versionid={updateConfiguration.VersionId}&os={SystemInformation.OperatingSystemName}"); // Only for calling it + + if (string.IsNullOrEmpty(response)) + return; + OnStatisticsEntryFailed(new StatisticsException(string.Format( + _lp.StatisticsScriptExceptionText, response))); } } } @@ -486,10 +478,11 @@ public void DownloadPackagesAsync() TaskScheduler.Default); } -#if PROVIDE_TAP /// -/// Downloads the available update packages from the server, asynchronously. -/// -/// +#if PROVIDE_TAP + /// + /// Downloads the available update packages from the server, asynchronously. + /// + /// public async Task DownloadPackagesAsync(IProgress progress) { _downloadCancellationTokenSource?.Dispose(); @@ -497,8 +490,8 @@ public async Task DownloadPackagesAsync(IProgress GetUpdatePackageSize(config.UpdatePackageUri)) - .Where(updatePackageSize => updatePackageSize != null) - .Sum(updatePackageSize => updatePackageSize.Value); + .Where(updatePackageSize => updatePackageSize != null) + .Sum(updatePackageSize => updatePackageSize.Value); if (!Directory.Exists(_applicationUpdateDirectory)) Directory.CreateDirectory(_applicationUpdateDirectory); @@ -554,28 +547,24 @@ public async Task DownloadPackagesAsync(IProgress downloadDialog.ProgressPercentage = (int) args.Percentage; - + await UpdateManagerInstance.DownloadPackagesAsync(progressIndicator); } catch (OperationCanceledException) { return; } + catch (StatisticsException ex) + { + downloadDialog.StatisticsEntryFail(ex); + } catch (Exception ex) { downloadDialog.Fail(ex); @@ -205,7 +210,25 @@ public void ShowUserInterface() _lp.SignatureNotMatchingErrorText, PopupButtons.Ok), null); else - UpdateManagerInstance.InstallPackage(); + { + try + { + UpdateManagerInstance.InstallPackage(); + } + catch (Win32Exception ex) + { + // TODO: Localize + _context.Send(o => Popup.ShowPopup(SystemIcons.Error, "Error while starting the installer.", + ex, + PopupButtons.Ok), null); + } + catch (Exception ex) + { + _context.Send(o => Popup.ShowPopup(SystemIcons.Error, _lp.InstallerInitializingErrorCaption, + ex, + PopupButtons.Ok), null); + } + } }); } finally @@ -223,6 +246,7 @@ public void ShowUserInterface() UpdateManagerInstance.PackagesDownloadProgressChanged += downloadDialog.ProgressChanged; UpdateManagerInstance.PackagesDownloadFinished += downloadDialog.Finished; UpdateManagerInstance.PackagesDownloadFailed += downloadDialog.Failed; + UpdateManagerInstance.StatisticsEntryFailed += downloadDialog.StatisticsEntryFailed; Task.Factory.StartNew(() => { @@ -293,6 +317,7 @@ public void ShowUserInterface() _lp.SignatureNotMatchingErrorText, PopupButtons.Ok), null); else + { try { UpdateManagerInstance.InstallPackage(); @@ -310,6 +335,7 @@ public void ShowUserInterface() ex, PopupButtons.Ok), null); } + } }); } finally