diff --git a/.gitignore b/.gitignore index 463e3995..7ef7e873 100644 --- a/.gitignore +++ b/.gitignore @@ -190,3 +190,4 @@ FakesAssemblies/ # Visual Studio 6 workspace options file *.opt +.vs/ \ No newline at end of file diff --git a/.vs/config/applicationhost.config b/.vs/config/applicationhost.config deleted file mode 100644 index c2abfb48..00000000 --- a/.vs/config/applicationhost.config +++ /dev/null @@ -1,1030 +0,0 @@ - - - - - - - - -
-
-
-
-
-
-
-
- - - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
- -
-
-
-
-
-
- -
-
-
-
-
- -
-
-
- -
-
- -
-
- -
-
-
- - -
-
-
-
-
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/README.md b/README.md index dc5f4b10..84e4f96a 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@ # nUpdate - .NET Update Solution -[![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/) +[![Release](https://img.shields.io/badge/release-v/pseminardemo/-blue.svg)](https://github.com/ProgTrade/nUpdate/releases) +[![NuGet](https://img.shields.io/badge/nuget%20nUpdate.ProvideTAP-v3.2-red.svg)](https://www.nuget.org/packages/nUpdate.ProvideTAP/) +[![NuGet](https://img.shields.io/badge/nuget%20nUpdate.WithoutTAP-v3.2-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.8 +PM> Install-Package nUpdate.ProvideTAP -Version 3.2 ``` 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.8 +PM> Install-Package nUpdate.WithoutTAP -Version 3.2 ``` ## Web diff --git a/nUpdate.Administration/Core/Application/UpdateProject.cs b/nUpdate.Administration/Core/Application/UpdateProject.cs index bfeb2412..685380df 100644 --- a/nUpdate.Administration/Core/Application/UpdateProject.cs +++ b/nUpdate.Administration/Core/Application/UpdateProject.cs @@ -5,7 +5,7 @@ using System.IO; using System.Net; using nUpdate.Administration.Core.History; -using nUpdate.Core; +using nUpdate.Internal.Core; using Starksoft.Aspen.Ftps; namespace nUpdate.Administration.Core.Application diff --git a/nUpdate.Administration/Core/Operations/Panels/FileDeleteOperationPanel.cs b/nUpdate.Administration/Core/Operations/Panels/FileDeleteOperationPanel.cs index 64977b2e..eefc8ffc 100644 --- a/nUpdate.Administration/Core/Operations/Panels/FileDeleteOperationPanel.cs +++ b/nUpdate.Administration/Core/Operations/Panels/FileDeleteOperationPanel.cs @@ -6,7 +6,7 @@ using System.Linq; using System.Windows.Forms; using nUpdate.Administration.UI.Popups; -using nUpdate.Core.Operations; +using nUpdate.Internal.Core.Operations; namespace nUpdate.Administration.Core.Operations.Panels { diff --git a/nUpdate.Administration/Core/Operations/Panels/FileRenameOperationPanel.cs b/nUpdate.Administration/Core/Operations/Panels/FileRenameOperationPanel.cs index aca4bf8e..5db4dc92 100644 --- a/nUpdate.Administration/Core/Operations/Panels/FileRenameOperationPanel.cs +++ b/nUpdate.Administration/Core/Operations/Panels/FileRenameOperationPanel.cs @@ -6,7 +6,7 @@ using System.Windows.Forms; using nUpdate.Administration.UI.Controls; using nUpdate.Administration.UI.Popups; -using nUpdate.Core.Operations; +using nUpdate.Internal.Core.Operations; namespace nUpdate.Administration.Core.Operations.Panels { diff --git a/nUpdate.Administration/Core/Operations/Panels/IOperationPanel.cs b/nUpdate.Administration/Core/Operations/Panels/IOperationPanel.cs index 82af6316..03b6de7a 100644 --- a/nUpdate.Administration/Core/Operations/Panels/IOperationPanel.cs +++ b/nUpdate.Administration/Core/Operations/Panels/IOperationPanel.cs @@ -1,6 +1,6 @@ // Author: Dominic Beger (Trade/ProgTrade) 2016 -using nUpdate.Core.Operations; +using nUpdate.Internal.Core.Operations; namespace nUpdate.Administration.Core.Operations.Panels { diff --git a/nUpdate.Administration/Core/Operations/Panels/ProcessStartOperationPanel.cs b/nUpdate.Administration/Core/Operations/Panels/ProcessStartOperationPanel.cs index 7454db65..4096eeb3 100644 --- a/nUpdate.Administration/Core/Operations/Panels/ProcessStartOperationPanel.cs +++ b/nUpdate.Administration/Core/Operations/Panels/ProcessStartOperationPanel.cs @@ -4,7 +4,7 @@ using System.Drawing; using System.Windows.Forms; using nUpdate.Administration.UI.Popups; -using nUpdate.Core.Operations; +using nUpdate.Internal.Core.Operations; namespace nUpdate.Administration.Core.Operations.Panels { diff --git a/nUpdate.Administration/Core/Operations/Panels/ProcessStopOperationPanel.cs b/nUpdate.Administration/Core/Operations/Panels/ProcessStopOperationPanel.cs index a67f0a8d..ce08b047 100644 --- a/nUpdate.Administration/Core/Operations/Panels/ProcessStopOperationPanel.cs +++ b/nUpdate.Administration/Core/Operations/Panels/ProcessStopOperationPanel.cs @@ -4,7 +4,7 @@ using System.Drawing; using System.Windows.Forms; using nUpdate.Administration.UI.Popups; -using nUpdate.Core.Operations; +using nUpdate.Internal.Core.Operations; namespace nUpdate.Administration.Core.Operations.Panels { diff --git a/nUpdate.Administration/Core/Operations/Panels/RegistryDeleteValueOperationPanel.cs b/nUpdate.Administration/Core/Operations/Panels/RegistryDeleteValueOperationPanel.cs index 9d3f0f6e..0ee63661 100644 --- a/nUpdate.Administration/Core/Operations/Panels/RegistryDeleteValueOperationPanel.cs +++ b/nUpdate.Administration/Core/Operations/Panels/RegistryDeleteValueOperationPanel.cs @@ -4,7 +4,7 @@ using System.ComponentModel; using System.Linq; using System.Windows.Forms; -using nUpdate.Core.Operations; +using nUpdate.Internal.Core.Operations; namespace nUpdate.Administration.Core.Operations.Panels { diff --git a/nUpdate.Administration/Core/Operations/Panels/RegistrySetValueOperationPanel.Designer.cs b/nUpdate.Administration/Core/Operations/Panels/RegistrySetValueOperationPanel.Designer.cs index c47e4679..c058b913 100644 --- a/nUpdate.Administration/Core/Operations/Panels/RegistrySetValueOperationPanel.Designer.cs +++ b/nUpdate.Administration/Core/Operations/Panels/RegistrySetValueOperationPanel.Designer.cs @@ -1,4 +1,6 @@ -namespace nUpdate.Administration.Core.Operations.Panels +using nUpdate.Internal.UI.Controls; + +namespace nUpdate.Administration.Core.Operations.Panels { partial class RegistrySetValueOperationPanel { @@ -48,7 +50,7 @@ private void InitializeComponent() this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.label4 = new System.Windows.Forms.Label(); this.nameTextBox = new nUpdate.Administration.UI.Controls.CueTextBox(); - this.line1 = new nUpdate.UI.Controls.Line(); + this.line1 = new Line(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.SuspendLayout(); // @@ -224,7 +226,7 @@ private void InitializeComponent() // // line1 // - this.line1.LineAlignment = nUpdate.UI.Controls.Line.Alignment.Horizontal; + this.line1.LineAlignment = Line.Alignment.Horizontal; this.line1.Location = new System.Drawing.Point(2, 41); this.line1.Name = "line1"; this.line1.Size = new System.Drawing.Size(455, 13); @@ -285,6 +287,6 @@ private void InitializeComponent() private System.Windows.Forms.ColumnHeader columnHeader3; private System.Windows.Forms.Label label4; private UI.Controls.CueTextBox nameTextBox; - private nUpdate.UI.Controls.Line line1; + private Line line1; } } diff --git a/nUpdate.Administration/Core/Operations/Panels/RegistrySetValueOperationPanel.cs b/nUpdate.Administration/Core/Operations/Panels/RegistrySetValueOperationPanel.cs index 16bdb311..36aa2d7f 100644 --- a/nUpdate.Administration/Core/Operations/Panels/RegistrySetValueOperationPanel.cs +++ b/nUpdate.Administration/Core/Operations/Panels/RegistrySetValueOperationPanel.cs @@ -5,7 +5,7 @@ using System.Linq; using System.Windows.Forms; using Microsoft.Win32; -using nUpdate.Core.Operations; +using nUpdate.Internal.Core.Operations; namespace nUpdate.Administration.Core.Operations.Panels { diff --git a/nUpdate.Administration/Core/Operations/Panels/RegistrySubKeyCreateOperationPanel.cs b/nUpdate.Administration/Core/Operations/Panels/RegistrySubKeyCreateOperationPanel.cs index 87b8b50e..a3556081 100644 --- a/nUpdate.Administration/Core/Operations/Panels/RegistrySubKeyCreateOperationPanel.cs +++ b/nUpdate.Administration/Core/Operations/Panels/RegistrySubKeyCreateOperationPanel.cs @@ -4,7 +4,7 @@ using System.ComponentModel; using System.Linq; using System.Windows.Forms; -using nUpdate.Core.Operations; +using nUpdate.Internal.Core.Operations; namespace nUpdate.Administration.Core.Operations.Panels { diff --git a/nUpdate.Administration/Core/Operations/Panels/RegistrySubKeyDeleteOperationPanel.cs b/nUpdate.Administration/Core/Operations/Panels/RegistrySubKeyDeleteOperationPanel.cs index 7482a190..358e8c39 100644 --- a/nUpdate.Administration/Core/Operations/Panels/RegistrySubKeyDeleteOperationPanel.cs +++ b/nUpdate.Administration/Core/Operations/Panels/RegistrySubKeyDeleteOperationPanel.cs @@ -4,7 +4,7 @@ using System.ComponentModel; using System.Linq; using System.Windows.Forms; -using nUpdate.Core.Operations; +using nUpdate.Internal.Core.Operations; namespace nUpdate.Administration.Core.Operations.Panels { diff --git a/nUpdate.Administration/Core/Operations/Panels/ScriptExecuteOperationPanel.cs b/nUpdate.Administration/Core/Operations/Panels/ScriptExecuteOperationPanel.cs index ab4cd761..590449e4 100644 --- a/nUpdate.Administration/Core/Operations/Panels/ScriptExecuteOperationPanel.cs +++ b/nUpdate.Administration/Core/Operations/Panels/ScriptExecuteOperationPanel.cs @@ -10,7 +10,7 @@ using System.Windows.Forms; using FastColoredTextBoxNS; using nUpdate.Administration.UI.Popups; -using nUpdate.Core.Operations; +using nUpdate.Internal.Core.Operations; namespace nUpdate.Administration.Core.Operations.Panels { diff --git a/nUpdate.Administration/Core/Operations/Panels/ServiceStartOperationPanel.cs b/nUpdate.Administration/Core/Operations/Panels/ServiceStartOperationPanel.cs index 148759dd..3ad02f94 100644 --- a/nUpdate.Administration/Core/Operations/Panels/ServiceStartOperationPanel.cs +++ b/nUpdate.Administration/Core/Operations/Panels/ServiceStartOperationPanel.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Windows.Forms; -using nUpdate.Core.Operations; +using nUpdate.Internal.Core.Operations; namespace nUpdate.Administration.Core.Operations.Panels { diff --git a/nUpdate.Administration/Core/Operations/Panels/ServiceStopOperationPanel.cs b/nUpdate.Administration/Core/Operations/Panels/ServiceStopOperationPanel.cs index e7f52d90..236f0254 100644 --- a/nUpdate.Administration/Core/Operations/Panels/ServiceStopOperationPanel.cs +++ b/nUpdate.Administration/Core/Operations/Panels/ServiceStopOperationPanel.cs @@ -1,7 +1,7 @@ // Author: Dominic Beger (Trade/ProgTrade) 2016 using System.Windows.Forms; -using nUpdate.Core.Operations; +using nUpdate.Internal.Core.Operations; namespace nUpdate.Administration.Core.Operations.Panels { diff --git a/nUpdate.Administration/Core/ProjectConfiguration.cs b/nUpdate.Administration/Core/ProjectConfiguration.cs index 1c478094..0cab27d1 100644 --- a/nUpdate.Administration/Core/ProjectConfiguration.cs +++ b/nUpdate.Administration/Core/ProjectConfiguration.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; -using nUpdate.Core; +using nUpdate.Internal.Core; namespace nUpdate.Administration.Core { diff --git a/nUpdate.Administration/Program.cs b/nUpdate.Administration/Program.cs index 9314e4b6..8e9cf400 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.8"; + public static string VersionString => "nUpdate Administration v3.2.0"; 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 ffa22ec9..eb028065 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.8.0")] -[assembly: AssemblyFileVersion("3.1.8.0")] +[assembly: AssemblyVersion("3.2.0.0")] +[assembly: AssemblyFileVersion("3.2.0.0")] [assembly: NeutralResourcesLanguage("")] \ No newline at end of file diff --git a/nUpdate.Administration/UI/Dialogs/CredentialsDialog.Designer.cs b/nUpdate.Administration/UI/Dialogs/CredentialsDialog.Designer.cs index ec3a7cab..14b1d881 100644 --- a/nUpdate.Administration/UI/Dialogs/CredentialsDialog.Designer.cs +++ b/nUpdate.Administration/UI/Dialogs/CredentialsDialog.Designer.cs @@ -1,4 +1,6 @@ -namespace nUpdate.Administration.UI.Dialogs +using nUpdate.Internal.UI.Controls; + +namespace nUpdate.Administration.UI.Dialogs { partial class CredentialsDialog { @@ -35,7 +37,7 @@ private void InitializeComponent() this.ftpPasswordLabel = new System.Windows.Forms.Label(); this.proxyPasswordLabel = new System.Windows.Forms.Label(); this.continueButton = new System.Windows.Forms.Button(); - this.controlPanel1 = new nUpdate.UI.Controls.BottomPanel(); + this.controlPanel1 = new BottomPanel(); this.cancelButton = new System.Windows.Forms.Button(); this.controlPanel1.SuspendLayout(); this.SuspendLayout(); @@ -148,7 +150,7 @@ private void InitializeComponent() #endregion - private nUpdate.UI.Controls.BottomPanel controlPanel1; + private BottomPanel controlPanel1; private System.Windows.Forms.Button continueButton; private System.Windows.Forms.Label headerLabel; private System.Windows.Forms.TextBox usernameTextBox; diff --git a/nUpdate.Administration/UI/Dialogs/DirectorySearchDialog.Designer.cs b/nUpdate.Administration/UI/Dialogs/DirectorySearchDialog.Designer.cs index 210b62ae..c04b37ae 100644 --- a/nUpdate.Administration/UI/Dialogs/DirectorySearchDialog.Designer.cs +++ b/nUpdate.Administration/UI/Dialogs/DirectorySearchDialog.Designer.cs @@ -1,4 +1,6 @@ using System.Windows.Forms; +using nUpdate.Internal.UI.Controls; + namespace nUpdate.Administration.UI.Dialogs { partial class DirectorySearchDialog @@ -34,7 +36,7 @@ private void InitializeComponent() this.serverImageList = new System.Windows.Forms.ImageList(this.components); this.continueButton = new System.Windows.Forms.Button(); this.cancelButton = new System.Windows.Forms.Button(); - this.controlPanel1 = new nUpdate.UI.Controls.BottomPanel(); + this.controlPanel1 = new BottomPanel(); this.backButton = new ExplorerNavigationButton.ExplorerNavigationButton(); this.forwardButton = new ExplorerNavigationButton.ExplorerNavigationButton(); this.serverDataTreeView = new nUpdate.Administration.UI.Controls.ExplorerTreeView(); @@ -256,7 +258,7 @@ private void InitializeComponent() #endregion - private nUpdate.UI.Controls.BottomPanel controlPanel1; + private BottomPanel controlPanel1; private System.Windows.Forms.Button cancelButton; private System.Windows.Forms.Button continueButton; private System.Windows.Forms.ImageList serverImageList; diff --git a/nUpdate.Administration/UI/Dialogs/FeedbackDialog.Designer.cs b/nUpdate.Administration/UI/Dialogs/FeedbackDialog.Designer.cs index 9ecc2e60..f168e962 100644 --- a/nUpdate.Administration/UI/Dialogs/FeedbackDialog.Designer.cs +++ b/nUpdate.Administration/UI/Dialogs/FeedbackDialog.Designer.cs @@ -1,4 +1,5 @@ using nUpdate.Administration.UI.Controls; +using nUpdate.Internal.UI.Controls; namespace nUpdate.Administration.UI.Dialogs { @@ -36,7 +37,7 @@ private void InitializeComponent() this.nameTextBox = new nUpdate.Administration.UI.Controls.CueTextBox(); this.emailTextBox = new nUpdate.Administration.UI.Controls.CueTextBox(); this.contentTextBox = new nUpdate.Administration.UI.Controls.CueTextBox(); - this.cpnl = new nUpdate.UI.Controls.BottomPanel(); + this.cpnl = new BottomPanel(); this.headerLabel = new System.Windows.Forms.Label(); this.cpnl.SuspendLayout(); this.SuspendLayout(); @@ -142,7 +143,7 @@ private void InitializeComponent() #endregion - private nUpdate.UI.Controls.BottomPanel cpnl; + private BottomPanel cpnl; private System.Windows.Forms.Button cancelButton; private System.Windows.Forms.Button sendButton; private CueTextBox contentTextBox; diff --git a/nUpdate.Administration/UI/Dialogs/FeedbackDialog.cs b/nUpdate.Administration/UI/Dialogs/FeedbackDialog.cs index 34ecb606..dc5e5bba 100644 --- a/nUpdate.Administration/UI/Dialogs/FeedbackDialog.cs +++ b/nUpdate.Administration/UI/Dialogs/FeedbackDialog.cs @@ -5,7 +5,7 @@ using System.Net.Mail; using nUpdate.Administration.Core; using nUpdate.Administration.UI.Popups; -using nUpdate.Core; +using nUpdate.Internal.Core; namespace nUpdate.Administration.UI.Dialogs { diff --git a/nUpdate.Administration/UI/Dialogs/FtpAssemblyInputDialog.Designer.cs b/nUpdate.Administration/UI/Dialogs/FtpAssemblyInputDialog.Designer.cs index c574df28..7058e582 100644 --- a/nUpdate.Administration/UI/Dialogs/FtpAssemblyInputDialog.Designer.cs +++ b/nUpdate.Administration/UI/Dialogs/FtpAssemblyInputDialog.Designer.cs @@ -1,4 +1,6 @@ -namespace nUpdate.Administration.UI.Dialogs +using nUpdate.Internal.UI.Controls; + +namespace nUpdate.Administration.UI.Dialogs { partial class FtpAssemblyInputDialog { @@ -31,7 +33,7 @@ private void InitializeComponent() System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FtpAssemblyInputDialog)); this.assemblyFilePathTextBox = new nUpdate.Administration.UI.Controls.ButtonTextBox(); this.label1 = new System.Windows.Forms.Label(); - this.bottomPanel1 = new nUpdate.UI.Controls.BottomPanel(); + this.bottomPanel1 = new BottomPanel(); this.cancelButton = new System.Windows.Forms.Button(); this.continueButton = new System.Windows.Forms.Button(); this.bottomPanel1.SuspendLayout(); @@ -113,7 +115,7 @@ private void InitializeComponent() private Controls.ButtonTextBox assemblyFilePathTextBox; private System.Windows.Forms.Label label1; - private nUpdate.UI.Controls.BottomPanel bottomPanel1; + private BottomPanel bottomPanel1; private System.Windows.Forms.Button cancelButton; private System.Windows.Forms.Button continueButton; } diff --git a/nUpdate.Administration/UI/Dialogs/InfoDialog.Designer.cs b/nUpdate.Administration/UI/Dialogs/InfoDialog.Designer.cs index ecde6b49..8899aa15 100644 --- a/nUpdate.Administration/UI/Dialogs/InfoDialog.Designer.cs +++ b/nUpdate.Administration/UI/Dialogs/InfoDialog.Designer.cs @@ -1,4 +1,6 @@ -namespace nUpdate.Administration.UI.Dialogs +using nUpdate.Internal.UI.Controls; + +namespace nUpdate.Administration.UI.Dialogs { partial class InfoDialog { @@ -31,9 +33,9 @@ private void InitializeComponent() System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(InfoDialog)); this.closeButton = new System.Windows.Forms.Button(); this.donatePictureBox = new System.Windows.Forms.PictureBox(); - this.line1 = new nUpdate.UI.Controls.Line(); + this.line1 = new Line(); this.label13 = new System.Windows.Forms.Label(); - this.controlPanel1 = new nUpdate.UI.Controls.BottomPanel(); + this.controlPanel1 = new BottomPanel(); this.websiteLinkLabel = new System.Windows.Forms.LinkLabel(); this.label12 = new System.Windows.Forms.Label(); this.ll_github = new System.Windows.Forms.LinkLabel(); @@ -50,7 +52,7 @@ private void InitializeComponent() this.copyrightLabel = new System.Windows.Forms.Label(); this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.headerLabel = new System.Windows.Forms.Label(); - this.line2 = new nUpdate.UI.Controls.Line(); + this.line2 = new Line(); this.label1 = new System.Windows.Forms.Label(); this.dotNetZipLinkLabel = new System.Windows.Forms.LinkLabel(); this.jsonNetLinkLabel = new System.Windows.Forms.LinkLabel(); @@ -90,7 +92,7 @@ private void InitializeComponent() // // line1 // - this.line1.LineAlignment = nUpdate.UI.Controls.Line.Alignment.Horizontal; + this.line1.LineAlignment = Line.Alignment.Horizontal; this.line1.Location = new System.Drawing.Point(17, 157); this.line1.Name = "line1"; this.line1.Size = new System.Drawing.Size(401, 14); @@ -105,7 +107,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.8"; + this.label13.Text = "v3.2.0"; // // controlPanel1 // @@ -287,7 +289,7 @@ private void InitializeComponent() // // line2 // - this.line2.LineAlignment = nUpdate.UI.Controls.Line.Alignment.Horizontal; + this.line2.LineAlignment = Line.Alignment.Horizontal; this.line2.Location = new System.Drawing.Point(21, 273); this.line2.Name = "line2"; this.line2.Size = new System.Drawing.Size(397, 10); @@ -484,12 +486,12 @@ private void InitializeComponent() private System.Windows.Forms.LinkLabel ll_github; private System.Windows.Forms.Label label12; private System.Windows.Forms.LinkLabel websiteLinkLabel; - private nUpdate.UI.Controls.BottomPanel controlPanel1; + private BottomPanel controlPanel1; private System.Windows.Forms.Button closeButton; private System.Windows.Forms.Label label13; - private nUpdate.UI.Controls.Line line1; + private Line line1; private System.Windows.Forms.PictureBox donatePictureBox; - private nUpdate.UI.Controls.Line line2; + private Line line2; private System.Windows.Forms.Label label1; private System.Windows.Forms.LinkLabel dotNetZipLinkLabel; private System.Windows.Forms.LinkLabel jsonNetLinkLabel; diff --git a/nUpdate.Administration/UI/Dialogs/JsonEditorDialog.Designer.cs b/nUpdate.Administration/UI/Dialogs/JsonEditorDialog.Designer.cs index cd0a7e4f..62caa24a 100644 --- a/nUpdate.Administration/UI/Dialogs/JsonEditorDialog.Designer.cs +++ b/nUpdate.Administration/UI/Dialogs/JsonEditorDialog.Designer.cs @@ -1,4 +1,6 @@ -namespace nUpdate.Administration.UI.Dialogs +using nUpdate.Internal.UI.Controls; + +namespace nUpdate.Administration.UI.Dialogs { partial class JsonEditorDialog { @@ -34,7 +36,7 @@ private void InitializeComponent() this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(JsonEditorDialog)); this.codeTextBox = new FastColoredTextBoxNS.FastColoredTextBox(); - this.controlPanel1 = new nUpdate.UI.Controls.BottomPanel(); + this.controlPanel1 = new BottomPanel(); this.cancelButton = new System.Windows.Forms.Button(); this.saveLanguageButton = new System.Windows.Forms.Button(); ((System.ComponentModel.ISupportInitialize)(this.codeTextBox)).BeginInit(); @@ -140,7 +142,7 @@ private void InitializeComponent() #endregion private FastColoredTextBoxNS.FastColoredTextBox codeTextBox; - private nUpdate.UI.Controls.BottomPanel controlPanel1; + private BottomPanel controlPanel1; private System.Windows.Forms.Button saveLanguageButton; private System.Windows.Forms.Button cancelButton; diff --git a/nUpdate.Administration/UI/Dialogs/MainDialog.Designer.cs b/nUpdate.Administration/UI/Dialogs/MainDialog.Designer.cs index ecbeac16..f226da83 100644 --- a/nUpdate.Administration/UI/Dialogs/MainDialog.Designer.cs +++ b/nUpdate.Administration/UI/Dialogs/MainDialog.Designer.cs @@ -1,4 +1,6 @@ -namespace nUpdate.Administration.UI.Dialogs +using nUpdate.Internal.UI.Controls; + +namespace nUpdate.Administration.UI.Dialogs { partial class MainDialog { @@ -39,7 +41,7 @@ private void InitializeComponent() this.sectionsListView = new nUpdate.Administration.UI.Controls.ExplorerListView(); this.itemName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.itemDescription = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.line1 = new nUpdate.UI.Controls.Line(); + this.line1 = new Line(); this.pictureBox1 = new System.Windows.Forms.PictureBox(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.SuspendLayout(); @@ -105,7 +107,7 @@ private void InitializeComponent() // // line1 // - this.line1.LineAlignment = nUpdate.UI.Controls.Line.Alignment.Horizontal; + this.line1.LineAlignment = Line.Alignment.Horizontal; resources.ApplyResources(this.line1, "line1"); this.line1.Name = "line1"; // @@ -142,7 +144,7 @@ private void InitializeComponent() private System.Windows.Forms.PictureBox pictureBox1; private System.Windows.Forms.Label headerLabel; private System.Windows.Forms.Label infoLabel; - private nUpdate.UI.Controls.Line line1; + private Line line1; private UI.Controls.ExplorerListView sectionsListView; private System.Windows.Forms.ColumnHeader itemName; private System.Windows.Forms.ColumnHeader itemDescription; diff --git a/nUpdate.Administration/UI/Dialogs/MainDialog.cs b/nUpdate.Administration/UI/Dialogs/MainDialog.cs index 8dcf17f3..1785345a 100644 --- a/nUpdate.Administration/UI/Dialogs/MainDialog.cs +++ b/nUpdate.Administration/UI/Dialogs/MainDialog.cs @@ -12,7 +12,7 @@ using nUpdate.Administration.Core.Localization; using nUpdate.Administration.Properties; using nUpdate.Administration.UI.Popups; -using nUpdate.Core; +using nUpdate.Internal.Core; namespace nUpdate.Administration.UI.Dialogs { diff --git a/nUpdate.Administration/UI/Dialogs/NewProjectDialog.Designer.cs b/nUpdate.Administration/UI/Dialogs/NewProjectDialog.Designer.cs index 7dbf5549..f52ac658 100644 --- a/nUpdate.Administration/UI/Dialogs/NewProjectDialog.Designer.cs +++ b/nUpdate.Administration/UI/Dialogs/NewProjectDialog.Designer.cs @@ -1,4 +1,5 @@ using nUpdate.Administration.UI.Controls; +using nUpdate.Internal.UI.Controls; namespace nUpdate.Administration.UI.Dialogs { @@ -34,7 +35,7 @@ private void InitializeComponent() System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(NewProjectDialog)); this.continueButton = new System.Windows.Forms.Button(); this.cancelButton = new System.Windows.Forms.Button(); - this.controlPanel1 = new nUpdate.UI.Controls.BottomPanel(); + this.controlPanel1 = new BottomPanel(); this.backButton = new System.Windows.Forms.Button(); this.informationCategoriesTabControl = new nUpdate.Administration.UI.Controls.TablessTabControl(); this.keyPairTabPage = new System.Windows.Forms.TabPage(); @@ -71,7 +72,7 @@ private void InitializeComponent() this.ftpImportButton = new System.Windows.Forms.Button(); this.securityInfoButton = new System.Windows.Forms.Button(); this.searchOnServerButton = new System.Windows.Forms.Button(); - this.line1 = new nUpdate.UI.Controls.Line(); + this.line1 = new Line(); this.ftpProtocolComboBox = new System.Windows.Forms.ComboBox(); this.ftpProtocolLabel = new System.Windows.Forms.Label(); this.ftpModeComboBox = new System.Windows.Forms.ComboBox(); @@ -88,7 +89,7 @@ private void InitializeComponent() this.ftpHostLabel = new System.Windows.Forms.Label(); this.ftpHeaderLabel = new System.Windows.Forms.Label(); this.statisticsServerTabPage = new System.Windows.Forms.TabPage(); - this.line2 = new nUpdate.UI.Controls.Line(); + this.line2 = new Line(); this.selectServerButton = new System.Windows.Forms.Button(); this.label2 = new System.Windows.Forms.Label(); this.doNotUseStatisticsServerButton = new System.Windows.Forms.RadioButton(); @@ -420,7 +421,7 @@ private void InitializeComponent() // // line1 // - this.line1.LineAlignment = nUpdate.UI.Controls.Line.Alignment.Horizontal; + this.line1.LineAlignment = Line.Alignment.Horizontal; resources.ApplyResources(this.line1, "line1"); this.line1.Name = "line1"; // @@ -537,7 +538,7 @@ private void InitializeComponent() // line2 // this.line2.BackColor = System.Drawing.SystemColors.Window; - this.line2.LineAlignment = nUpdate.UI.Controls.Line.Alignment.Horizontal; + this.line2.LineAlignment = Line.Alignment.Horizontal; resources.ApplyResources(this.line2, "line2"); this.line2.Name = "line2"; // @@ -768,7 +769,7 @@ private void InitializeComponent() private System.Windows.Forms.Label ftpHostLabel; private System.Windows.Forms.Label ftpHeaderLabel; private CueTextBox nameTextBox; - private nUpdate.UI.Controls.BottomPanel controlPanel1; + private BottomPanel controlPanel1; private System.Windows.Forms.TextBox ftpPasswordTextBox; private CueTextBox ftpUserTextBox; private CueTextBox ftpHostTextBox; @@ -807,7 +808,7 @@ private void InitializeComponent() private System.Windows.Forms.TextBox sqlPasswordTextBox; private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label3; - private nUpdate.UI.Controls.Line line2; + private Line line2; private System.Windows.Forms.Button selectServerButton; private System.Windows.Forms.Label databaseNameLabel; private System.Windows.Forms.Button continueButton; @@ -826,7 +827,7 @@ private void InitializeComponent() private System.Windows.Forms.Label label5; private System.Windows.Forms.ComboBox ipVersionComboBox; private System.Windows.Forms.Label ipVersionLabel; - private nUpdate.UI.Controls.Line line1; + private Line line1; private System.Windows.Forms.TabPage httpAuthenticationTabPage; private System.Windows.Forms.Panel httpAuthenticationPanel; private CueTextBox httpAuthenticationPasswordTextBox; diff --git a/nUpdate.Administration/UI/Dialogs/NewProjectDialog.cs b/nUpdate.Administration/UI/Dialogs/NewProjectDialog.cs index d8412b08..331e3705 100644 --- a/nUpdate.Administration/UI/Dialogs/NewProjectDialog.cs +++ b/nUpdate.Administration/UI/Dialogs/NewProjectDialog.cs @@ -16,7 +16,7 @@ using nUpdate.Administration.Core.Application; using nUpdate.Administration.Properties; using nUpdate.Administration.UI.Popups; -using nUpdate.Core; +using nUpdate.Internal.Core; using Starksoft.Aspen.Ftps; namespace nUpdate.Administration.UI.Dialogs diff --git a/nUpdate.Administration/UI/Dialogs/PackageAddDialog.Designer.cs b/nUpdate.Administration/UI/Dialogs/PackageAddDialog.Designer.cs index e796150b..81e74a6c 100644 --- a/nUpdate.Administration/UI/Dialogs/PackageAddDialog.Designer.cs +++ b/nUpdate.Administration/UI/Dialogs/PackageAddDialog.Designer.cs @@ -1,4 +1,6 @@ -namespace nUpdate.Administration.UI.Dialogs +using nUpdate.Internal.UI.Controls; + +namespace nUpdate.Administration.UI.Dialogs { partial class PackageAddDialog { @@ -90,18 +92,18 @@ private void InitializeComponent() this.loadingLabel = new System.Windows.Forms.Label(); this.createButton = new System.Windows.Forms.Button(); this.cancelButton = new System.Windows.Forms.Button(); - this.controlPanel1 = new nUpdate.UI.Controls.BottomPanel(); + this.controlPanel1 = new BottomPanel(); this.categoryTabControl = new nUpdate.Administration.UI.Controls.TablessTabControl(); this.generalTabPage = new System.Windows.Forms.TabPage(); this.generalPanel = new System.Windows.Forms.Panel(); this.includeIntoStatisticsInfoLabel = new System.Windows.Forms.Label(); this.includeIntoStatisticsCheckBox = new System.Windows.Forms.CheckBox(); - this.line2 = new nUpdate.UI.Controls.Line(); + this.line2 = new Line(); this.developmentBuildNumericUpDown = new System.Windows.Forms.NumericUpDown(); this.necessaryUpdateInfoLabel = new System.Windows.Forms.Label(); this.necessaryUpdateCheckBox = new System.Windows.Forms.CheckBox(); - this.line3 = new nUpdate.UI.Controls.Line(); - this.line1 = new nUpdate.UI.Controls.Line(); + this.line3 = new Line(); + this.line1 = new Line(); this.architectureInfoLabel = new System.Windows.Forms.Label(); this.buildNumericUpDown = new System.Windows.Forms.NumericUpDown(); this.descriptionLabel = new System.Windows.Forms.Label(); @@ -402,7 +404,7 @@ private void InitializeComponent() // line2 // this.line2.BackColor = System.Drawing.SystemColors.Window; - this.line2.LineAlignment = nUpdate.UI.Controls.Line.Alignment.Horizontal; + this.line2.LineAlignment = Line.Alignment.Horizontal; this.line2.Location = new System.Drawing.Point(9, 323); this.line2.Name = "line2"; this.line2.Size = new System.Drawing.Size(437, 10); @@ -442,7 +444,7 @@ private void InitializeComponent() // line3 // this.line3.BackColor = System.Drawing.SystemColors.Window; - this.line3.LineAlignment = nUpdate.UI.Controls.Line.Alignment.Horizontal; + this.line3.LineAlignment = Line.Alignment.Horizontal; this.line3.Location = new System.Drawing.Point(10, 231); this.line3.Name = "line3"; this.line3.Size = new System.Drawing.Size(437, 10); @@ -452,7 +454,7 @@ private void InitializeComponent() // line1 // this.line1.BackColor = System.Drawing.SystemColors.Window; - this.line1.LineAlignment = nUpdate.UI.Controls.Line.Alignment.Horizontal; + this.line1.LineAlignment = Line.Alignment.Horizontal; this.line1.Location = new System.Drawing.Point(7, 153); this.line1.Name = "line1"; this.line1.Size = new System.Drawing.Size(437, 14); @@ -1414,18 +1416,18 @@ private void InitializeComponent() private System.Windows.Forms.Panel loadingPanel; private System.Windows.Forms.Label loadingLabel; private System.Windows.Forms.PictureBox pictureBox1; - private nUpdate.UI.Controls.Line line1; + private Line line1; private Controls.ExplorerTreeView categoryTreeView; private System.Windows.Forms.ImageList categoryImageList; private System.Windows.Forms.Label necessaryUpdateInfoLabel; private System.Windows.Forms.CheckBox necessaryUpdateCheckBox = new System.Windows.Forms.CheckBox(); - private nUpdate.UI.Controls.Line line3; + private Line line3; private Controls.ExplorerListView operationsListView; private System.Windows.Forms.ColumnHeader itemName; private System.Windows.Forms.ColumnHeader Description; private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; private Controls.ExplorerTreeView filesDataTreeView; - private nUpdate.UI.Controls.BottomPanel controlPanel1; + private BottomPanel controlPanel1; private System.Windows.Forms.NumericUpDown developmentBuildNumericUpDown; private Controls.TablessTabControl categoryTabControl; private System.Windows.Forms.TabPage generalTabPage; @@ -1435,7 +1437,7 @@ private void InitializeComponent() private System.Windows.Forms.TabPage replaceFilesTabPage; private System.Windows.Forms.Label includeIntoStatisticsInfoLabel; private System.Windows.Forms.CheckBox includeIntoStatisticsCheckBox; - private nUpdate.UI.Controls.Line line2; + private Line line2; private System.Windows.Forms.ToolStripComboBox changelogLanguageComboBox; private System.Windows.Forms.ToolStripSeparator toolStripSeparator3; private Controls.TablessTabControl changelogContentTabControl; diff --git a/nUpdate.Administration/UI/Dialogs/PackageAddDialog.cs b/nUpdate.Administration/UI/Dialogs/PackageAddDialog.cs index b7ecdbb6..d26b891c 100644 --- a/nUpdate.Administration/UI/Dialogs/PackageAddDialog.cs +++ b/nUpdate.Administration/UI/Dialogs/PackageAddDialog.cs @@ -23,7 +23,8 @@ using nUpdate.Administration.UI.Controls; using nUpdate.Administration.UI.Popups; using nUpdate.Core; -using nUpdate.Core.Operations; +using nUpdate.Internal.Core; +using nUpdate.Internal.Core.Operations; using nUpdate.Updating; using Starksoft.Aspen.Ftps; using TransferProgressEventArgs = nUpdate.Administration.TransferInterface.TransferProgressEventArgs; @@ -951,7 +952,11 @@ private void CreateFilesNode(DirectoryInfo directoryInfo, TreeNode directoryNode fileNode = new TreeNode(file.Name, 1, 1) {Tag = file.FullName}; else { - if (filesImageList.Images.ContainsKey(file.Extension)) + if (string.IsNullOrEmpty(file.Extension)) + { + fileNode = new TreeNode(file.Name, 1, 1) { Tag = file.FullName }; + } + else if (filesImageList.Images.ContainsKey(file.Extension)) { var index = filesImageList.Images.IndexOfKey(file.Extension); fileNode = new TreeNode(file.Name, index, index) {Tag = file.FullName}; @@ -1020,7 +1025,11 @@ private void addFilesButton_Click(object sender, EventArgs e) { TreeNode fileNode; var fileInfo = new FileInfo(fileName); - if (filesImageList.Images.ContainsKey(fileInfo.Extension)) + if (string.IsNullOrEmpty(fileInfo.Extension)) + { + fileNode = new TreeNode(fileInfo.Name, 1, 1) { Tag = fileInfo.FullName }; + } + else if (filesImageList.Images.ContainsKey(fileInfo.Extension)) { var index = filesImageList.Images.IndexOfKey(fileInfo.Extension); fileNode = new TreeNode(fileInfo.Name, index, index) {Tag = fileInfo.FullName}; diff --git a/nUpdate.Administration/UI/Dialogs/PackageEditDialog.Designer.cs b/nUpdate.Administration/UI/Dialogs/PackageEditDialog.Designer.cs index da98440f..8c3630b4 100644 --- a/nUpdate.Administration/UI/Dialogs/PackageEditDialog.Designer.cs +++ b/nUpdate.Administration/UI/Dialogs/PackageEditDialog.Designer.cs @@ -1,4 +1,6 @@ -namespace nUpdate.Administration.UI.Dialogs +using nUpdate.Internal.UI.Controls; + +namespace nUpdate.Administration.UI.Dialogs { partial class PackageEditDialog { @@ -85,18 +87,18 @@ private void InitializeComponent() this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.loadingLabel = new System.Windows.Forms.Label(); this.categoryTreeView = new nUpdate.Administration.UI.Controls.ExplorerTreeView(); - this.controlPanel1 = new nUpdate.UI.Controls.BottomPanel(); + this.controlPanel1 = new BottomPanel(); this.categoryTabControl = new nUpdate.Administration.UI.Controls.TablessTabControl(); this.generalTabPage = new System.Windows.Forms.TabPage(); this.generalPanel = new System.Windows.Forms.Panel(); this.includeIntoStatisticsInfoLabel = new System.Windows.Forms.Label(); this.includeIntoStatisticsCheckBox = new System.Windows.Forms.CheckBox(); - this.line2 = new nUpdate.UI.Controls.Line(); + this.line2 = new Line(); this.developmentBuildNumericUpDown = new System.Windows.Forms.NumericUpDown(); this.necessaryUpdateInfoLabel = new System.Windows.Forms.Label(); this.necessaryUpdateCheckBox = new System.Windows.Forms.CheckBox(); - this.line3 = new nUpdate.UI.Controls.Line(); - this.line1 = new nUpdate.UI.Controls.Line(); + this.line3 = new Line(); + this.line1 = new Line(); this.architectureInfoLabel = new System.Windows.Forms.Label(); this.buildNumericUpDown = new System.Windows.Forms.NumericUpDown(); this.descriptionLabel = new System.Windows.Forms.Label(); @@ -402,7 +404,7 @@ private void InitializeComponent() // line2 // this.line2.BackColor = System.Drawing.SystemColors.Window; - this.line2.LineAlignment = nUpdate.UI.Controls.Line.Alignment.Horizontal; + this.line2.LineAlignment = Line.Alignment.Horizontal; this.line2.Location = new System.Drawing.Point(9, 262); this.line2.Name = "line2"; this.line2.Size = new System.Drawing.Size(437, 10); @@ -441,7 +443,7 @@ private void InitializeComponent() // line3 // this.line3.BackColor = System.Drawing.SystemColors.Window; - this.line3.LineAlignment = nUpdate.UI.Controls.Line.Alignment.Horizontal; + this.line3.LineAlignment = Line.Alignment.Horizontal; this.line3.Location = new System.Drawing.Point(10, 170); this.line3.Name = "line3"; this.line3.Size = new System.Drawing.Size(437, 10); @@ -451,7 +453,7 @@ private void InitializeComponent() // line1 // this.line1.BackColor = System.Drawing.SystemColors.Window; - this.line1.LineAlignment = nUpdate.UI.Controls.Line.Alignment.Horizontal; + this.line1.LineAlignment = Line.Alignment.Horizontal; this.line1.Location = new System.Drawing.Point(7, 92); this.line1.Name = "line1"; this.line1.Size = new System.Drawing.Size(437, 14); @@ -1129,13 +1131,13 @@ private void InitializeComponent() private Controls.ExplorerTreeView categoryTreeView; private System.Windows.Forms.Label includeIntoStatisticsInfoLabel; private System.Windows.Forms.CheckBox includeIntoStatisticsCheckBox; - private nUpdate.UI.Controls.Line line2; + private Line line2; private System.Windows.Forms.Panel generalPanel; private System.Windows.Forms.NumericUpDown developmentBuildNumericUpDown; private System.Windows.Forms.Label necessaryUpdateInfoLabel; private System.Windows.Forms.CheckBox necessaryUpdateCheckBox; - private nUpdate.UI.Controls.Line line3; - private nUpdate.UI.Controls.Line line1; + private Line line3; + private Line line1; private System.Windows.Forms.Label architectureInfoLabel; private System.Windows.Forms.NumericUpDown buildNumericUpDown; private System.Windows.Forms.Label descriptionLabel; @@ -1149,7 +1151,7 @@ private void InitializeComponent() private System.Windows.Forms.Label devStageLabel; private System.Windows.Forms.NumericUpDown minorNumericUpDown; private System.Windows.Forms.TabPage generalTabPage; - private nUpdate.UI.Controls.BottomPanel controlPanel1; + private BottomPanel controlPanel1; private System.Windows.Forms.Button saveButton; private System.Windows.Forms.Button cancelButton; private Controls.TablessTabControl categoryTabControl; diff --git a/nUpdate.Administration/UI/Dialogs/PackageEditDialog.cs b/nUpdate.Administration/UI/Dialogs/PackageEditDialog.cs index 07c80907..dbc37fea 100644 --- a/nUpdate.Administration/UI/Dialogs/PackageEditDialog.cs +++ b/nUpdate.Administration/UI/Dialogs/PackageEditDialog.cs @@ -18,8 +18,8 @@ using nUpdate.Administration.Core.Operations.Panels; using nUpdate.Administration.UI.Controls; using nUpdate.Administration.UI.Popups; -using nUpdate.Core; -using nUpdate.Core.Operations; +using nUpdate.Internal.Core; +using nUpdate.Internal.Core.Operations; using nUpdate.Updating; using Newtonsoft.Json.Linq; using Starksoft.Aspen.Ftps; diff --git a/nUpdate.Administration/UI/Dialogs/PackagesToAffectDialog.Designer.cs b/nUpdate.Administration/UI/Dialogs/PackagesToAffectDialog.Designer.cs index 10eb0bd9..f75124c3 100644 --- a/nUpdate.Administration/UI/Dialogs/PackagesToAffectDialog.Designer.cs +++ b/nUpdate.Administration/UI/Dialogs/PackagesToAffectDialog.Designer.cs @@ -1,4 +1,6 @@ -namespace nUpdate.Administration.UI.Dialogs +using nUpdate.Internal.UI.Controls; + +namespace nUpdate.Administration.UI.Dialogs { partial class PackagesToAffectDialog { @@ -30,7 +32,7 @@ private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PackagesToAffectDialog)); this.checkedListBox1 = new System.Windows.Forms.CheckedListBox(); - this.controlPanel1 = new nUpdate.UI.Controls.BottomPanel(); + this.controlPanel1 = new BottomPanel(); this.cancelButton = new System.Windows.Forms.Button(); this.continueButton = new System.Windows.Forms.Button(); this.label4 = new System.Windows.Forms.Label(); @@ -132,7 +134,7 @@ private void InitializeComponent() #endregion private System.Windows.Forms.CheckedListBox checkedListBox1; - private nUpdate.UI.Controls.BottomPanel controlPanel1; + private BottomPanel controlPanel1; private System.Windows.Forms.Button continueButton; private System.Windows.Forms.Button cancelButton; private System.Windows.Forms.Label label4; diff --git a/nUpdate.Administration/UI/Dialogs/PreferencesDialog.Designer.cs b/nUpdate.Administration/UI/Dialogs/PreferencesDialog.Designer.cs index 923808b2..24baa48a 100644 --- a/nUpdate.Administration/UI/Dialogs/PreferencesDialog.Designer.cs +++ b/nUpdate.Administration/UI/Dialogs/PreferencesDialog.Designer.cs @@ -1,4 +1,6 @@ -namespace nUpdate.Administration.UI.Dialogs +using nUpdate.Internal.UI.Controls; + +namespace nUpdate.Administration.UI.Dialogs { partial class PreferencesDialog { @@ -32,7 +34,7 @@ private void InitializeComponent() this.label1 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); this.saveButton = new System.Windows.Forms.Button(); - this.controlPanel1 = new nUpdate.UI.Controls.BottomPanel(); + this.controlPanel1 = new BottomPanel(); this.cancelButton = new System.Windows.Forms.Button(); this.languagesComboBox = new System.Windows.Forms.ComboBox(); this.label7 = new System.Windows.Forms.Label(); @@ -145,7 +147,7 @@ private void InitializeComponent() private System.Windows.Forms.Label label1; private System.Windows.Forms.Button saveButton; - private nUpdate.UI.Controls.BottomPanel controlPanel1; + private BottomPanel controlPanel1; private System.Windows.Forms.Label label3; private System.Windows.Forms.Button cancelButton; private System.Windows.Forms.ComboBox languagesComboBox; diff --git a/nUpdate.Administration/UI/Dialogs/PreferencesDialog.cs b/nUpdate.Administration/UI/Dialogs/PreferencesDialog.cs index 5946f78d..7268f481 100644 --- a/nUpdate.Administration/UI/Dialogs/PreferencesDialog.cs +++ b/nUpdate.Administration/UI/Dialogs/PreferencesDialog.cs @@ -12,7 +12,7 @@ using nUpdate.Administration.Core.Localization; using nUpdate.Administration.Properties; using nUpdate.Administration.UI.Popups; -using nUpdate.Core; +using nUpdate.Internal.Core; namespace nUpdate.Administration.UI.Dialogs { diff --git a/nUpdate.Administration/UI/Dialogs/ProjectDialog.Designer.cs b/nUpdate.Administration/UI/Dialogs/ProjectDialog.Designer.cs index 0b76058b..0d41ed52 100644 --- a/nUpdate.Administration/UI/Dialogs/ProjectDialog.Designer.cs +++ b/nUpdate.Administration/UI/Dialogs/ProjectDialog.Designer.cs @@ -1,4 +1,5 @@ using nUpdate.Administration.UI.Controls; +using nUpdate.Internal.UI.Controls; namespace nUpdate.Administration.UI.Dialogs { @@ -45,7 +46,7 @@ private void InitializeComponent() this.assemblyPathTextBox = new nUpdate.Administration.UI.Controls.ButtonTextBox(); this.label8 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); - this.line5 = new nUpdate.UI.Controls.Line(); + this.line5 = new Line(); this.label3 = new System.Windows.Forms.Label(); this.stepTwoLabel = new System.Windows.Forms.Label(); this.programmingLanguageComboBox = new System.Windows.Forms.ComboBox(); @@ -55,7 +56,7 @@ private void InitializeComponent() this.assumeHeader = new System.Windows.Forms.Label(); this.checkingUrlPictureBox = new System.Windows.Forms.PictureBox(); this.tickPictureBox = new System.Windows.Forms.PictureBox(); - this.line3 = new nUpdate.UI.Controls.Line(); + this.line3 = new Line(); this.newestPackageLabel = new System.Windows.Forms.Label(); this.amountLabel = new System.Windows.Forms.Label(); this.checkUpdateConfigurationLinkLabel = new System.Windows.Forms.LinkLabel(); @@ -70,15 +71,15 @@ private void InitializeComponent() this.projectIdLabel = new System.Windows.Forms.Label(); this.publicKeyTextBox = new System.Windows.Forms.TextBox(); this.publicKeyLabel = new System.Windows.Forms.Label(); - this.line2 = new nUpdate.UI.Controls.Line(); + this.line2 = new Line(); this.projectDataHeader = new System.Windows.Forms.Label(); - this.line1 = new nUpdate.UI.Controls.Line(); + this.line1 = new Line(); this.ftpDirectoryLabel = new System.Windows.Forms.Label(); this.ftpHostLabel = new System.Windows.Forms.Label(); this.overviewHeader = new System.Windows.Forms.Label(); this.newestPackageReleasedLabel = new System.Windows.Forms.Label(); this.releasedPackagesAmountLabel = new System.Windows.Forms.Label(); - this.line4 = new nUpdate.UI.Controls.Line(); + this.line4 = new Line(); this.panel2 = new System.Windows.Forms.Panel(); this.loadFromAssemblyRadioButton = new System.Windows.Forms.RadioButton(); this.enterVersionManuallyRadioButton = new System.Windows.Forms.RadioButton(); @@ -107,7 +108,7 @@ private void InitializeComponent() this.searchTextBox = new nUpdate.Administration.UI.Controls.CueTextBox(); this.statisticsTabPage = new System.Windows.Forms.TabPage(); this.updateStatisticsButton = new System.Windows.Forms.Button(); - this.controlPanel1 = new nUpdate.UI.Controls.BottomPanel(); + this.controlPanel1 = new BottomPanel(); this.lastUpdatedLabel = new System.Windows.Forms.Label(); this.chartPanel = new System.Windows.Forms.Panel(); this.gatheringStatisticsPictureBox = new System.Windows.Forms.PictureBox(); @@ -247,7 +248,7 @@ private void InitializeComponent() // line5 // this.line5.BackColor = System.Drawing.Color.White; - this.line5.LineAlignment = nUpdate.UI.Controls.Line.Alignment.Horizontal; + this.line5.LineAlignment = Line.Alignment.Horizontal; this.line5.Location = new System.Drawing.Point(132, 368); this.line5.Name = "line5"; this.line5.Size = new System.Drawing.Size(398, 13); @@ -350,7 +351,7 @@ private void InitializeComponent() // line3 // this.line3.BackColor = System.Drawing.Color.White; - this.line3.LineAlignment = nUpdate.UI.Controls.Line.Alignment.Horizontal; + this.line3.LineAlignment = Line.Alignment.Horizontal; this.line3.Location = new System.Drawing.Point(25, 167); this.line3.Name = "line3"; this.line3.Size = new System.Drawing.Size(505, 10); @@ -496,7 +497,7 @@ private void InitializeComponent() // line2 // this.line2.BackColor = System.Drawing.Color.White; - this.line2.LineAlignment = nUpdate.UI.Controls.Line.Alignment.Horizontal; + this.line2.LineAlignment = Line.Alignment.Horizontal; this.line2.Location = new System.Drawing.Point(110, 270); this.line2.Name = "line2"; this.line2.Size = new System.Drawing.Size(420, 13); @@ -518,7 +519,7 @@ private void InitializeComponent() // line1 // this.line1.BackColor = System.Drawing.Color.White; - this.line1.LineAlignment = nUpdate.UI.Controls.Line.Alignment.Horizontal; + this.line1.LineAlignment = Line.Alignment.Horizontal; this.line1.Location = new System.Drawing.Point(144, 24); this.line1.Name = "line1"; this.line1.Size = new System.Drawing.Size(386, 13); @@ -577,7 +578,7 @@ private void InitializeComponent() // line4 // this.line4.BackColor = System.Drawing.Color.White; - this.line4.LineAlignment = nUpdate.UI.Controls.Line.Alignment.Horizontal; + this.line4.LineAlignment = Line.Alignment.Horizontal; this.line4.Location = new System.Drawing.Point(101, 532); this.line4.Name = "line4"; this.line4.Size = new System.Drawing.Size(432, 10); @@ -1085,9 +1086,9 @@ private void InitializeComponent() private System.Windows.Forms.Label projectIdLabel; private System.Windows.Forms.TextBox publicKeyTextBox; private System.Windows.Forms.Label publicKeyLabel; - private nUpdate.UI.Controls.Line line2; + private Line line2; private System.Windows.Forms.Label projectDataHeader; - private nUpdate.UI.Controls.Line line1; + private Line line1; private System.Windows.Forms.Label ftpDirectoryLabel; private System.Windows.Forms.Label ftpHostLabel; private System.Windows.Forms.Label overviewHeader; @@ -1099,11 +1100,11 @@ private void InitializeComponent() private System.Windows.Forms.Label newestPackageLabel; private System.Windows.Forms.Label amountLabel; private System.Windows.Forms.LinkLabel checkUpdateConfigurationLinkLabel; - private nUpdate.UI.Controls.Line line3; + private Line line3; private System.Windows.Forms.PictureBox tickPictureBox; private System.Windows.Forms.PictureBox checkingUrlPictureBox; private System.Windows.Forms.Label assumeHeader; - private nUpdate.UI.Controls.Line line4; + private Line line4; private System.Windows.Forms.Button copySourceButton; private System.Windows.Forms.Label stepTwoLabel; private System.Windows.Forms.ComboBox programmingLanguageComboBox; @@ -1115,7 +1116,7 @@ private void InitializeComponent() private System.Windows.Forms.ColumnHeader columnHeader3; private System.Windows.Forms.ColumnHeader columnHeader4; private System.Windows.Forms.Label label2; - private nUpdate.UI.Controls.Line line5; + private Line line5; private System.Windows.Forms.Label label3; private System.Windows.Forms.TabPage statisticsTabPage; private System.Windows.Forms.PictureBox pictureBox2; @@ -1136,7 +1137,7 @@ private void InitializeComponent() private System.Windows.Forms.ToolTip updateStatisticsButtonToolTip; private System.Windows.Forms.PictureBox gatheringStatisticsPictureBox; private System.Windows.Forms.Panel chartPanel; - private nUpdate.UI.Controls.BottomPanel controlPanel1; + private BottomPanel controlPanel1; private System.Windows.Forms.Label lastUpdatedLabel; private ButtonTextBox assemblyPathTextBox; private System.Windows.Forms.ContextMenuStrip packagesContextMenuStrip; diff --git a/nUpdate.Administration/UI/Dialogs/ProjectDialog.cs b/nUpdate.Administration/UI/Dialogs/ProjectDialog.cs index d594cea0..89205a03 100644 --- a/nUpdate.Administration/UI/Dialogs/ProjectDialog.cs +++ b/nUpdate.Administration/UI/Dialogs/ProjectDialog.cs @@ -22,6 +22,7 @@ using nUpdate.Administration.UI.Controls; using nUpdate.Administration.UI.Popups; using nUpdate.Core; +using nUpdate.Internal.Core; using nUpdate.Updating; namespace nUpdate.Administration.UI.Dialogs diff --git a/nUpdate.Administration/UI/Dialogs/ProjectEditDialog.Designer.cs b/nUpdate.Administration/UI/Dialogs/ProjectEditDialog.Designer.cs index 52b6a339..2719f3b2 100644 --- a/nUpdate.Administration/UI/Dialogs/ProjectEditDialog.Designer.cs +++ b/nUpdate.Administration/UI/Dialogs/ProjectEditDialog.Designer.cs @@ -1,4 +1,6 @@ -namespace nUpdate.Administration.UI.Dialogs +using nUpdate.Internal.UI.Controls; + +namespace nUpdate.Administration.UI.Dialogs { partial class ProjectEditDialog { @@ -38,7 +40,7 @@ private void InitializeComponent() this.loadingPanel = new System.Windows.Forms.Panel(); this.loadingLabel = new System.Windows.Forms.Label(); this.pictureBox2 = new System.Windows.Forms.PictureBox(); - this.controlPanel1 = new nUpdate.UI.Controls.BottomPanel(); + this.controlPanel1 = new BottomPanel(); this.backButton = new System.Windows.Forms.Button(); this.tablessTabControl1 = new nUpdate.Administration.UI.Controls.TablessTabControl(); this.generalTabPage = new System.Windows.Forms.TabPage(); @@ -69,7 +71,7 @@ private void InitializeComponent() this.ftpImportButton = new System.Windows.Forms.Button(); this.securityInfoButton = new System.Windows.Forms.Button(); this.searchOnServerButton = new System.Windows.Forms.Button(); - this.line1 = new nUpdate.UI.Controls.Line(); + this.line1 = new Line(); this.ftpProtocolComboBox = new System.Windows.Forms.ComboBox(); this.ftpProtocolLabel = new System.Windows.Forms.Label(); this.ftpModeComboBox = new System.Windows.Forms.ComboBox(); @@ -86,7 +88,7 @@ private void InitializeComponent() this.ftpHostLabel = new System.Windows.Forms.Label(); this.ftpHeaderLabel = new System.Windows.Forms.Label(); this.statisticsServerTabPage = new System.Windows.Forms.TabPage(); - this.line2 = new nUpdate.UI.Controls.Line(); + this.line2 = new Line(); this.selectServerButton = new System.Windows.Forms.Button(); this.label2 = new System.Windows.Forms.Label(); this.doNotUseStatisticsServerButton = new System.Windows.Forms.RadioButton(); @@ -537,7 +539,7 @@ private void InitializeComponent() // // line1 // - this.line1.LineAlignment = nUpdate.UI.Controls.Line.Alignment.Horizontal; + this.line1.LineAlignment = Line.Alignment.Horizontal; this.line1.Location = new System.Drawing.Point(14, 136); this.line1.Name = "line1"; this.line1.Size = new System.Drawing.Size(419, 10); @@ -721,7 +723,7 @@ private void InitializeComponent() // line2 // this.line2.BackColor = System.Drawing.SystemColors.Window; - this.line2.LineAlignment = nUpdate.UI.Controls.Line.Alignment.Horizontal; + this.line2.LineAlignment = Line.Alignment.Horizontal; this.line2.Location = new System.Drawing.Point(5, 117); this.line2.Name = "line2"; this.line2.Size = new System.Drawing.Size(481, 10); @@ -1015,7 +1017,7 @@ private void InitializeComponent() #endregion - private nUpdate.UI.Controls.Line line2; + private Line line2; private System.Windows.Forms.Button selectServerButton; private System.Windows.Forms.Label label2; private System.Windows.Forms.RadioButton doNotUseStatisticsServerButton; @@ -1029,7 +1031,7 @@ private void InitializeComponent() private System.Windows.Forms.Label label8; private System.Windows.Forms.Button securityInfoButton; private System.Windows.Forms.Button searchOnServerButton; - private nUpdate.UI.Controls.Line line1; + private Line line1; private System.Windows.Forms.ComboBox ftpProtocolComboBox; private System.Windows.Forms.Label ftpProtocolLabel; private System.Windows.Forms.ComboBox ftpModeComboBox; @@ -1055,7 +1057,7 @@ private void InitializeComponent() private Controls.CueTextBox ftpPortTextBox; private System.Windows.Forms.Button cancelButton; private System.Windows.Forms.Button continueButton; - private nUpdate.UI.Controls.BottomPanel controlPanel1; + private BottomPanel controlPanel1; private System.Windows.Forms.Button backButton; private Controls.TablessTabControl tablessTabControl1; private System.Windows.Forms.TabPage generalTabPage; diff --git a/nUpdate.Administration/UI/Dialogs/ProjectEditDialog.cs b/nUpdate.Administration/UI/Dialogs/ProjectEditDialog.cs index eb9b8bb8..5f08ef61 100644 --- a/nUpdate.Administration/UI/Dialogs/ProjectEditDialog.cs +++ b/nUpdate.Administration/UI/Dialogs/ProjectEditDialog.cs @@ -16,7 +16,7 @@ using nUpdate.Administration.Core.Application; using nUpdate.Administration.Properties; using nUpdate.Administration.UI.Popups; -using nUpdate.Core; +using nUpdate.Internal.Core; using nUpdate.Updating; using Starksoft.Aspen.Ftps; @@ -994,6 +994,10 @@ await Task.Factory.StartNew(() => _useStatistics = useStatisticsServerRadioButton.Checked; })); + bool synchronizeData = Popup.ShowPopup(this, SystemIcons.Question, "Automatically synchronize data?", + "nUpdate Administration may encounter differences between your remote configuration and the local changes that you've made. Should nUpdate Administration try to synchronize these changes or do you want to keep them locally? Choose the latter option, if you just fixed a problem with the data (e.g. a typo due to which nUpdate Administration could not connect to the server).", + PopupButtons.YesNo) == DialogResult.Yes; + if (Project.Name != _name) { Invoke( @@ -1054,30 +1058,39 @@ await Task.Factory.StartNew(() => if (Project.Path != _localPath) { - Invoke( - new Action( - () => - loadingLabel.Text = "Moving project file...")); - - try - { - File.Move(Project.Path, _localPath); - _projectFileMoved = true; - } - catch (IOException ex) + if (Popup.ShowPopup(this, SystemIcons.Question, "Automatically move the project file?", + "nUpdate Administration noticed that the path of the local project file has changed. Should nUpdate Administration move it to this new location? Choose \"No\", if the file is already located at the path that you specified.", + PopupButtons.YesNo) == DialogResult.Yes) { Invoke( new Action( () => - Popup.ShowPopup(this, SystemIcons.Error, "Error while moving the project file.", ex, - PopupButtons.Ok))); - Reset(); - return; + loadingLabel.Text = "Moving project file...")); + + try + { + File.Move(Project.Path, _localPath); + _projectFileMoved = true; + } + catch (IOException ex) + { + Invoke( + new Action( + () => + Popup.ShowPopup(this, SystemIcons.Error, "Error while moving the project file.", + ex, + PopupButtons.Ok))); + Reset(); + return; + } } } if (Project.UpdateUrl != _updateUrl) { + if (!synchronizeData) + goto saveData; + if (_newUpdateConfiguration == null && !LoadConfiguration()) { Reset(); diff --git a/nUpdate.Administration/UI/Dialogs/ProjectImportDialog.Designer.cs b/nUpdate.Administration/UI/Dialogs/ProjectImportDialog.Designer.cs index bd5a76b6..fc5843ce 100644 --- a/nUpdate.Administration/UI/Dialogs/ProjectImportDialog.Designer.cs +++ b/nUpdate.Administration/UI/Dialogs/ProjectImportDialog.Designer.cs @@ -1,4 +1,6 @@ -namespace nUpdate.Administration.UI.Dialogs +using nUpdate.Internal.UI.Controls; + +namespace nUpdate.Administration.UI.Dialogs { partial class ProjectImportDialog { @@ -29,7 +31,7 @@ protected override void Dispose(bool disposing) private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ProjectImportDialog)); - this.controlPanel1 = new nUpdate.UI.Controls.BottomPanel(); + this.controlPanel1 = new BottomPanel(); this.cancelButton = new System.Windows.Forms.Button(); this.backButton = new System.Windows.Forms.Button(); this.continueButton = new System.Windows.Forms.Button(); @@ -385,7 +387,7 @@ private void InitializeComponent() #endregion - private nUpdate.UI.Controls.BottomPanel controlPanel1; + private BottomPanel controlPanel1; private System.Windows.Forms.Button backButton; private System.Windows.Forms.Button continueButton; private System.Windows.Forms.Label headerLabel; diff --git a/nUpdate.Administration/UI/Dialogs/ProjectImportDialog.cs b/nUpdate.Administration/UI/Dialogs/ProjectImportDialog.cs index 9f774477..7fe24ab2 100644 --- a/nUpdate.Administration/UI/Dialogs/ProjectImportDialog.cs +++ b/nUpdate.Administration/UI/Dialogs/ProjectImportDialog.cs @@ -10,7 +10,7 @@ using nUpdate.Administration.Core; using nUpdate.Administration.Core.Application; using nUpdate.Administration.UI.Popups; -using nUpdate.Core; +using nUpdate.Internal.Core; using nUpdate.Updating; namespace nUpdate.Administration.UI.Dialogs diff --git a/nUpdate.Administration/UI/Dialogs/ProjectRemovalDialog.Designer.cs b/nUpdate.Administration/UI/Dialogs/ProjectRemovalDialog.Designer.cs index 030278eb..58bda17b 100644 --- a/nUpdate.Administration/UI/Dialogs/ProjectRemovalDialog.Designer.cs +++ b/nUpdate.Administration/UI/Dialogs/ProjectRemovalDialog.Designer.cs @@ -1,4 +1,6 @@ -namespace nUpdate.Administration.UI.Dialogs +using nUpdate.Internal.UI.Controls; + +namespace nUpdate.Administration.UI.Dialogs { partial class ProjectRemovalDialog { @@ -30,7 +32,7 @@ private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ProjectRemovalDialog)); this.projectsTreeView = new nUpdate.Administration.UI.Controls.ExplorerTreeView(); - this.line1 = new nUpdate.UI.Controls.Line(); + this.line1 = new Line(); this.label2 = new System.Windows.Forms.Label(); this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.noProjectsLabel = new System.Windows.Forms.Label(); @@ -51,7 +53,7 @@ private void InitializeComponent() // // line1 // - this.line1.LineAlignment = nUpdate.UI.Controls.Line.Alignment.Horizontal; + this.line1.LineAlignment = Line.Alignment.Horizontal; this.line1.Location = new System.Drawing.Point(-6, 225); this.line1.Name = "line1"; this.line1.Size = new System.Drawing.Size(401, 10); @@ -116,7 +118,7 @@ private void InitializeComponent() #endregion private Controls.ExplorerTreeView projectsTreeView; - private nUpdate.UI.Controls.Line line1; + private Line line1; private System.Windows.Forms.Label label2; private System.Windows.Forms.PictureBox pictureBox1; private System.Windows.Forms.Label noProjectsLabel; diff --git a/nUpdate.Administration/UI/Dialogs/ProjectRemovalDialog.cs b/nUpdate.Administration/UI/Dialogs/ProjectRemovalDialog.cs index f89d5d38..1731e5a6 100644 --- a/nUpdate.Administration/UI/Dialogs/ProjectRemovalDialog.cs +++ b/nUpdate.Administration/UI/Dialogs/ProjectRemovalDialog.cs @@ -9,7 +9,7 @@ using System.Windows.Forms; using nUpdate.Administration.Core; using nUpdate.Administration.UI.Popups; -using nUpdate.Core; +using nUpdate.Internal.Core; namespace nUpdate.Administration.UI.Dialogs { diff --git a/nUpdate.Administration/UI/Dialogs/StatisticsServerAddDialog.Designer.cs b/nUpdate.Administration/UI/Dialogs/StatisticsServerAddDialog.Designer.cs index ecb5c8b5..c302d82b 100644 --- a/nUpdate.Administration/UI/Dialogs/StatisticsServerAddDialog.Designer.cs +++ b/nUpdate.Administration/UI/Dialogs/StatisticsServerAddDialog.Designer.cs @@ -1,4 +1,5 @@ using nUpdate.Administration.UI.Controls; +using nUpdate.Internal.UI.Controls; namespace nUpdate.Administration.UI.Dialogs { @@ -33,7 +34,7 @@ private void InitializeComponent() System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(StatisticsServerAddDialog)); this.saveButton = new System.Windows.Forms.Button(); this.cancelButton = new System.Windows.Forms.Button(); - this.controlPanel1 = new nUpdate.UI.Controls.BottomPanel(); + this.controlPanel1 = new BottomPanel(); this.label4 = new System.Windows.Forms.Label(); this.usernameTextBox = new System.Windows.Forms.TextBox(); this.label5 = new System.Windows.Forms.Label(); @@ -41,7 +42,7 @@ private void InitializeComponent() this.label12 = new System.Windows.Forms.Label(); this.hostTextBox = new nUpdate.Administration.UI.Controls.CueTextBox(); this.databaseTextBox = new nUpdate.Administration.UI.Controls.CueTextBox(); - this.line2 = new nUpdate.UI.Controls.Line(); + this.line2 = new Line(); this.label1 = new System.Windows.Forms.Label(); this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.controlPanel1.SuspendLayout(); @@ -149,7 +150,7 @@ private void InitializeComponent() // line2 // this.line2.BackColor = System.Drawing.SystemColors.Window; - this.line2.LineAlignment = nUpdate.UI.Controls.Line.Alignment.Horizontal; + this.line2.LineAlignment = Line.Alignment.Horizontal; this.line2.Location = new System.Drawing.Point(10, 105); this.line2.Name = "line2"; this.line2.Size = new System.Drawing.Size(319, 10); @@ -211,7 +212,7 @@ private void InitializeComponent() #endregion - private nUpdate.UI.Controls.BottomPanel controlPanel1; + private BottomPanel controlPanel1; private System.Windows.Forms.Button cancelButton; private System.Windows.Forms.Button saveButton; private System.Windows.Forms.Label label4; @@ -221,7 +222,7 @@ private void InitializeComponent() private System.Windows.Forms.Label label12; private CueTextBox hostTextBox; private CueTextBox databaseTextBox; - private nUpdate.UI.Controls.Line line2; + private Line line2; private System.Windows.Forms.Label label1; private System.Windows.Forms.PictureBox pictureBox1; } diff --git a/nUpdate.Administration/UI/Dialogs/StatisticsServerDialog.cs b/nUpdate.Administration/UI/Dialogs/StatisticsServerDialog.cs index 4b1e3cc5..9a467f7c 100644 --- a/nUpdate.Administration/UI/Dialogs/StatisticsServerDialog.cs +++ b/nUpdate.Administration/UI/Dialogs/StatisticsServerDialog.cs @@ -9,7 +9,7 @@ using nUpdate.Administration.Core; using nUpdate.Administration.UI.Controls; using nUpdate.Administration.UI.Popups; -using nUpdate.Core; +using nUpdate.Internal.Core; namespace nUpdate.Administration.UI.Dialogs { diff --git a/nUpdate.Administration/UI/Dialogs/StatisticsServerEditDialog.Designer.cs b/nUpdate.Administration/UI/Dialogs/StatisticsServerEditDialog.Designer.cs index c0769318..f2b33d67 100644 --- a/nUpdate.Administration/UI/Dialogs/StatisticsServerEditDialog.Designer.cs +++ b/nUpdate.Administration/UI/Dialogs/StatisticsServerEditDialog.Designer.cs @@ -1,4 +1,6 @@ -namespace nUpdate.Administration.UI.Dialogs +using nUpdate.Internal.UI.Controls; + +namespace nUpdate.Administration.UI.Dialogs { partial class StatisticsServerEditDialog { @@ -32,9 +34,9 @@ private void InitializeComponent() this.cancelButton = new System.Windows.Forms.Button(); this.saveButton = new System.Windows.Forms.Button(); this.label1 = new System.Windows.Forms.Label(); - this.controlPanel1 = new nUpdate.UI.Controls.BottomPanel(); + this.controlPanel1 = new BottomPanel(); this.label4 = new System.Windows.Forms.Label(); - this.line2 = new nUpdate.UI.Controls.Line(); + this.line2 = new Line(); this.usernameTextBox = new System.Windows.Forms.TextBox(); this.databaseTextBox = new nUpdate.Administration.UI.Controls.CueTextBox(); this.label5 = new System.Windows.Forms.Label(); @@ -100,7 +102,7 @@ private void InitializeComponent() // line2 // this.line2.BackColor = System.Drawing.SystemColors.Window; - this.line2.LineAlignment = nUpdate.UI.Controls.Line.Alignment.Horizontal; + this.line2.LineAlignment = Line.Alignment.Horizontal; this.line2.Location = new System.Drawing.Point(10, 105); this.line2.Name = "line2"; this.line2.Size = new System.Drawing.Size(321, 12); @@ -212,10 +214,10 @@ private void InitializeComponent() private System.Windows.Forms.Button cancelButton; private System.Windows.Forms.Button saveButton; private System.Windows.Forms.Label label1; - private nUpdate.UI.Controls.BottomPanel controlPanel1; + private BottomPanel controlPanel1; private System.Windows.Forms.PictureBox pictureBox1; private System.Windows.Forms.Label label4; - private nUpdate.UI.Controls.Line line2; + private Line line2; private System.Windows.Forms.TextBox usernameTextBox; private Controls.CueTextBox databaseTextBox; private System.Windows.Forms.Label label5; diff --git a/nUpdate.Administration/UI/Popups/PopupDialog.Designer.cs b/nUpdate.Administration/UI/Popups/PopupDialog.Designer.cs index d36da265..7c562317 100644 --- a/nUpdate.Administration/UI/Popups/PopupDialog.Designer.cs +++ b/nUpdate.Administration/UI/Popups/PopupDialog.Designer.cs @@ -1,4 +1,6 @@ -namespace nUpdate.Administration.UI.Popups +using nUpdate.Internal.UI.Controls; + +namespace nUpdate.Administration.UI.Popups { partial class PopupDialog { @@ -33,7 +35,7 @@ private void InitializeComponent() this.contextMenu = new System.Windows.Forms.ContextMenuStrip(this.components); this.copyEntireMessageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.headerLabel = new System.Windows.Forms.Label(); - this.controlPanel1 = new nUpdate.UI.Controls.BottomPanel(); + this.controlPanel1 = new BottomPanel(); this.noButton = new System.Windows.Forms.Button(); this.closeButton = new System.Windows.Forms.Button(); this.yesButton = new System.Windows.Forms.Button(); @@ -166,7 +168,7 @@ private void InitializeComponent() private System.Windows.Forms.PictureBox iconPictureBox; private System.Windows.Forms.Label messageLabel; private System.Windows.Forms.Label headerLabel; - private nUpdate.UI.Controls.BottomPanel controlPanel1; + private BottomPanel controlPanel1; private System.Windows.Forms.Button closeButton; private System.Windows.Forms.ContextMenuStrip contextMenu; private System.Windows.Forms.ToolStripMenuItem copyEntireMessageToolStripMenuItem; diff --git a/nUpdate.Administration/nUpdate.Administration.csproj b/nUpdate.Administration/nUpdate.Administration.csproj index 6da44193..e2f53a1c 100644 --- a/nUpdate.Administration/nUpdate.Administration.csproj +++ b/nUpdate.Administration/nUpdate.Administration.csproj @@ -614,9 +614,13 @@ - + + {b60f0aee-f710-44ff-9c64-7bc4fcbd1bf5} + nUpdate.ProvideTAP + + {EFB71D69-EBF9-4F60-B776-DE443730A3DD} - nUpdate + nUpdate.Internal diff --git a/nUpdate.Client.GuiInterface/Properties/AssemblyInfo.cs b/nUpdate.Client.GuiInterface/Properties/AssemblyInfo.cs index b3e8e4fe..519c050e 100644 --- a/nUpdate.Client.GuiInterface/Properties/AssemblyInfo.cs +++ b/nUpdate.Client.GuiInterface/Properties/AssemblyInfo.cs @@ -37,5 +37,5 @@ // übernehmen, indem Sie "*" eingeben: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("3.1.0.0")] -[assembly: AssemblyFileVersion("3.1.8.0")] +[assembly: AssemblyVersion("3.2.0.0")] +[assembly: AssemblyFileVersion("3.2.0.0")] diff --git a/nUpdate/Core/Architecture.cs b/nUpdate.Internal/Core/Architecture.cs similarity index 80% rename from nUpdate/Core/Architecture.cs rename to nUpdate.Internal/Core/Architecture.cs index 3ff4cd45..6365f6a9 100644 --- a/nUpdate/Core/Architecture.cs +++ b/nUpdate.Internal/Core/Architecture.cs @@ -1,6 +1,6 @@ // Copyright © Dominic Beger 2017 -namespace nUpdate.Core +namespace nUpdate.Internal.Core { public enum Architecture { diff --git a/nUpdate/Core/ConnectionManager.cs b/nUpdate.Internal/Core/ConnectionManager.cs similarity index 79% rename from nUpdate/Core/ConnectionManager.cs rename to nUpdate.Internal/Core/ConnectionManager.cs index 7740a4a0..714cee39 100644 --- a/nUpdate/Core/ConnectionManager.cs +++ b/nUpdate.Internal/Core/ConnectionManager.cs @@ -1,8 +1,8 @@ // Copyright © Dominic Beger 2017 -using nUpdate.Core.Win32; +using nUpdate.Internal.Core.Win32; -namespace nUpdate.Core +namespace nUpdate.Internal.Core { public class ConnectionManager { diff --git a/nUpdate/Core/DevelopmentalStage.cs b/nUpdate.Internal/Core/DevelopmentalStage.cs similarity index 83% rename from nUpdate/Core/DevelopmentalStage.cs rename to nUpdate.Internal/Core/DevelopmentalStage.cs index f80a8ad9..dfbcb737 100644 --- a/nUpdate/Core/DevelopmentalStage.cs +++ b/nUpdate.Internal/Core/DevelopmentalStage.cs @@ -1,6 +1,6 @@ // Copyright © Dominic Beger 2017 -namespace nUpdate.Core +namespace nUpdate.Internal.Core { public enum DevelopmentalStage { diff --git a/nUpdate/Core/IDeepCopy.cs b/nUpdate.Internal/Core/IDeepCopy.cs similarity index 90% rename from nUpdate/Core/IDeepCopy.cs rename to nUpdate.Internal/Core/IDeepCopy.cs index bc54cc7d..b4300c01 100644 --- a/nUpdate/Core/IDeepCopy.cs +++ b/nUpdate.Internal/Core/IDeepCopy.cs @@ -1,6 +1,6 @@ // Copyright © Dominic Beger 2017 -namespace nUpdate.Core +namespace nUpdate.Internal.Core { /// /// Offers methods for cloning/copying class instances. diff --git a/nUpdate/Core/IconHelper.cs b/nUpdate.Internal/Core/IconHelper.cs similarity index 96% rename from nUpdate/Core/IconHelper.cs rename to nUpdate.Internal/Core/IconHelper.cs index 03f6c272..a3765fcd 100644 --- a/nUpdate/Core/IconHelper.cs +++ b/nUpdate.Internal/Core/IconHelper.cs @@ -5,9 +5,9 @@ using System.IO; using System.Runtime.InteropServices; using System.Text; -using nUpdate.Core.Win32; +using nUpdate.Internal.Core.Win32; -namespace nUpdate.Core +namespace nUpdate.Internal.Core { internal class IconHelper { diff --git a/nUpdate/Core/Localization/LocalizationHelper.cs b/nUpdate.Internal/Core/Localization/LocalizationHelper.cs similarity index 95% rename from nUpdate/Core/Localization/LocalizationHelper.cs rename to nUpdate.Internal/Core/Localization/LocalizationHelper.cs index 3fa92ec0..40805b76 100644 --- a/nUpdate/Core/Localization/LocalizationHelper.cs +++ b/nUpdate.Internal/Core/Localization/LocalizationHelper.cs @@ -9,7 +9,7 @@ using System.Reflection; using System.Text; -namespace nUpdate.Core.Localization +namespace nUpdate.Internal.Core.Localization { internal class LocalizationHelper { @@ -22,7 +22,7 @@ internal class LocalizationHelper internal static LocalizationProperties GetLocalizationProperties(CultureInfo cultureInfo, Dictionary localizationFilePaths) { - var resourceName = $"nUpdate.Core.Localization.{cultureInfo.Name}.json"; + var resourceName = $"nUpdate.Internal.Core.Localization.{cultureInfo.Name}.json"; using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceName)) { if (stream != null) diff --git a/nUpdate/Core/Localization/LocalizationProperties.cs b/nUpdate.Internal/Core/Localization/LocalizationProperties.cs similarity index 99% rename from nUpdate/Core/Localization/LocalizationProperties.cs rename to nUpdate.Internal/Core/Localization/LocalizationProperties.cs index e3416634..44a1414e 100644 --- a/nUpdate/Core/Localization/LocalizationProperties.cs +++ b/nUpdate.Internal/Core/Localization/LocalizationProperties.cs @@ -1,6 +1,6 @@ // Copyright © Dominic Beger 2017 -namespace nUpdate.Core.Localization +namespace nUpdate.Internal.Core.Localization { public class LocalizationProperties { diff --git a/nUpdate/Core/Localization/de-AT.json b/nUpdate.Internal/Core/Localization/de-AT.json similarity index 99% rename from nUpdate/Core/Localization/de-AT.json rename to nUpdate.Internal/Core/Localization/de-AT.json index 73e65228..4c710ec8 100644 --- a/nUpdate/Core/Localization/de-AT.json +++ b/nUpdate.Internal/Core/Localization/de-AT.json @@ -43,7 +43,7 @@ "PackageNotFoundErrorText": "Das Updatepaket konnte nicht gefunden werden.", "InvalidSignatureErrorCaption": "Ungültige Signatur.", "InvalidSignatureErrorText": "Die Signatur des Updatepakets ist keine gültige RSA-Signatur.", - "SignatureNotMatchingErrorText": "nUpdate wird die Installation abbrechen und das Paket löschen.", + "SignatureNotMatchingErrorText": "nUpdate wird die Installation abbrechen und die Pakete löschen.", "SearchProcessRunningExceptionText": "Es wird bereits eine Updatesuche ausgeführt.", "DownloadingProcessRunningExceptionText": "Es wird bereits ein aktiver Download ausgeführt.", "NetworkConnectionExceptionText": "Es ist keine Internetverbindung verfügbar.", diff --git a/nUpdate/Core/Localization/de-CH.json b/nUpdate.Internal/Core/Localization/de-CH.json similarity index 99% rename from nUpdate/Core/Localization/de-CH.json rename to nUpdate.Internal/Core/Localization/de-CH.json index 73e65228..4c710ec8 100644 --- a/nUpdate/Core/Localization/de-CH.json +++ b/nUpdate.Internal/Core/Localization/de-CH.json @@ -43,7 +43,7 @@ "PackageNotFoundErrorText": "Das Updatepaket konnte nicht gefunden werden.", "InvalidSignatureErrorCaption": "Ungültige Signatur.", "InvalidSignatureErrorText": "Die Signatur des Updatepakets ist keine gültige RSA-Signatur.", - "SignatureNotMatchingErrorText": "nUpdate wird die Installation abbrechen und das Paket löschen.", + "SignatureNotMatchingErrorText": "nUpdate wird die Installation abbrechen und die Pakete löschen.", "SearchProcessRunningExceptionText": "Es wird bereits eine Updatesuche ausgeführt.", "DownloadingProcessRunningExceptionText": "Es wird bereits ein aktiver Download ausgeführt.", "NetworkConnectionExceptionText": "Es ist keine Internetverbindung verfügbar.", diff --git a/nUpdate/Core/Localization/de-DE.json b/nUpdate.Internal/Core/Localization/de-DE.json similarity index 99% rename from nUpdate/Core/Localization/de-DE.json rename to nUpdate.Internal/Core/Localization/de-DE.json index 296174c4..48ecc37a 100644 --- a/nUpdate/Core/Localization/de-DE.json +++ b/nUpdate.Internal/Core/Localization/de-DE.json @@ -43,7 +43,7 @@ "PackageNotFoundErrorText": "Das Updatepaket konnte nicht gefunden werden.", "InvalidSignatureErrorCaption": "Ungültige Signatur.", "InvalidSignatureErrorText": "Die Signatur des Updatepakets ist keine gültige RSA-Signatur.", - "SignatureNotMatchingErrorText": "nUpdate wird die Installation abbrechen und das Paket löschen.", + "SignatureNotMatchingErrorText": "nUpdate wird die Installation abbrechen und die Pakete löschen.", "SearchProcessRunningExceptionText": "Es wird bereits eine Updatesuche ausgeführt.", "DownloadingProcessRunningExceptionText": "Es wird bereits ein aktiver Download ausgeführt.", "NetworkConnectionExceptionText": "Es ist keine Internetverbindung verfügbar.", diff --git a/nUpdate/Core/Localization/en.json b/nUpdate.Internal/Core/Localization/en.json similarity index 100% rename from nUpdate/Core/Localization/en.json rename to nUpdate.Internal/Core/Localization/en.json diff --git a/nUpdate/Core/Localization/zh-CN.json b/nUpdate.Internal/Core/Localization/zh-CN.json similarity index 100% rename from nUpdate/Core/Localization/zh-CN.json rename to nUpdate.Internal/Core/Localization/zh-CN.json diff --git a/nUpdate/Core/Operations/Operation.cs b/nUpdate.Internal/Core/Operations/Operation.cs similarity index 99% rename from nUpdate/Core/Operations/Operation.cs rename to nUpdate.Internal/Core/Operations/Operation.cs index 895d1779..8d30461b 100644 --- a/nUpdate/Core/Operations/Operation.cs +++ b/nUpdate.Internal/Core/Operations/Operation.cs @@ -2,7 +2,7 @@ using System; -namespace nUpdate.Core.Operations +namespace nUpdate.Internal.Core.Operations { public class Operation { diff --git a/nUpdate/Core/Operations/OperationArea.cs b/nUpdate.Internal/Core/Operations/OperationArea.cs similarity index 93% rename from nUpdate/Core/Operations/OperationArea.cs rename to nUpdate.Internal/Core/Operations/OperationArea.cs index 71770f68..d1d47d62 100644 --- a/nUpdate/Core/Operations/OperationArea.cs +++ b/nUpdate.Internal/Core/Operations/OperationArea.cs @@ -2,7 +2,7 @@ using System.ComponentModel; -namespace nUpdate.Core.Operations +namespace nUpdate.Internal.Core.Operations { /// /// Represents the different areas in which operations can take place. diff --git a/nUpdate/Core/Operations/OperationMethod.cs b/nUpdate.Internal/Core/Operations/OperationMethod.cs similarity index 89% rename from nUpdate/Core/Operations/OperationMethod.cs rename to nUpdate.Internal/Core/Operations/OperationMethod.cs index e4721599..f376af9c 100644 --- a/nUpdate/Core/Operations/OperationMethod.cs +++ b/nUpdate.Internal/Core/Operations/OperationMethod.cs @@ -1,6 +1,6 @@ // Copyright © Dominic Beger 2017 -namespace nUpdate.Core.Operations +namespace nUpdate.Internal.Core.Operations { /// /// Represents the different methods of the operations performed in different areas. diff --git a/nUpdate/Core/RsaManager.cs b/nUpdate.Internal/Core/RsaManager.cs similarity index 99% rename from nUpdate/Core/RsaManager.cs rename to nUpdate.Internal/Core/RsaManager.cs index 7044f3fa..51e1c963 100644 --- a/nUpdate/Core/RsaManager.cs +++ b/nUpdate.Internal/Core/RsaManager.cs @@ -4,7 +4,7 @@ using System.IO; using System.Security.Cryptography; -namespace nUpdate.Core +namespace nUpdate.Internal.Core { /// /// Provides methods and properties to sign and verify data with the RSACryptoServiceProvider. diff --git a/nUpdate/Core/Serializer.cs b/nUpdate.Internal/Core/Serializer.cs similarity index 98% rename from nUpdate/Core/Serializer.cs rename to nUpdate.Internal/Core/Serializer.cs index 6ddb550b..0cf40907 100644 --- a/nUpdate/Core/Serializer.cs +++ b/nUpdate.Internal/Core/Serializer.cs @@ -4,7 +4,7 @@ using System.Text; using Newtonsoft.Json; -namespace nUpdate.Core +namespace nUpdate.Internal.Core { public class Serializer { diff --git a/nUpdate/Core/SizeHelper.cs b/nUpdate.Internal/Core/SizeHelper.cs similarity index 93% rename from nUpdate/Core/SizeHelper.cs rename to nUpdate.Internal/Core/SizeHelper.cs index 335a87f5..d4d3ae47 100644 --- a/nUpdate/Core/SizeHelper.cs +++ b/nUpdate.Internal/Core/SizeHelper.cs @@ -3,9 +3,9 @@ using System; using System.IO; using System.Text; -using nUpdate.Core.Win32; +using nUpdate.Internal.Core.Win32; -namespace nUpdate.Core +namespace nUpdate.Internal.Core { public class SizeHelper { diff --git a/nUpdate/Core/SystemInformation.cs b/nUpdate.Internal/Core/SystemInformation.cs similarity index 98% rename from nUpdate/Core/SystemInformation.cs rename to nUpdate.Internal/Core/SystemInformation.cs index 8b356284..3b6b376c 100644 --- a/nUpdate/Core/SystemInformation.cs +++ b/nUpdate.Internal/Core/SystemInformation.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Net.NetworkInformation; -namespace nUpdate.Core +namespace nUpdate.Internal.Core { internal class SystemInformation { diff --git a/nUpdate/Core/UriConnector.cs b/nUpdate.Internal/Core/UriConnector.cs similarity index 93% rename from nUpdate/Core/UriConnector.cs rename to nUpdate.Internal/Core/UriConnector.cs index d18fc728..98c27131 100644 --- a/nUpdate/Core/UriConnector.cs +++ b/nUpdate.Internal/Core/UriConnector.cs @@ -2,7 +2,7 @@ using System; -namespace nUpdate.Core +namespace nUpdate.Internal.Core { public class UriConnector { diff --git a/nUpdate/Core/WebClientWrapper.cs b/nUpdate.Internal/Core/WebClientWrapper.cs similarity index 96% rename from nUpdate/Core/WebClientWrapper.cs rename to nUpdate.Internal/Core/WebClientWrapper.cs index 98e2d0a4..ebbc2a65 100644 --- a/nUpdate/Core/WebClientWrapper.cs +++ b/nUpdate.Internal/Core/WebClientWrapper.cs @@ -3,7 +3,7 @@ using System; using System.Net; -namespace nUpdate.Core +namespace nUpdate.Internal.Core { public class WebClientWrapper : WebClient { diff --git a/nUpdate/Core/Win32/NativeMethods.cs b/nUpdate.Internal/Core/Win32/NativeMethods.cs similarity index 95% rename from nUpdate/Core/Win32/NativeMethods.cs rename to nUpdate.Internal/Core/Win32/NativeMethods.cs index 13ed42be..ca8f67b3 100644 --- a/nUpdate/Core/Win32/NativeMethods.cs +++ b/nUpdate.Internal/Core/Win32/NativeMethods.cs @@ -4,7 +4,7 @@ using System.Runtime.InteropServices; using System.Text; -namespace nUpdate.Core.Win32 +namespace nUpdate.Internal.Core.Win32 { internal class NativeMethods { diff --git a/nUpdate/Properties/AssemblyInfo.cs b/nUpdate.Internal/Properties/AssemblyInfo.cs similarity index 78% rename from nUpdate/Properties/AssemblyInfo.cs rename to nUpdate.Internal/Properties/AssemblyInfo.cs index ec5ed094..ee057452 100644 --- a/nUpdate/Properties/AssemblyInfo.cs +++ b/nUpdate.Internal/Properties/AssemblyInfo.cs @@ -1,6 +1,7 @@ // Copyright © Dominic Beger 2017 using System.Reflection; +using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // Allgemeine Informationen über eine Assembly werden über die folgenden @@ -8,7 +9,7 @@ // die mit einer Assembly verknüpft sind. [assembly: AssemblyTitle("nUpdate")] -[assembly: AssemblyDescription("A class library for updating .NET-applications.")] +[assembly: AssemblyDescription("The internal nUpdate class library that provides basic classes used in all projects.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("")] @@ -37,5 +38,8 @@ // übernehmen, indem Sie "*" eingeben: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("3.1.8.0")] -[assembly: AssemblyFileVersion("3.1.8.0")] \ No newline at end of file +[assembly: AssemblyVersion("3.2.0.0")] +[assembly: AssemblyFileVersion("3.2.0.0")] +[assembly: InternalsVisibleTo("nUpdate.Shared")] +[assembly: InternalsVisibleTo("nUpdate.ProvideTAP")] +[assembly: InternalsVisibleTo("nUpdate.WithoutTAP")] \ No newline at end of file diff --git a/nUpdate/Properties/Resources.Designer.cs b/nUpdate.Internal/Properties/Resources.Designer.cs similarity index 51% rename from nUpdate/Properties/Resources.Designer.cs rename to nUpdate.Internal/Properties/Resources.Designer.cs index aefffb46..53a8e29a 100644 --- a/nUpdate/Properties/Resources.Designer.cs +++ b/nUpdate.Internal/Properties/Resources.Designer.cs @@ -1,25 +1,25 @@ //------------------------------------------------------------------------------ // -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 +// Dieser Code wurde von einem Tool generiert. +// Laufzeitversion:4.0.30319.42000 // -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn +// der Code erneut generiert wird. // //------------------------------------------------------------------------------ -namespace nUpdate.Properties { +namespace nUpdate.Internal.Properties { using System; /// - /// A strongly-typed resource class, for looking up localized strings, etc. + /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + // Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert + // -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert. + // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen + // mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { @@ -33,13 +33,13 @@ internal Resources() { } /// - /// Returns the cached ResourceManager instance used by this class. + /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { - var temp = new global::System.Resources.ResourceManager("nUpdate.Properties.Resources", typeof(Resources).Assembly); + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("nUpdate.Internal.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; @@ -47,8 +47,8 @@ internal Resources() { } /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. + /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle + /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Globalization.CultureInfo Culture { @@ -61,61 +61,41 @@ internal Resources() { } /// - /// Looks up a localized resource of type System.Byte[]. + /// Sucht eine lokalisierte Ressource vom Typ System.Byte[]. /// internal static byte[] Ionic_Zip { get { - var obj = ResourceManager.GetObject("Ionic_Zip", resourceCulture); + object obj = ResourceManager.GetObject("Ionic_Zip", resourceCulture); return ((byte[])(obj)); } } /// - /// Looks up a localized resource of type System.Byte[]. + /// Sucht eine lokalisierte Ressource vom Typ System.Byte[]. /// internal static byte[] Newtonsoft_Json { get { - var obj = ResourceManager.GetObject("Newtonsoft_Json", resourceCulture); + object obj = ResourceManager.GetObject("Newtonsoft_Json", resourceCulture); return ((byte[])(obj)); } } /// - /// Looks up a localized resource of type System.Byte[]. - /// - internal static byte[] Newtonsoft_Json_Pdb { - get { - var obj = ResourceManager.GetObject("Newtonsoft_Json_Pdb", resourceCulture); - return ((byte[])(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Byte[]. + /// Sucht eine lokalisierte Ressource vom Typ System.Byte[]. /// internal static byte[] nUpdate_UpdateInstaller { get { - var obj = ResourceManager.GetObject("nUpdate_UpdateInstaller", resourceCulture); + object obj = ResourceManager.GetObject("nUpdate_UpdateInstaller", resourceCulture); return ((byte[])(obj)); } } /// - /// Looks up a localized resource of type System.Byte[]. + /// Sucht eine lokalisierte Ressource vom Typ System.Byte[]. /// internal static byte[] nUpdate_UpdateInstaller_Client_GuiInterface { get { - var obj = ResourceManager.GetObject("nUpdate_UpdateInstaller_Client_GuiInterface", resourceCulture); - return ((byte[])(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Byte[]. - /// - internal static byte[] nUpdate_UpdateInstaller1 { - get { - var obj = ResourceManager.GetObject("nUpdate_UpdateInstaller1", resourceCulture); + object obj = ResourceManager.GetObject("nUpdate_UpdateInstaller_Client_GuiInterface", resourceCulture); return ((byte[])(obj)); } } diff --git a/nUpdate/Properties/Resources.resx b/nUpdate.Internal/Properties/Resources.resx similarity index 93% rename from nUpdate/Properties/Resources.resx rename to nUpdate.Internal/Properties/Resources.resx index 22ecccbd..33789466 100644 --- a/nUpdate/Properties/Resources.resx +++ b/nUpdate.Internal/Properties/Resources.resx @@ -124,15 +124,9 @@ ..\Resources\Newtonsoft.Json.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - ..\Resources\Newtonsoft.Json.pdb;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - ..\Resources\nUpdate UpdateInstaller.exe;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - ..\Resources\nUpdate UpdateInstaller.pdb;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - ..\Resources\nUpdate.UpdateInstaller.Client.GuiInterface.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 diff --git a/nUpdate/Resources/Ionic.Zip.dll b/nUpdate.Internal/Resources/Ionic.Zip.dll similarity index 100% rename from nUpdate/Resources/Ionic.Zip.dll rename to nUpdate.Internal/Resources/Ionic.Zip.dll diff --git a/nUpdate/Resources/Newtonsoft.Json.dll b/nUpdate.Internal/Resources/Newtonsoft.Json.dll similarity index 100% rename from nUpdate/Resources/Newtonsoft.Json.dll rename to nUpdate.Internal/Resources/Newtonsoft.Json.dll diff --git a/nUpdate/Resources/en.xml b/nUpdate.Internal/Resources/en.xml similarity index 100% rename from nUpdate/Resources/en.xml rename to nUpdate.Internal/Resources/en.xml diff --git a/nUpdate/Resources/nUpdate UpdateInstaller.exe b/nUpdate.Internal/Resources/nUpdate UpdateInstaller.exe similarity index 99% rename from nUpdate/Resources/nUpdate UpdateInstaller.exe rename to nUpdate.Internal/Resources/nUpdate UpdateInstaller.exe index f708dbb9..106c3d76 100644 Binary files a/nUpdate/Resources/nUpdate UpdateInstaller.exe and b/nUpdate.Internal/Resources/nUpdate UpdateInstaller.exe differ diff --git a/nUpdate.Internal/Resources/nUpdate.UpdateInstaller.Client.GuiInterface.dll b/nUpdate.Internal/Resources/nUpdate.UpdateInstaller.Client.GuiInterface.dll new file mode 100644 index 00000000..6bcf5690 Binary files /dev/null and b/nUpdate.Internal/Resources/nUpdate.UpdateInstaller.Client.GuiInterface.dll differ diff --git a/nUpdate/UI/Controls/BottomPanel.cs b/nUpdate.Internal/UI/Controls/BottomPanel.cs similarity index 98% rename from nUpdate/UI/Controls/BottomPanel.cs rename to nUpdate.Internal/UI/Controls/BottomPanel.cs index 7de1e6f6..a787779c 100644 --- a/nUpdate/UI/Controls/BottomPanel.cs +++ b/nUpdate.Internal/UI/Controls/BottomPanel.cs @@ -5,7 +5,7 @@ using System.Windows.Forms; using System.Windows.Forms.VisualStyles; -namespace nUpdate.UI.Controls +namespace nUpdate.Internal.UI.Controls { /// /// A "Bottom Panel" drawn by Windows via Visual Styles if available. diff --git a/nUpdate/UI/Controls/Line.cs b/nUpdate.Internal/UI/Controls/Line.cs similarity index 93% rename from nUpdate/UI/Controls/Line.cs rename to nUpdate.Internal/UI/Controls/Line.cs index a17a9071..170b2282 100644 --- a/nUpdate/UI/Controls/Line.cs +++ b/nUpdate.Internal/UI/Controls/Line.cs @@ -3,7 +3,7 @@ using System.Drawing; using System.Windows.Forms; -namespace nUpdate.UI.Controls +namespace nUpdate.Internal.UI.Controls { public class Line : Control { diff --git a/nUpdate/UI/Popups/Popup.cs b/nUpdate.Internal/UI/Popups/Popup.cs similarity index 94% rename from nUpdate/UI/Popups/Popup.cs rename to nUpdate.Internal/UI/Popups/Popup.cs index 0264c02a..e63c7608 100644 --- a/nUpdate/UI/Popups/Popup.cs +++ b/nUpdate.Internal/UI/Popups/Popup.cs @@ -4,7 +4,7 @@ using System.Drawing; using System.Windows.Forms; -namespace nUpdate.UI.Popups +namespace nUpdate.Internal.UI.Popups { internal class Popup { @@ -25,8 +25,8 @@ public static DialogResult ShowPopup(Icon popupIcon, string title, string infoMe Buttons = buttons, StartPosition = FormStartPosition.CenterParent }; - - return popupWindow.ShowDialog(); + + return popupWindow.ShowDialog(Form.ActiveForm); } /// @@ -47,8 +47,8 @@ public static DialogResult ShowPopup(Icon popupIcon, string title, Exception ex, StartPosition = FormStartPosition.CenterParent, Exception = ex }; - - return popupWindow.ShowDialog(); + + return popupWindow.ShowDialog(Form.ActiveForm); } /// @@ -95,7 +95,7 @@ public static DialogResult ShowPopup(IWin32Window owner, Icon popupIcon, string Exception = exception }; - return popupWindow.ShowDialog(); + return popupWindow.ShowDialog(owner); } } } \ No newline at end of file diff --git a/nUpdate/UI/Popups/PopupButtons.cs b/nUpdate.Internal/UI/Popups/PopupButtons.cs similarity index 74% rename from nUpdate/UI/Popups/PopupButtons.cs rename to nUpdate.Internal/UI/Popups/PopupButtons.cs index b9c59b9d..09427183 100644 --- a/nUpdate/UI/Popups/PopupButtons.cs +++ b/nUpdate.Internal/UI/Popups/PopupButtons.cs @@ -1,6 +1,6 @@ // Copyright © Dominic Beger 2017 -namespace nUpdate.UI.Popups +namespace nUpdate.Internal.UI.Popups { public enum PopupButtons { diff --git a/nUpdate/UI/Popups/PopupDialog.cs b/nUpdate.Internal/UI/Popups/PopupDialog.cs similarity index 98% rename from nUpdate/UI/Popups/PopupDialog.cs rename to nUpdate.Internal/UI/Popups/PopupDialog.cs index 4a1d7fcd..8f20a413 100644 --- a/nUpdate/UI/Popups/PopupDialog.cs +++ b/nUpdate.Internal/UI/Popups/PopupDialog.cs @@ -5,7 +5,7 @@ using System.Media; using System.Windows.Forms; -namespace nUpdate.UI.Popups +namespace nUpdate.Internal.UI.Popups { public partial class PopupDialog : Form { diff --git a/nUpdate/UI/Popups/PopupDialog.designer.cs b/nUpdate.Internal/UI/Popups/PopupDialog.designer.cs similarity index 98% rename from nUpdate/UI/Popups/PopupDialog.designer.cs rename to nUpdate.Internal/UI/Popups/PopupDialog.designer.cs index b59b9f1e..91ef0b92 100644 --- a/nUpdate/UI/Popups/PopupDialog.designer.cs +++ b/nUpdate.Internal/UI/Popups/PopupDialog.designer.cs @@ -1,4 +1,6 @@ -namespace nUpdate.UI.Popups +using nUpdate.Internal.UI.Controls; + +namespace nUpdate.Internal.UI.Popups { partial class PopupDialog { @@ -33,7 +35,7 @@ private void InitializeComponent() this.contextMenu = new System.Windows.Forms.ContextMenuStrip(this.components); this.copyEntireMessageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.headerLabel = new System.Windows.Forms.Label(); - this.controlPanel1 = new nUpdate.UI.Controls.BottomPanel(); + this.controlPanel1 = new BottomPanel(); this.noButton = new System.Windows.Forms.Button(); this.closeButton = new System.Windows.Forms.Button(); this.yesButton = new System.Windows.Forms.Button(); diff --git a/nUpdate/UI/Popups/PopupDialog.resx b/nUpdate.Internal/UI/Popups/PopupDialog.resx similarity index 100% rename from nUpdate/UI/Popups/PopupDialog.resx rename to nUpdate.Internal/UI/Popups/PopupDialog.resx diff --git a/nUpdate/app.config b/nUpdate.Internal/app.config similarity index 100% rename from nUpdate/app.config rename to nUpdate.Internal/app.config diff --git a/nUpdate/nUpdate.csproj b/nUpdate.Internal/nUpdate.Internal.csproj similarity index 56% rename from nUpdate/nUpdate.csproj rename to nUpdate.Internal/nUpdate.Internal.csproj index 75af4da1..5f2f843a 100644 --- a/nUpdate/nUpdate.csproj +++ b/nUpdate.Internal/nUpdate.Internal.csproj @@ -7,8 +7,8 @@ {EFB71D69-EBF9-4F60-B776-DE443730A3DD} Library Properties - nUpdate - nUpdate + nUpdate.Internal + nUpdate.Internal v4.0 512 @@ -22,20 +22,21 @@ full false bin\Debug\ - DEBUG;TRACE + TRACE prompt 0 false - bin\Debug\nUpdate.XML + bin\Debug\nUpdate.Internal.xml MinimumRecommendedRules.ruleset - pdbonly + full true bin\Release\ TRACE prompt 4 + true OnBuildSuccess @@ -63,18 +64,6 @@ MinimumRecommendedRules.ruleset - - ..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll - False - - - ..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.dll - False - - - ..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll - False - False ..\packages\Newtonsoft.Json.10.0.3\lib\net40\Newtonsoft.Json.dll @@ -82,17 +71,7 @@ - - ..\packages\Microsoft.Bcl.1.1.10\lib\net40\System.IO.dll - - - ..\packages\Microsoft.Bcl.1.1.10\lib\net40\System.Runtime.dll - False - - - ..\packages\Microsoft.Bcl.1.1.10\lib\net40\System.Threading.Tasks.dll - @@ -103,7 +82,6 @@ - @@ -114,87 +92,28 @@ Component - - - - - - - - - - - - - + Component - - Form - - - - - Form - - - NewUpdateDialog.cs - - - Form - - - NoUpdateFoundDialog.cs - - - Form - - - UpdateSearchDialog.cs - - + + + Form - - UpdateDownloadDialog.cs + + PopupDialog.cs + True True Resources.resx - - - - - Form - - - PopupDialog.cs - - - BaseDialog.cs - Designer - - - NewUpdateDialog.cs - Designer - - - NoUpdateFoundDialog.cs - Designer - - - UpdateSearchDialog.cs - - - UpdateDownloadDialog.cs - ResXFileCodeGenerator Designer @@ -210,9 +129,6 @@ - - - @@ -220,19 +136,20 @@ - + + PreserveNewest + - + + PreserveNewest + - + - - - @@ -241,9 +158,7 @@ Dieses Projekt verweist auf mindestens ein NuGet-Paket, das auf diesem Computer fehlt. Aktivieren Sie die Wiederherstellung von NuGet-Paketen, um die fehlende Datei herunterzuladen. Weitere Informationen finden Sie unter "http://go.microsoft.com/fwlink/?LinkID=322105". Die fehlende Datei ist "{0}". - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/nUpdate.WithoutTAP/UI/Dialogs/DialogResultWrapper.cs b/nUpdate.WithoutTAP/UI/Dialogs/DialogResultWrapper.cs new file mode 100644 index 00000000..cbca9e45 --- /dev/null +++ b/nUpdate.WithoutTAP/UI/Dialogs/DialogResultWrapper.cs @@ -0,0 +1,9 @@ +using System.Windows.Forms; + +namespace nUpdate.UI.Dialogs +{ + internal class DialogResultWrapper + { + internal DialogResult DialogResult { get; set; } + } +} diff --git a/nUpdate.WithoutTAP/UI/Dialogs/FileLoadDialog.resx b/nUpdate.WithoutTAP/UI/Dialogs/FileLoadDialog.resx new file mode 100644 index 00000000..7080a7d1 --- /dev/null +++ b/nUpdate.WithoutTAP/UI/Dialogs/FileLoadDialog.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/nUpdate.WithoutTAP/UI/Dialogs/NewUpdateDialog.Designer.cs b/nUpdate.WithoutTAP/UI/Dialogs/NewUpdateDialog.Designer.cs new file mode 100644 index 00000000..2d95bdc4 --- /dev/null +++ b/nUpdate.WithoutTAP/UI/Dialogs/NewUpdateDialog.Designer.cs @@ -0,0 +1,227 @@ +using nUpdate.Internal.UI.Controls; + +namespace nUpdate.UI.Dialogs +{ + partial class NewUpdateDialog + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.changelogTextBox = new System.Windows.Forms.RichTextBox(); + this.headerLabel = new System.Windows.Forms.Label(); + this.infoLabel = new System.Windows.Forms.Label(); + this.newestVersionLabel = new System.Windows.Forms.Label(); + this.currentVersionLabel = new System.Windows.Forms.Label(); + this.updateSizeLabel = new System.Windows.Forms.Label(); + this.changelogLabel = new System.Windows.Forms.Label(); + this.iconPictureBox = new System.Windows.Forms.PictureBox(); + this.controlPanel1 = new BottomPanel(); + this.cancelButton = new System.Windows.Forms.Button(); + this.installButton = new System.Windows.Forms.Button(); + this.accessLabel = new System.Windows.Forms.Label(); + this.line1 = new Line(); + ((System.ComponentModel.ISupportInitialize)(this.iconPictureBox)).BeginInit(); + this.controlPanel1.SuspendLayout(); + this.SuspendLayout(); + // + // changelogTextBox + // + this.changelogTextBox.BackColor = System.Drawing.Color.White; + this.changelogTextBox.BulletIndent = 10; + this.changelogTextBox.Location = new System.Drawing.Point(12, 185); + this.changelogTextBox.Name = "changelogTextBox"; + this.changelogTextBox.ReadOnly = true; + this.changelogTextBox.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.ForcedVertical; + this.changelogTextBox.Size = new System.Drawing.Size(351, 102); + this.changelogTextBox.TabIndex = 0; + this.changelogTextBox.Text = ""; + this.changelogTextBox.LinkClicked += new System.Windows.Forms.LinkClickedEventHandler(this.changelogTextBox_LinkClicked); + // + // headerLabel + // + this.headerLabel.AutoSize = true; + this.headerLabel.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.headerLabel.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(51)))), ((int)(((byte)(153))))); + this.headerLabel.Location = new System.Drawing.Point(61, 12); + this.headerLabel.Name = "headerLabel"; + this.headerLabel.Size = new System.Drawing.Size(189, 21); + this.headerLabel.TabIndex = 2; + this.headerLabel.Text = "{0} new updates available."; + // + // infoLabel + // + this.infoLabel.Location = new System.Drawing.Point(63, 36); + this.infoLabel.Name = "infoLabel"; + this.infoLabel.Size = new System.Drawing.Size(300, 34); + this.infoLabel.TabIndex = 4; + this.infoLabel.Text = "New updates can be downloaded for {0}."; + // + // newestVersionLabel + // + this.newestVersionLabel.AutoSize = true; + this.newestVersionLabel.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.newestVersionLabel.Location = new System.Drawing.Point(9, 82); + this.newestVersionLabel.Name = "newestVersionLabel"; + this.newestVersionLabel.Size = new System.Drawing.Size(121, 13); + this.newestVersionLabel.TabIndex = 12; + this.newestVersionLabel.Text = "Available versions: {0}"; + // + // currentVersionLabel + // + this.currentVersionLabel.AutoSize = true; + this.currentVersionLabel.Location = new System.Drawing.Point(9, 100); + this.currentVersionLabel.Name = "currentVersionLabel"; + this.currentVersionLabel.Size = new System.Drawing.Size(104, 13); + this.currentVersionLabel.TabIndex = 13; + this.currentVersionLabel.Text = "Current version: {0}"; + // + // updateSizeLabel + // + this.updateSizeLabel.AutoSize = true; + this.updateSizeLabel.Location = new System.Drawing.Point(9, 117); + this.updateSizeLabel.Name = "updateSizeLabel"; + this.updateSizeLabel.Size = new System.Drawing.Size(118, 13); + this.updateSizeLabel.TabIndex = 14; + this.updateSizeLabel.Text = "Total package size: {0}"; + // + // changelogLabel + // + this.changelogLabel.AutoSize = true; + this.changelogLabel.Location = new System.Drawing.Point(9, 166); + this.changelogLabel.Name = "changelogLabel"; + this.changelogLabel.Size = new System.Drawing.Size(67, 13); + this.changelogLabel.TabIndex = 15; + this.changelogLabel.Text = "Changelog:"; + // + // iconPictureBox + // + this.iconPictureBox.Location = new System.Drawing.Point(16, 17); + this.iconPictureBox.Name = "iconPictureBox"; + this.iconPictureBox.Size = new System.Drawing.Size(41, 39); + this.iconPictureBox.TabIndex = 11; + this.iconPictureBox.TabStop = false; + // + // controlPanel1 + // + this.controlPanel1.BackColor = System.Drawing.SystemColors.Control; + this.controlPanel1.Controls.Add(this.cancelButton); + this.controlPanel1.Controls.Add(this.installButton); + this.controlPanel1.Location = new System.Drawing.Point(0, 296); + this.controlPanel1.Name = "controlPanel1"; + this.controlPanel1.Size = new System.Drawing.Size(371, 39); + this.controlPanel1.TabIndex = 16; + // + // cancelButton + // + this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.cancelButton.Location = new System.Drawing.Point(278, 8); + this.cancelButton.Name = "cancelButton"; + this.cancelButton.Size = new System.Drawing.Size(85, 23); + this.cancelButton.TabIndex = 17; + this.cancelButton.Text = "Cancel"; + this.cancelButton.UseVisualStyleBackColor = true; + // + // installButton + // + this.installButton.Location = new System.Drawing.Point(163, 8); + this.installButton.Name = "installButton"; + this.installButton.Size = new System.Drawing.Size(111, 23); + this.installButton.TabIndex = 0; + this.installButton.Text = "Install"; + this.installButton.UseVisualStyleBackColor = true; + this.installButton.Click += new System.EventHandler(this.installButton_Click); + // + // accessLabel + // + this.accessLabel.AutoSize = true; + this.accessLabel.Location = new System.Drawing.Point(9, 134); + this.accessLabel.Name = "accessLabel"; + this.accessLabel.Size = new System.Drawing.Size(54, 13); + this.accessLabel.TabIndex = 17; + this.accessLabel.Text = "Accesses:"; + // + // line1 + // + this.line1.LineAlignment = Line.Alignment.Horizontal; + this.line1.Location = new System.Drawing.Point(7, 151); + this.line1.Name = "line1"; + this.line1.Size = new System.Drawing.Size(356, 10); + this.line1.TabIndex = 18; + this.line1.Text = "line1"; + // + // NewUpdateDialog + // + this.AcceptButton = this.installButton; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.White; + this.CancelButton = this.cancelButton; + this.ClientSize = new System.Drawing.Size(371, 335); + this.Controls.Add(this.line1); + this.Controls.Add(this.accessLabel); + this.Controls.Add(this.controlPanel1); + this.Controls.Add(this.changelogLabel); + this.Controls.Add(this.updateSizeLabel); + this.Controls.Add(this.currentVersionLabel); + this.Controls.Add(this.newestVersionLabel); + this.Controls.Add(this.iconPictureBox); + this.Controls.Add(this.infoLabel); + this.Controls.Add(this.headerLabel); + this.Controls.Add(this.changelogTextBox); + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "NewUpdateDialog"; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "FormTitle"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.NewUpdateDialog_FormClosing); + this.Load += new System.EventHandler(this.NewUpdateDialog_Load); + ((System.ComponentModel.ISupportInitialize)(this.iconPictureBox)).EndInit(); + this.controlPanel1.ResumeLayout(false); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.RichTextBox changelogTextBox; + private System.Windows.Forms.Label headerLabel; + private System.Windows.Forms.Label infoLabel; + private System.Windows.Forms.PictureBox iconPictureBox; + private System.Windows.Forms.Label newestVersionLabel; + private System.Windows.Forms.Label currentVersionLabel; + private System.Windows.Forms.Label updateSizeLabel; + private System.Windows.Forms.Label changelogLabel; + private BottomPanel controlPanel1; + private System.Windows.Forms.Button cancelButton; + private System.Windows.Forms.Button installButton; + private System.Windows.Forms.Label accessLabel; + private Line line1; + } +} \ No newline at end of file diff --git a/nUpdate/UI/Dialogs/NewUpdateDialog.cs b/nUpdate.WithoutTAP/UI/Dialogs/NewUpdateDialog.cs similarity index 75% rename from nUpdate/UI/Dialogs/NewUpdateDialog.cs rename to nUpdate.WithoutTAP/UI/Dialogs/NewUpdateDialog.cs index d789d4a3..a63df3ec 100644 --- a/nUpdate/UI/Dialogs/NewUpdateDialog.cs +++ b/nUpdate.WithoutTAP/UI/Dialogs/NewUpdateDialog.cs @@ -6,23 +6,22 @@ using System.Drawing; using System.Linq; using System.Windows.Forms; -using nUpdate.Core; -using nUpdate.Core.Localization; -using nUpdate.Core.Operations; -using nUpdate.Core.Win32; -using nUpdate.UI.Popups; +using nUpdate.Internal.Core; +using nUpdate.Internal.Core.Localization; +using nUpdate.Internal.Core.Operations; +using nUpdate.Internal.Core.Win32; +using nUpdate.Internal.UI.Popups; using nUpdate.Updating; namespace nUpdate.UI.Dialogs { - public partial class NewUpdateDialog : BaseDialog + internal partial class NewUpdateDialog : BaseDialog { - private const float GB = 1073741824; private readonly Icon _appIcon = IconHelper.ExtractAssociatedIcon(Application.ExecutablePath); private bool _allowCancel; private LocalizationProperties _lp; - public NewUpdateDialog() + internal NewUpdateDialog() { InitializeComponent(); } @@ -30,7 +29,7 @@ public NewUpdateDialog() /// /// Sets a list of areas for this update's operations. /// - public List OperationAreas { get; set; } + internal List OperationAreas { get; set; } internal static void AddShieldToButton(Button btn) { @@ -53,10 +52,10 @@ public void CloseDialog(object state) private void installButton_Click(object sender, EventArgs e) { double necessarySpaceToFree; - if (!SizeHelper.HasEnoughSpace(Updater.TotalSize, out necessarySpaceToFree)) + if (!SizeHelper.HasEnoughSpace(UpdateManager.TotalSize, out necessarySpaceToFree)) { - var packageSizeString = SizeHelper.ConvertSize((long)Updater.TotalSize); - var spaceToFreeString = SizeHelper.ConvertSize((long)necessarySpaceToFree); + var packageSizeString = SizeHelper.ConvertSize((long) UpdateManager.TotalSize); + var spaceToFreeString = SizeHelper.ConvertSize((long) necessarySpaceToFree); Popup.ShowPopup(this, SystemIcons.Warning, "Not enough disk space.", $"You don't have enough disk space left on your drive and nUpdate is not able to download and install the available updates ({packageSizeString}). Please free a minimum of {spaceToFreeString} to make sure the updates can be downloaded and installed without any problems.", PopupButtons.Ok); @@ -76,27 +75,28 @@ private void NewUpdateDialog_FormClosing(object sender, FormClosingEventArgs e) private void NewUpdateDialog_Load(object sender, EventArgs e) { - _lp = LocalizationHelper.GetLocalizationProperties(Updater.LanguageCulture, Updater.CultureFilePaths); + _lp = LocalizationHelper.GetLocalizationProperties(UpdateManager.LanguageCulture, + UpdateManager.CultureFilePaths); headerLabel.Text = string.Format( - Updater.PackageConfigurations.Count() > 1 + UpdateManager.PackageConfigurations.Count() > 1 ? _lp.NewUpdateDialogMultipleUpdatesHeader - : _lp.NewUpdateDialogSingleUpdateHeader, Updater.PackageConfigurations.Count()); + : _lp.NewUpdateDialogSingleUpdateHeader, UpdateManager.PackageConfigurations.Count()); infoLabel.Text = string.Format(_lp.NewUpdateDialogInfoText, Application.ProductName); var availableVersions = - Updater.PackageConfigurations.Select(item => new UpdateVersion(item.LiteralVersion)).ToArray(); + UpdateManager.PackageConfigurations.Select(item => new UpdateVersion(item.LiteralVersion)).ToArray(); newestVersionLabel.Text = string.Format(_lp.NewUpdateDialogAvailableVersionsText, - Updater.PackageConfigurations.Count() <= 2 + UpdateManager.PackageConfigurations.Count() <= 2 ? string.Join(", ", availableVersions.Select(item => item.FullText)) : $"{UpdateVersion.GetLowestUpdateVersion(availableVersions).FullText} - {UpdateVersion.GetHighestUpdateVersion(availableVersions).FullText}"); currentVersionLabel.Text = string.Format(_lp.NewUpdateDialogCurrentVersionText, - Updater.CurrentVersion.FullText); + UpdateManager.CurrentVersion.FullText); changelogLabel.Text = _lp.NewUpdateDialogChangelogText; cancelButton.Text = _lp.CancelButtonText; installButton.Text = _lp.InstallButtonText; - var size = SizeHelper.ConvertSize((long)Updater.TotalSize); + var size = SizeHelper.ConvertSize((long) UpdateManager.TotalSize); updateSizeLabel.Text = $"{string.Format(_lp.NewUpdateDialogSizeText, size)}"; Icon = _appIcon; @@ -104,16 +104,13 @@ private void NewUpdateDialog_Load(object sender, EventArgs e) iconPictureBox.Image = _appIcon.ToBitmap(); iconPictureBox.BackgroundImageLayout = ImageLayout.Center; - foreach (var updateConfiguration in Updater.PackageConfigurations) + foreach (var updateConfiguration in UpdateManager.PackageConfigurations) { var versionText = new UpdateVersion(updateConfiguration.LiteralVersion).FullText; - var changelogText = updateConfiguration.Changelog.ContainsKey(Updater.LanguageCulture) - ? updateConfiguration.Changelog.First(item => Equals(item.Key, Updater.LanguageCulture)).Value + var changelogText = updateConfiguration.Changelog.ContainsKey(UpdateManager.LanguageCulture) + ? updateConfiguration.Changelog.First(item => Equals(item.Key, UpdateManager.LanguageCulture)).Value : updateConfiguration.Changelog.First(item => item.Key.Name == "en").Value; - if (Updater.TotalSize > GB) - changelogTextBox.Text += _lp.NewUpdateDialogBigPackageWarning; - changelogTextBox.Text += string.Format(string.IsNullOrEmpty(changelogTextBox.Text) ? "{0}:\n{1}" : "\n\n{0}:\n{1}", versionText, changelogText); @@ -131,13 +128,5 @@ private void NewUpdateDialog_Load(object sender, EventArgs e) $"{_lp.NewUpdateDialogAccessText} {string.Join(", ", LocalizationHelper.GetLocalizedEnumerationValues(_lp, OperationAreas.Cast().GroupBy(item => item).Select(item => item.First()).ToArray()))}"; _allowCancel = true; } - - public void ShowModalDialog(object dialogResultReference) - { - if (dialogResultReference != null) - ((DialogResultReference) dialogResultReference).DialogResult = ShowDialog(); - else - ShowDialog(); - } } } \ No newline at end of file diff --git a/nUpdate.WithoutTAP/UI/Dialogs/NewUpdateDialog.resx b/nUpdate.WithoutTAP/UI/Dialogs/NewUpdateDialog.resx new file mode 100644 index 00000000..1af7de15 --- /dev/null +++ b/nUpdate.WithoutTAP/UI/Dialogs/NewUpdateDialog.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/nUpdate.WithoutTAP/UI/Dialogs/NoUpdateFoundDialog.Designer.cs b/nUpdate.WithoutTAP/UI/Dialogs/NoUpdateFoundDialog.Designer.cs new file mode 100644 index 00000000..d72aea24 --- /dev/null +++ b/nUpdate.WithoutTAP/UI/Dialogs/NoUpdateFoundDialog.Designer.cs @@ -0,0 +1,110 @@ +using nUpdate.Internal.UI.Controls; + +namespace nUpdate.UI.Dialogs +{ + partial class NoUpdateFoundDialog + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.headerLabel = new System.Windows.Forms.Label(); + this.infoLabel = new System.Windows.Forms.Label(); + this.controlPanel1 = new BottomPanel(); + this.closeButton = new System.Windows.Forms.Button(); + this.controlPanel1.SuspendLayout(); + this.SuspendLayout(); + // + // headerLabel + // + this.headerLabel.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.headerLabel.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(51)))), ((int)(((byte)(153))))); + this.headerLabel.Location = new System.Drawing.Point(12, 12); + this.headerLabel.Name = "headerLabel"; + this.headerLabel.Size = new System.Drawing.Size(312, 21); + this.headerLabel.TabIndex = 2; + this.headerLabel.Text = "There are no new updates available."; + this.headerLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // infoLabel + // + this.infoLabel.Location = new System.Drawing.Point(16, 34); + this.infoLabel.Name = "infoLabel"; + this.infoLabel.Size = new System.Drawing.Size(295, 15); + this.infoLabel.TabIndex = 3; + this.infoLabel.Text = "The application is currently up-to-date."; + this.infoLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // controlPanel1 + // + this.controlPanel1.BackColor = System.Drawing.SystemColors.Control; + this.controlPanel1.Controls.Add(this.closeButton); + this.controlPanel1.Location = new System.Drawing.Point(0, 72); + this.controlPanel1.Name = "controlPanel1"; + this.controlPanel1.Size = new System.Drawing.Size(336, 37); + this.controlPanel1.TabIndex = 4; + // + // closeButton + // + this.closeButton.Location = new System.Drawing.Point(254, 7); + this.closeButton.Name = "closeButton"; + this.closeButton.Size = new System.Drawing.Size(75, 23); + this.closeButton.TabIndex = 0; + this.closeButton.Text = "Close"; + this.closeButton.UseVisualStyleBackColor = true; + this.closeButton.Click += new System.EventHandler(this.closeButton_Click); + // + // NoUpdateFoundDialog + // + this.AcceptButton = this.closeButton; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.White; + this.ClientSize = new System.Drawing.Size(336, 109); + this.Controls.Add(this.infoLabel); + this.Controls.Add(this.headerLabel); + this.Controls.Add(this.controlPanel1); + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "NoUpdateFoundDialog"; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "FormTitle"; + this.Load += new System.EventHandler(this.NoUpdateFoundDialog_Load); + this.controlPanel1.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Label headerLabel; + private System.Windows.Forms.Label infoLabel; + private BottomPanel controlPanel1; + private System.Windows.Forms.Button closeButton; + } +} \ No newline at end of file diff --git a/nUpdate/UI/Dialogs/NoUpdateFoundDialog.cs b/nUpdate.WithoutTAP/UI/Dialogs/NoUpdateFoundDialog.cs similarity index 67% rename from nUpdate/UI/Dialogs/NoUpdateFoundDialog.cs rename to nUpdate.WithoutTAP/UI/Dialogs/NoUpdateFoundDialog.cs index b940cecf..b80c94c2 100644 --- a/nUpdate/UI/Dialogs/NoUpdateFoundDialog.cs +++ b/nUpdate.WithoutTAP/UI/Dialogs/NoUpdateFoundDialog.cs @@ -3,17 +3,17 @@ using System; using System.Drawing; using System.Windows.Forms; -using nUpdate.Core; -using nUpdate.Core.Localization; +using nUpdate.Internal.Core; +using nUpdate.Internal.Core.Localization; namespace nUpdate.UI.Dialogs { - public partial class NoUpdateFoundDialog : BaseDialog + internal partial class NoUpdateFoundDialog : BaseDialog { private readonly Icon _appIcon = IconHelper.ExtractAssociatedIcon(Application.ExecutablePath); private LocalizationProperties _lp; - public NoUpdateFoundDialog() + internal NoUpdateFoundDialog() { InitializeComponent(); } @@ -30,7 +30,8 @@ public void CloseDialog(object state) private void NoUpdateFoundDialog_Load(object sender, EventArgs e) { - _lp = LocalizationHelper.GetLocalizationProperties(Updater.LanguageCulture, Updater.CultureFilePaths); + _lp = LocalizationHelper.GetLocalizationProperties(UpdateManager.LanguageCulture, + UpdateManager.CultureFilePaths); closeButton.Text = _lp.CloseButtonText; headerLabel.Text = _lp.NoUpdateDialogHeader; @@ -39,13 +40,5 @@ private void NoUpdateFoundDialog_Load(object sender, EventArgs e) Icon = _appIcon; Text = Application.ProductName; } - - public void ShowModalDialog(object dialogResultReference) - { - if (dialogResultReference != null) - ((DialogResultReference) dialogResultReference).DialogResult = ShowDialog(); - else - ShowDialog(); - } } } \ No newline at end of file diff --git a/nUpdate.WithoutTAP/UI/Dialogs/NoUpdateFoundDialog.resx b/nUpdate.WithoutTAP/UI/Dialogs/NoUpdateFoundDialog.resx new file mode 100644 index 00000000..1af7de15 --- /dev/null +++ b/nUpdate.WithoutTAP/UI/Dialogs/NoUpdateFoundDialog.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/nUpdate.WithoutTAP/UI/Dialogs/UpdateDownloadDialog.Designer.cs b/nUpdate.WithoutTAP/UI/Dialogs/UpdateDownloadDialog.Designer.cs new file mode 100644 index 00000000..fb54c826 --- /dev/null +++ b/nUpdate.WithoutTAP/UI/Dialogs/UpdateDownloadDialog.Designer.cs @@ -0,0 +1,124 @@ +using nUpdate.Internal.UI.Controls; + +namespace nUpdate.UI.Dialogs +{ + partial class UpdateDownloadDialog + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.cancelButton = new System.Windows.Forms.Button(); + this.controlPanel1 = new BottomPanel(); + this.downloadProgressBar = new System.Windows.Forms.ProgressBar(); + this.headerLabel = new System.Windows.Forms.Label(); + this.infoLabel = new System.Windows.Forms.Label(); + this.controlPanel1.SuspendLayout(); + this.SuspendLayout(); + // + // cancelButton + // + this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.cancelButton.Location = new System.Drawing.Point(238, 8); + this.cancelButton.Name = "cancelButton"; + this.cancelButton.Size = new System.Drawing.Size(75, 23); + this.cancelButton.TabIndex = 0; + this.cancelButton.Text = "Cancel"; + this.cancelButton.UseVisualStyleBackColor = true; + this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click); + // + // controlPanel1 + // + this.controlPanel1.BackColor = System.Drawing.SystemColors.Control; + this.controlPanel1.Controls.Add(this.cancelButton); + this.controlPanel1.Location = new System.Drawing.Point(0, 108); + this.controlPanel1.Name = "controlPanel1"; + this.controlPanel1.Size = new System.Drawing.Size(327, 40); + this.controlPanel1.TabIndex = 19; + // + // downloadProgressBar + // + this.downloadProgressBar.Location = new System.Drawing.Point(20, 78); + this.downloadProgressBar.Name = "downloadProgressBar"; + this.downloadProgressBar.Size = new System.Drawing.Size(290, 18); + this.downloadProgressBar.TabIndex = 13; + // + // headerLabel + // + this.headerLabel.AutoSize = true; + this.headerLabel.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.headerLabel.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(51)))), ((int)(((byte)(153))))); + this.headerLabel.Location = new System.Drawing.Point(17, 9); + this.headerLabel.Name = "headerLabel"; + this.headerLabel.Size = new System.Drawing.Size(264, 32); + this.headerLabel.TabIndex = 12; + this.headerLabel.Text = "Downloading updates..."; + // + // infoLabel + // + this.infoLabel.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.infoLabel.Location = new System.Drawing.Point(17, 41); + this.infoLabel.Name = "infoLabel"; + this.infoLabel.Size = new System.Drawing.Size(293, 26); + this.infoLabel.TabIndex = 11; + this.infoLabel.Text = "Please wait while the available updates are\r\ndownloaded... {0}"; + // + // UpdateDownloadDialog + // + this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 23F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.White; + this.CancelButton = this.cancelButton; + this.ClientSize = new System.Drawing.Size(327, 148); + this.Controls.Add(this.controlPanel1); + this.Controls.Add(this.downloadProgressBar); + this.Controls.Add(this.headerLabel); + this.Controls.Add(this.infoLabel); + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "UpdateDownloadDialog"; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "FormTitle"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.UpdateDownloadDialog_FormClosing); + this.Load += new System.EventHandler(this.UpdateDownloadDialog_Load); + this.Shown += new System.EventHandler(this.UpdateDownloadDialog_Shown); + this.controlPanel1.ResumeLayout(false); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label headerLabel; + private System.Windows.Forms.Label infoLabel; + private System.Windows.Forms.ProgressBar downloadProgressBar; + private BottomPanel controlPanel1; + private System.Windows.Forms.Button cancelButton; + } +} \ No newline at end of file diff --git a/nUpdate/UI/Dialogs/UpdateDownloadDialog.cs b/nUpdate.WithoutTAP/UI/Dialogs/UpdateDownloadDialog.cs similarity index 56% rename from nUpdate/UI/Dialogs/UpdateDownloadDialog.cs rename to nUpdate.WithoutTAP/UI/Dialogs/UpdateDownloadDialog.cs index 1e74b3dc..93162cb8 100644 --- a/nUpdate/UI/Dialogs/UpdateDownloadDialog.cs +++ b/nUpdate.WithoutTAP/UI/Dialogs/UpdateDownloadDialog.cs @@ -3,19 +3,19 @@ using System; using System.Drawing; using System.Windows.Forms; -using nUpdate.Core; -using nUpdate.Core.Localization; -using nUpdate.UI.Popups; +using nUpdate.Internal.Core; +using nUpdate.Internal.Core.Localization; +using nUpdate.Internal.UI.Popups; using nUpdate.UpdateEventArgs; namespace nUpdate.UI.Dialogs { - public partial class UpdateDownloadDialog : BaseDialog + internal partial class UpdateDownloadDialog : BaseDialog { private readonly Icon _appIcon = IconHelper.ExtractAssociatedIcon(Application.ExecutablePath); private LocalizationProperties _lp; - public UpdateDownloadDialog() + internal UpdateDownloadDialog() { InitializeComponent(); } @@ -23,7 +23,7 @@ public UpdateDownloadDialog() /// /// Gets or sets the progress percentage. /// - public int ProgressPercentage + internal float ProgressPercentage { get => downloadProgressBar.Value; set @@ -32,9 +32,9 @@ public int ProgressPercentage { Invoke(new Action(() => { - downloadProgressBar.Value = value; + downloadProgressBar.Value = (int) value; infoLabel.Text = string.Format( - _lp.UpdateDownloadDialogLoadingInfo, value); + _lp.UpdateDownloadDialogLoadingInfo, Math.Round(value, 1)); })); } catch (InvalidOperationException) @@ -44,92 +44,33 @@ public int ProgressPercentage } } - private void cancelButton_Click(object sender, EventArgs e) + private void Cancel() { - OnCancelButtonClicked(); + UpdateManager.CancelDownloadAsync(); DialogResult = DialogResult.Cancel; } - /// - /// Occurs when the cancel button is clicked. - /// - public event EventHandler CancelButtonClicked; - - public void CloseDialog(object state) - { - Close(); - } - - protected virtual void OnCancelButtonClicked() - { - CancelButtonClicked?.Invoke(this, EventArgs.Empty); - } - - public void ShowModalDialog(object dialogResultReference) - { - if (dialogResultReference != null) - ((DialogResultReference) dialogResultReference).DialogResult = ShowDialog(); - else - ShowDialog(); - } - - private void UpdateDownloadDialog_Load(object sender, EventArgs e) + private void cancelButton_Click(object sender, EventArgs e) { - _lp = LocalizationHelper.GetLocalizationProperties(Updater.LanguageCulture, Updater.CultureFilePaths); - - headerLabel.Text = _lp.UpdateDownloadDialogLoadingHeader; - infoLabel.Text = string.Format( - _lp.UpdateDownloadDialogLoadingInfo, "0"); - cancelButton.Text = _lp.CancelButtonText; - - Text = Application.ProductName; - Icon = _appIcon; + Cancel(); } - #region TAP - - public void Fail(Exception ex) + public void Failed(object sender, FailedEventArgs e) { Invoke(new Action(() => Popup.ShowPopup(this, SystemIcons.Error, "Error while downloading the update package.", - ex.InnerException ?? ex, PopupButtons.Ok))); + e.Exception.InnerException ?? e.Exception, PopupButtons.Ok))); + DialogResult = DialogResult.Cancel; } - public void StatisticsEntryFail(Exception ex) + public void Finished(object sender, EventArgs e) { - Invoke(new Action(() => - Popup.ShowPopup(this, SystemIcons.Warning, - "Error while adding a new statistics entry.", - ex, PopupButtons.Ok))); + DialogResult = DialogResult.OK; } - #endregion - - #region EAP - public void ProgressChanged(object sender, UpdateDownloadProgressChangedEventArgs e) { - try - { - Invoke(new Action(() => - { - downloadProgressBar.Value = (int) e.Percentage; - infoLabel.Text = string.Format( - _lp.UpdateDownloadDialogLoadingInfo, (int) e.Percentage); - })); - } - catch (InvalidOperationException) - { - // Prevent race conditions - } - } - - public void Failed(object sender, FailedEventArgs e) - { - Invoke(new Action(() => Popup.ShowPopup(this, SystemIcons.Error, - "Error while downloading the update package.", - e.Exception.InnerException ?? e.Exception, PopupButtons.Ok))); - DialogResult = DialogResult.Cancel; + ProgressPercentage = e.Percentage; } public void StatisticsEntryFailed(object sender, FailedEventArgs e) @@ -140,11 +81,45 @@ public void StatisticsEntryFailed(object sender, FailedEventArgs e) DialogResult = DialogResult.OK; } - public void Finished(object sender, EventArgs e) + private void UpdateDownloadDialog_FormClosing(object sender, FormClosingEventArgs e) { - DialogResult = DialogResult.OK; + if (e.CloseReason != CloseReason.UserClosing) + { + /* Important to unsubscribe the events, otherwise any calls on the UI thread (Invoke) + will cause an InvalidOperationException as the window handle is no longer available. */ + + UpdateManager.PackagesDownloadProgressChanged -= ProgressChanged; + UpdateManager.PackagesDownloadFailed -= Failed; + UpdateManager.StatisticsEntryFailed -= StatisticsEntryFailed; + UpdateManager.PackagesDownloadFinished -= Finished; + return; + } + e.Cancel = true; + Cancel(); } - #endregion + private void UpdateDownloadDialog_Load(object sender, EventArgs e) + { + _lp = LocalizationHelper.GetLocalizationProperties(UpdateManager.LanguageCulture, + UpdateManager.CultureFilePaths); + + headerLabel.Text = _lp.UpdateDownloadDialogLoadingHeader; + infoLabel.Text = string.Format( + _lp.UpdateDownloadDialogLoadingInfo, "0"); + cancelButton.Text = _lp.CancelButtonText; + + Text = Application.ProductName; + Icon = _appIcon; + + UpdateManager.PackagesDownloadProgressChanged += ProgressChanged; + UpdateManager.PackagesDownloadFailed += Failed; + UpdateManager.StatisticsEntryFailed += StatisticsEntryFailed; + UpdateManager.PackagesDownloadFinished += Finished; + } + + private void UpdateDownloadDialog_Shown(object sender, EventArgs e) + { + UpdateManager.DownloadPackagesAsync(); + } } } \ No newline at end of file diff --git a/nUpdate.WithoutTAP/UI/Dialogs/UpdateDownloadDialog.resx b/nUpdate.WithoutTAP/UI/Dialogs/UpdateDownloadDialog.resx new file mode 100644 index 00000000..1af7de15 --- /dev/null +++ b/nUpdate.WithoutTAP/UI/Dialogs/UpdateDownloadDialog.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/nUpdate.WithoutTAP/UI/Dialogs/UpdateSearchDialog.Designer.cs b/nUpdate.WithoutTAP/UI/Dialogs/UpdateSearchDialog.Designer.cs new file mode 100644 index 00000000..dfdb27cb --- /dev/null +++ b/nUpdate.WithoutTAP/UI/Dialogs/UpdateSearchDialog.Designer.cs @@ -0,0 +1,112 @@ +using nUpdate.Internal.UI.Controls; + +namespace nUpdate.UI.Dialogs +{ + partial class UpdateSearchDialog + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.progressBar1 = new System.Windows.Forms.ProgressBar(); + this.headerLabel = new System.Windows.Forms.Label(); + this.controlPanel1 = new BottomPanel(); + this.cancelButton = new System.Windows.Forms.Button(); + this.controlPanel1.SuspendLayout(); + this.SuspendLayout(); + // + // progressBar1 + // + this.progressBar1.Location = new System.Drawing.Point(13, 51); + this.progressBar1.Name = "progressBar1"; + this.progressBar1.Size = new System.Drawing.Size(283, 16); + this.progressBar1.Style = System.Windows.Forms.ProgressBarStyle.Marquee; + this.progressBar1.TabIndex = 0; + // + // headerLabel + // + this.headerLabel.AutoSize = true; + this.headerLabel.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.headerLabel.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(51)))), ((int)(((byte)(153))))); + this.headerLabel.Location = new System.Drawing.Point(12, 9); + this.headerLabel.Name = "headerLabel"; + this.headerLabel.Size = new System.Drawing.Size(264, 32); + this.headerLabel.TabIndex = 1; + this.headerLabel.Text = "Searching for updates..."; + // + // controlPanel1 + // + this.controlPanel1.BackColor = System.Drawing.SystemColors.Control; + this.controlPanel1.Controls.Add(this.cancelButton); + this.controlPanel1.Location = new System.Drawing.Point(0, 85); + this.controlPanel1.Name = "controlPanel1"; + this.controlPanel1.Size = new System.Drawing.Size(311, 36); + this.controlPanel1.TabIndex = 2; + // + // cancelButton + // + this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.cancelButton.Location = new System.Drawing.Point(229, 7); + this.cancelButton.Name = "cancelButton"; + this.cancelButton.Size = new System.Drawing.Size(75, 23); + this.cancelButton.TabIndex = 0; + this.cancelButton.Text = "Cancel"; + this.cancelButton.UseVisualStyleBackColor = true; + this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click); + // + // UpdateSearchDialog + // + this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 23F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.White; + this.CancelButton = this.cancelButton; + this.ClientSize = new System.Drawing.Size(311, 121); + this.Controls.Add(this.controlPanel1); + this.Controls.Add(this.headerLabel); + this.Controls.Add(this.progressBar1); + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "UpdateSearchDialog"; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.UpdateSearchDialog_FormClosing); + this.Load += new System.EventHandler(this.SearchDialog_Load); + this.Shown += new System.EventHandler(this.UpdateSearchDialog_Shown); + this.controlPanel1.ResumeLayout(false); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.ProgressBar progressBar1; + private System.Windows.Forms.Label headerLabel; + private BottomPanel controlPanel1; + private System.Windows.Forms.Button cancelButton; + } +} \ No newline at end of file diff --git a/nUpdate.WithoutTAP/UI/Dialogs/UpdateSearchDialog.cs b/nUpdate.WithoutTAP/UI/Dialogs/UpdateSearchDialog.cs new file mode 100644 index 00000000..a1a8413c --- /dev/null +++ b/nUpdate.WithoutTAP/UI/Dialogs/UpdateSearchDialog.cs @@ -0,0 +1,88 @@ +// Copyright © Dominic Beger 2017 + +using System; +using System.Drawing; +using System.Windows.Forms; +using nUpdate.Internal.Core; +using nUpdate.Internal.Core.Localization; +using nUpdate.Internal.UI.Popups; +using nUpdate.UpdateEventArgs; + +namespace nUpdate.UI.Dialogs +{ + internal partial class UpdateSearchDialog : BaseDialog + { + private readonly Icon _appIcon = IconHelper.ExtractAssociatedIcon(Application.ExecutablePath); + private LocalizationProperties _lp; + + internal UpdateSearchDialog() + { + InitializeComponent(); + } + + internal bool UpdatesFound { get; set; } + + private void Cancel() + { + UpdateManager.CancelSearchAsync(); + DialogResult = DialogResult.Cancel; + } + + private void cancelButton_Click(object sender, EventArgs e) + { + Cancel(); + } + + public void Failed(object sender, FailedEventArgs e) + { + Invoke(new Action(() => + Popup.ShowPopup(this, SystemIcons.Error, _lp.UpdateSearchErrorCaption, + e.Exception.InnerException ?? e.Exception, + PopupButtons.Ok))); + DialogResult = DialogResult.Cancel; + } + + public void Finished(object sender, UpdateSearchFinishedEventArgs e) + { + UpdatesFound = e.UpdatesAvailable; + DialogResult = DialogResult.OK; + } + + private void SearchDialog_Load(object sender, EventArgs e) + { + _lp = LocalizationHelper.GetLocalizationProperties(UpdateManager.LanguageCulture, + UpdateManager.CultureFilePaths); + + cancelButton.Text = _lp.CancelButtonText; + headerLabel.Text = _lp.UpdateSearchDialogHeader; + + Text = Application.ProductName; + Icon = _appIcon; + + UpdateManager.UpdateSearchFailed += Failed; + UpdateManager.UpdateSearchFinished += Finished; + } + + private void UpdateSearchDialog_FormClosing(object sender, FormClosingEventArgs e) + { + if (e.CloseReason != CloseReason.UserClosing) + { + /* Important to unsubscribe the events, otherwise any calls on the UI thread (Invoke) + will cause an InvalidOperationException as the window handle is no longer available. */ + + UpdateManager.UpdateSearchFailed -= Failed; + UpdateManager.UpdateSearchFinished -= Finished; + + return; + } + + e.Cancel = true; + Cancel(); + } + + private void UpdateSearchDialog_Shown(object sender, EventArgs e) + { + UpdateManager.SearchForUpdatesAsync(); + } + } +} \ No newline at end of file diff --git a/nUpdate.WithoutTAP/UI/Dialogs/UpdateSearchDialog.resx b/nUpdate.WithoutTAP/UI/Dialogs/UpdateSearchDialog.resx new file mode 100644 index 00000000..1af7de15 --- /dev/null +++ b/nUpdate.WithoutTAP/UI/Dialogs/UpdateSearchDialog.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/nUpdate/UpdateEventArgs/FailedEventArgs.cs b/nUpdate.WithoutTAP/UpdateEventArgs/FailedEventArgs.cs similarity index 93% rename from nUpdate/UpdateEventArgs/FailedEventArgs.cs rename to nUpdate.WithoutTAP/UpdateEventArgs/FailedEventArgs.cs index ca36cd92..4bbfd683 100644 --- a/nUpdate/UpdateEventArgs/FailedEventArgs.cs +++ b/nUpdate.WithoutTAP/UpdateEventArgs/FailedEventArgs.cs @@ -21,6 +21,6 @@ internal FailedEventArgs(Exception exception) /// /// Gets or sets a value representing the exception that occured. /// - public Exception Exception { get; set; } + public Exception Exception { get; } } } \ No newline at end of file diff --git a/nUpdate/UpdateEventArgs/UpdateSearchFinishedEventArgs.cs b/nUpdate.WithoutTAP/UpdateEventArgs/UpdateSearchFinishedEventArgs.cs similarity index 97% rename from nUpdate/UpdateEventArgs/UpdateSearchFinishedEventArgs.cs rename to nUpdate.WithoutTAP/UpdateEventArgs/UpdateSearchFinishedEventArgs.cs index fd983a63..64227c48 100644 --- a/nUpdate/UpdateEventArgs/UpdateSearchFinishedEventArgs.cs +++ b/nUpdate.WithoutTAP/UpdateEventArgs/UpdateSearchFinishedEventArgs.cs @@ -1,6 +1,7 @@ // Copyright © Dominic Beger 2017 using System; +using nUpdate.Updating; namespace nUpdate.UpdateEventArgs { diff --git a/nUpdate.WithoutTAP/Updating/UpdateConfiguration.cs b/nUpdate.WithoutTAP/Updating/UpdateConfiguration.cs new file mode 100644 index 00000000..2c416597 --- /dev/null +++ b/nUpdate.WithoutTAP/Updating/UpdateConfiguration.cs @@ -0,0 +1,80 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Text; +using System.Threading; +using nUpdate.Internal.Core; + +namespace nUpdate.Updating +{ + // WITHOUT TAP + public partial class UpdateConfiguration + { + /// + /// Downloads the update configurations from the server. + /// + /// The url of the configuration file. + /// The optional proxy to use. + /// The to invoke when the operation has finished. + /// The optional to use for canceling the operation. + /// Returns an containing the package configurations. + public static void DownloadAsync(Uri configFileUri, WebProxy proxy, Action, Exception> finishedCallback, CancellationTokenSource cancellationTokenSource = null) + { + DownloadAsync(configFileUri, null, proxy, finishedCallback, cancellationTokenSource); + } + + /// + /// Downloads the update configurations from the server. + /// + /// The url of the configuration file. + /// The HTTP authentication credentials. + /// The optional proxy to use. + /// The to invoke when the operation has finished. + /// The optional to use for canceling the operation. + /// Returns an containing the package configurations. + public static void DownloadAsync(Uri configFileUri, NetworkCredential credentials, + WebProxy proxy, Action, Exception> finishedCallback, CancellationTokenSource cancellationTokenSource = null) + { + using (var wc = new WebClientWrapper(10000)) + { + var resetEvent = new ManualResetEvent(false); + string source = null; + Exception exception = null; + + wc.Encoding = Encoding.UTF8; + if (credentials != null) + wc.Credentials = credentials; + + if (proxy != null) + wc.Proxy = proxy; + + wc.DownloadStringCompleted += (sender, args) => + { + if (!args.Cancelled) + { + if (args.Error != null) + exception = args.Error; + else + source = args.Result; + } + + resetEvent.Set(); + resetEvent.Dispose(); + }; + + // Register the cancel async method of the webclient to be called + cancellationTokenSource?.Token.Register(wc.CancelAsync); + + // Check for SSL and ignore it + ServicePointManager.ServerCertificateValidationCallback += delegate { return true; }; + + wc.DownloadStringAsync(configFileUri); + resetEvent.WaitOne(); + finishedCallback?.Invoke(!string.IsNullOrEmpty(source) + ? Serializer.Deserialize>(source) + : Enumerable.Empty(), exception); + } + } + } +} diff --git a/nUpdate.WithoutTAP/Updating/UpdateManager.cs b/nUpdate.WithoutTAP/Updating/UpdateManager.cs new file mode 100644 index 00000000..8b083c02 --- /dev/null +++ b/nUpdate.WithoutTAP/Updating/UpdateManager.cs @@ -0,0 +1,427 @@ +// Copyright � Dominic Beger 2017 + +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Net; +using System.Threading; +using System.Threading.Tasks; +using nUpdate.Exceptions; +using nUpdate.Internal.Core; +using nUpdate.UpdateEventArgs; + +namespace nUpdate.Updating +{ + // WITHOUT TAP + /// + /// Provides functionality to update .NET-applications. + /// + public partial class UpdateManager + { + private readonly ManualResetEvent _searchManualResetEvent = new ManualResetEvent(false); + + /// + /// Releases all managed and unmanaged resources used by the current -instance. + /// + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + /// + /// Releases unmanaged and - optionally - managed resources. + /// + /// + /// true to release both managed and unmanaged resources; false to release only + /// unmanaged resources. + /// + protected virtual void Dispose(bool disposing) + { + if (!disposing || _disposed) + return; + + _searchCancellationTokenSource.Dispose(); + _downloadCancellationTokenSource.Dispose(); + _searchManualResetEvent.Dispose(); + _disposed = true; + } + + /// + /// Downloads the available update packages from the server. + /// + /// + public void DownloadPackages() + { + OnUpdateDownloadStarted(this, EventArgs.Empty); + + long received = 0; + var total = PackageConfigurations.Select(config => GetUpdatePackageSize(config.UpdatePackageUri)) + .Where(updatePackageSize => updatePackageSize != null) + .Sum(updatePackageSize => updatePackageSize.Value); + + if (!Directory.Exists(_applicationUpdateDirectory)) + Directory.CreateDirectory(_applicationUpdateDirectory); + + foreach (var updateConfiguration in PackageConfigurations) + { + WebResponse webResponse = null; + try + { + var webRequest = WebRequest.Create(updateConfiguration.UpdatePackageUri); + if (HttpAuthenticationCredentials != null) + webRequest.Credentials = HttpAuthenticationCredentials; + using (webResponse = webRequest.GetResponse()) + { + var buffer = new byte[1024]; + _packageFilePaths.Add(new UpdateVersion(updateConfiguration.LiteralVersion), + Path.Combine(_applicationUpdateDirectory, + $"{updateConfiguration.LiteralVersion}.zip")); + using (var fileStream = File.Create(Path.Combine(_applicationUpdateDirectory, + $"{updateConfiguration.LiteralVersion}.zip"))) + { + using (var input = webResponse.GetResponseStream()) + { + if (input == null) + throw new Exception("The response stream couldn't be read."); + + var size = input.Read(buffer, 0, buffer.Length); + while (size > 0) + { + fileStream.Write(buffer, 0, size); + received += size; + OnUpdateDownloadProgressChanged(received, + (long) total, (float) (received / total) * 100); + size = input.Read(buffer, 0, buffer.Length); + } + + if (_downloadCancellationTokenSource.IsCancellationRequested) + return; + + if (!updateConfiguration.UseStatistics || !IncludeCurrentPcIntoStatistics) + continue; + + 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))); + } + } + } + } + finally + { + webResponse?.Close(); + } + } + } + + /// + /// Downloads the available update packages from the server, asynchronously. + /// + public void DownloadPackagesAsync() + { + OnUpdateDownloadStarted(this, EventArgs.Empty); + + Task.Factory.StartNew(() => + { + _downloadCancellationTokenSource?.Dispose(); + _downloadCancellationTokenSource = new CancellationTokenSource(); + + long received = 0; + var total = PackageConfigurations.Select(config => GetUpdatePackageSize(config.UpdatePackageUri)) + .Where(updatePackageSize => updatePackageSize != null) + .Sum(updatePackageSize => updatePackageSize.Value); + + if (!Directory.Exists(_applicationUpdateDirectory)) + Directory.CreateDirectory(_applicationUpdateDirectory); + + foreach (var updateConfiguration in PackageConfigurations) + { + if (_downloadCancellationTokenSource.IsCancellationRequested) + break; + + WebResponse webResponse = null; + try + { + // TODO: Implement cancellation for this method in case of e.g. a timeout + // Thread will currently continue until the timeout message is thrown and then cancel in the background + var webRequest = WebRequest.Create(updateConfiguration.UpdatePackageUri); + if (HttpAuthenticationCredentials != null) + webRequest.Credentials = HttpAuthenticationCredentials; + using (webResponse = webRequest.GetResponse()) + { + var buffer = new byte[1024]; + _packageFilePaths.Add(new UpdateVersion(updateConfiguration.LiteralVersion), + Path.Combine(_applicationUpdateDirectory, + $"{updateConfiguration.LiteralVersion}.zip")); + using (var fileStream = File.Create(Path.Combine(_applicationUpdateDirectory, + $"{updateConfiguration.LiteralVersion}.zip"))) + { + using (var input = webResponse.GetResponseStream()) + { + if (input == null) + throw new Exception("The response stream couldn't be read."); + + var size = input.Read(buffer, 0, buffer.Length); + while (size > 0) + { + if (_downloadCancellationTokenSource.IsCancellationRequested) + break; + + fileStream.Write(buffer, 0, size); + received += size; + OnUpdateDownloadProgressChanged(received, + (long) total, (float) (received / total) * 100); + size = input.Read(buffer, 0, buffer.Length); + } + + if (_downloadCancellationTokenSource.IsCancellationRequested) + return; + + if (!updateConfiguration.UseStatistics || !IncludeCurrentPcIntoStatistics) + continue; + + 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))); + } + } + } + } + finally + { + webResponse?.Close(); + } + } + }).ContinueWith(DownloadTaskCompleted); + } + + private void DownloadTaskCompleted(Task task) + { + if (_downloadCancellationTokenSource.IsCancellationRequested) + return; + + var exception = task.Exception; + if (exception != null) + OnUpdateDownloadFailed(exception.InnerException ?? exception); + else + OnUpdateDownloadFinished(this, EventArgs.Empty); + } + + protected virtual void OnStatisticsEntryFailed(Exception exception) + { + StatisticsEntryFailed?.Invoke(this, new FailedEventArgs(exception)); + } + + protected virtual void OnUpdateDownloadFailed(Exception exception) + { + PackagesDownloadFailed?.Invoke(this, new FailedEventArgs(exception)); + } + + protected virtual void OnUpdateDownloadFinished(object sender, EventArgs e) + { + PackagesDownloadFinished?.Invoke(sender, e); + } + + protected virtual void OnUpdateDownloadProgressChanged(long bytesReceived, long totalBytesToReceive, + float percentage) + { + PackagesDownloadProgressChanged?.Invoke(this, + new UpdateDownloadProgressChangedEventArgs(bytesReceived, totalBytesToReceive, percentage)); + } + + protected virtual void OnUpdateDownloadStarted(object sender, EventArgs e) + { + PackagesDownloadStarted?.Invoke(sender, e); + } + + protected virtual void OnUpdateSearchFailed(Exception exception) + { + UpdateSearchFailed?.Invoke(this, new FailedEventArgs(exception)); + } + + protected virtual void OnUpdateSearchFinished(bool updateAvailable) + { + UpdateSearchFinished?.Invoke(this, new UpdateSearchFinishedEventArgs(updateAvailable)); + } + + protected virtual void OnUpdateSearchStarted(object sender, EventArgs e) + { + UpdateSearchStarted?.Invoke(sender, e); + } + + /// + /// Occurs when the download of the packages fails. + /// + public event EventHandler PackagesDownloadFailed; + + /// + /// Occurs when the download of the packages has finished. + /// + public event EventHandler PackagesDownloadFinished; + + /// + /// Occurs when the download progress of the packages has changed. + /// + public event EventHandler PackagesDownloadProgressChanged; + + /// + /// Occurs when the download of the packages begins. + /// + public event EventHandler PackagesDownloadStarted; + + /// + /// Searches for updates. + /// + /// Returns true if updates were found; otherwise, false. + public bool SearchForUpdates() + { + // It may be that this is not the first search call and previously saved data needs to be disposed. + Cleanup(); + + OnUpdateSearchStarted(this, EventArgs.Empty); + if (!ConnectionManager.IsConnectionAvailable()) + return false; + + // Check for SSL and ignore it + ServicePointManager.ServerCertificateValidationCallback += delegate { return true; }; + var configuration = + UpdateConfiguration.Download(UpdateConfigurationFileUri, HttpAuthenticationCredentials, Proxy); + + var result = new UpdateResult(configuration, CurrentVersion, + IncludeAlpha, IncludeBeta); + if (!result.UpdatesFound) + return false; + + PackageConfigurations = result.NewestConfigurations; + double updatePackageSize = 0; + foreach (var updateConfiguration in PackageConfigurations) + { + var newPackageSize = GetUpdatePackageSize(updateConfiguration.UpdatePackageUri); + if (newPackageSize == null) + throw new SizeCalculationException(_lp.PackageSizeCalculationExceptionText); + + updatePackageSize += newPackageSize.Value; + _packageOperations.Add(new UpdateVersion(updateConfiguration.LiteralVersion), + updateConfiguration.Operations); + } + + TotalSize = updatePackageSize; + return true; + } + + /// + /// Searches for updates, asynchronously. + /// + /// + public void SearchForUpdatesAsync() + { + OnUpdateSearchStarted(this, EventArgs.Empty); + + Task.Factory.StartNew(() => + { + // It may be that this is not the first search call and previously saved data needs to be disposed. + Cleanup(); + + // Reinitialize the cancellation tokens and wait handles + _searchCancellationTokenSource?.Dispose(); + _searchCancellationTokenSource = new CancellationTokenSource(); + _searchManualResetEvent.Reset(); + + if (!ConnectionManager.IsConnectionAvailable()) + return false; + + // Check for SSL and ignore it + ServicePointManager.ServerCertificateValidationCallback += delegate { return true; }; + + IEnumerable configurations = null; + Exception exception = null; + UpdateConfiguration.DownloadAsync(UpdateConfigurationFileUri, HttpAuthenticationCredentials, + Proxy, + (c, e) => + { + configurations = c; + exception = e; + _searchManualResetEvent.Set(); + }, _searchCancellationTokenSource); + _searchManualResetEvent.WaitOne(); + + // Check for cancellation before throwing any errors + if (_searchCancellationTokenSource.IsCancellationRequested) + return false; + if (exception != null) + throw exception; + + var result = new UpdateResult(configurations, CurrentVersion, + IncludeAlpha, IncludeBeta); + if (!result.UpdatesFound) + return false; + + PackageConfigurations = result.NewestConfigurations; + double updatePackageSize = 0; + foreach (var updateConfiguration in PackageConfigurations) + { + if (_searchCancellationTokenSource.IsCancellationRequested) + return false; + + var newPackageSize = GetUpdatePackageSize(updateConfiguration.UpdatePackageUri); + if (newPackageSize == null) + throw new SizeCalculationException(_lp.PackageSizeCalculationExceptionText); + + updatePackageSize += newPackageSize.Value; + _packageOperations.Add(new UpdateVersion(updateConfiguration.LiteralVersion), + updateConfiguration.Operations); + } + + TotalSize = updatePackageSize; + return true; + }).ContinueWith(SearchTaskCompleted); + } + + private void SearchTaskCompleted(Task task) + { + if (_searchCancellationTokenSource.IsCancellationRequested) + return; + + var exception = task.Exception; + if (exception != null) + OnUpdateSearchFailed(exception.InnerException ?? exception); + OnUpdateSearchFinished(task.Result); + } + + /// + /// Occurs when the statistics entry failed. + /// + /// + /// This event is meant to provide the user with a warning, if the statistic server entry fails. The update process + /// should not be canceled as this does not cause any problems that could affect it. + /// + public event EventHandler StatisticsEntryFailed; + + /// + /// Occurs when an update search has failed. + /// + public event EventHandler UpdateSearchFailed; + + /// + /// Occurs when an active update search has finished. + /// + public event EventHandler UpdateSearchFinished; + + /// + /// Occurs when an update search is started. + /// + public event EventHandler UpdateSearchStarted; + } +} \ No newline at end of file diff --git a/nUpdate.WithoutTAP/Updating/UpdaterUI.cs b/nUpdate.WithoutTAP/Updating/UpdaterUI.cs new file mode 100644 index 00000000..d0b74ac5 --- /dev/null +++ b/nUpdate.WithoutTAP/Updating/UpdaterUI.cs @@ -0,0 +1,140 @@ +// Copyright © Dominic Beger 2017 + +using System; +using System.Drawing; +using System.IO; +using System.Threading; +using System.Threading.Tasks; +using System.Windows.Forms; +using nUpdate.Internal.UI.Popups; +using nUpdate.UI.Dialogs; + +namespace nUpdate.Updating +{ + // WITHOUT TAP + public sealed partial class UpdaterUI + { + private readonly ManualResetEvent _searchResetEvent = new ManualResetEvent(false); + + /// + /// Starts the complete update process and uses the integrated user interface for user interaction. + /// + public void ShowUserInterface() + { + if (_active) + return; + _active = true; + _searchResetEvent.Reset(); + + Task.Factory.StartNew(() => + { + try + { + if (!UseHiddenSearch) + { + var searchDialog = new UpdateSearchDialog {UpdateManager = UpdateManager}; + var searchDialogResult = new DialogResultWrapper(); + Context.Send(d => searchDialog.ShowDialog(searchDialogResult), null); + if (searchDialogResult.DialogResult != DialogResult.OK) + return; + + if (!searchDialog.UpdatesFound) + { + var noUpdateDialog = new NoUpdateFoundDialog {UpdateManager = UpdateManager}; + var noUpdateDialogResult = new DialogResultWrapper(); + Context.Send(d => noUpdateDialog.ShowDialog(noUpdateDialogResult), null); + if (noUpdateDialogResult.DialogResult != DialogResult.OK) + return; + } + } + else + { + var failed = false; + var updatesFound = false; + + UpdateManager.UpdateSearchFailed += (sender, args) => + { + failed = true; + + // Important: The UI thread that we want to access using the synchronization context is blocked until we set the manual reset event. + // This call needs to be done first, otherwise we'll experience a deadlock as SynchronizationContext.Send is sending a synchronous message. + _searchResetEvent.Set(); + Context.Send(c => Popup.ShowPopup(SystemIcons.Error, _lp.UpdateSearchErrorCaption, + args.Exception, + PopupButtons.Ok), null); + }; + + UpdateManager.UpdateSearchFinished += (sender, args) => + { + updatesFound = args.UpdatesAvailable; + _searchResetEvent.Set(); + }; + + UpdateManager.SearchForUpdatesAsync(); + _searchResetEvent.WaitOne(); + + if (failed || !updatesFound) + return; + } + + var newUpdateDialog = new NewUpdateDialog {UpdateManager = UpdateManager}; + var newUpdateDialogResult = new DialogResultWrapper(); + Context.Send(d => newUpdateDialog.ShowDialog(newUpdateDialogResult), null); + if (newUpdateDialogResult.DialogResult != DialogResult.OK) + return; + + var downloadDialog = new UpdateDownloadDialog {UpdateManager = UpdateManager}; + var downloadDialogResult = new DialogResultWrapper(); + Context.Send(d => downloadDialog.ShowDialog(downloadDialogResult), null); + if (downloadDialogResult.DialogResult != DialogResult.OK) + return; + + var valid = false; + try + { + valid = UpdateManager.ValidatePackages(); + } + catch (FileNotFoundException) + { + Context.Send(c => Popup.ShowPopup(SystemIcons.Error, _lp.PackageValidityCheckErrorCaption, + _lp.PackageNotFoundErrorText, + PopupButtons.Ok), null); + return; + } + catch (ArgumentException) + { + Context.Send(c => Popup.ShowPopup(SystemIcons.Error, _lp.PackageValidityCheckErrorCaption, + _lp.InvalidSignatureErrorText, PopupButtons.Ok), null); + return; + } + catch (Exception ex) + { + Context.Send(c => Popup.ShowPopup(SystemIcons.Error, _lp.PackageValidityCheckErrorCaption, + ex, PopupButtons.Ok), null); + return; + } + + if (!valid) + Context.Send(c => Popup.ShowPopup(SystemIcons.Error, _lp.InvalidSignatureErrorCaption, + _lp.SignatureNotMatchingErrorText, + PopupButtons.Ok), null); + else + try + { + UpdateManager.InstallPackage(); + } + catch (Exception ex) + { + Context.Send(c => Popup.ShowPopup(SystemIcons.Error, _lp.InstallerInitializingErrorCaption, + ex, + PopupButtons.Ok), null); + } + } + finally + { + _active = false; + } + }); + } + } +} \ No newline at end of file diff --git a/nUpdate.WithoutTAP/app.config b/nUpdate.WithoutTAP/app.config new file mode 100644 index 00000000..e03ea0a5 --- /dev/null +++ b/nUpdate.WithoutTAP/app.config @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/nUpdate.WithoutTAP/nUpdate.WithoutTAP.csproj b/nUpdate.WithoutTAP/nUpdate.WithoutTAP.csproj new file mode 100644 index 00000000..bfb37f33 --- /dev/null +++ b/nUpdate.WithoutTAP/nUpdate.WithoutTAP.csproj @@ -0,0 +1,115 @@ + + + + + Debug + AnyCPU + {CE1809EE-88FD-449C-81AB-6409F9B4ECEA} + Library + Properties + nUpdate + nUpdate.WithoutTAP + v4.0 + 512 + + + + + + true + full + false + bin\Debug\ + TRACE + prompt + 4 + + + full + true + bin\Release\ + DEBUG;TRACE + prompt + 4 + true + + + + + + + + + + + + + + + + + Form + + + + Form + + + NewUpdateDialog.cs + + + Form + + + NoUpdateFoundDialog.cs + + + Form + + + UpdateDownloadDialog.cs + + + Form + + + UpdateSearchDialog.cs + + + + + + + + + + {efb71d69-ebf9-4f60-b776-de443730a3dd} + nUpdate.Internal + + + + + BaseDialog.cs + Designer + + + NewUpdateDialog.cs + Designer + + + NoUpdateFoundDialog.cs + Designer + + + UpdateDownloadDialog.cs + + + UpdateSearchDialog.cs + + + + + + + + \ No newline at end of file diff --git a/nUpdate.WithoutTAP/nUpdate.WithoutTAP.csproj.DotSettings b/nUpdate.WithoutTAP/nUpdate.WithoutTAP.csproj.DotSettings new file mode 100644 index 00000000..6e7fff86 --- /dev/null +++ b/nUpdate.WithoutTAP/nUpdate.WithoutTAP.csproj.DotSettings @@ -0,0 +1,2 @@ + + No \ No newline at end of file diff --git a/nUpdate.WithoutTAP/packages.config b/nUpdate.WithoutTAP/packages.config new file mode 100644 index 00000000..03c70925 --- /dev/null +++ b/nUpdate.WithoutTAP/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/nUpdate.sln b/nUpdate.sln index bc98f5a8..2b740927 100644 --- a/nUpdate.sln +++ b/nUpdate.sln @@ -1,9 +1,9 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.23107.0 +# Visual Studio 15 +VisualStudioVersion = 15.0.26730.12 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nUpdate", "nUpdate\nUpdate.csproj", "{EFB71D69-EBF9-4F60-B776-DE443730A3DD}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nUpdate.Internal", "nUpdate.Internal\nUpdate.Internal.csproj", "{EFB71D69-EBF9-4F60-B776-DE443730A3DD}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nUpdate.Test", "nUpdate.Test\nUpdate.Test.csproj", "{4BF8AB62-1A33-49BB-8054-B154D3E64957}" EndProject @@ -24,7 +24,18 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nUpdate.Administration", "n EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nUpdate.UserInterfaceTest", "nUpdate.UserInterfaceTest\nUpdate.UserInterfaceTest.csproj", "{1C11588B-06FC-4502-A7C1-00C75E9E551F}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nUpdate.ProvideTAP", "nUpdate.ProvideTAP\nUpdate.ProvideTAP.csproj", "{B60F0AEE-F710-44FF-9C64-7BC4FCBD1BF5}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nUpdate.WithoutTAP", "nUpdate.WithoutTAP\nUpdate.WithoutTAP.csproj", "{CE1809EE-88FD-449C-81AB-6409F9B4ECEA}" +EndProject +Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "nUpdate.Shared", "nUpdate.Shared\nUpdate.Shared.shproj", "{1FC358A3-632D-4E44-8533-057D72176220}" +EndProject Global + GlobalSection(SharedMSBuildProjectFiles) = preSolution + nUpdate.Shared\nUpdate.Shared.projitems*{1fc358a3-632d-4e44-8533-057d72176220}*SharedItemsImports = 13 + nUpdate.Shared\nUpdate.Shared.projitems*{b60f0aee-f710-44ff-9c64-7bc4fcbd1bf5}*SharedItemsImports = 4 + nUpdate.Shared\nUpdate.Shared.projitems*{ce1809ee-88fd-449c-81ab-6409f9b4ecea}*SharedItemsImports = 4 + EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Debug|Mixed Platforms = Debug|Mixed Platforms @@ -106,10 +117,37 @@ Global {1C11588B-06FC-4502-A7C1-00C75E9E551F}.Release|Mixed Platforms.Build.0 = Release|Any CPU {1C11588B-06FC-4502-A7C1-00C75E9E551F}.Release|x86.ActiveCfg = Release|Any CPU {1C11588B-06FC-4502-A7C1-00C75E9E551F}.Release|x86.Build.0 = Release|Any CPU + {B60F0AEE-F710-44FF-9C64-7BC4FCBD1BF5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B60F0AEE-F710-44FF-9C64-7BC4FCBD1BF5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B60F0AEE-F710-44FF-9C64-7BC4FCBD1BF5}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {B60F0AEE-F710-44FF-9C64-7BC4FCBD1BF5}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {B60F0AEE-F710-44FF-9C64-7BC4FCBD1BF5}.Debug|x86.ActiveCfg = Debug|Any CPU + {B60F0AEE-F710-44FF-9C64-7BC4FCBD1BF5}.Debug|x86.Build.0 = Debug|Any CPU + {B60F0AEE-F710-44FF-9C64-7BC4FCBD1BF5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B60F0AEE-F710-44FF-9C64-7BC4FCBD1BF5}.Release|Any CPU.Build.0 = Release|Any CPU + {B60F0AEE-F710-44FF-9C64-7BC4FCBD1BF5}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {B60F0AEE-F710-44FF-9C64-7BC4FCBD1BF5}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {B60F0AEE-F710-44FF-9C64-7BC4FCBD1BF5}.Release|x86.ActiveCfg = Release|Any CPU + {B60F0AEE-F710-44FF-9C64-7BC4FCBD1BF5}.Release|x86.Build.0 = Release|Any CPU + {CE1809EE-88FD-449C-81AB-6409F9B4ECEA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CE1809EE-88FD-449C-81AB-6409F9B4ECEA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CE1809EE-88FD-449C-81AB-6409F9B4ECEA}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {CE1809EE-88FD-449C-81AB-6409F9B4ECEA}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {CE1809EE-88FD-449C-81AB-6409F9B4ECEA}.Debug|x86.ActiveCfg = Debug|Any CPU + {CE1809EE-88FD-449C-81AB-6409F9B4ECEA}.Debug|x86.Build.0 = Debug|Any CPU + {CE1809EE-88FD-449C-81AB-6409F9B4ECEA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CE1809EE-88FD-449C-81AB-6409F9B4ECEA}.Release|Any CPU.Build.0 = Release|Any CPU + {CE1809EE-88FD-449C-81AB-6409F9B4ECEA}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {CE1809EE-88FD-449C-81AB-6409F9B4ECEA}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {CE1809EE-88FD-449C-81AB-6409F9B4ECEA}.Release|x86.ActiveCfg = Release|Any CPU + {CE1809EE-88FD-449C-81AB-6409F9B4ECEA}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {D76F8B92-B31B-4E3E-BEF7-D64B32A79CC2} + EndGlobalSection GlobalSection(TestCaseManagementSettings) = postSolution CategoryFile = DotNetZip.vsmdi EndGlobalSection diff --git a/nUpdate/Resources/Newtonsoft.Json.pdb b/nUpdate/Resources/Newtonsoft.Json.pdb deleted file mode 100644 index bb0ba134..00000000 Binary files a/nUpdate/Resources/Newtonsoft.Json.pdb and /dev/null differ diff --git a/nUpdate/Resources/nUpdate UpdateInstaller.pdb b/nUpdate/Resources/nUpdate UpdateInstaller.pdb deleted file mode 100644 index 3f2a450a..00000000 Binary files a/nUpdate/Resources/nUpdate UpdateInstaller.pdb and /dev/null differ diff --git a/nUpdate/Resources/nUpdate.UpdateInstaller.Client.GuiInterface.dll b/nUpdate/Resources/nUpdate.UpdateInstaller.Client.GuiInterface.dll deleted file mode 100644 index 2cd639aa..00000000 Binary files a/nUpdate/Resources/nUpdate.UpdateInstaller.Client.GuiInterface.dll and /dev/null differ diff --git a/nUpdate/Resources/nUpdate.UpdateInstaller.Client.GuiInterface.pdb b/nUpdate/Resources/nUpdate.UpdateInstaller.Client.GuiInterface.pdb deleted file mode 100644 index deccf07a..00000000 Binary files a/nUpdate/Resources/nUpdate.UpdateInstaller.Client.GuiInterface.pdb and /dev/null differ diff --git a/nUpdate/UI/Dialogs/BaseDialog.cs b/nUpdate/UI/Dialogs/BaseDialog.cs deleted file mode 100644 index ea908097..00000000 --- a/nUpdate/UI/Dialogs/BaseDialog.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright © Dominic Beger 2017 - -using System.Drawing; -using System.Windows.Forms; -using nUpdate.Updating; - -namespace nUpdate.UI.Dialogs -{ - public class BaseDialog : Form - { - public UpdateManager Updater { get; set; } - - public void InitializeComponent() - { - SuspendLayout(); - // - // BaseForm - // - ClientSize = new Size(284, 262); - BackColor = Color.White; - Font = new Font("Segoe UI", 10); - ResumeLayout(false); - } - } -} \ No newline at end of file diff --git a/nUpdate/UI/Dialogs/DialogResultReference.cs b/nUpdate/UI/Dialogs/DialogResultReference.cs deleted file mode 100644 index 60ca5199..00000000 --- a/nUpdate/UI/Dialogs/DialogResultReference.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright © Dominic Beger 2017 - -using System.Windows.Forms; - -namespace nUpdate.UI.Dialogs -{ - internal class DialogResultReference - { - public DialogResult DialogResult { get; set; } - } -} \ No newline at end of file diff --git a/nUpdate/UI/Dialogs/UpdateSearchDialog.cs b/nUpdate/UI/Dialogs/UpdateSearchDialog.cs deleted file mode 100644 index e52bd4a9..00000000 --- a/nUpdate/UI/Dialogs/UpdateSearchDialog.cs +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright © Dominic Beger 2017 - -using System; -using System.Drawing; -using System.Windows.Forms; -using nUpdate.Core; -using nUpdate.Core.Localization; -using nUpdate.UI.Popups; -using nUpdate.UpdateEventArgs; - -namespace nUpdate.UI.Dialogs -{ - public partial class UpdateSearchDialog : BaseDialog - { - private readonly Icon _appIcon = IconHelper.ExtractAssociatedIcon(Application.ExecutablePath); - private LocalizationProperties _lp; - - public UpdateSearchDialog() - { - InitializeComponent(); - } - - private void cancelButton_Click(object sender, EventArgs e) - { - OnCancelButtonClicked(); - DialogResult = DialogResult.Cancel; - } - - /// - /// Occurs when the cancel button is clicked. - /// - public event EventHandler CancelButtonClicked; - - protected virtual void OnCancelButtonClicked() - { - if (CancelButtonClicked != null) - CancelButtonClicked(this, EventArgs.Empty); - } - - private void SearchDialog_Load(object sender, EventArgs e) - { - _lp = LocalizationHelper.GetLocalizationProperties(Updater.LanguageCulture, Updater.CultureFilePaths); - - cancelButton.Text = _lp.CancelButtonText; - headerLabel.Text = _lp.UpdateSearchDialogHeader; - - Text = Application.ProductName; - Icon = _appIcon; - } - - #region TAP - - public void Fail(Exception ex) - { - Invoke(new Action(() => Popup.ShowPopup(this, SystemIcons.Error, _lp.UpdateSearchErrorCaption, ex, - PopupButtons.Ok))); - } - - public void ShowModalDialog(object dialogResultReference) - { - if (dialogResultReference != null) - ((DialogResultReference) dialogResultReference).DialogResult = ShowDialog(); - else - ShowDialog(); - } - - public void CloseDialog(object state) - { - Close(); - } - - #endregion - - #region EAP - - public void Failed(object sender, FailedEventArgs e) - { - Invoke( - new Action( - () => - Popup.ShowPopup(this, SystemIcons.Error, _lp.UpdateSearchErrorCaption, - e.Exception.InnerException ?? e.Exception, - PopupButtons.Ok))); - DialogResult = DialogResult.Cancel; - } - - public void Finished(object sender, UpdateSearchFinishedEventArgs e) - { - DialogResult = DialogResult.OK; - } - - #endregion - } -} \ No newline at end of file diff --git a/nUpdate/Updating/UpdateManager.cd b/nUpdate/Updating/UpdateManager.cd deleted file mode 100644 index 5bd0baad..00000000 --- a/nUpdate/Updating/UpdateManager.cd +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - oAAACLFAKmAEQQEAoAARIAwAEhkwkggDICWYIAcwNmo= - Updating\UpdateManager.cs - - - - - \ No newline at end of file diff --git a/nUpdate/Updating/UpdateManager.cs b/nUpdate/Updating/UpdateManager.cs deleted file mode 100644 index 8a9beda8..00000000 --- a/nUpdate/Updating/UpdateManager.cs +++ /dev/null @@ -1,880 +0,0 @@ -// Copyright � Dominic Beger 2017 - -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Diagnostics; -using System.Globalization; -using System.IO; -using System.Linq; -using System.Net; -using System.Reflection; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -using System.Windows.Forms; -using nUpdate.Core; -using nUpdate.Core.Localization; -using nUpdate.Core.Operations; -using nUpdate.Exceptions; -using nUpdate.Properties; -using nUpdate.UpdateEventArgs; -using SystemInformation = nUpdate.Core.SystemInformation; - -namespace nUpdate.Updating -{ - /// - /// Provides functionality to update .NET-applications. - /// - public class UpdateManager : IDisposable - { - private bool _disposed; - private CancellationTokenSource _searchCancellationTokenSource = new CancellationTokenSource(); - private CancellationTokenSource _downloadCancellationTokenSource = new CancellationTokenSource(); - private readonly Dictionary _packageFilePaths = new Dictionary(); - - private readonly Dictionary> _packageOperations = - new Dictionary>(); - - private readonly string _applicationUpdateDirectory = Path.Combine(Path.GetTempPath(), "nUpdate", - Application.ProductName); - - private LocalizationProperties _lp; - private CultureInfo _languageCulture = new CultureInfo("en"); - - /// - /// Initializes a new instance of the class. - /// - /// The URI of the update configuration file. - /// The public key for the validity check of the update packages. - /// - /// The language culture to use. If no value is provided, the default one ("en") will be - /// used. - /// - /// - /// The current version of that should be used for the update checks. This parameter has a - /// higher priority than the and will replace it, if specified. - /// - /// - /// The public key can be found in the overview of your project when you're opening it in nUpdate Administration. - /// If you have problems inserting the data (or if you want to save time) you can scroll down there and follow the - /// steps of the category "Copy data" which will automatically generate the necessray code for you. - /// - public UpdateManager(Uri updateConfigurationFileUri, string publicKey, - CultureInfo languageCulture = null, UpdateVersion currentVersion = null) - { - if (updateConfigurationFileUri == null) - throw new ArgumentNullException(nameof(updateConfigurationFileUri)); - UpdateConfigurationFileUri = updateConfigurationFileUri; - - if (string.IsNullOrEmpty(publicKey)) - throw new ArgumentNullException(nameof(publicKey)); - PublicKey = publicKey; - - CultureFilePaths = new Dictionary(); - Arguments = new List(); - - var projectAssembly = Assembly.GetCallingAssembly(); - var nUpateVersionAttribute = - projectAssembly.GetCustomAttributes(false).OfType().SingleOrDefault(); - - // TODO: This is just there to make sure we don't create an API-change that would require a new Major version. This will be changed/removed in v4.0. - // Before v3.0-beta8 it was not possible to provide the current version except using the nUpdateVersionAttribute. - // In order to allow specific features, e.g. updating another application and not the current one (as it's done by a launcher), there must be a way to provide this version separately. - // So, if an argument is specified for the "currentVersion" parameter, we will use this one instead of the nUpdateVersionAttribute. - if (currentVersion != null) - CurrentVersion = currentVersion; - else - { - // Neither the nUpdateVersionAttribute nor the additional parameter argument was provided. - if (nUpateVersionAttribute == null) - throw new ArgumentException( - "The version string couldn't be loaded because the nUpdateVersionAttribute isn't implemented in the executing assembly and no version was provided explicitly."); - - CurrentVersion = new UpdateVersion(nUpateVersionAttribute.VersionString); - } - - // TODO: This is just there to make sure we don't create an API-change that would require a new Major version. This will be changed/removed in v4.0. - // Before v3.0-beta5 it was not possible to use custom languages due to a mistake in the architecture. So we can be pretty sure that nobody specifies a custom CultureInfo in the constructor. - // We only need these two lines for those who specified one of the implemented CultureInfos here as they shouldn't have to change anything when updating to v3.0-beta5. - // Nevertheless, it's therefore possible to use custom CultureInfos just by leaving the optional parameter "null" and specifying the culture using the corresponding properties. So, both cases are covered with that solution. - if (languageCulture != null && LocalizationHelper.IsIntegratedCulture(languageCulture, CultureFilePaths)) - LanguageCulture = languageCulture; - else - throw new ArgumentException($"The culture \"{languageCulture}\" is not defined."); - - if (UseCustomInstallerUserInterface && string.IsNullOrEmpty(CustomInstallerUiAssemblyPath)) - throw new ArgumentException( - "The property \"CustomInstallerUiAssemblyPath\" is not initialized although \"UseCustomInstallerUserInterface\" is set to \"true\""); - Initialize(); - } - - /// - /// Finalizes an instance of the class. - /// - ~UpdateManager() - { - Dispose(true); - } - - public SynchronizationContext Context { get; set; } - - /// - /// Gets or sets the URI of the update configuration file. - /// - public Uri UpdateConfigurationFileUri { get; } - - /// - /// Gets or sets the public key for checking the validity of the signature. - /// - public string PublicKey { get; } - - /// - /// Gets or sets the version of the current application. - /// - internal UpdateVersion CurrentVersion { get; set; } - - /// - /// Gets or sets the culture of the language to use. - /// - /// - /// "en" (English) and "de" (German) are currently the only language cultures that are already implemented in - /// nUpdate. In order to use own languages download the language template from - /// , edit it, save it as a JSON-file and add a new entry to - /// property - /// CultureFilePaths with the relating CultureInfo and path which locates the JSON-file on the client's - /// system (e. g. AppData). - /// - public CultureInfo LanguageCulture - { - get => _languageCulture; - set - { - if (!LocalizationHelper.IsIntegratedCulture(value, CultureFilePaths) && - !CultureFilePaths.ContainsKey(_languageCulture)) - throw new ArgumentException( - "The localization file of the culture set does not exist."); - _lp = LocalizationHelper.GetLocalizationProperties(value, CultureFilePaths); - _languageCulture = value; - } - } - - /// - /// Gets or sets the paths to the files that contain the localized strings of their corresponding . - /// - public Dictionary CultureFilePaths { get; set; } - - /// - /// Gets or sets a value indicating whether the nUpdate UpdateInstaller should use a custom user interface, or not. - /// - /// This property also requires to be set, if the value is true. - public bool UseCustomInstallerUserInterface { get; set; } - - /// - /// Gets or sets the path of the assembly file that contains the user interface data for nUpdate UpdateInstaller. - /// - public string CustomInstallerUiAssemblyPath { get; set; } - - /// - /// Gets or sets a value indicating whether the user should be able to update to alpha versions, or not. - /// - public bool IncludeAlpha { get; set; } - - /// - /// Gets or sets a value indicating whether the user should be able to update to beta versions, or not. - /// - public bool IncludeBeta { get; set; } - - /// - /// Gets the package configurations for all available updates. - /// - public IEnumerable PackageConfigurations { get; internal set; } - - /// - /// Gets or sets a value indicating whether the current computer should be included into the statistics, or not. - /// - public bool IncludeCurrentPcIntoStatistics { get; set; } = true; - - /// - /// Gets or sets a value indicating whether the host application should be closed when the nUpdate UpdateInstaller is started, or - /// not. - /// - public bool CloseHostApplication { get; set; } = true; - - /// - /// Gets or sets a value indicating whether the host application should be restarted once the update installation has - /// completed, or not. - /// - public bool RestartHostApplication { get; set; } = true; - - /// - /// Gets the total size of all update packages. - /// - public double TotalSize { get; private set; } - - /// - /// Gets or sets the proxy to use. - /// - public WebProxy Proxy { get; set; } - - /// - /// Gets or sets the HTTP(S) authentication credentials. - /// - public NetworkCredential HttpAuthenticationCredentials { get; set; } - - /// - /// Gets or sets the arguments that should be handled over to the application once the update installation has completed. - /// - public List Arguments { get; set; } - - /// - /// Releases all managed and unmanaged resources used by the current -instance. - /// - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - /// - /// Releases unmanaged and - optionally - managed resources. - /// - /// - /// true to release both managed and unmanaged resources; false to release only - /// unmanaged resources. - /// - protected virtual void Dispose(bool disposing) - { - if (!disposing || _disposed) - return; - - _searchCancellationTokenSource.Dispose(); - _downloadCancellationTokenSource.Dispose(); - _disposed = true; - } - - private double? GetUpdatePackageSize(Uri packageUri) - { - try - { - var req = WebRequest.Create(packageUri); - req.Method = "HEAD"; - if (HttpAuthenticationCredentials != null) - req.Credentials = HttpAuthenticationCredentials; - using (var resp = req.GetResponse()) - { - double contentLength; - if (double.TryParse(resp.Headers.Get("Content-Length"), out contentLength)) - return contentLength; - } - } - catch - { - return null; - } - - return null; - } - - /// - /// Searches for updates. - /// - /// Returns true if updates were found; otherwise, false. - /// The calculation of the size of the available updates has failed. - /// The update search was canceled. - public bool SearchForUpdates() - { - // It may be that this is not the first search call and previously saved data needs to be disposed. - Cleanup(); - _searchCancellationTokenSource?.Dispose(); - _searchCancellationTokenSource = new CancellationTokenSource(); - - OnUpdateSearchStarted(this, EventArgs.Empty); - if (!ConnectionManager.IsConnectionAvailable()) - return false; - - // Check for SSL and ignore it - ServicePointManager.ServerCertificateValidationCallback += delegate { return true; }; - var configuration = - UpdateConfiguration.Download(UpdateConfigurationFileUri, HttpAuthenticationCredentials, Proxy); - - var result = new UpdateResult(configuration, CurrentVersion, - IncludeAlpha, IncludeBeta); - if (!result.UpdatesFound) - return false; - - PackageConfigurations = result.NewestConfigurations; - double updatePackageSize = 0; - foreach (var updateConfiguration in PackageConfigurations) - { - var newPackageSize = GetUpdatePackageSize(updateConfiguration.UpdatePackageUri); - if (newPackageSize == null) - throw new SizeCalculationException(_lp.PackageSizeCalculationExceptionText); - - updatePackageSize += newPackageSize.Value; - _packageOperations.Add(new UpdateVersion(updateConfiguration.LiteralVersion), - updateConfiguration.Operations); - } - - TotalSize = updatePackageSize; - if (!_searchCancellationTokenSource.Token.IsCancellationRequested) - return true; - - Cleanup(); - throw new OperationCanceledException(); - } - - /// - /// Searches for updates, asynchronously. - /// - /// - public -#if PROVIDE_TAP - async Task -#else - void -#endif - SearchForUpdatesAsync() - { -#if PROVIDE_TAP - return SearchForUpdates(); -#else - Task.Factory.StartNew(SearchForUpdates).ContinueWith(SearchTaskCompleted, - _searchCancellationTokenSource.Token, - TaskContinuationOptions.None, TaskScheduler.Default); -#endif - } - - private void SearchTaskCompleted(Task task) - { - if (_searchCancellationTokenSource.IsCancellationRequested) - return; - - var exception = task.Exception; - if (exception != null) - OnUpdateSearchFailed(exception.InnerException ?? exception); - OnUpdateSearchFinished(task.Result); - } - - /// - /// Cancels the update search. - /// - /// If there is no search task running, nothing will happen. - public void CancelSearch() - { - _searchCancellationTokenSource.Cancel(); - } - - /// - /// Downloads the available update packages from the server. - /// - /// The download process has failed because of an . - /// The URI of the update package is null. - /// The creation of the directory, where the update packages should be saved in, failed. - /// An exception occured while writing to the file. - /// The download was canceled. - /// - /// - public void DownloadPackages() - { - _downloadCancellationTokenSource?.Dispose(); - _downloadCancellationTokenSource = new CancellationTokenSource(); - - OnUpdateDownloadStarted(this, EventArgs.Empty); - - long received = 0; - var total = PackageConfigurations.Select(config => GetUpdatePackageSize(config.UpdatePackageUri)) - .Where(updatePackageSize => updatePackageSize != null) - .Sum(updatePackageSize => updatePackageSize.Value); - - if (!Directory.Exists(_applicationUpdateDirectory)) - Directory.CreateDirectory(_applicationUpdateDirectory); - - foreach (var updateConfiguration in PackageConfigurations) - { - WebResponse webResponse = null; - try - { - if (_downloadCancellationTokenSource.Token.IsCancellationRequested) - { - DeletePackages(); - Cleanup(); - throw new OperationCanceledException(); - } - - var webRequest = WebRequest.Create(updateConfiguration.UpdatePackageUri); - if (HttpAuthenticationCredentials != null) - webRequest.Credentials = HttpAuthenticationCredentials; - using (webResponse = webRequest.GetResponse()) - { - var buffer = new byte[1024]; - _packageFilePaths.Add(new UpdateVersion(updateConfiguration.LiteralVersion), - Path.Combine(_applicationUpdateDirectory, - $"{updateConfiguration.LiteralVersion}.zip")); - using (var fileStream = File.Create(Path.Combine(_applicationUpdateDirectory, - $"{updateConfiguration.LiteralVersion}.zip"))) - { - using (var input = webResponse.GetResponseStream()) - { - if (input == null) - throw new Exception("The response stream couldn't be read."); - - if (_downloadCancellationTokenSource.Token.IsCancellationRequested) - { - DeletePackages(); - Cleanup(); - throw new OperationCanceledException(); - } - - var size = input.Read(buffer, 0, buffer.Length); - while (size > 0) - { - if (_downloadCancellationTokenSource.Token.IsCancellationRequested) - { - fileStream.Flush(); - fileStream.Close(); - DeletePackages(); - Cleanup(); - throw new OperationCanceledException(); - } - - fileStream.Write(buffer, 0, size); - received += size; - OnUpdateDownloadProgressChanged(received, - (long) total, (float) (received / total) * 100); - size = input.Read(buffer, 0, buffer.Length); - } - - if (!updateConfiguration.UseStatistics || !IncludeCurrentPcIntoStatistics) - continue; - - 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))); - } - } - } - } - finally - { - webResponse?.Close(); - } - } - } - - /// - /// Downloads the available update packages from the server, asynchronously. - /// - public void DownloadPackagesAsync() - { - Task.Factory.StartNew(DownloadPackages).ContinueWith(DownloadTaskCompleted, - _downloadCancellationTokenSource.Token, - TaskContinuationOptions.None, - TaskScheduler.Default); - } - -#if PROVIDE_TAP - /// - /// Downloads the available update packages from the server, asynchronously. - /// - /// - public async Task DownloadPackagesAsync(IProgress progress) - { - _downloadCancellationTokenSource?.Dispose(); - _downloadCancellationTokenSource = new CancellationTokenSource(); - - long received = 0; - var total = PackageConfigurations.Select(config => GetUpdatePackageSize(config.UpdatePackageUri)) - .Where(updatePackageSize => updatePackageSize != null) - .Sum(updatePackageSize => updatePackageSize.Value); - - if (!Directory.Exists(_applicationUpdateDirectory)) - Directory.CreateDirectory(_applicationUpdateDirectory); - - foreach (var updateConfiguration in PackageConfigurations) - { - WebResponse webResponse = null; - try - { - if (_downloadCancellationTokenSource.Token.IsCancellationRequested) - { - DeletePackages(); - Cleanup(); - throw new OperationCanceledException(); - } - - var webRequest = WebRequest.Create(updateConfiguration.UpdatePackageUri); - if (HttpAuthenticationCredentials != null) - webRequest.Credentials = HttpAuthenticationCredentials; - webResponse = await webRequest.GetResponseAsync(); - - var buffer = new byte[1024]; - _packageFilePaths.Add(new UpdateVersion(updateConfiguration.LiteralVersion), - Path.Combine(_applicationUpdateDirectory, - $"{updateConfiguration.LiteralVersion}.zip")); - using (var fileStream = File.Create(Path.Combine(_applicationUpdateDirectory, - $"{updateConfiguration.LiteralVersion}.zip"))) - { - using (var input = webResponse.GetResponseStream()) - { - if (input == null) - throw new Exception("The response stream couldn't be read."); - - if (_downloadCancellationTokenSource.Token.IsCancellationRequested) - { - DeletePackages(); - Cleanup(); - throw new OperationCanceledException(); - } - - var size = await input.ReadAsync(buffer, 0, buffer.Length); - while (size > 0) - { - if (_downloadCancellationTokenSource.Token.IsCancellationRequested) - { - fileStream.Flush(); - fileStream.Close(); - DeletePackages(); - Cleanup(); - throw new OperationCanceledException(); - } - - await fileStream.WriteAsync(buffer, 0, size); - received += size; - progress.Report(new UpdateDownloadProgressChangedEventArgs(received, - (long) total, (float) (received / total) * 100)); - size = await input.ReadAsync(buffer, 0, buffer.Length); - } - - if (!updateConfiguration.UseStatistics || !IncludeCurrentPcIntoStatistics) - continue; - - 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)); - } - } - } - } - finally - { - webResponse?.Close(); - } - } - } - - -#endif - - private void DownloadTaskCompleted(Task task) - { - if (_downloadCancellationTokenSource.IsCancellationRequested) - return; - - var exception = task.Exception; - if (exception != null) - OnUpdateDownloadFailed(exception.InnerException ?? exception); - else - OnUpdateDownloadFinished(this, EventArgs.Empty); - } - - /// - /// Cancels the download. - /// - /// If there is no download task running, nothing will happen. - public void CancelDownload() - { - _downloadCancellationTokenSource.Cancel(); - } - - /// - /// Returns a value indicating whether the signature of each package is valid, or not. If a package contains an invalid - /// signature, it will be deleted. - /// - /// Returns true if the package is valid; otherwise false. - /// The update package to check could not be found. - /// The signature of the update package is null or empty. - public bool ValidatePackages() - { - foreach (var filePathItem in _packageFilePaths) - { - if (!File.Exists(filePathItem.Value)) - throw new FileNotFoundException(string.Format(_lp.PackageFileNotFoundExceptionText, - filePathItem.Key.FullText)); - - var configuration = - PackageConfigurations.First(config => config.LiteralVersion == filePathItem.Key.ToString()); - if (configuration.Signature == null || configuration.Signature.Length <= 0) - throw new ArgumentException($"Signature of version \"{configuration}\" is null or empty."); - - var stream = File.Open(filePathItem.Value, FileMode.Open); - try - { - RsaManager rsa; - - try - { - rsa = new RsaManager(PublicKey); - } - catch - { - try - { - DeletePackages(); - Cleanup(); - } - catch (Exception ex) - { - throw new PackageDeleteException(ex.Message); - } - return false; - } - - if (rsa.VerifyData(stream, Convert.FromBase64String(configuration.Signature))) - continue; - - try - { - DeletePackages(); - } - catch (Exception ex) - { - throw new PackageDeleteException(ex.Message); - } - - Cleanup(); - return false; - } - finally - { - stream.Close(); - } - } - return true; - } - - /// - /// Terminates the application. - /// - /// - /// If your apllication doesn't terminate correctly or if you want to perform custom actions before terminating, - /// then override this method and implement your own code. - /// - public virtual void TerminateApplication() - { - Environment.Exit(0); - } - - /// - /// Starts the nUpdate UpdateInstaller to unpack the package and start the updating process. - /// - public void InstallPackage() - { - var unpackerDirectory = Path.Combine(Path.GetTempPath(), "nUpdate Installer"); - var unpackerZipPath = Path.Combine(unpackerDirectory, "Ionic.Zip.dll"); - var guiInterfacePath = Path.Combine(unpackerDirectory, "nUpdate.UpdateInstaller.Client.GuiInterface.dll"); - var jsonNetPath = Path.Combine(unpackerDirectory, "Newtonsoft.Json.dll"); - var jsonNetPdbPath = Path.Combine(unpackerDirectory, "Newtonsoft.Json.pdb"); - var unpackerAppPath = Path.Combine(unpackerDirectory, "nUpdate UpdateInstaller.exe"); - //var unpackerAppPdbPath = Path.Combine(unpackerDirectory, "nUpdate UpdateInstaller.pdb"); - - if (Directory.Exists(unpackerDirectory)) - Directory.Delete(unpackerDirectory, true); - Directory.CreateDirectory(unpackerDirectory); - - File.WriteAllBytes(unpackerZipPath, Resources.Ionic_Zip); - File.WriteAllBytes(guiInterfacePath, Resources.nUpdate_UpdateInstaller_Client_GuiInterface); - File.WriteAllBytes(jsonNetPath, Resources.Newtonsoft_Json); - File.WriteAllBytes(jsonNetPdbPath, Resources.Newtonsoft_Json_Pdb); - File.WriteAllBytes(unpackerAppPath, Resources.nUpdate_UpdateInstaller); - - //if (!File.Exists(unpackerAppPdbPath)) - // File.WriteAllBytes(unpackerAppPath, Resources.nUpdate_UpdateInstaller_Pdb); - - var installerUiAssemblyPath = UseCustomInstallerUserInterface - ? $"\"{CustomInstallerUiAssemblyPath}\"" - : string.Empty; - string[] args = - { - $"\"{string.Join("%", _packageFilePaths.Select(item => item.Value))}\"", - $"\"{Application.StartupPath}\"", - $"\"{Application.ExecutablePath}\"", - $"\"{Application.ProductName}\"", - $"\"{Convert.ToBase64String(Encoding.UTF8.GetBytes(Serializer.Serialize(_packageOperations)))}\"", - $"\"{installerUiAssemblyPath}\"", - _lp.InstallerExtractingFilesText, - _lp.InstallerCopyingText, - _lp.FileDeletingOperationText, - _lp.FileRenamingOperationText, - _lp.RegistrySubKeyCreateOperationText, - _lp.RegistrySubKeyDeleteOperationText, - _lp.RegistryNameValuePairDeleteValueOperationText, - _lp.RegistryNameValuePairSetValueOperationText, - _lp.ProcessStartOperationText, - _lp.ProcessStopOperationText, - _lp.ServiceStartOperationText, - _lp.ServiceStopOperationText, - _lp.InstallerUpdatingErrorCaption, - _lp.InstallerInitializingErrorCaption, - $"\"{Convert.ToBase64String(Encoding.UTF8.GetBytes(Serializer.Serialize(Arguments)))}\"", - $"\"{CloseHostApplication}\"", - $"\"{RestartHostApplication}\"", - $"\"{_lp.InstallerFileInUseError}\"" - }; - - var startInfo = new ProcessStartInfo - { - FileName = unpackerAppPath, - Arguments = string.Join("|", args), - UseShellExecute = true, - Verb = "runas" - }; - - try - { - Process.Start(startInfo); - } - catch (Win32Exception ex) - { - DeletePackages(); - Cleanup(); - if (ex.NativeErrorCode != 1223) - throw; - return; - } - - if (CloseHostApplication) - TerminateApplication(); - } - - /// - /// Deletes the downloaded update packages. - /// - public void DeletePackages() - { - foreach (var filePathItem in _packageFilePaths.Where(item => File.Exists(item.Value))) - File.Delete(filePathItem.Value); - } - - private void Initialize() - { - if (Directory.Exists(Path.Combine(Path.GetTempPath(), "nUpdate"))) - return; - - try - { - Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), "nUpdate", Application.ProductName)); - } - catch (Exception ex) - { - throw new IOException(string.Format(_lp.MainFolderCreationExceptionText, - ex.Message)); - } - } - - private void Cleanup() - { - _packageFilePaths.Clear(); - _packageOperations.Clear(); - } - - /// - /// Occurs when an update search is started. - /// - public event EventHandler UpdateSearchStarted; - - /// - /// Occurs when an active update search has finished. - /// - public event EventHandler UpdateSearchFinished; - - /// - /// Occurs when an update search has failed. - /// - public event EventHandler UpdateSearchFailed; - - /// - /// Occurs when the download of the packages begins. - /// - public event EventHandler PackagesDownloadStarted; - - /// - /// Occurs when the download of the packages fails. - /// - public event EventHandler PackagesDownloadFailed; - - /// - /// Occurs when the download progress of the packages has changed. - /// - public event EventHandler PackagesDownloadProgressChanged; - - /// - /// Occurs when the download of the packages has finished. - /// - public event EventHandler PackagesDownloadFinished; - - /// - /// Occurs when the statistics entry failed. - /// - /// - /// This event is meant to provide the user with a warning, if the statistic server entry fails. The update process - /// should not be canceled as this does not cause any problems that could affect it. - /// - public event EventHandler StatisticsEntryFailed; - - protected virtual void OnUpdateSearchStarted(object sender, EventArgs e) - { - UpdateSearchStarted?.Invoke(sender, e); - } - - protected virtual void OnUpdateSearchFinished(bool updateAvailable) - { - UpdateSearchFinished?.Invoke(this, new UpdateSearchFinishedEventArgs(updateAvailable)); - } - - protected virtual void OnUpdateSearchFailed(Exception exception) - { - UpdateSearchFailed?.Invoke(this, new FailedEventArgs(exception)); - } - - protected virtual void OnUpdateDownloadStarted(object sender, EventArgs e) - { - PackagesDownloadStarted?.Invoke(sender, e); - } - - protected virtual void OnUpdateDownloadProgressChanged(long bytesReceived, long totalBytesToReceive, - float percentage) - { - PackagesDownloadProgressChanged?.Invoke(this, - new UpdateDownloadProgressChangedEventArgs(bytesReceived, totalBytesToReceive, percentage)); - } - - protected virtual void OnUpdateDownloadFinished(object sender, EventArgs e) - { - PackagesDownloadFinished?.Invoke(sender, e); - } - - protected virtual void OnUpdateDownloadFailed(Exception exception) - { - PackagesDownloadFailed?.Invoke(this, new FailedEventArgs(exception)); - } - - protected virtual void OnStatisticsEntryFailed(Exception exception) - { - StatisticsEntryFailed?.Invoke(this, new FailedEventArgs(exception)); - } - } -} \ No newline at end of file diff --git a/nUpdate/Updating/UpdateVersion.cd b/nUpdate/Updating/UpdateVersion.cd deleted file mode 100644 index 8adab76e..00000000 --- a/nUpdate/Updating/UpdateVersion.cd +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - AAAAEBAAAAAAAAAGgAqAAgEAgEAAgIAAAAAgAAAAByA= - Updating\UpdateVersion.cs - - - - \ No newline at end of file diff --git a/nUpdate/Updating/UpdaterUI.cd b/nUpdate/Updating/UpdaterUI.cd deleted file mode 100644 index f3a66b6e..00000000 --- a/nUpdate/Updating/UpdaterUI.cd +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - AAAAAAIAAgABFIAAAAAIAEAAAAAAAAACQAAAAAAAAQg= - Updating\UpdaterUI.cs - - - - \ No newline at end of file diff --git a/nUpdate/Updating/UpdaterUi.cs b/nUpdate/Updating/UpdaterUi.cs deleted file mode 100644 index 02cf6b37..00000000 --- a/nUpdate/Updating/UpdaterUi.cs +++ /dev/null @@ -1,358 +0,0 @@ -// Copyright © Dominic Beger 2017 - -using System; -using System.ComponentModel; -using System.Drawing; -using System.IO; -using System.Threading; -using System.Threading.Tasks; -using System.Windows.Forms; -using Microsoft; -using nUpdate.Core.Localization; -using nUpdate.Exceptions; -using nUpdate.UI.Dialogs; -using nUpdate.UI.Popups; -using nUpdate.UpdateEventArgs; - -namespace nUpdate.Updating -{ - public class UpdaterUI - { - private readonly LocalizationProperties _lp; - private readonly ManualResetEvent _searchResetEvent = new ManualResetEvent(false); - private SynchronizationContext _context; - private bool _isTaskRunning; - private bool _updatesAvailable; - - /// - /// Initializes a new instance of the -class. - /// - /// The instance of the to handle over. - /// The synchronization context to use. - public UpdaterUI(UpdateManager updateManager, SynchronizationContext context) - : this(updateManager, context, false) - { - } - - /// - /// Initializes a new instance of the class. - /// - /// The update manager. - /// The context. - /// - /// If set to true a hidden search will be provided in order to search in the - /// background without informing the user. - /// - public UpdaterUI(UpdateManager updateManager, SynchronizationContext context, bool useHiddenSearch) - { - UpdateManagerInstance = updateManager; - Context = context; - UseHiddenSearch = useHiddenSearch; - _lp = LocalizationHelper.GetLocalizationProperties(UpdateManagerInstance.LanguageCulture, - UpdateManagerInstance.CultureFilePaths); - } - - /// - /// Gets or sets the synchronization context to use. - /// - internal SynchronizationContext Context - { - get => _context; - set - { - _context = value; - UpdateManagerInstance.Context = value; - } - } - - /// - /// Gets or sets the given instance of the -class. - /// - internal UpdateManager UpdateManagerInstance { get; set; } - - /// - /// Gets or sets a value indicating whether a hidden search should be provided in order to search in the background - /// without informing the user, or not. - /// - public bool UseHiddenSearch { get; set; } - - private void SearchFinished(object sender, UpdateSearchFinishedEventArgs e) - { - _updatesAvailable = e.UpdatesAvailable; - _searchResetEvent.Set(); - } - - /// - /// Shows the built-in UI while the updates are managed. - /// - public void ShowUserInterface() - { - if (_isTaskRunning) - return; - - _isTaskRunning = true; - var searchDialog = new UpdateSearchDialog {Updater = UpdateManagerInstance}; - searchDialog.CancelButtonClicked += UpdateSearchDialogCancelButtonClick; - - var newUpdateDialog = new NewUpdateDialog {Updater = UpdateManagerInstance}; - var noUpdateDialog = new NoUpdateFoundDialog {Updater = UpdateManagerInstance}; - - var progressIndicator = new Progress(); - var downloadDialog = new UpdateDownloadDialog {Updater = UpdateManagerInstance}; - downloadDialog.CancelButtonClicked += UpdateDownloadDialogCancelButtonClick; - -#if PROVIDE_TAP - - try - { - // TAP - TaskEx.Run(async delegate - { - if (!UseHiddenSearch) - _context.Post(searchDialog.ShowModalDialog, null); - - try - { - _updatesAvailable = await UpdateManagerInstance.SearchForUpdatesAsync(); - } - catch (OperationCanceledException) - { - return; - } - catch (Exception ex) - { - if (UseHiddenSearch) - _context.Send( - o => - Popup.ShowPopup(SystemIcons.Error, _lp.UpdateSearchErrorCaption, ex, - PopupButtons.Ok), null); - else - { - searchDialog.Fail(ex); - _context.Post(searchDialog.CloseDialog, null); - } - return; - } - - if (!UseHiddenSearch) - { - _context.Post(searchDialog.CloseDialog, null); - await TaskEx.Delay(100); - // Prevents race conditions that cause that the UpdateSearchDialog can't be closed before further actions are done - } - - if (_updatesAvailable) - { - var newUpdateDialogReference = new DialogResultReference(); - _context.Send(newUpdateDialog.ShowModalDialog, newUpdateDialogReference); - if (newUpdateDialogReference.DialogResult == DialogResult.Cancel) - return; - } - else if (!_updatesAvailable && UseHiddenSearch) - return; - else if (!_updatesAvailable && !UseHiddenSearch) - { - var noUpdateDialogResultReference = new DialogResultReference(); - if (!UseHiddenSearch) - _context.Send(noUpdateDialog.ShowModalDialog, noUpdateDialogResultReference); - return; - } - - _context.Post(downloadDialog.ShowModalDialog, null); - - try - { - progressIndicator.ProgressChanged += (sender, args) => - downloadDialog.ProgressPercentage = (int) args.Percentage; - - await UpdateManagerInstance.DownloadPackagesAsync(progressIndicator); - } - catch (OperationCanceledException) - { - return; - } - catch (StatisticsException ex) - { - downloadDialog.StatisticsEntryFail(ex); - } - catch (Exception ex) - { - downloadDialog.Fail(ex); - _context.Send(downloadDialog.CloseDialog, null); - return; - } - _context.Send(downloadDialog.CloseDialog, null); - - bool isValid = false; - try - { - isValid = UpdateManagerInstance.ValidatePackages(); - } - catch (FileNotFoundException) - { - _context.Send(o => Popup.ShowPopup(SystemIcons.Error, _lp.PackageValidityCheckErrorCaption, - _lp.PackageNotFoundErrorText, - PopupButtons.Ok), null); - } - catch (ArgumentException) - { - _context.Send(o => Popup.ShowPopup(SystemIcons.Error, _lp.PackageValidityCheckErrorCaption, - _lp.InvalidSignatureErrorText, PopupButtons.Ok), null); - } - catch (Exception ex) - { - _context.Send(o => Popup.ShowPopup(SystemIcons.Error, _lp.PackageValidityCheckErrorCaption, - ex, PopupButtons.Ok), null); - } - - if (!isValid) - _context.Send(o => Popup.ShowPopup(SystemIcons.Error, _lp.InvalidSignatureErrorCaption, - _lp.SignatureNotMatchingErrorText, - PopupButtons.Ok), null); - else - { - 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 - { - _isTaskRunning = false; - } - -#else - try - { - //EAP - UpdateManagerInstance.UpdateSearchFinished += SearchFinished; - UpdateManagerInstance.UpdateSearchFinished += searchDialog.Finished; - UpdateManagerInstance.UpdateSearchFailed += searchDialog.Failed; - UpdateManagerInstance.PackagesDownloadProgressChanged += downloadDialog.ProgressChanged; - UpdateManagerInstance.PackagesDownloadFinished += downloadDialog.Finished; - UpdateManagerInstance.PackagesDownloadFailed += downloadDialog.Failed; - UpdateManagerInstance.StatisticsEntryFailed += downloadDialog.StatisticsEntryFailed; - - Task.Factory.StartNew(() => - { - UpdateManagerInstance.SearchForUpdatesAsync(); - if (!UseHiddenSearch) - { - var searchDialogResultReference = new DialogResultReference(); - _context.Send(searchDialog.ShowModalDialog, searchDialogResultReference); - _context.Send(searchDialog.CloseDialog, null); - if (searchDialogResultReference.DialogResult == DialogResult.Cancel) - return; - } - else - { - _searchResetEvent.WaitOne(); - } - - if (_updatesAvailable) - { - var newUpdateDialogResultReference = new DialogResultReference(); - _context.Send(newUpdateDialog.ShowModalDialog, newUpdateDialogResultReference); - if (newUpdateDialogResultReference.DialogResult == DialogResult.Cancel) - return; - } - else if (!_updatesAvailable && UseHiddenSearch) - { - return; - } - else if (!_updatesAvailable && !UseHiddenSearch) - { - _context.Send(noUpdateDialog.ShowModalDialog, null); - _context.Send(noUpdateDialog.CloseDialog, null); - return; - } - - UpdateManagerInstance.DownloadPackagesAsync(); - - var downloadDialogResultReference = new DialogResultReference(); - _context.Send(downloadDialog.ShowModalDialog, downloadDialogResultReference); - _context.Send(downloadDialog.CloseDialog, null); - if (downloadDialogResultReference.DialogResult == DialogResult.Cancel) - return; - - var isValid = false; - try - { - isValid = UpdateManagerInstance.ValidatePackages(); - } - catch (FileNotFoundException) - { - _context.Send(o => Popup.ShowPopup(SystemIcons.Error, _lp.PackageValidityCheckErrorCaption, - _lp.PackageNotFoundErrorText, - PopupButtons.Ok), null); - } - catch (ArgumentException) - { - _context.Send(o => Popup.ShowPopup(SystemIcons.Error, _lp.PackageValidityCheckErrorCaption, - _lp.InvalidSignatureErrorText, PopupButtons.Ok), null); - } - catch (Exception ex) - { - _context.Send(o => Popup.ShowPopup(SystemIcons.Error, _lp.PackageValidityCheckErrorCaption, - ex, PopupButtons.Ok), null); - } - - if (!isValid) - _context.Send(o => Popup.ShowPopup(SystemIcons.Error, _lp.InvalidSignatureErrorCaption, - _lp.SignatureNotMatchingErrorText, - PopupButtons.Ok), null); - else - { - 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 - { - _isTaskRunning = false; - } -#endif - } - - private void UpdateDownloadDialogCancelButtonClick(object sender, EventArgs e) - { - UpdateManagerInstance.CancelDownload(); - } - - private void UpdateSearchDialogCancelButtonClick(object sender, EventArgs e) - { - UpdateManagerInstance.CancelSearch(); - } - } -} \ No newline at end of file