From 130f4062c40e067e3f4a7121a81fa342b0c8372d Mon Sep 17 00:00:00 2001 From: Matthias Beerens Date: Wed, 1 Nov 2017 19:27:28 +0100 Subject: [PATCH 01/40] Change implementation to a queue and task --- .../Logging/Writers/FileLogWriter.cs | 34 +++++++++++-------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/UpdateLib/UpdateLib/Logging/Writers/FileLogWriter.cs b/UpdateLib/UpdateLib/Logging/Writers/FileLogWriter.cs index 5217052..a6345f1 100644 --- a/UpdateLib/UpdateLib/Logging/Writers/FileLogWriter.cs +++ b/UpdateLib/UpdateLib/Logging/Writers/FileLogWriter.cs @@ -16,6 +16,8 @@ */ using MatthiWare.UpdateLib.Common; +using MatthiWare.UpdateLib.Tasks; +using MatthiWare.UpdateLib.Threading; using MatthiWare.UpdateLib.Utils; using System; using System.IO; @@ -25,20 +27,21 @@ namespace MatthiWare.UpdateLib.Logging.Writers { public class FileLogWriter : ILogWriter { - public const string LOG_FOLDER_NAME = "Log"; - public LoggingLevel LoggingLevel { get { return LoggingLevel.Debug; } } private Lazy m_logFile = new Lazy(GetLogFile); - private readonly object sync = new object(); + private ConcurrentQueue m_logQueue = new ConcurrentQueue(); + private AsyncTask m_logTask; - private static FileInfo GetLogFile() + public FileLogWriter() { - string path = IOUtils.AppDataPath; - string name = Assembly.GetEntryAssembly().GetName().Name; + m_logTask = AsyncTaskFactory.From(new Action(Log)); + } - FileInfo m_logFile = new FileInfo($@"{path}\{LOG_FOLDER_NAME}\log_{DateTime.Now.ToString("yyyyMMdd")}.log"); + private static FileInfo GetLogFile() + { + FileInfo m_logFile = new FileInfo($@"{IOUtils.LogPath}\log_{DateTime.Now.ToString("yyyyMMdd")}.log"); if (!m_logFile.Directory.Exists) m_logFile.Directory.Create(); @@ -48,20 +51,23 @@ private static FileInfo GetLogFile() public void Log(string text) { - Action logAction = new Action(LogAsync); - logAction.BeginInvoke(text, new AsyncCallback(r => logAction.EndInvoke(r)), null); + m_logQueue.Enqueue(text); + + if (!m_logTask.IsRunning) + m_logTask.Start(); } - private void LogAsync(string text) + private void Log() { - lock (sync) - { - using (StreamWriter writer = new StreamWriter(m_logFile.Value.Open(FileMode.OpenOrCreate, FileAccess.Write))) + string text; + using (StreamWriter writer = new StreamWriter(m_logFile.Value.Open(FileMode.OpenOrCreate, FileAccess.Write))) + while (m_logQueue.TryDequeue(out text)) { writer.BaseStream.Seek(0, SeekOrigin.End); writer.WriteLine(text); } - } + } } } + From 054a850f638a1288eae123ea81faa74be54e31eb Mon Sep 17 00:00:00 2001 From: Matthias Beerens Date: Sat, 4 Nov 2017 19:49:29 +0100 Subject: [PATCH 02/40] Add IOUtils CachePath --- UpdateLib/TestApp/Program.cs | 2 +- .../UpdateLib.Tests/Tasks/DownloadTaskTest.cs | 2 +- UpdateLib/UpdateLib/Files/HashCacheFile.cs | 15 +++++-------- UpdateLib/UpdateLib/Tasks/DownloadTask.cs | 22 ++++++++++++------- UpdateLib/UpdateLib/Updater.cs | 11 +++++++--- UpdateLib/UpdateLib/Utils/IOUtils.cs | 6 +++-- 6 files changed, 33 insertions(+), 25 deletions(-) diff --git a/UpdateLib/TestApp/Program.cs b/UpdateLib/TestApp/Program.cs index bcb50b3..a84bacc 100644 --- a/UpdateLib/TestApp/Program.cs +++ b/UpdateLib/TestApp/Program.cs @@ -49,7 +49,7 @@ static void Main() .ConfigureLogger((logger) => logger.LogLevel = LoggingLevel.Debug) .ConfigureLogger((logger) => logger.Writers.Add(new ConsoleLogWriter())) .ConfigureLogger((logger) => logger.Writers.Add(new FileLogWriter())) - .ConfigureUnsafeConnections(true) + .ConfigureAllowUnsafeConnections(true) .ConfigureCacheInvalidation(TimeSpan.FromSeconds(30)) .ConfigureNeedsRestartBeforeUpdate(true) .ConfigureInstallationMode(InstallationMode.Shared) diff --git a/UpdateLib/UpdateLib.Tests/Tasks/DownloadTaskTest.cs b/UpdateLib/UpdateLib.Tests/Tasks/DownloadTaskTest.cs index a6ef8b3..387f871 100644 --- a/UpdateLib/UpdateLib.Tests/Tasks/DownloadTaskTest.cs +++ b/UpdateLib/UpdateLib.Tests/Tasks/DownloadTaskTest.cs @@ -34,7 +34,7 @@ public void Before() Updater.Instance .ConfigureUpdateUrl($@"file:///{path}") .ConfigureInstallationMode(InstallationMode.Local) - .ConfigureUnsafeConnections(true) + .ConfigureAllowUnsafeConnections(true) .Initialize(); } diff --git a/UpdateLib/UpdateLib/Files/HashCacheFile.cs b/UpdateLib/UpdateLib/Files/HashCacheFile.cs index 8ad356f..759cf76 100644 --- a/UpdateLib/UpdateLib/Files/HashCacheFile.cs +++ b/UpdateLib/UpdateLib/Files/HashCacheFile.cs @@ -27,8 +27,7 @@ namespace MatthiWare.UpdateLib.Files [Serializable] public class HashCacheFile { - public const string CACHE_FOLDER_NAME = "Cache"; - public const string FILE_NAME = "HashCacheFile.xml"; + public const string FILE_NAME = "Cache.xml"; [XmlArray("Items")] [XmlArrayItem("Entry")] @@ -52,25 +51,21 @@ public void AddOrUpdateEntry(string fullPath, string hash = "") { HashCacheEntry entry = Items.FirstOrDefault(f => f.FilePath == fullPath); + entry?.Recalculate(); + if (entry == null) { entry = new HashCacheEntry(fullPath); Items.Add(entry); } - else - entry.Recalculate(); Updater.Instance.Logger.Debug(nameof(HashCacheFile), nameof(AddOrUpdateEntry), $"Cache updated for file -> '{entry.FilePath}'"); } } #region Save/Load - private static string GetStoragePath() - { - string path = IOUtils.AppDataPath; - - return $@"{path}\{CACHE_FOLDER_NAME}\{FILE_NAME}"; - } + private static string GetStoragePath()=> $@"{IOUtils.AppDataPath}\{FILE_NAME}"; + /// /// Loads the from the default storage location diff --git a/UpdateLib/UpdateLib/Tasks/DownloadTask.cs b/UpdateLib/UpdateLib/Tasks/DownloadTask.cs index 718516b..1a5be57 100644 --- a/UpdateLib/UpdateLib/Tasks/DownloadTask.cs +++ b/UpdateLib/UpdateLib/Tasks/DownloadTask.cs @@ -17,6 +17,7 @@ using MatthiWare.UpdateLib.Files; using MatthiWare.UpdateLib.Security; +using MatthiWare.UpdateLib.Utils; using System; using System.IO; using System.Net; @@ -49,13 +50,18 @@ protected override void DoWork() string localFile = Updater.Instance.Converter.Convert(Entry.DestinationLocation); string remoteFile = string.Concat(Updater.Instance.RemoteBasePath, Entry.SourceLocation); + Updater.Instance.Logger.Debug(nameof(DownloadTask), nameof(DoWork), $"LocalFile => {localFile}"); Updater.Instance.Logger.Debug(nameof(DownloadTask), nameof(DoWork), $"RemoteFile => {remoteFile}"); FileInfo fi = new FileInfo(localFile); + string cacheFile = $"{IOUtils.CachePath}\\{fi.Name}"; + + if (File.Exists(cacheFile)) + File.Delete(cacheFile); if (fi.Exists) - fi.MoveTo($"{localFile}.old.tmp"); + fi.MoveTo(cacheFile); if (!fi.Directory.Exists) fi.Directory.Create(); @@ -83,23 +89,23 @@ public override void Rollback() webClient.CancelAsync(); - string localFile = Updater.Instance.Converter.Convert(Entry.DestinationLocation); - string localTempFile = $"{localFile}.old.tmp"; + FileInfo localFile = new FileInfo(Updater.Instance.Converter.Convert(Entry.DestinationLocation)); + FileInfo cacheFile = new FileInfo($"{IOUtils.CachePath}\\{localFile.Name}"); - if (!File.Exists(localTempFile)) + if (!cacheFile.Exists) { OnTaskProgressChanged(100); return; } - if (File.Exists(localFile)) - File.Delete(localFile); + if (localFile.Exists) + localFile.Delete(); - File.Move(localTempFile, localFile); + cacheFile.MoveTo(localFile.FullName); OnTaskProgressChanged(50); - Updater.Instance.GetCache().AddOrUpdateEntry(localFile); + Updater.Instance.GetCache().AddOrUpdateEntry(localFile.FullName); Updater.Instance.Logger.Warn(nameof(DownloadTask), nameof(Cancel), $"Rolled back -> {Entry.Name}"); diff --git a/UpdateLib/UpdateLib/Updater.cs b/UpdateLib/UpdateLib/Updater.cs index e05ad6d..2841c80 100644 --- a/UpdateLib/UpdateLib/Updater.cs +++ b/UpdateLib/UpdateLib/Updater.cs @@ -61,11 +61,12 @@ public static Updater Instance #region Fields private const string m_strUpdateLib = "UpdateLib"; - + private string m_updateUrl = string.Empty; private const string m_argUpdateSilent = "silent"; private const string m_argUpdate = "update"; private const string m_argWait = "wait"; + private const string m_rollback = "rollback"; private Lazy m_lazyPathVarConv = new Lazy(() => new PathVariableConverter()); private TimeSpan m_cacheInvalidation = TimeSpan.FromMinutes(5); private Lazy m_lazyLogger = new Lazy(() => new Logger()); @@ -159,6 +160,8 @@ public InstallationMode InstallationMode /// public bool WaitForProcessExit { get; private set; } + public bool Rollback { get; private set; } + /// /// Gets the . /// This property is only initialized when called. @@ -233,7 +236,7 @@ public Updater ConfigurePathConverter(Action action) /// Do not enable this unless you know what you are doing /// Allowed? /// - public Updater ConfigureUnsafeConnections(bool allow) + public Updater ConfigureAllowUnsafeConnections(bool allow) { AllowUnsafeConnection = allow; @@ -324,6 +327,7 @@ private Updater() CommandLine.AddParameter(m_argUpdateSilent); CommandLine.AddParameter(m_argUpdate); CommandLine.AddParameter(m_argWait, ParamMandatoryType.Optional, ParamValueType.Int); + CommandLine.AddParameter(m_rollback); } /// @@ -340,6 +344,7 @@ public void Initialize() WaitForProcessExit = CommandLine[m_argWait]?.IsFound ?? false; StartUpdating = CommandLine[m_argUpdate]?.IsFound ?? false; UpdateSilently = CommandLine[m_argUpdateSilent]?.IsFound ?? false; + Rollback = CommandLine[m_rollback]?.IsFound ?? false; if (WaitForProcessExit) WaitForProcessToExit((int)CommandLine[m_argWait].Value); @@ -586,7 +591,7 @@ internal bool RestartApp(bool update = false, bool silent = false, bool waitForP args.Add(Process.GetCurrentProcess().Id.ToString()); } - if (update && !args.Contains(CommandLine.ParameterPrefix + m_argUpdate)) + if (update && !args.Contains(CommandLine.ParameterPrefix + m_argUpdate)) args.Add(CommandLine.ParameterPrefix + m_argUpdate); if (silent && !args.Contains(CommandLine.ParameterPrefix + m_argUpdateSilent)) diff --git a/UpdateLib/UpdateLib/Utils/IOUtils.cs b/UpdateLib/UpdateLib/Utils/IOUtils.cs index 4430cac..08e8c29 100644 --- a/UpdateLib/UpdateLib/Utils/IOUtils.cs +++ b/UpdateLib/UpdateLib/Utils/IOUtils.cs @@ -24,6 +24,8 @@ namespace MatthiWare.UpdateLib.Utils public static class IOUtils { private static Lazy m_getAppDataPath = new Lazy(GetAppDataPath); + private static Lazy m_getCachePath = new Lazy(() => $"{AppDataPath}\\Cache"); + private static Lazy m_getLogPath = new Lazy(() => $"{AppDataPath}\\Log"); internal static void ReinitializeAppData() { @@ -31,6 +33,8 @@ internal static void ReinitializeAppData() } public static string AppDataPath { get { return m_getAppDataPath.Value; } } + public static string CachePath { get { return m_getCachePath.Value; } } + public static string LogPath { get { return m_getLogPath.Value; } } public static string GetRemoteBasePath(string url) { @@ -72,8 +76,6 @@ private static string GetPathPrefix() default: return Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); } - - } } From bf99c745d9beb84115579a02b77c28bd9d637b13 Mon Sep 17 00:00:00 2001 From: Matthias Beerens Date: Sat, 11 Nov 2017 15:17:30 +0100 Subject: [PATCH 03/40] Add Version proxy class that can be serialized to XML --- UpdateLib/UpdateLib/Common/VersionXml.cs | 57 ++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 UpdateLib/UpdateLib/Common/VersionXml.cs diff --git a/UpdateLib/UpdateLib/Common/VersionXml.cs b/UpdateLib/UpdateLib/Common/VersionXml.cs new file mode 100644 index 0000000..51b3afe --- /dev/null +++ b/UpdateLib/UpdateLib/Common/VersionXml.cs @@ -0,0 +1,57 @@ +/* UpdateLib - .Net auto update library + * Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using System; +using System.Diagnostics; +using System.ComponentModel; +using System.Xml.Serialization; + +namespace MatthiWare.UpdateLib.Common +{ + /// + /// Serialize System.Version to XML: https://stackoverflow.com/a/18962224/6058174 + /// + [Serializable] + [XmlType("Version")] + [DebuggerDisplay("Version")] + public class VersionXml + { + public VersionXml() { } + + public VersionXml(Version version) + { + Version = version; + } + + [XmlIgnore] + public Version Version { get; set; } = null; + + [XmlText] + [EditorBrowsable(EditorBrowsableState.Never), Browsable(false)] + public string Value + { + get { return Version?.ToString() ?? string.Empty; } + set { Version = new Version(value); } + } + + public static implicit operator Version(VersionXml VersionXml) => VersionXml.Version; + + public static implicit operator VersionXml(Version Version) => new VersionXml(Version); + + public override string ToString() => Value; + } +} From 9cd84c9a8246827049b50b52d17491222c01eee4 Mon Sep 17 00:00:00 2001 From: Matthias Beerens Date: Sat, 11 Nov 2017 16:03:30 +0100 Subject: [PATCH 04/40] Marked as obsolete --- UpdateLib/UpdateLib/Controls/UpdaterControl.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/UpdateLib/UpdateLib/Controls/UpdaterControl.cs b/UpdateLib/UpdateLib/Controls/UpdaterControl.cs index 39fcebf..919c063 100644 --- a/UpdateLib/UpdateLib/Controls/UpdaterControl.cs +++ b/UpdateLib/UpdateLib/Controls/UpdaterControl.cs @@ -7,6 +7,7 @@ namespace MatthiWare.UpdateLib.Controls { [ToolboxBitmap(typeof(UpdaterControl), "UpdaterControl.bmp")] + [Obsolete("We will no longer be supporting the UpdaterControl")] public partial class UpdaterControl : UserControl { private const int ICON_SIZE = 16; From 5f9dbbdfecd0761478eaf5248132411c8f11e05a Mon Sep 17 00:00:00 2001 From: Matthias Beerens Date: Sat, 11 Nov 2017 16:03:49 +0100 Subject: [PATCH 05/40] Remove IEncoder we will not need this --- UpdateLib/UpdateLib/Encoders/IEncoder.cs | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 UpdateLib/UpdateLib/Encoders/IEncoder.cs diff --git a/UpdateLib/UpdateLib/Encoders/IEncoder.cs b/UpdateLib/UpdateLib/Encoders/IEncoder.cs deleted file mode 100644 index 7b652a2..0000000 --- a/UpdateLib/UpdateLib/Encoders/IEncoder.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace MatthiWare.UpdateLib.Encoders -{ - public interface IEncoder - { - } -} From 99792d8dcf03700b4e1b50d2607fee7e9757b38b Mon Sep 17 00:00:00 2001 From: Matthias Beerens Date: Sat, 11 Nov 2017 16:04:32 +0100 Subject: [PATCH 06/40] Change namespace to MatthiWare.UpdateLib.Common --- .../Tasks/UpdateGeneratorTask.cs | 3 +- .../UI/Pages/InformationPage.cs | 8 +- .../Files/DirectoryEntryTest.cs | 1 + .../UpdateLib.Tests/Files/FileEntryTest.cs | 1 + .../Files/HashCacheEntryTest.cs | 1 + .../Files/HashCacheFileTest.cs | 7 +- .../Files/PathVariableConverterTest.cs | 2 +- .../UpdateLib.Tests/Files/UpdateFileTest.cs | 13 +- .../Util/RegistryHelperTest.cs | 1 + .../{Files => Common}/DirectoryEntry.cs | 2 +- .../UpdateLib/{Files => Common}/EntryBase.cs | 2 +- .../UpdateLib/{Files => Common}/FileEntry.cs | 4 +- .../{Files => Common}/HashCacheEntry.cs | 2 +- .../PathVariableConverter.cs | 2 +- .../{Files => Common}/RegistryKeyEntry.cs | 6 +- UpdateLib/UpdateLib/Common/VersionXml.cs | 3 +- .../{Tasks => Common}/WorkerScheduler.cs | 3 +- UpdateLib/UpdateLib/Files/HashCacheFile.cs | 1 + UpdateLib/UpdateLib/Files/UpdateFile.cs | 29 ++-- UpdateLib/UpdateLib/Tasks/AsyncTask.cs | 1 + .../Tasks/CheckForUpdatedItemsTask.cs | 1 + .../CheckForUpdatesCompletedEventArgs.cs | 2 +- .../UpdateLib/Tasks/CheckForUpdatesTask.cs | 4 +- .../Tasks/CheckRequiredPrivilegesTask.cs | 1 + UpdateLib/UpdateLib/Tasks/DownloadManager.cs | 1 + UpdateLib/UpdateLib/Tasks/DownloadTask.cs | 2 +- UpdateLib/UpdateLib/Tasks/UpdateCacheTask.cs | 1 + .../Tasks/UpdateFileProcessorTask.cs | 1 + .../UpdateLib/Tasks/UpdateRegistryTask.cs | 2 +- .../UpdateLib/UI/Components/FinishPage.cs | 6 +- .../UI/Components/RollbackPage.Designer.cs | 142 ++++++++++++++++++ .../UpdateLib/UI/Components/RollbackPage.cs | 19 +++ .../UpdateLib/UI/Components/RollbackPage.resx | 123 +++++++++++++++ .../UpdateLib/UI/Components/UpdatePage.cs | 1 + UpdateLib/UpdateLib/UpdateLib.csproj | 25 ++- UpdateLib/UpdateLib/Updater.cs | 2 +- UpdateLib/UpdateLib/Utils/RegistryHelper.cs | 2 +- 37 files changed, 370 insertions(+), 57 deletions(-) rename UpdateLib/UpdateLib/{Files => Common}/DirectoryEntry.cs (99%) rename UpdateLib/UpdateLib/{Files => Common}/EntryBase.cs (97%) rename UpdateLib/UpdateLib/{Files => Common}/FileEntry.cs (96%) rename UpdateLib/UpdateLib/{Files => Common}/HashCacheEntry.cs (98%) rename UpdateLib/UpdateLib/{Files => Common}/PathVariableConverter.cs (99%) rename UpdateLib/UpdateLib/{Files => Common}/RegistryKeyEntry.cs (91%) rename UpdateLib/UpdateLib/{Tasks => Common}/WorkerScheduler.cs (98%) create mode 100644 UpdateLib/UpdateLib/UI/Components/RollbackPage.Designer.cs create mode 100644 UpdateLib/UpdateLib/UI/Components/RollbackPage.cs create mode 100644 UpdateLib/UpdateLib/UI/Components/RollbackPage.resx diff --git a/UpdateLib/UpdateLib.Generator/Tasks/UpdateGeneratorTask.cs b/UpdateLib/UpdateLib.Generator/Tasks/UpdateGeneratorTask.cs index 53c5771..845628b 100644 --- a/UpdateLib/UpdateLib.Generator/Tasks/UpdateGeneratorTask.cs +++ b/UpdateLib/UpdateLib.Generator/Tasks/UpdateGeneratorTask.cs @@ -25,6 +25,7 @@ using MatthiWare.UpdateLib.Generator.Data.FilesPage; using System.Collections.Generic; using MatthiWare.UpdateLib.Generator.UI.Pages; +using MatthiWare.UpdateLib.Common; namespace MatthiWare.UpdateLib.Generator.Tasks { @@ -73,7 +74,7 @@ protected override void DoWork() Enqueue(new Action(AddRegistryItems), null); Result.ApplicationName = infoPage.ApplicationName; - Result.VersionString = infoPage.ApplicationVersion; + Result.Version = infoPage.Version; } private void AddRegistryItems() diff --git a/UpdateLib/UpdateLib.Generator/UI/Pages/InformationPage.cs b/UpdateLib/UpdateLib.Generator/UI/Pages/InformationPage.cs index 390ecfd..a8e05e2 100644 --- a/UpdateLib/UpdateLib.Generator/UI/Pages/InformationPage.cs +++ b/UpdateLib/UpdateLib.Generator/UI/Pages/InformationPage.cs @@ -15,6 +15,8 @@ * along with this program. If not, see . */ +using System; + namespace MatthiWare.UpdateLib.Generator.UI.Pages { public partial class InformationPage : PageControlBase @@ -32,15 +34,15 @@ public string ApplicationName } } - public string ApplicationVersion + public Version Version { get { - return txtAppVersion.Text; + return new Version(txtAppVersion.Text); } set { - txtAppVersion.Text = value; + txtAppVersion.Text = value.ToString(); } } diff --git a/UpdateLib/UpdateLib.Tests/Files/DirectoryEntryTest.cs b/UpdateLib/UpdateLib.Tests/Files/DirectoryEntryTest.cs index 146d7dc..8873610 100644 --- a/UpdateLib/UpdateLib.Tests/Files/DirectoryEntryTest.cs +++ b/UpdateLib/UpdateLib.Tests/Files/DirectoryEntryTest.cs @@ -15,6 +15,7 @@ * along with this program. If not, see . */ +using MatthiWare.UpdateLib.Common; using MatthiWare.UpdateLib.Files; using NUnit.Framework; using System; diff --git a/UpdateLib/UpdateLib.Tests/Files/FileEntryTest.cs b/UpdateLib/UpdateLib.Tests/Files/FileEntryTest.cs index 5fde225..c8eaaab 100644 --- a/UpdateLib/UpdateLib.Tests/Files/FileEntryTest.cs +++ b/UpdateLib/UpdateLib.Tests/Files/FileEntryTest.cs @@ -15,6 +15,7 @@ * along with this program. If not, see . */ +using MatthiWare.UpdateLib.Common; using MatthiWare.UpdateLib.Files; using NUnit.Framework; diff --git a/UpdateLib/UpdateLib.Tests/Files/HashCacheEntryTest.cs b/UpdateLib/UpdateLib.Tests/Files/HashCacheEntryTest.cs index 2eae599..53c7651 100644 --- a/UpdateLib/UpdateLib.Tests/Files/HashCacheEntryTest.cs +++ b/UpdateLib/UpdateLib.Tests/Files/HashCacheEntryTest.cs @@ -15,6 +15,7 @@ * along with this program. If not, see . */ +using MatthiWare.UpdateLib.Common; using MatthiWare.UpdateLib.Files; using NUnit.Framework; using System; diff --git a/UpdateLib/UpdateLib.Tests/Files/HashCacheFileTest.cs b/UpdateLib/UpdateLib.Tests/Files/HashCacheFileTest.cs index 8ce9748..e3565d5 100644 --- a/UpdateLib/UpdateLib.Tests/Files/HashCacheFileTest.cs +++ b/UpdateLib/UpdateLib.Tests/Files/HashCacheFileTest.cs @@ -1,5 +1,4 @@ -using MatthiWare.UpdateLib.Files; -/* UpdateLib - .Net auto update library +/* UpdateLib - .Net auto update library * Copyright (C) 2016 - MatthiWare (Matthias Beerens) * * This program is free software: you can redistribute it and/or modify @@ -16,6 +15,8 @@ * along with this program. If not, see . */ +using MatthiWare.UpdateLib.Common; +using MatthiWare.UpdateLib.Files; using NUnit.Framework; using System; using System.IO; @@ -35,7 +36,7 @@ public void Before() { var path = Path.GetTempPath(); - m_path = $@"{path}\{HashCacheFile.CACHE_FOLDER_NAME}_{Guid.NewGuid().ToString()}\{HashCacheFile.FILE_NAME}"; + m_path = $@"{path}\\Cache_{Guid.NewGuid().ToString()}\{HashCacheFile.FILE_NAME}"; m_tempFile = Path.GetTempPath() + Guid.NewGuid().ToString() + "hash_cache_file_test.tmp"; using (StreamWriter sw = new StreamWriter(File.Open(m_tempFile, FileMode.OpenOrCreate, FileAccess.Write), Encoding.Default)) diff --git a/UpdateLib/UpdateLib.Tests/Files/PathVariableConverterTest.cs b/UpdateLib/UpdateLib.Tests/Files/PathVariableConverterTest.cs index 2956a7d..28677b2 100644 --- a/UpdateLib/UpdateLib.Tests/Files/PathVariableConverterTest.cs +++ b/UpdateLib/UpdateLib.Tests/Files/PathVariableConverterTest.cs @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -using MatthiWare.UpdateLib.Files; +using MatthiWare.UpdateLib.Common; using NUnit.Framework; using System; using System.IO; diff --git a/UpdateLib/UpdateLib.Tests/Files/UpdateFileTest.cs b/UpdateLib/UpdateLib.Tests/Files/UpdateFileTest.cs index 038fa91..d609ced 100644 --- a/UpdateLib/UpdateLib.Tests/Files/UpdateFileTest.cs +++ b/UpdateLib/UpdateLib.Tests/Files/UpdateFileTest.cs @@ -1,7 +1,4 @@ -using MatthiWare.UpdateLib.Files; -using Moq; -using NUnit.Framework; -/* UpdateLib - .Net auto update library +/* UpdateLib - .Net auto update library * Copyright (C) 2016 - MatthiWare (Matthias Beerens) * * This program is free software: you can redistribute it and/or modify @@ -20,6 +17,10 @@ using System; using System.IO; +using MatthiWare.UpdateLib.Common; +using MatthiWare.UpdateLib.Files; +using Moq; +using NUnit.Framework; namespace UpdateLib.Tests.Files { @@ -42,7 +43,7 @@ public void SaveAndLoadUpdateFileShouldBeTheSame() UpdateFile loadedFile = UpdateFile.Load(temp_file); Assert.AreEqual(file.ApplicationName, loadedFile.ApplicationName); - Assert.AreEqual(file.VersionString, loadedFile.VersionString); + Assert.AreEqual(file.Version, loadedFile.Version); Assert.AreEqual(file.FileCount, loadedFile.FileCount); } @@ -85,7 +86,7 @@ private UpdateFile MakeUpdateFile() UpdateFile file = new UpdateFile(); file.ApplicationName = nameof(UpdateFileTest); - file.VersionString = "9.9.9.9"; + file.Version = new Version("9.9.9.9"); DirectoryEntry appSubFolder = new DirectoryEntry("AppSubFolder"); DirectoryEntry otherSubFolder = new DirectoryEntry("OtherSubFolder"); diff --git a/UpdateLib/UpdateLib.Tests/Util/RegistryHelperTest.cs b/UpdateLib/UpdateLib.Tests/Util/RegistryHelperTest.cs index 367c6b9..f836c39 100644 --- a/UpdateLib/UpdateLib.Tests/Util/RegistryHelperTest.cs +++ b/UpdateLib/UpdateLib.Tests/Util/RegistryHelperTest.cs @@ -15,6 +15,7 @@ * along with this program. If not, see . */ +using MatthiWare.UpdateLib.Common; using MatthiWare.UpdateLib.Files; using MatthiWare.UpdateLib.Utils; using NUnit.Framework; diff --git a/UpdateLib/UpdateLib/Files/DirectoryEntry.cs b/UpdateLib/UpdateLib/Common/DirectoryEntry.cs similarity index 99% rename from UpdateLib/UpdateLib/Files/DirectoryEntry.cs rename to UpdateLib/UpdateLib/Common/DirectoryEntry.cs index 023824c..8e31430 100644 --- a/UpdateLib/UpdateLib/Files/DirectoryEntry.cs +++ b/UpdateLib/UpdateLib/Common/DirectoryEntry.cs @@ -22,7 +22,7 @@ using System.Linq; using System.Diagnostics; -namespace MatthiWare.UpdateLib.Files +namespace MatthiWare.UpdateLib.Common { /// /// Represents a directory in the update file. diff --git a/UpdateLib/UpdateLib/Files/EntryBase.cs b/UpdateLib/UpdateLib/Common/EntryBase.cs similarity index 97% rename from UpdateLib/UpdateLib/Files/EntryBase.cs rename to UpdateLib/UpdateLib/Common/EntryBase.cs index 74cc5af..8fc9864 100644 --- a/UpdateLib/UpdateLib/Files/EntryBase.cs +++ b/UpdateLib/UpdateLib/Common/EntryBase.cs @@ -19,7 +19,7 @@ using System.Text; using System.Xml.Serialization; -namespace MatthiWare.UpdateLib.Files +namespace MatthiWare.UpdateLib.Common { [Serializable] public abstract class EntryBase diff --git a/UpdateLib/UpdateLib/Files/FileEntry.cs b/UpdateLib/UpdateLib/Common/FileEntry.cs similarity index 96% rename from UpdateLib/UpdateLib/Files/FileEntry.cs rename to UpdateLib/UpdateLib/Common/FileEntry.cs index 7b1a221..165ee43 100644 --- a/UpdateLib/UpdateLib/Files/FileEntry.cs +++ b/UpdateLib/UpdateLib/Common/FileEntry.cs @@ -14,11 +14,11 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ - + using System; using System.Xml.Serialization; -namespace MatthiWare.UpdateLib.Files +namespace MatthiWare.UpdateLib.Common { [Serializable] public class FileEntry : EntryBase diff --git a/UpdateLib/UpdateLib/Files/HashCacheEntry.cs b/UpdateLib/UpdateLib/Common/HashCacheEntry.cs similarity index 98% rename from UpdateLib/UpdateLib/Files/HashCacheEntry.cs rename to UpdateLib/UpdateLib/Common/HashCacheEntry.cs index 18c1380..351816c 100644 --- a/UpdateLib/UpdateLib/Files/HashCacheEntry.cs +++ b/UpdateLib/UpdateLib/Common/HashCacheEntry.cs @@ -20,7 +20,7 @@ using System.IO; using System.Xml.Serialization; -namespace MatthiWare.UpdateLib.Files +namespace MatthiWare.UpdateLib.Common { [Serializable] public class HashCacheEntry diff --git a/UpdateLib/UpdateLib/Files/PathVariableConverter.cs b/UpdateLib/UpdateLib/Common/PathVariableConverter.cs similarity index 99% rename from UpdateLib/UpdateLib/Files/PathVariableConverter.cs rename to UpdateLib/UpdateLib/Common/PathVariableConverter.cs index 0e8b61e..575663f 100644 --- a/UpdateLib/UpdateLib/Files/PathVariableConverter.cs +++ b/UpdateLib/UpdateLib/Common/PathVariableConverter.cs @@ -20,7 +20,7 @@ using System.IO; using System.Text; -namespace MatthiWare.UpdateLib.Files +namespace MatthiWare.UpdateLib.Common { /// /// This will convert specified path variables to their actual path diff --git a/UpdateLib/UpdateLib/Files/RegistryKeyEntry.cs b/UpdateLib/UpdateLib/Common/RegistryKeyEntry.cs similarity index 91% rename from UpdateLib/UpdateLib/Files/RegistryKeyEntry.cs rename to UpdateLib/UpdateLib/Common/RegistryKeyEntry.cs index 8051d72..10b9048 100644 --- a/UpdateLib/UpdateLib/Files/RegistryKeyEntry.cs +++ b/UpdateLib/UpdateLib/Common/RegistryKeyEntry.cs @@ -17,14 +17,10 @@ using Microsoft.Win32; using System; -using System.Collections.Generic; using System.Diagnostics; -using System.Linq; -using System.Security.AccessControl; -using System.Text; using System.Xml.Serialization; -namespace MatthiWare.UpdateLib.Files +namespace MatthiWare.UpdateLib.Common { [Serializable] [DebuggerDisplay("RegistryKeyEntry: {DestinationLocation}")] diff --git a/UpdateLib/UpdateLib/Common/VersionXml.cs b/UpdateLib/UpdateLib/Common/VersionXml.cs index 51b3afe..1dcbd78 100644 --- a/UpdateLib/UpdateLib/Common/VersionXml.cs +++ b/UpdateLib/UpdateLib/Common/VersionXml.cs @@ -23,7 +23,8 @@ namespace MatthiWare.UpdateLib.Common { /// - /// Serialize System.Version to XML: https://stackoverflow.com/a/18962224/6058174 + /// Version proxy class to serialize to XML + /// https://stackoverflow.com/a/18962224/6058174 /// [Serializable] [XmlType("Version")] diff --git a/UpdateLib/UpdateLib/Tasks/WorkerScheduler.cs b/UpdateLib/UpdateLib/Common/WorkerScheduler.cs similarity index 98% rename from UpdateLib/UpdateLib/Tasks/WorkerScheduler.cs rename to UpdateLib/UpdateLib/Common/WorkerScheduler.cs index 41b5ce9..62ff183 100644 --- a/UpdateLib/UpdateLib/Tasks/WorkerScheduler.cs +++ b/UpdateLib/UpdateLib/Common/WorkerScheduler.cs @@ -15,11 +15,12 @@ * along with this program. If not, see . */ +using MatthiWare.UpdateLib.Tasks; using MatthiWare.UpdateLib.Threading; using System; using System.Threading; -namespace MatthiWare.UpdateLib.Tasks +namespace MatthiWare.UpdateLib.Common { internal class WorkerScheduler { diff --git a/UpdateLib/UpdateLib/Files/HashCacheFile.cs b/UpdateLib/UpdateLib/Files/HashCacheFile.cs index 759cf76..15d33fb 100644 --- a/UpdateLib/UpdateLib/Files/HashCacheFile.cs +++ b/UpdateLib/UpdateLib/Files/HashCacheFile.cs @@ -16,6 +16,7 @@ */ using MatthiWare.UpdateLib.Utils; +using MatthiWare.UpdateLib.Common; using System; using System.Collections.Generic; using System.IO; diff --git a/UpdateLib/UpdateLib/Files/UpdateFile.cs b/UpdateLib/UpdateLib/Files/UpdateFile.cs index 5c66f16..64c1b2e 100644 --- a/UpdateLib/UpdateLib/Files/UpdateFile.cs +++ b/UpdateLib/UpdateLib/Files/UpdateFile.cs @@ -22,6 +22,7 @@ using System.Xml; using System.Xml.Serialization; using System.Linq; +using MatthiWare.UpdateLib.Common; namespace MatthiWare.UpdateLib.Files { @@ -39,16 +40,16 @@ public class UpdateFile /// /// Gets or sets the version of the current update. - /// The versionstring should be parsable by the to be valid. + /// The versionstring should be parsable by the to be valid. /// [XmlAttribute] - public string VersionString { get; set; } = "1.0.0.0"; + public VersionXml Version { get; set; } = new Version("1.0.0.0"); /// /// Gets the folders of the project /// [XmlArray("Folders"), XmlArrayItem("Directory")] - public List Folders { get; set; } = new List(); + public List Folders { get; private set; } = new List(); /// /// Gets the count of all the files in the @@ -61,7 +62,7 @@ public class UpdateFile public int RegistryKeyCount { get { return Registry.Select(r => r.Count).Sum(); } } [XmlArray("Registry"), XmlArrayItem("Directory")] - public List Registry { get; set; } = new List(); + public List Registry { get; private set; } = new List(); public UpdateFile() { @@ -80,7 +81,7 @@ public void Save(Stream output) throw new ArgumentException("Stream is not writable", nameof(output)); XmlSerializerNamespaces ns = new XmlSerializerNamespaces(); - // ns.Add(string.Empty, string.Empty); + // ns.Add(string.Empty, string.Empty); XmlSerializer serializer = new XmlSerializer(typeof(UpdateFile), string.Empty); serializer.Serialize(output, this, ns); @@ -96,11 +97,13 @@ public void Save(string path) if (string.IsNullOrEmpty(path)) throw new ArgumentNullException(nameof(path)); - if (File.Exists(path)) - File.Delete(path); + FileInfo file = new FileInfo(path); - using (Stream s = File.Open(path, FileMode.OpenOrCreate, FileAccess.Write)) - Save(s); + if (file.Exists) + file.Delete(); + + using (var stream = file.Open(FileMode.OpenOrCreate, FileAccess.Write)) + Save(stream); } /// @@ -141,11 +144,13 @@ public static UpdateFile Load(string path) if (string.IsNullOrEmpty(path)) throw new ArgumentNullException(nameof(path)); - if (!File.Exists(path)) + FileInfo file = new FileInfo(path); + + if (!file.Exists) throw new FileNotFoundException("The UpdateFile doesn't exist.", path); - using (Stream s = File.Open(path, FileMode.Open, FileAccess.Read)) - return Load(s); + using (Stream stream = file.OpenRead()) + return Load(stream); } } } diff --git a/UpdateLib/UpdateLib/Tasks/AsyncTask.cs b/UpdateLib/UpdateLib/Tasks/AsyncTask.cs index 8ad53f0..944c0bb 100644 --- a/UpdateLib/UpdateLib/Tasks/AsyncTask.cs +++ b/UpdateLib/UpdateLib/Tasks/AsyncTask.cs @@ -15,6 +15,7 @@ * along with this program. If not, see . */ +using MatthiWare.UpdateLib.Common; using MatthiWare.UpdateLib.Threading; using System; using System.Collections.Generic; diff --git a/UpdateLib/UpdateLib/Tasks/CheckForUpdatedItemsTask.cs b/UpdateLib/UpdateLib/Tasks/CheckForUpdatedItemsTask.cs index 839044b..9a32e42 100644 --- a/UpdateLib/UpdateLib/Tasks/CheckForUpdatedItemsTask.cs +++ b/UpdateLib/UpdateLib/Tasks/CheckForUpdatedItemsTask.cs @@ -15,6 +15,7 @@ * along with this program. If not, see . */ +using MatthiWare.UpdateLib.Common; using MatthiWare.UpdateLib.Files; using MatthiWare.UpdateLib.Utils; using System; diff --git a/UpdateLib/UpdateLib/Tasks/CheckForUpdatesCompletedEventArgs.cs b/UpdateLib/UpdateLib/Tasks/CheckForUpdatesCompletedEventArgs.cs index 279e1cf..a8ae465 100644 --- a/UpdateLib/UpdateLib/Tasks/CheckForUpdatesCompletedEventArgs.cs +++ b/UpdateLib/UpdateLib/Tasks/CheckForUpdatesCompletedEventArgs.cs @@ -22,7 +22,7 @@ namespace MatthiWare.UpdateLib.Tasks { public class CheckForUpdatesCompletedEventArgs : AsyncCompletedEventArgs { - public string LatestVersion { get; set; } + public Version LatestVersion { get; set; } public bool UpdateAvailable { get; set; } public CheckForUpdatesCompletedEventArgs(CheckForUpdatesTask.CheckForUpdatesResult result, Exception error, bool cancelled, object userState) diff --git a/UpdateLib/UpdateLib/Tasks/CheckForUpdatesTask.cs b/UpdateLib/UpdateLib/Tasks/CheckForUpdatesTask.cs index a4438fc..ea2ba61 100644 --- a/UpdateLib/UpdateLib/Tasks/CheckForUpdatesTask.cs +++ b/UpdateLib/UpdateLib/Tasks/CheckForUpdatesTask.cs @@ -63,7 +63,7 @@ protected override void DoWork() // load the updatefile from disk Result.UpdateFile = UpdateFile.Load(localFile); - Result.Version = Result.UpdateFile.VersionString; + Result.Version = Result.UpdateFile.Version; CheckRequiredPrivilegesTask privilegesCheckTask = CheckPrivileges(Result.UpdateFile); @@ -115,7 +115,7 @@ private CheckRequiredPrivilegesTask CheckPrivileges(UpdateFile file) public class CheckForUpdatesResult { - public string Version { get; set; } = string.Empty; + public Version Version { get; set; } public bool UpdateAvailable { get; set; } = false; public UpdateFile UpdateFile { get; set; } public bool AdminRightsNeeded { get; set; } = false; diff --git a/UpdateLib/UpdateLib/Tasks/CheckRequiredPrivilegesTask.cs b/UpdateLib/UpdateLib/Tasks/CheckRequiredPrivilegesTask.cs index 4262536..3c6f278 100644 --- a/UpdateLib/UpdateLib/Tasks/CheckRequiredPrivilegesTask.cs +++ b/UpdateLib/UpdateLib/Tasks/CheckRequiredPrivilegesTask.cs @@ -19,6 +19,7 @@ using MatthiWare.UpdateLib.Security; using System.Linq; using MatthiWare.UpdateLib.Utils; +using MatthiWare.UpdateLib.Common; namespace MatthiWare.UpdateLib.Tasks { diff --git a/UpdateLib/UpdateLib/Tasks/DownloadManager.cs b/UpdateLib/UpdateLib/Tasks/DownloadManager.cs index b17466e..708dc78 100644 --- a/UpdateLib/UpdateLib/Tasks/DownloadManager.cs +++ b/UpdateLib/UpdateLib/Tasks/DownloadManager.cs @@ -15,6 +15,7 @@ * along with this program. If not, see . */ +using MatthiWare.UpdateLib.Common; using MatthiWare.UpdateLib.Files; using MatthiWare.UpdateLib.Threading; using MatthiWare.UpdateLib.Utils; diff --git a/UpdateLib/UpdateLib/Tasks/DownloadTask.cs b/UpdateLib/UpdateLib/Tasks/DownloadTask.cs index 1a5be57..4e2b78d 100644 --- a/UpdateLib/UpdateLib/Tasks/DownloadTask.cs +++ b/UpdateLib/UpdateLib/Tasks/DownloadTask.cs @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -using MatthiWare.UpdateLib.Files; +using MatthiWare.UpdateLib.Common; using MatthiWare.UpdateLib.Security; using MatthiWare.UpdateLib.Utils; using System; diff --git a/UpdateLib/UpdateLib/Tasks/UpdateCacheTask.cs b/UpdateLib/UpdateLib/Tasks/UpdateCacheTask.cs index 9ebef2a..30a98fc 100644 --- a/UpdateLib/UpdateLib/Tasks/UpdateCacheTask.cs +++ b/UpdateLib/UpdateLib/Tasks/UpdateCacheTask.cs @@ -15,6 +15,7 @@ * along with this program. If not, see . */ +using MatthiWare.UpdateLib.Common; using MatthiWare.UpdateLib.Files; using MatthiWare.UpdateLib.Utils; using System; diff --git a/UpdateLib/UpdateLib/Tasks/UpdateFileProcessorTask.cs b/UpdateLib/UpdateLib/Tasks/UpdateFileProcessorTask.cs index 81f0db6..b459014 100644 --- a/UpdateLib/UpdateLib/Tasks/UpdateFileProcessorTask.cs +++ b/UpdateLib/UpdateLib/Tasks/UpdateFileProcessorTask.cs @@ -15,6 +15,7 @@ * along with this program. If not, see . */ +using MatthiWare.UpdateLib.Common; using MatthiWare.UpdateLib.Files; using System; diff --git a/UpdateLib/UpdateLib/Tasks/UpdateRegistryTask.cs b/UpdateLib/UpdateLib/Tasks/UpdateRegistryTask.cs index 8dd66a7..26adba1 100644 --- a/UpdateLib/UpdateLib/Tasks/UpdateRegistryTask.cs +++ b/UpdateLib/UpdateLib/Tasks/UpdateRegistryTask.cs @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -using MatthiWare.UpdateLib.Files; +using MatthiWare.UpdateLib.Common; using MatthiWare.UpdateLib.Utils; using Microsoft.Win32; using System; diff --git a/UpdateLib/UpdateLib/UI/Components/FinishPage.cs b/UpdateLib/UpdateLib/UI/Components/FinishPage.cs index 75413fd..916930a 100644 --- a/UpdateLib/UpdateLib/UI/Components/FinishPage.cs +++ b/UpdateLib/UpdateLib/UI/Components/FinishPage.cs @@ -30,7 +30,7 @@ public FinishPage(UpdaterForm parent) _updaterForm = parent; txtDescription.Text = txtDescription.Text.Replace("%AppName%", parent.updateInfoFile.ApplicationName); - txtDescription.Text = txtDescription.Text.Replace("%version%", parent.updateInfoFile.VersionString); + txtDescription.Text = txtDescription.Text.Replace("%version%", parent.updateInfoFile.Version.Value); } public void UpdateState() @@ -42,7 +42,7 @@ public void UpdateState() UpdateFile file = _updaterForm.updateInfoFile; - txtDescription.Text = $"{file.ApplicationName} was unable to update to version {file.VersionString}!\n\n" + + txtDescription.Text = $"{file.ApplicationName} was unable to update to version {file.Version}!\n\n" + "Check the log files for more information!\n\n" + "Press Finish to close this wizard."; @@ -55,7 +55,7 @@ public void UpdateState() UpdateFile file = _updaterForm.updateInfoFile; - txtDescription.Text = $"{file.ApplicationName} was unable to update to version {file.VersionString}!\n\n" + + txtDescription.Text = $"{file.ApplicationName} was unable to update to version {file.Version}!\n\n" + "Update process cancelled by the user.\n\n" + "Press Finish to close this wizard."; diff --git a/UpdateLib/UpdateLib/UI/Components/RollbackPage.Designer.cs b/UpdateLib/UpdateLib/UI/Components/RollbackPage.Designer.cs new file mode 100644 index 0000000..2164900 --- /dev/null +++ b/UpdateLib/UpdateLib/UI/Components/RollbackPage.Designer.cs @@ -0,0 +1,142 @@ +namespace MatthiWare.UpdateLib.UI.Components +{ + partial class RollbackPage + { + /// + /// 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 Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + System.Windows.Forms.ListViewGroup listViewGroup1 = new System.Windows.Forms.ListViewGroup("Installed version", System.Windows.Forms.HorizontalAlignment.Left); + System.Windows.Forms.ListViewGroup listViewGroup2 = new System.Windows.Forms.ListViewGroup("Local versions", System.Windows.Forms.HorizontalAlignment.Left); + System.Windows.Forms.ListViewGroup listViewGroup3 = new System.Windows.Forms.ListViewGroup("Available versions", System.Windows.Forms.HorizontalAlignment.Left); + this.lblHeader = new System.Windows.Forms.Label(); + this.ilIcons = new System.Windows.Forms.ImageList(this.components); + this.lvItems = new System.Windows.Forms.ListView(); + this.clmnVersion = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.clmnStatus = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.clmnProgress = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.clmnDescription = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.clmnPath = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.SuspendLayout(); + // + // lblHeader + // + this.lblHeader.AutoSize = true; + this.lblHeader.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblHeader.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(43)))), ((int)(((byte)(129)))), ((int)(((byte)(181))))); + this.lblHeader.Location = new System.Drawing.Point(17, 18); + this.lblHeader.Name = "lblHeader"; + this.lblHeader.Size = new System.Drawing.Size(359, 25); + this.lblHeader.TabIndex = 3; + this.lblHeader.Text = "Rollback/repair manager %AppName%"; + // + // ilIcons + // + this.ilIcons.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit; + this.ilIcons.ImageSize = new System.Drawing.Size(16, 16); + this.ilIcons.TransparentColor = System.Drawing.Color.Transparent; + // + // lvItems + // + this.lvItems.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.lvItems.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.clmnVersion, + this.clmnStatus, + this.clmnProgress, + this.clmnDescription, + this.clmnPath}); + this.lvItems.FullRowSelect = true; + listViewGroup1.Header = "Installed version"; + listViewGroup1.Name = "lvgInstalled"; + listViewGroup2.Header = "Local versions"; + listViewGroup2.Name = "lvgLocal"; + listViewGroup3.Header = "Available versions"; + listViewGroup3.Name = "lvgAvailable"; + this.lvItems.Groups.AddRange(new System.Windows.Forms.ListViewGroup[] { + listViewGroup1, + listViewGroup2, + listViewGroup3}); + this.lvItems.Location = new System.Drawing.Point(17, 46); + this.lvItems.Name = "lvItems"; + this.lvItems.Size = new System.Drawing.Size(505, 282); + this.lvItems.TabIndex = 4; + this.lvItems.UseCompatibleStateImageBehavior = false; + this.lvItems.View = System.Windows.Forms.View.Details; + // + // clmnVersion + // + this.clmnVersion.Text = "Version"; + this.clmnVersion.Width = 125; + // + // clmnStatus + // + this.clmnStatus.Text = "Status"; + this.clmnStatus.Width = 131; + // + // clmnProgress + // + this.clmnProgress.Text = "Progress"; + this.clmnProgress.Width = 85; + // + // clmnDescription + // + this.clmnDescription.Text = "Description"; + this.clmnDescription.Width = 100; + // + // clmnPath + // + this.clmnPath.Text = "Path"; + this.clmnPath.Width = 350; + // + // RollbackPage + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.SystemColors.Window; + this.Controls.Add(this.lvItems); + this.Controls.Add(this.lblHeader); + this.Font = new System.Drawing.Font("Segoe UI", 9.75F); + this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.Name = "RollbackPage"; + this.Size = new System.Drawing.Size(538, 341); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + private System.Windows.Forms.Label lblHeader; + private System.Windows.Forms.ImageList ilIcons; + private System.Windows.Forms.ListView lvItems; + private System.Windows.Forms.ColumnHeader clmnVersion; + private System.Windows.Forms.ColumnHeader clmnStatus; + private System.Windows.Forms.ColumnHeader clmnProgress; + private System.Windows.Forms.ColumnHeader clmnDescription; + private System.Windows.Forms.ColumnHeader clmnPath; + } +} diff --git a/UpdateLib/UpdateLib/UI/Components/RollbackPage.cs b/UpdateLib/UpdateLib/UI/Components/RollbackPage.cs new file mode 100644 index 0000000..81dce32 --- /dev/null +++ b/UpdateLib/UpdateLib/UI/Components/RollbackPage.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace MatthiWare.UpdateLib.UI.Components +{ + public partial class RollbackPage : UserControl + { + public RollbackPage() + { + InitializeComponent(); + } + } +} diff --git a/UpdateLib/UpdateLib/UI/Components/RollbackPage.resx b/UpdateLib/UpdateLib/UI/Components/RollbackPage.resx new file mode 100644 index 0000000..be67fa0 --- /dev/null +++ b/UpdateLib/UpdateLib/UI/Components/RollbackPage.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + 17, 17 + + \ No newline at end of file diff --git a/UpdateLib/UpdateLib/UI/Components/UpdatePage.cs b/UpdateLib/UpdateLib/UI/Components/UpdatePage.cs index 04c23a8..ca9351e 100644 --- a/UpdateLib/UpdateLib/UI/Components/UpdatePage.cs +++ b/UpdateLib/UpdateLib/UI/Components/UpdatePage.cs @@ -25,6 +25,7 @@ using System.Collections.Generic; using System.Linq; using MatthiWare.UpdateLib.Utils; +using MatthiWare.UpdateLib.Common; namespace MatthiWare.UpdateLib.UI.Components { diff --git a/UpdateLib/UpdateLib/UpdateLib.csproj b/UpdateLib/UpdateLib/UpdateLib.csproj index 96c445a..6b86375 100644 --- a/UpdateLib/UpdateLib/UpdateLib.csproj +++ b/UpdateLib/UpdateLib/UpdateLib.csproj @@ -52,20 +52,20 @@ + UserControl UpdaterControl.cs - - - - + + + - - - + + + @@ -93,7 +93,7 @@ - + @@ -114,6 +114,12 @@ IntroPage.cs + + UserControl + + + RollbackPage.cs + UserControl @@ -174,6 +180,9 @@ IntroPage.cs + + RollbackPage.cs + UpdatePage.cs diff --git a/UpdateLib/UpdateLib/Updater.cs b/UpdateLib/UpdateLib/Updater.cs index 2841c80..b4c8933 100644 --- a/UpdateLib/UpdateLib/Updater.cs +++ b/UpdateLib/UpdateLib/Updater.cs @@ -512,7 +512,7 @@ private void HandleException(IWin32Window owner, Exception e) MessageBoxButtons.OK); } - private void HandleNoUpdate(IWin32Window owner, string latest) + private void HandleNoUpdate(IWin32Window owner, Version latest) { Logger.Info(nameof(Updater), nameof(CheckForUpdatesAsync), "No update available"); diff --git a/UpdateLib/UpdateLib/Utils/RegistryHelper.cs b/UpdateLib/UpdateLib/Utils/RegistryHelper.cs index 80aee92..37bf802 100644 --- a/UpdateLib/UpdateLib/Utils/RegistryHelper.cs +++ b/UpdateLib/UpdateLib/Utils/RegistryHelper.cs @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -using MatthiWare.UpdateLib.Files; +using MatthiWare.UpdateLib.Common; using MatthiWare.UpdateLib.Tasks; using Microsoft.Win32; using System; From 0719bae9ae1ac9e9fbfee04e4e72c15d9e3f88f8 Mon Sep 17 00:00:00 2001 From: Matthias Beerens Date: Sat, 11 Nov 2017 16:05:56 +0100 Subject: [PATCH 07/40] Cleaned unused usings --- UpdateLib/TestApp/Program.cs | 2 -- UpdateLib/TestApp/Properties/AssemblyInfo.cs | 1 - UpdateLib/UpdateLib.Generator/Data/FilesPage/GenReg.cs | 3 --- UpdateLib/UpdateLib.Generator/Data/TreeViewFolderNode.cs | 2 -- UpdateLib/UpdateLib.Generator/Files/ProjectFile.cs | 3 --- UpdateLib/UpdateLib.Generator/Properties/AssemblyInfo.cs | 1 - UpdateLib/UpdateLib.Tests/Files/DirectoryEntryTest.cs | 1 - UpdateLib/UpdateLib.Tests/Files/FileEntryTest.cs | 1 - UpdateLib/UpdateLib.Tests/Files/HashCacheEntryTest.cs | 1 - UpdateLib/UpdateLib.Tests/Logging/LoggingTests.cs | 6 ------ UpdateLib/UpdateLib.Tests/Properties/AssemblyInfo.cs | 1 - UpdateLib/UpdateLib.Tests/Tasks/DownloadTaskTest.cs | 1 - UpdateLib/UpdateLib.Tests/Util/RegistryHelperTest.cs | 1 - UpdateLib/UpdateLib/Common/Enums.cs | 7 +------ UpdateLib/UpdateLib/Common/ParameterDefinition.cs | 8 +------- UpdateLib/UpdateLib/Logging/Writers/FileLogWriter.cs | 1 - UpdateLib/UpdateLib/Properties/AssemblyInfo.cs | 1 - UpdateLib/UpdateLib/Security/PermissionUtil.cs | 1 - UpdateLib/UpdateLib/UI/Components/RollbackPage.cs | 9 +-------- UpdateLib/UpdateLib/Utils/CmdLineParser.cs | 3 --- 20 files changed, 3 insertions(+), 51 deletions(-) diff --git a/UpdateLib/TestApp/Program.cs b/UpdateLib/TestApp/Program.cs index a84bacc..92efc64 100644 --- a/UpdateLib/TestApp/Program.cs +++ b/UpdateLib/TestApp/Program.cs @@ -17,10 +17,8 @@ using MatthiWare.UpdateLib; using MatthiWare.UpdateLib.Common; -using MatthiWare.UpdateLib.Logging; using MatthiWare.UpdateLib.Logging.Writers; using System; -using System.Text; using System.Windows.Forms; namespace TestApp diff --git a/UpdateLib/TestApp/Properties/AssemblyInfo.cs b/UpdateLib/TestApp/Properties/AssemblyInfo.cs index acc0ca6..3138a30 100644 --- a/UpdateLib/TestApp/Properties/AssemblyInfo.cs +++ b/UpdateLib/TestApp/Properties/AssemblyInfo.cs @@ -1,5 +1,4 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following diff --git a/UpdateLib/UpdateLib.Generator/Data/FilesPage/GenReg.cs b/UpdateLib/UpdateLib.Generator/Data/FilesPage/GenReg.cs index 8fb2602..a41064d 100644 --- a/UpdateLib/UpdateLib.Generator/Data/FilesPage/GenReg.cs +++ b/UpdateLib/UpdateLib.Generator/Data/FilesPage/GenReg.cs @@ -17,9 +17,6 @@ using Microsoft.Win32; using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; namespace MatthiWare.UpdateLib.Generator.Data.FilesPage { diff --git a/UpdateLib/UpdateLib.Generator/Data/TreeViewFolderNode.cs b/UpdateLib/UpdateLib.Generator/Data/TreeViewFolderNode.cs index 231418e..fbfdfa6 100644 --- a/UpdateLib/UpdateLib.Generator/Data/TreeViewFolderNode.cs +++ b/UpdateLib/UpdateLib.Generator/Data/TreeViewFolderNode.cs @@ -1,6 +1,4 @@ using MatthiWare.UpdateLib.Generator.Data.FilesPage; -using System; -using System.Collections.Generic; /* UpdateLib - .Net auto update library * Copyright (C) 2016 - MatthiWare (Matthias Beerens) * diff --git a/UpdateLib/UpdateLib.Generator/Files/ProjectFile.cs b/UpdateLib/UpdateLib.Generator/Files/ProjectFile.cs index e28bc23..5ef1c4c 100644 --- a/UpdateLib/UpdateLib.Generator/Files/ProjectFile.cs +++ b/UpdateLib/UpdateLib.Generator/Files/ProjectFile.cs @@ -16,9 +16,6 @@ */ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; namespace MatthiWare.UpdateLib.Generator.Files { diff --git a/UpdateLib/UpdateLib.Generator/Properties/AssemblyInfo.cs b/UpdateLib/UpdateLib.Generator/Properties/AssemblyInfo.cs index 0e3eea2..dab727a 100644 --- a/UpdateLib/UpdateLib.Generator/Properties/AssemblyInfo.cs +++ b/UpdateLib/UpdateLib.Generator/Properties/AssemblyInfo.cs @@ -1,5 +1,4 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following diff --git a/UpdateLib/UpdateLib.Tests/Files/DirectoryEntryTest.cs b/UpdateLib/UpdateLib.Tests/Files/DirectoryEntryTest.cs index 8873610..792af2e 100644 --- a/UpdateLib/UpdateLib.Tests/Files/DirectoryEntryTest.cs +++ b/UpdateLib/UpdateLib.Tests/Files/DirectoryEntryTest.cs @@ -16,7 +16,6 @@ */ using MatthiWare.UpdateLib.Common; -using MatthiWare.UpdateLib.Files; using NUnit.Framework; using System; using System.Linq; diff --git a/UpdateLib/UpdateLib.Tests/Files/FileEntryTest.cs b/UpdateLib/UpdateLib.Tests/Files/FileEntryTest.cs index c8eaaab..7347289 100644 --- a/UpdateLib/UpdateLib.Tests/Files/FileEntryTest.cs +++ b/UpdateLib/UpdateLib.Tests/Files/FileEntryTest.cs @@ -16,7 +16,6 @@ */ using MatthiWare.UpdateLib.Common; -using MatthiWare.UpdateLib.Files; using NUnit.Framework; namespace UpdateLib.Tests.Files diff --git a/UpdateLib/UpdateLib.Tests/Files/HashCacheEntryTest.cs b/UpdateLib/UpdateLib.Tests/Files/HashCacheEntryTest.cs index 53c7651..2fb8ef8 100644 --- a/UpdateLib/UpdateLib.Tests/Files/HashCacheEntryTest.cs +++ b/UpdateLib/UpdateLib.Tests/Files/HashCacheEntryTest.cs @@ -16,7 +16,6 @@ */ using MatthiWare.UpdateLib.Common; -using MatthiWare.UpdateLib.Files; using NUnit.Framework; using System; using System.IO; diff --git a/UpdateLib/UpdateLib.Tests/Logging/LoggingTests.cs b/UpdateLib/UpdateLib.Tests/Logging/LoggingTests.cs index 377e853..aea5e4c 100644 --- a/UpdateLib/UpdateLib.Tests/Logging/LoggingTests.cs +++ b/UpdateLib/UpdateLib.Tests/Logging/LoggingTests.cs @@ -18,12 +18,6 @@ using MatthiWare.UpdateLib.Logging; using NUnit.Framework; using Moq; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using MatthiWare.UpdateLib.Logging.Writers; using MatthiWare.UpdateLib.Common; namespace UpdateLib.Tests.Logging diff --git a/UpdateLib/UpdateLib.Tests/Properties/AssemblyInfo.cs b/UpdateLib/UpdateLib.Tests/Properties/AssemblyInfo.cs index 412603d..7b0c098 100644 --- a/UpdateLib/UpdateLib.Tests/Properties/AssemblyInfo.cs +++ b/UpdateLib/UpdateLib.Tests/Properties/AssemblyInfo.cs @@ -1,5 +1,4 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following diff --git a/UpdateLib/UpdateLib.Tests/Tasks/DownloadTaskTest.cs b/UpdateLib/UpdateLib.Tests/Tasks/DownloadTaskTest.cs index 387f871..dd187d9 100644 --- a/UpdateLib/UpdateLib.Tests/Tasks/DownloadTaskTest.cs +++ b/UpdateLib/UpdateLib.Tests/Tasks/DownloadTaskTest.cs @@ -17,7 +17,6 @@ using MatthiWare.UpdateLib; using MatthiWare.UpdateLib.Common; -using MatthiWare.UpdateLib.Files; using System.IO; namespace UpdateLib.Tests.Tasks diff --git a/UpdateLib/UpdateLib.Tests/Util/RegistryHelperTest.cs b/UpdateLib/UpdateLib.Tests/Util/RegistryHelperTest.cs index f836c39..932f468 100644 --- a/UpdateLib/UpdateLib.Tests/Util/RegistryHelperTest.cs +++ b/UpdateLib/UpdateLib.Tests/Util/RegistryHelperTest.cs @@ -16,7 +16,6 @@ */ using MatthiWare.UpdateLib.Common; -using MatthiWare.UpdateLib.Files; using MatthiWare.UpdateLib.Utils; using NUnit.Framework; using System; diff --git a/UpdateLib/UpdateLib/Common/Enums.cs b/UpdateLib/UpdateLib/Common/Enums.cs index ce760c5..917d00c 100644 --- a/UpdateLib/UpdateLib/Common/Enums.cs +++ b/UpdateLib/UpdateLib/Common/Enums.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace MatthiWare.UpdateLib.Common +namespace MatthiWare.UpdateLib.Common { /// /// Indicates the how the underlaying application is installed. diff --git a/UpdateLib/UpdateLib/Common/ParameterDefinition.cs b/UpdateLib/UpdateLib/Common/ParameterDefinition.cs index a746dde..8203d19 100644 --- a/UpdateLib/UpdateLib/Common/ParameterDefinition.cs +++ b/UpdateLib/UpdateLib/Common/ParameterDefinition.cs @@ -1,10 +1,4 @@ -using MatthiWare.UpdateLib.Utils; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace MatthiWare.UpdateLib.Common +namespace MatthiWare.UpdateLib.Common { public class ParameterDefinition { diff --git a/UpdateLib/UpdateLib/Logging/Writers/FileLogWriter.cs b/UpdateLib/UpdateLib/Logging/Writers/FileLogWriter.cs index a6345f1..caea025 100644 --- a/UpdateLib/UpdateLib/Logging/Writers/FileLogWriter.cs +++ b/UpdateLib/UpdateLib/Logging/Writers/FileLogWriter.cs @@ -21,7 +21,6 @@ using MatthiWare.UpdateLib.Utils; using System; using System.IO; -using System.Reflection; namespace MatthiWare.UpdateLib.Logging.Writers { diff --git a/UpdateLib/UpdateLib/Properties/AssemblyInfo.cs b/UpdateLib/UpdateLib/Properties/AssemblyInfo.cs index b8c7614..279a776 100644 --- a/UpdateLib/UpdateLib/Properties/AssemblyInfo.cs +++ b/UpdateLib/UpdateLib/Properties/AssemblyInfo.cs @@ -1,5 +1,4 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following diff --git a/UpdateLib/UpdateLib/Security/PermissionUtil.cs b/UpdateLib/UpdateLib/Security/PermissionUtil.cs index bfe8d5d..bbb8963 100644 --- a/UpdateLib/UpdateLib/Security/PermissionUtil.cs +++ b/UpdateLib/UpdateLib/Security/PermissionUtil.cs @@ -16,7 +16,6 @@ */ using MatthiWare.UpdateLib.Common; -using MatthiWare.UpdateLib.Files; using MatthiWare.UpdateLib.Utils; using Microsoft.Win32; using System; diff --git a/UpdateLib/UpdateLib/UI/Components/RollbackPage.cs b/UpdateLib/UpdateLib/UI/Components/RollbackPage.cs index 81dce32..b088ae3 100644 --- a/UpdateLib/UpdateLib/UI/Components/RollbackPage.cs +++ b/UpdateLib/UpdateLib/UI/Components/RollbackPage.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Drawing; -using System.Data; -using System.Linq; -using System.Text; -using System.Windows.Forms; +using System.Windows.Forms; namespace MatthiWare.UpdateLib.UI.Components { diff --git a/UpdateLib/UpdateLib/Utils/CmdLineParser.cs b/UpdateLib/UpdateLib/Utils/CmdLineParser.cs index e3026ac..2abcf94 100644 --- a/UpdateLib/UpdateLib/Utils/CmdLineParser.cs +++ b/UpdateLib/UpdateLib/Utils/CmdLineParser.cs @@ -16,11 +16,8 @@ */ using MatthiWare.UpdateLib.Common; using System; -using System.Collections; using System.Collections.Generic; -using System.Collections.Specialized; using System.Linq; -using System.Text; namespace MatthiWare.UpdateLib.Utils { From 69d1ded8154c450e6f1f66f30a8e2278eed3b873 Mon Sep 17 00:00:00 2001 From: Matthias Beerens Date: Sat, 11 Nov 2017 23:55:48 +0100 Subject: [PATCH 08/40] Add UpdateVersion to replace System.Version --- .../UI/Pages/InformationPage.cs | 5 +- .../UpdateLib.Tests/Files/UpdateFileTest.cs | 2 +- .../Tasks/DownloadManagerTests.cs | 1 + UpdateLib/UpdateLib/Common/Enums.cs | 8 + UpdateLib/UpdateLib/Common/UpdateVersion.cs | 257 ++++++++++++++++++ UpdateLib/UpdateLib/Common/VersionXml.cs | 58 ---- UpdateLib/UpdateLib/Files/UpdateFile.cs | 2 +- .../CheckForUpdatesCompletedEventArgs.cs | 3 +- .../UpdateLib/Tasks/CheckForUpdatesTask.cs | 3 +- UpdateLib/UpdateLib/UpdateLib.csproj | 2 +- UpdateLib/UpdateLib/Updater.cs | 2 +- 11 files changed, 277 insertions(+), 66 deletions(-) create mode 100644 UpdateLib/UpdateLib/Common/UpdateVersion.cs delete mode 100644 UpdateLib/UpdateLib/Common/VersionXml.cs diff --git a/UpdateLib/UpdateLib.Generator/UI/Pages/InformationPage.cs b/UpdateLib/UpdateLib.Generator/UI/Pages/InformationPage.cs index a8e05e2..3ad0dda 100644 --- a/UpdateLib/UpdateLib.Generator/UI/Pages/InformationPage.cs +++ b/UpdateLib/UpdateLib.Generator/UI/Pages/InformationPage.cs @@ -15,6 +15,7 @@ * along with this program. If not, see . */ +using MatthiWare.UpdateLib.Common; using System; namespace MatthiWare.UpdateLib.Generator.UI.Pages @@ -34,11 +35,11 @@ public string ApplicationName } } - public Version Version + public UpdateVersion Version { get { - return new Version(txtAppVersion.Text); + return new UpdateVersion(txtAppVersion.Text); } set { diff --git a/UpdateLib/UpdateLib.Tests/Files/UpdateFileTest.cs b/UpdateLib/UpdateLib.Tests/Files/UpdateFileTest.cs index d609ced..78457bc 100644 --- a/UpdateLib/UpdateLib.Tests/Files/UpdateFileTest.cs +++ b/UpdateLib/UpdateLib.Tests/Files/UpdateFileTest.cs @@ -86,7 +86,7 @@ private UpdateFile MakeUpdateFile() UpdateFile file = new UpdateFile(); file.ApplicationName = nameof(UpdateFileTest); - file.Version = new Version("9.9.9.9"); + file.Version = new UpdateVersion(9, 9, 9); DirectoryEntry appSubFolder = new DirectoryEntry("AppSubFolder"); DirectoryEntry otherSubFolder = new DirectoryEntry("OtherSubFolder"); diff --git a/UpdateLib/UpdateLib.Tests/Tasks/DownloadManagerTests.cs b/UpdateLib/UpdateLib.Tests/Tasks/DownloadManagerTests.cs index 22f45d2..9194e1d 100644 --- a/UpdateLib/UpdateLib.Tests/Tasks/DownloadManagerTests.cs +++ b/UpdateLib/UpdateLib.Tests/Tasks/DownloadManagerTests.cs @@ -16,6 +16,7 @@ */ using MatthiWare.UpdateLib; +using MatthiWare.UpdateLib.Common; using MatthiWare.UpdateLib.Files; using MatthiWare.UpdateLib.Security; using MatthiWare.UpdateLib.Tasks; diff --git a/UpdateLib/UpdateLib/Common/Enums.cs b/UpdateLib/UpdateLib/Common/Enums.cs index 917d00c..0b9ef12 100644 --- a/UpdateLib/UpdateLib/Common/Enums.cs +++ b/UpdateLib/UpdateLib/Common/Enums.cs @@ -81,4 +81,12 @@ public enum LoggingLevel Warn = 2, Error = 3 } + + public enum VersionLabel : byte + { + Alpha=0, + Beta=1, + RC=2, + None=3 + } } diff --git a/UpdateLib/UpdateLib/Common/UpdateVersion.cs b/UpdateLib/UpdateLib/Common/UpdateVersion.cs new file mode 100644 index 0000000..07090e7 --- /dev/null +++ b/UpdateLib/UpdateLib/Common/UpdateVersion.cs @@ -0,0 +1,257 @@ +/* UpdateLib - .Net auto update library + * Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using System; +using System.ComponentModel; +using System.Xml.Serialization; + +namespace MatthiWare.UpdateLib.Common +{ + /// + /// Versioning class with small extensions over the original . + /// Support for version label's and serializable. + /// Partially based on Semantic Versioning + /// + [Serializable] + public class UpdateVersion : IComparable, IComparable, IEquatable + { + private int m_major, m_minor, m_patch; + private VersionLabel m_label; + + #region Constants + + private const string ALPHA_STRING = "-alpha"; + private const string BETA_STRING = "-beta"; + private const string RC_STRING = "-rc"; + private static readonly char[] CharSplit = new char[] { '.', '-' }; + + #endregion + + #region Properties + + [XmlIgnore] + public int Major + { + get { return m_major; } + } + + [XmlIgnore] + public int Minor + { + get { return m_minor; } + } + + [XmlIgnore] + public int Patch + { + get { return m_patch; } + } + + [XmlIgnore] + public VersionLabel Label + { + get { return m_label; } + } + + [XmlText] + [EditorBrowsable(EditorBrowsableState.Never), Browsable(false)] + public string Value + { + get { return ToString(); } + set + { + UpdateVersion version; + + if (!TryParse(value, out version)) + throw new ArgumentException(nameof(value), "Unable to parse input string"); + + m_major = version.m_major; + m_minor = version.m_minor; + m_patch = version.m_patch; + m_label = version.m_label; + } + } + + #endregion + + #region Constructor + + public UpdateVersion(int major = 0, int minor = 0, int patch = 0, VersionLabel label = VersionLabel.None) + { + if (major < 0) throw new ArgumentOutOfRangeException(nameof(major), "Version cannot be negative"); + if (minor < 0) throw new ArgumentOutOfRangeException(nameof(minor), "Version cannot be negative"); + if (patch < 0) throw new ArgumentOutOfRangeException(nameof(patch), "Version cannot be negative"); + + m_major = major; + m_minor = minor; + m_patch = patch; + m_label = label; + } + + public UpdateVersion(string input) + { + UpdateVersion version; + + if (!TryParse(input, out version)) + throw new ArgumentException(nameof(input), "Unable to parse input string"); + + m_major = version.m_major; + m_minor = version.m_minor; + m_patch = version.m_patch; + m_label = version.m_label; + } + + #endregion + + #region Interface Impl. + + public int CompareTo(UpdateVersion other) + { + if (other == null) + return 1; + + if (m_major != other.m_major) + return m_major > other.m_major ? 1 : -1; + + if (m_minor != other.m_minor) + return m_minor > other.m_minor ? 1 : -1; + + if (m_patch != other.m_patch) + return m_patch > other.m_patch ? 1 : -1; + + if (m_label != other.m_label) + return m_label > other.m_label ? 1 : -1; + + return 0; + } + + public int CompareTo(object obj) + { + UpdateVersion other = obj as UpdateVersion; + + if (other == null) + return 1; + + return CompareTo(other); + } + + public bool Equals(UpdateVersion other) + { + if (other == null) + return false; + + return m_major == other.m_major + && m_minor == other.m_minor + && m_patch == other.m_patch + && m_label == other.m_label; + } + + #endregion + + public override string ToString() + { + return $"{m_major}.{m_minor}.{m_patch}{LabelToString()}"; + } + + private string LabelToString() + { + switch (m_label) + { + case VersionLabel.Alpha: + return ALPHA_STRING; + case VersionLabel.Beta: + return BETA_STRING; + case VersionLabel.RC: + return RC_STRING; + case VersionLabel.None: + default: + return string.Empty; + } + } + + private static bool TryParseVersionLabelString(string input, out VersionLabel label) + { + input = $"-{input}"; + + if (input == ALPHA_STRING) + { + label = VersionLabel.Alpha; + return true; + } + else if (input == BETA_STRING) + { + label = VersionLabel.Beta; + return true; + } + else if (input == RC_STRING) + { + label = VersionLabel.RC; + return true; + } + else + { + label = VersionLabel.None; + return false; + } + } + + public static bool TryParse(string input, out UpdateVersion version) + { + var tokens = input.Split(CharSplit); + version = new UpdateVersion(); + + if (tokens.Length < 3 || tokens.Length > 4) + return false; + + if (tokens.Length > 3) + if (!TryParseVersionLabelString(tokens[3], out version.m_label)) + return false; + + if (tokens.Length > 2) + if (!int.TryParse(tokens[2], out version.m_patch)) + return false; + + if (tokens.Length > 1) + if (!int.TryParse(tokens[1], out version.m_minor)) + return false; + + if (tokens.Length > 0) + if (!int.TryParse(tokens[0], out version.m_major)) + return false; + + return true; + } + + public static bool operator ==(UpdateVersion v1, UpdateVersion v2) + => ReferenceEquals(v1, null) ? ReferenceEquals(v2, null) : v1.Equals(v2); + + public static bool operator !=(UpdateVersion v1, UpdateVersion v2) + => !(v1 == v2); + + public static bool operator >(UpdateVersion v1, UpdateVersion v2) + => v2 < v1; + + public static bool operator >=(UpdateVersion v1, UpdateVersion v2) + => v2 <= v1; + + public static bool operator <(UpdateVersion v1, UpdateVersion v2) + => !ReferenceEquals(v1, null) && v1.CompareTo(v2) < 0; + + public static bool operator <=(UpdateVersion v1, UpdateVersion v2) + => !ReferenceEquals(v1, null) && v1.CompareTo(v2) <= 0; + } +} diff --git a/UpdateLib/UpdateLib/Common/VersionXml.cs b/UpdateLib/UpdateLib/Common/VersionXml.cs deleted file mode 100644 index 1dcbd78..0000000 --- a/UpdateLib/UpdateLib/Common/VersionXml.cs +++ /dev/null @@ -1,58 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.Diagnostics; -using System.ComponentModel; -using System.Xml.Serialization; - -namespace MatthiWare.UpdateLib.Common -{ - /// - /// Version proxy class to serialize to XML - /// https://stackoverflow.com/a/18962224/6058174 - /// - [Serializable] - [XmlType("Version")] - [DebuggerDisplay("Version")] - public class VersionXml - { - public VersionXml() { } - - public VersionXml(Version version) - { - Version = version; - } - - [XmlIgnore] - public Version Version { get; set; } = null; - - [XmlText] - [EditorBrowsable(EditorBrowsableState.Never), Browsable(false)] - public string Value - { - get { return Version?.ToString() ?? string.Empty; } - set { Version = new Version(value); } - } - - public static implicit operator Version(VersionXml VersionXml) => VersionXml.Version; - - public static implicit operator VersionXml(Version Version) => new VersionXml(Version); - - public override string ToString() => Value; - } -} diff --git a/UpdateLib/UpdateLib/Files/UpdateFile.cs b/UpdateLib/UpdateLib/Files/UpdateFile.cs index 64c1b2e..def9a18 100644 --- a/UpdateLib/UpdateLib/Files/UpdateFile.cs +++ b/UpdateLib/UpdateLib/Files/UpdateFile.cs @@ -43,7 +43,7 @@ public class UpdateFile /// The versionstring should be parsable by the to be valid. /// [XmlAttribute] - public VersionXml Version { get; set; } = new Version("1.0.0.0"); + public UpdateVersion Version { get; set; } = new UpdateVersion(1); /// /// Gets the folders of the project diff --git a/UpdateLib/UpdateLib/Tasks/CheckForUpdatesCompletedEventArgs.cs b/UpdateLib/UpdateLib/Tasks/CheckForUpdatesCompletedEventArgs.cs index a8ae465..f56679c 100644 --- a/UpdateLib/UpdateLib/Tasks/CheckForUpdatesCompletedEventArgs.cs +++ b/UpdateLib/UpdateLib/Tasks/CheckForUpdatesCompletedEventArgs.cs @@ -15,6 +15,7 @@ * along with this program. If not, see . */ +using MatthiWare.UpdateLib.Common; using System; using System.ComponentModel; @@ -22,7 +23,7 @@ namespace MatthiWare.UpdateLib.Tasks { public class CheckForUpdatesCompletedEventArgs : AsyncCompletedEventArgs { - public Version LatestVersion { get; set; } + public UpdateVersion LatestVersion { get; set; } public bool UpdateAvailable { get; set; } public CheckForUpdatesCompletedEventArgs(CheckForUpdatesTask.CheckForUpdatesResult result, Exception error, bool cancelled, object userState) diff --git a/UpdateLib/UpdateLib/Tasks/CheckForUpdatesTask.cs b/UpdateLib/UpdateLib/Tasks/CheckForUpdatesTask.cs index ea2ba61..9329cb0 100644 --- a/UpdateLib/UpdateLib/Tasks/CheckForUpdatesTask.cs +++ b/UpdateLib/UpdateLib/Tasks/CheckForUpdatesTask.cs @@ -21,6 +21,7 @@ using System.IO; using MatthiWare.UpdateLib.Utils; using static MatthiWare.UpdateLib.Tasks.CheckForUpdatesTask; +using MatthiWare.UpdateLib.Common; namespace MatthiWare.UpdateLib.Tasks { @@ -115,7 +116,7 @@ private CheckRequiredPrivilegesTask CheckPrivileges(UpdateFile file) public class CheckForUpdatesResult { - public Version Version { get; set; } + public UpdateVersion Version { get; set; } public bool UpdateAvailable { get; set; } = false; public UpdateFile UpdateFile { get; set; } public bool AdminRightsNeeded { get; set; } = false; diff --git a/UpdateLib/UpdateLib/UpdateLib.csproj b/UpdateLib/UpdateLib/UpdateLib.csproj index 6b86375..6159a43 100644 --- a/UpdateLib/UpdateLib/UpdateLib.csproj +++ b/UpdateLib/UpdateLib/UpdateLib.csproj @@ -52,7 +52,7 @@ - + UserControl diff --git a/UpdateLib/UpdateLib/Updater.cs b/UpdateLib/UpdateLib/Updater.cs index b4c8933..71110b6 100644 --- a/UpdateLib/UpdateLib/Updater.cs +++ b/UpdateLib/UpdateLib/Updater.cs @@ -512,7 +512,7 @@ private void HandleException(IWin32Window owner, Exception e) MessageBoxButtons.OK); } - private void HandleNoUpdate(IWin32Window owner, Version latest) + private void HandleNoUpdate(IWin32Window owner, UpdateVersion latest) { Logger.Info(nameof(Updater), nameof(CheckForUpdatesAsync), "No update available"); From bb06d475d489b2623bd2d3bab1025a49aaef406d Mon Sep 17 00:00:00 2001 From: Matthias Beerens Date: Sun, 12 Nov 2017 12:27:07 +0100 Subject: [PATCH 09/40] Add Unit Tests for UpdateVersion --- UpdateLib/TestApp/Program.cs | 7 +- .../Common/UpdateVersionTests.cs | 82 +++++++++++++++++++ .../UpdateLib.Tests/UpdateLib.Tests.csproj | 1 + UpdateLib/UpdateLib/Common/UpdateVersion.cs | 39 +++++++-- 4 files changed, 119 insertions(+), 10 deletions(-) create mode 100644 UpdateLib/UpdateLib.Tests/Common/UpdateVersionTests.cs diff --git a/UpdateLib/TestApp/Program.cs b/UpdateLib/TestApp/Program.cs index 92efc64..dd1fde3 100644 --- a/UpdateLib/TestApp/Program.cs +++ b/UpdateLib/TestApp/Program.cs @@ -20,6 +20,7 @@ using MatthiWare.UpdateLib.Logging.Writers; using System; using System.Windows.Forms; +using System.Xml.Serialization; namespace TestApp { @@ -31,11 +32,15 @@ static class Program [STAThread] static void Main() { + // UpdateVersion v1 = new UpdateVersion(1, 2, 3, VersionLabel.Alpha); + // XmlSerializer xml = new XmlSerializer(typeof(UpdateVersion)); + // xml.Serialize(Console.Out, v1); + Console.WriteLine(Environment.CommandLine); foreach (var s in Environment.GetCommandLineArgs()) Console.WriteLine(s); - // Environment.Exit(0); + Environment.Exit(0); // we still want our updater to have visual styles in case of update cmd argument switch Application.EnableVisualStyles(); diff --git a/UpdateLib/UpdateLib.Tests/Common/UpdateVersionTests.cs b/UpdateLib/UpdateLib.Tests/Common/UpdateVersionTests.cs new file mode 100644 index 0000000..47199ef --- /dev/null +++ b/UpdateLib/UpdateLib.Tests/Common/UpdateVersionTests.cs @@ -0,0 +1,82 @@ +using MatthiWare.UpdateLib.Common; +using NUnit.Framework; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace UpdateLib.Tests.Common +{ + [TestFixture] + public class UpdateVersionTests + { + + [Test] + public void TestTryParseGood() + { + string input = "1.2.3-beta"; + + var v = new UpdateVersion(input); + + Assert.AreEqual(1, v.Major); + Assert.AreEqual(2, v.Minor); + Assert.AreEqual(3, v.Patch); + Assert.AreEqual(VersionLabel.Beta, v.Label); + } + + [Test] + public void TestTryParseReturnsFalseInBadCase() + { + string input = "1.2.3.beta"; + + UpdateVersion v; + Assert.IsFalse(UpdateVersion.TryParse(input, out v)); + } + + [Test] + public void TestStringValue() + { + var v = new UpdateVersion(1, 2, 3, VersionLabel.RC); + + Assert.AreEqual("1.2.3-rc", v.Value); + + v.Value = "3.1.2"; + + Assert.AreEqual(3, v.Major); + Assert.AreEqual(1, v.Minor); + Assert.AreEqual(2, v.Patch); + Assert.AreEqual(VersionLabel.None, v.Label); + } + + [Test] + public void ConstructorThrowsException() + { + Assert.Catch(() => new UpdateVersion(-1)); + Assert.Catch(() => new UpdateVersion(1, -1)); + Assert.Catch(() => new UpdateVersion(1, 1, -1)); + Assert.Catch(() => new UpdateVersion("blabla")); + } + + [Test] + public void TestOperators() + { + UpdateVersion v1 = new UpdateVersion(1); + UpdateVersion v2 = new UpdateVersion(1); + UpdateVersion v3 = new UpdateVersion(1, 1); + UpdateVersion v4 = new UpdateVersion(1, 1, 1); + UpdateVersion v5 = new UpdateVersion(1, 1, 1, VersionLabel.Alpha); + UpdateVersion v6 = new UpdateVersion(1, 1, 1, VersionLabel.Beta); + UpdateVersion v7 = new UpdateVersion(1, 1, 1, VersionLabel.RC); + + Assert.IsTrue(v1 == v2, "v1 == v2"); + Assert.IsTrue(v1 != v3, "v1 != v3"); + + Assert.IsTrue(v3 > v1, "v3 > v1"); + Assert.IsFalse(v4 < v3, "v4 < v3"); + + Assert.IsTrue(v7 > v6, "v7 > v6"); + Assert.IsTrue(v6 > v5, "v6 > v5"); + } + } +} diff --git a/UpdateLib/UpdateLib.Tests/UpdateLib.Tests.csproj b/UpdateLib/UpdateLib.Tests/UpdateLib.Tests.csproj index f1fd1b1..72e9c81 100644 --- a/UpdateLib/UpdateLib.Tests/UpdateLib.Tests.csproj +++ b/UpdateLib/UpdateLib.Tests/UpdateLib.Tests.csproj @@ -54,6 +54,7 @@ + diff --git a/UpdateLib/UpdateLib/Common/UpdateVersion.cs b/UpdateLib/UpdateLib/Common/UpdateVersion.cs index 07090e7..2647258 100644 --- a/UpdateLib/UpdateLib/Common/UpdateVersion.cs +++ b/UpdateLib/UpdateLib/Common/UpdateVersion.cs @@ -37,7 +37,8 @@ public class UpdateVersion : IComparable, IComparable, IEquatable private const string ALPHA_STRING = "-alpha"; private const string BETA_STRING = "-beta"; private const string RC_STRING = "-rc"; - private static readonly char[] CharSplit = new char[] { '.', '-' }; + private static readonly char[] CharSplitDot = new char[] { '.' }; + private static readonly char[] CharSplitDash = new char[] { '-' }; #endregion @@ -90,7 +91,23 @@ public string Value #region Constructor - public UpdateVersion(int major = 0, int minor = 0, int patch = 0, VersionLabel label = VersionLabel.None) + public UpdateVersion() + : this(0, 0, 0, VersionLabel.None) + { } + + public UpdateVersion(int major) + : this(major, 0, 0, VersionLabel.None) + { } + + public UpdateVersion(int major, int minor) + : this(major, minor, 0, VersionLabel.None) + { } + + public UpdateVersion(int major, int minor, int patch) + : this(major, minor, patch, VersionLabel.None) + { } + + public UpdateVersion(int major, int minor, int patch, VersionLabel label) { if (major < 0) throw new ArgumentOutOfRangeException(nameof(major), "Version cannot be negative"); if (minor < 0) throw new ArgumentOutOfRangeException(nameof(minor), "Version cannot be negative"); @@ -211,20 +228,24 @@ private static bool TryParseVersionLabelString(string input, out VersionLabel la public static bool TryParse(string input, out UpdateVersion version) { - var tokens = input.Split(CharSplit); + var tokens = input.Split(CharSplitDot); version = new UpdateVersion(); - if (tokens.Length < 3 || tokens.Length > 4) + if (tokens.Length != 3) return false; - if (tokens.Length > 3) - if (!TryParseVersionLabelString(tokens[3], out version.m_label)) - return false; - if (tokens.Length > 2) - if (!int.TryParse(tokens[2], out version.m_patch)) + { + var extraTokens = tokens[2].Split(CharSplitDash); + + if (!int.TryParse(extraTokens[0], out version.m_patch)) return false; + if (extraTokens.Length > 1) + if (!TryParseVersionLabelString(extraTokens[1], out version.m_label)) + return false; + } + if (tokens.Length > 1) if (!int.TryParse(tokens[1], out version.m_minor)) return false; From 7958a1c91d37fa27d222b6d6e4eda8d54768be19 Mon Sep 17 00:00:00 2001 From: Matthias Beerens Date: Sun, 12 Nov 2017 23:09:39 +0100 Subject: [PATCH 10/40] Change UpdateFile to a catalog style of multitple updates --- UpdateLib/UpdateLib/Common/UpdateInfo.cs | 42 +++++++++++++++++++ UpdateLib/UpdateLib/Common/UpdateVersion.cs | 6 +++ UpdateLib/UpdateLib/Files/UpdateFile.cs | 34 ++++----------- UpdateLib/UpdateLib/Utils/ExtensionMethods.cs | 19 +++++++++ 4 files changed, 74 insertions(+), 27 deletions(-) create mode 100644 UpdateLib/UpdateLib/Common/UpdateInfo.cs diff --git a/UpdateLib/UpdateLib/Common/UpdateInfo.cs b/UpdateLib/UpdateLib/Common/UpdateInfo.cs new file mode 100644 index 0000000..7a8d1bc --- /dev/null +++ b/UpdateLib/UpdateLib/Common/UpdateInfo.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Xml.Serialization; + +namespace MatthiWare.UpdateLib.Common +{ + [Serializable] + public class UpdateInfo + { + /// + /// Gets or sets the version of the current update. + /// The versionstring should be parsable by the to be valid. + /// + public UpdateVersion Version { get; set; } = new UpdateVersion(1); + + /// + /// Gets the folders of the project + /// + [XmlArray("Folders"), XmlArrayItem("Directory")] + public List Folders { get; private set; } = new List(); + + /// + /// Gets the count of all the files in the + /// and their subdirectories. + /// + [XmlIgnore] + public int FileCount { get { return Folders.Select(d => d.Count).Sum(); } } + + [XmlIgnore] + public int RegistryKeyCount { get { return Registry.Select(r => r.Count).Sum(); } } + + [XmlArray("Registry"), XmlArrayItem("Directory")] + public List Registry { get; private set; } = new List(); + + public UpdateInfo() + { + + } + } +} diff --git a/UpdateLib/UpdateLib/Common/UpdateVersion.cs b/UpdateLib/UpdateLib/Common/UpdateVersion.cs index 2647258..2905500 100644 --- a/UpdateLib/UpdateLib/Common/UpdateVersion.cs +++ b/UpdateLib/UpdateLib/Common/UpdateVersion.cs @@ -16,7 +16,10 @@ */ using System; +using System.Collections.Generic; using System.ComponentModel; +using System.Xml; +using System.Xml.Schema; using System.Xml.Serialization; namespace MatthiWare.UpdateLib.Common @@ -27,6 +30,7 @@ namespace MatthiWare.UpdateLib.Common /// Partially based on Semantic Versioning /// [Serializable] + public class UpdateVersion : IComparable, IComparable, IEquatable { private int m_major, m_minor, m_patch; @@ -69,6 +73,7 @@ public VersionLabel Label } [XmlText] + [XmlElement(typeof(string))] [EditorBrowsable(EditorBrowsableState.Never), Browsable(false)] public string Value { @@ -274,5 +279,6 @@ public static bool TryParse(string input, out UpdateVersion version) public static bool operator <=(UpdateVersion v1, UpdateVersion v2) => !ReferenceEquals(v1, null) && v1.CompareTo(v2) <= 0; + } } diff --git a/UpdateLib/UpdateLib/Files/UpdateFile.cs b/UpdateLib/UpdateLib/Files/UpdateFile.cs index def9a18..011816d 100644 --- a/UpdateLib/UpdateLib/Files/UpdateFile.cs +++ b/UpdateLib/UpdateLib/Files/UpdateFile.cs @@ -21,7 +21,7 @@ using System.IO; using System.Xml; using System.Xml.Serialization; -using System.Linq; +using MatthiWare.UpdateLib.Utils; using MatthiWare.UpdateLib.Common; namespace MatthiWare.UpdateLib.Files @@ -38,36 +38,16 @@ public class UpdateFile [XmlAttribute] public string ApplicationName { get; set; } = "UpdateLib"; - /// - /// Gets or sets the version of the current update. - /// The versionstring should be parsable by the to be valid. - /// - [XmlAttribute] - public UpdateVersion Version { get; set; } = new UpdateVersion(1); - - /// - /// Gets the folders of the project - /// - [XmlArray("Folders"), XmlArrayItem("Directory")] - public List Folders { get; private set; } = new List(); - - /// - /// Gets the count of all the files in the - /// and their subdirectories. - /// - [XmlIgnore] - public int FileCount { get { return Folders.Select(d => d.Count).Sum(); } } - - [XmlIgnore] - public int RegistryKeyCount { get { return Registry.Select(r => r.Count).Sum(); } } - - [XmlArray("Registry"), XmlArrayItem("Directory")] - public List Registry { get; private set; } = new List(); + public List Updates { get; private set; } = new List(); public UpdateFile() { + } + public UpdateInfo GetLatestUpdate() + => Updates.Maxx(u => u.Version); + /// /// Saves the current to the output /// @@ -129,7 +109,7 @@ public static UpdateFile Load(Stream input) UpdateFile file = (UpdateFile)serializer.Deserialize(xml); - new UpdateFileProcessorTask(file).ConfigureAwait(false).Start().AwaitTask(); + new UpdateInfoPostProcessorTask(file).ConfigureAwait(false).Start().AwaitTask(); return file; } diff --git a/UpdateLib/UpdateLib/Utils/ExtensionMethods.cs b/UpdateLib/UpdateLib/Utils/ExtensionMethods.cs index eb829d1..4995de9 100644 --- a/UpdateLib/UpdateLib/Utils/ExtensionMethods.cs +++ b/UpdateLib/UpdateLib/Utils/ExtensionMethods.cs @@ -42,6 +42,25 @@ public static string AppendAll(this IEnumerable collection, string seperat } + [DebuggerStepThrough] + public static T Maxx(this IEnumerable collection, Func resolve) where K : IComparable + { + using (var enumerator = collection.GetEnumerator()) + { + T max = default(T); + + while (enumerator.MoveNext()) + { + T other = enumerator.Current; + + if (resolve(other).CompareTo(resolve(max)) > 0) + max = other; + } + + return max; + } + } + [DebuggerStepThrough] public static void ForEach(this IEnumerable collection, Action action) { From 4fd2ff1cd83e7f792cac433487ac28fba02e5281 Mon Sep 17 00:00:00 2001 From: Matthias Beerens Date: Wed, 15 Nov 2017 19:23:04 +0100 Subject: [PATCH 11/40] Seperate UpdateInfo From UpdateFile --- UpdateLib/TestApp/Program.cs | 14 ++++---- .../UI/Pages/BuilderPage.cs | 2 +- .../UpdateLib.Tests/Files/UpdateFileTest.cs | 24 ++++++++------ .../Tasks/DownloadManagerTests.cs | 6 ++-- .../Util/ExtensionMethodsTest.cs | 33 +++++++++++++++++++ UpdateLib/UpdateLib/Files/UpdateFile.cs | 2 +- .../Tasks/CheckForUpdatedItemsTask.cs | 4 +-- .../UpdateLib/Tasks/CheckForUpdatesTask.cs | 20 +++++------ .../Tasks/CheckRequiredPrivilegesTask.cs | 10 +++--- UpdateLib/UpdateLib/Tasks/DownloadManager.cs | 32 +++++++++--------- .../Tasks/UpdateFileProcessorTask.cs | 12 +++---- .../UpdateLib/UI/Components/FinishPage.cs | 20 ++++++----- .../UpdateLib/UI/Components/IntroPage.cs | 4 +-- .../UpdateLib/UI/Components/UpdatePage.cs | 10 +++--- UpdateLib/UpdateLib/UI/UpdaterForm.cs | 7 ++-- UpdateLib/UpdateLib/UpdateLib.csproj | 1 + UpdateLib/UpdateLib/Updater.cs | 11 ++++--- UpdateLib/UpdateLib/Utils/CmdLineParser.cs | 1 + 18 files changed, 128 insertions(+), 85 deletions(-) diff --git a/UpdateLib/TestApp/Program.cs b/UpdateLib/TestApp/Program.cs index dd1fde3..da364aa 100644 --- a/UpdateLib/TestApp/Program.cs +++ b/UpdateLib/TestApp/Program.cs @@ -32,15 +32,15 @@ static class Program [STAThread] static void Main() { - // UpdateVersion v1 = new UpdateVersion(1, 2, 3, VersionLabel.Alpha); - // XmlSerializer xml = new XmlSerializer(typeof(UpdateVersion)); - // xml.Serialize(Console.Out, v1); + // UpdateVersion v1 = new UpdateVersion(1, 2, 3, VersionLabel.Alpha); + // XmlSerializer xml = new XmlSerializer(typeof(UpdateVersion)); + // xml.Serialize(Console.Out, v1); - Console.WriteLine(Environment.CommandLine); - foreach (var s in Environment.GetCommandLineArgs()) - Console.WriteLine(s); + // Console.WriteLine(Environment.CommandLine); + // foreach (var s in Environment.GetCommandLineArgs()) + // Console.WriteLine(s); - Environment.Exit(0); + //Environment.Exit(0); // we still want our updater to have visual styles in case of update cmd argument switch Application.EnableVisualStyles(); diff --git a/UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.cs b/UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.cs index 6b5ab27..f4c7638 100644 --- a/UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.cs +++ b/UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.cs @@ -90,7 +90,7 @@ private void btnBuild_Click(object sender, EventArgs e) private AsyncTask Build(Stream s) { - UpdateGeneratorTask task = new UpdateGeneratorTask(filesPage.Root, infoPage,registryPage.Folders); + UpdateGeneratorTask task = new UpdateGeneratorTask(filesPage.Root, infoPage, registryPage.Folders); btnBuild.Enabled = false; diff --git a/UpdateLib/UpdateLib.Tests/Files/UpdateFileTest.cs b/UpdateLib/UpdateLib.Tests/Files/UpdateFileTest.cs index 78457bc..6703458 100644 --- a/UpdateLib/UpdateLib.Tests/Files/UpdateFileTest.cs +++ b/UpdateLib/UpdateLib.Tests/Files/UpdateFileTest.cs @@ -17,6 +17,7 @@ using System; using System.IO; +using System.Linq; using MatthiWare.UpdateLib.Common; using MatthiWare.UpdateLib.Files; using Moq; @@ -38,13 +39,15 @@ public void Before() public void SaveAndLoadUpdateFileShouldBeTheSame() { UpdateFile file = MakeUpdateFile(); + UpdateInfo info = file.GetLatestUpdate(); file.Save(temp_file); - UpdateFile loadedFile = UpdateFile.Load(temp_file); + UpdateFile updateFile = UpdateFile.Load(temp_file); + UpdateInfo updateInfo = updateFile.GetLatestUpdate(); - Assert.AreEqual(file.ApplicationName, loadedFile.ApplicationName); - Assert.AreEqual(file.Version, loadedFile.Version); - Assert.AreEqual(file.FileCount, loadedFile.FileCount); + Assert.AreEqual(file.ApplicationName, updateFile.ApplicationName); + Assert.AreEqual(info.Version, updateInfo.Version); + Assert.AreEqual(info.FileCount, updateInfo.FileCount); } [Test] @@ -86,7 +89,8 @@ private UpdateFile MakeUpdateFile() UpdateFile file = new UpdateFile(); file.ApplicationName = nameof(UpdateFileTest); - file.Version = new UpdateVersion(9, 9, 9); + + UpdateInfo info = new UpdateInfo { Version = new UpdateVersion(9, 9, 9) }; DirectoryEntry appSubFolder = new DirectoryEntry("AppSubFolder"); DirectoryEntry otherSubFolder = new DirectoryEntry("OtherSubFolder"); @@ -108,8 +112,8 @@ private UpdateFile MakeUpdateFile() appSubFolder.Add(appFile); otherSubFolder.Add(otherFile); - file.Folders.Add(appSubFolder); - file.Folders.Add(otherSubFolder); + info.Folders.Add(appSubFolder); + info.Folders.Add(otherSubFolder); DirectoryEntry regDir = new DirectoryEntry("HKEY_LOCAL_MACHINE"); @@ -117,10 +121,10 @@ private UpdateFile MakeUpdateFile() regDir.Add(regEntry); - file.Registry.Add(regDir); + info.Registry.Add(regDir); - Assert.AreEqual(2, file.FileCount); - Assert.AreEqual(1, file.RegistryKeyCount); + Assert.AreEqual(2, info.FileCount); + Assert.AreEqual(1, info.RegistryKeyCount); return file; } diff --git a/UpdateLib/UpdateLib.Tests/Tasks/DownloadManagerTests.cs b/UpdateLib/UpdateLib.Tests/Tasks/DownloadManagerTests.cs index 9194e1d..b9b3e81 100644 --- a/UpdateLib/UpdateLib.Tests/Tasks/DownloadManagerTests.cs +++ b/UpdateLib/UpdateLib.Tests/Tasks/DownloadManagerTests.cs @@ -59,17 +59,17 @@ public void TestDownloadManager() { - UpdateFile file = new UpdateFile(); + UpdateInfo info = new UpdateInfo(); DirectoryEntry dir = new DirectoryEntry("%appdir%"); FileEntry entry_file = new FileEntry("testfile.txt"); entry_file.Hash = HashUtil.GetHash(m_file); dir.Add(entry_file); - file.Folders.Add(dir); + info.Folders.Add(dir); ManualResetEvent wait = new ManualResetEvent(false); - DownloadManager manager = new DownloadManager(file); + DownloadManager manager = new DownloadManager(info); manager.Completed += (o, e) => wait.Set(); manager.Update(); diff --git a/UpdateLib/UpdateLib.Tests/Util/ExtensionMethodsTest.cs b/UpdateLib/UpdateLib.Tests/Util/ExtensionMethodsTest.cs index 974fecb..54d010a 100644 --- a/UpdateLib/UpdateLib.Tests/Util/ExtensionMethodsTest.cs +++ b/UpdateLib/UpdateLib.Tests/Util/ExtensionMethodsTest.cs @@ -21,6 +21,8 @@ using MatthiWare.UpdateLib.Utils; using Moq; using System.Diagnostics; +using MatthiWare.UpdateLib.Common; +using MatthiWare.UpdateLib.Files; namespace UpdateLib.Tests.Util { @@ -48,6 +50,37 @@ public void TestNotEmpty() Assert.AreEqual(4, test.Split('/').NotEmpty().Count()); } + [Test] + public void TestMax() + { + UpdateInfo v1 = MakeUpdateInfo(new UpdateVersion(1)); + UpdateInfo v2 = MakeUpdateInfo(new UpdateVersion(2)); + UpdateInfo v3 = MakeUpdateInfo(new UpdateVersion(2, 1)); + UpdateInfo v4 = MakeUpdateInfo(new UpdateVersion(2, 1, 1)); + UpdateInfo v5 = MakeUpdateInfo(new UpdateVersion(2, 1, 1, VersionLabel.Beta)); + UpdateInfo v6 = MakeUpdateInfo(new UpdateVersion(2, 1, 1, VersionLabel.RC)); + UpdateInfo v7 = MakeUpdateInfo(new UpdateVersion(2, 1, 2)); + + List versions = new List(new UpdateInfo[] + { + v1,v2,v3,v4,v5,v6,v7 + }); + + UpdateInfo max = versions.Maxx(u => u.Version); + + Assert.AreEqual(v7, max); + } + + private UpdateInfo MakeUpdateInfo(UpdateVersion version) + { + return new UpdateInfo + { + Version = version + }; + } + + + [Test] public void TestForEach() { diff --git a/UpdateLib/UpdateLib/Files/UpdateFile.cs b/UpdateLib/UpdateLib/Files/UpdateFile.cs index 011816d..eda79c1 100644 --- a/UpdateLib/UpdateLib/Files/UpdateFile.cs +++ b/UpdateLib/UpdateLib/Files/UpdateFile.cs @@ -109,7 +109,7 @@ public static UpdateFile Load(Stream input) UpdateFile file = (UpdateFile)serializer.Deserialize(xml); - new UpdateInfoPostProcessorTask(file).ConfigureAwait(false).Start().AwaitTask(); + //new UpdateInfoPostProcessorTask(file).ConfigureAwait(false).Start().AwaitTask(); return file; } diff --git a/UpdateLib/UpdateLib/Tasks/CheckForUpdatedItemsTask.cs b/UpdateLib/UpdateLib/Tasks/CheckForUpdatedItemsTask.cs index 9a32e42..3f0873e 100644 --- a/UpdateLib/UpdateLib/Tasks/CheckForUpdatedItemsTask.cs +++ b/UpdateLib/UpdateLib/Tasks/CheckForUpdatedItemsTask.cs @@ -26,10 +26,10 @@ namespace MatthiWare.UpdateLib.Tasks { public class CheckForUpdatedItemsTask : AsyncTask { - private UpdateFile m_updateFile; + private UpdateInfo m_updateFile; private HashCacheFile m_cacheFile; - public CheckForUpdatedItemsTask(UpdateFile update, HashCacheFile cache) + public CheckForUpdatedItemsTask(UpdateInfo update, HashCacheFile cache) { if (update == null) throw new ArgumentNullException(nameof(update)); if (cache == null) throw new ArgumentNullException(nameof(cache)); diff --git a/UpdateLib/UpdateLib/Tasks/CheckForUpdatesTask.cs b/UpdateLib/UpdateLib/Tasks/CheckForUpdatesTask.cs index 9329cb0..01af286 100644 --- a/UpdateLib/UpdateLib/Tasks/CheckForUpdatesTask.cs +++ b/UpdateLib/UpdateLib/Tasks/CheckForUpdatesTask.cs @@ -16,6 +16,7 @@ */ using System; +using System.Linq; using System.Net; using MatthiWare.UpdateLib.Files; using System.IO; @@ -63,10 +64,9 @@ protected override void DoWork() } // load the updatefile from disk - Result.UpdateFile = UpdateFile.Load(localFile); - Result.Version = Result.UpdateFile.Version; + Result.UpdateInfo = UpdateFile.Load(localFile).GetLatestUpdate(); - CheckRequiredPrivilegesTask privilegesCheckTask = CheckPrivileges(Result.UpdateFile); + CheckRequiredPrivilegesTask privilegesCheckTask = CheckPrivileges(Result.UpdateInfo); // lets wait for the Cache update to complete and get the task HashCacheFile cache = updater.GetCache(); @@ -81,7 +81,7 @@ protected override void DoWork() * Start a task to get all the files that need to be updated * Returns if there is anything to update */ - CheckForUpdatedItemsTask updatedFilesTask = CheckForUpdatedFiles(Result.UpdateFile, cache); + CheckForUpdatedItemsTask updatedFilesTask = CheckForUpdatedFiles(Result.UpdateInfo, cache); Result.AdminRightsNeeded = privilegesCheckTask.AwaitTask().Result; Result.UpdateAvailable = updatedFilesTask.AwaitTask().Result; @@ -100,25 +100,25 @@ private bool IsUpdateFileInvalid(string localFile) return false; } - private CheckForUpdatedItemsTask CheckForUpdatedFiles(UpdateFile file, HashCacheFile cache) + private CheckForUpdatedItemsTask CheckForUpdatedFiles(UpdateInfo updateInfo, HashCacheFile cache) { - CheckForUpdatedItemsTask task = new CheckForUpdatedItemsTask(file, cache); + CheckForUpdatedItemsTask task = new CheckForUpdatedItemsTask(updateInfo, cache); task.ConfigureAwait(false).Start(); return task; } - private CheckRequiredPrivilegesTask CheckPrivileges(UpdateFile file) + private CheckRequiredPrivilegesTask CheckPrivileges(UpdateInfo updateInfo) { - CheckRequiredPrivilegesTask task = new CheckRequiredPrivilegesTask(file); + CheckRequiredPrivilegesTask task = new CheckRequiredPrivilegesTask(updateInfo); task.ConfigureAwait(false).Start(); return task; } public class CheckForUpdatesResult { - public UpdateVersion Version { get; set; } + public UpdateVersion Version { get { return UpdateInfo.Version; } } public bool UpdateAvailable { get; set; } = false; - public UpdateFile UpdateFile { get; set; } + public UpdateInfo UpdateInfo { get; set; } public bool AdminRightsNeeded { get; set; } = false; } } diff --git a/UpdateLib/UpdateLib/Tasks/CheckRequiredPrivilegesTask.cs b/UpdateLib/UpdateLib/Tasks/CheckRequiredPrivilegesTask.cs index 3c6f278..922c1d0 100644 --- a/UpdateLib/UpdateLib/Tasks/CheckRequiredPrivilegesTask.cs +++ b/UpdateLib/UpdateLib/Tasks/CheckRequiredPrivilegesTask.cs @@ -26,11 +26,11 @@ namespace MatthiWare.UpdateLib.Tasks public class CheckRequiredPrivilegesTask : AsyncTask { - public UpdateFile File { get; set; } + public UpdateInfo UpdateInfo { get; set; } - public CheckRequiredPrivilegesTask(UpdateFile file) + public CheckRequiredPrivilegesTask(UpdateInfo updateInfo) { - File = file; + UpdateInfo = updateInfo; } protected override void DoWork() @@ -40,7 +40,7 @@ protected override void DoWork() if (PermissionUtil.IsProcessElevated) return; - foreach (DirectoryEntry dir in File.Folders) + foreach (DirectoryEntry dir in UpdateInfo.Folders) if (!CheckHasSufficientPermissionsForDirectory(dir)) { Result = true; @@ -48,7 +48,7 @@ protected override void DoWork() } - foreach (DirectoryEntry dir in File.Registry) + foreach (DirectoryEntry dir in UpdateInfo.Registry) if (!CheckHasSufficientPermissionForRegistry(dir)) { Result = true; diff --git a/UpdateLib/UpdateLib/Tasks/DownloadManager.cs b/UpdateLib/UpdateLib/Tasks/DownloadManager.cs index 708dc78..01952dc 100644 --- a/UpdateLib/UpdateLib/Tasks/DownloadManager.cs +++ b/UpdateLib/UpdateLib/Tasks/DownloadManager.cs @@ -27,23 +27,23 @@ namespace MatthiWare.UpdateLib.Tasks { public class DownloadManager { - private AtomicInteger amountToDownload = new AtomicInteger(); - private UpdateFile file; + private AtomicInteger m_amountToDownload = new AtomicInteger(); + private UpdateInfo m_updateInfo; - private List tasks = new List(); + private List m_tasks = new List(); private bool hasRegUpdate, hasErrors = false; public event EventHandler Completed; - public DownloadManager(UpdateFile file) + public DownloadManager(UpdateInfo updateInfo) { - amountToDownload.Value = file.FileCount; - this.file = file; + m_amountToDownload.Value = updateInfo.FileCount; + this.m_updateInfo = updateInfo; } private void Reset() { - tasks.Clear(); + m_tasks.Clear(); hasRegUpdate = false; hasErrors = false; } @@ -58,7 +58,7 @@ public void Update() private void StartUpdate() { - IEnumerable _tasks = tasks.Select(task => task as DownloadTask).NotNull(); + IEnumerable _tasks = m_tasks.Select(task => task as DownloadTask).NotNull(); _tasks.ForEach(task => task.Start()); @@ -68,12 +68,12 @@ private void StartUpdate() private void StartRegUpdate() { - tasks.Select(task => task as UpdateRegistryTask).NotNull().FirstOrDefault()?.Start(); + m_tasks.Select(task => task as UpdateRegistryTask).NotNull().FirstOrDefault()?.Start(); } private void AddUpdates() { - foreach (FileEntry file in file.Folders + foreach (FileEntry file in m_updateInfo.Folders .SelectMany(dir => dir.GetItems()) .Select(e => e as FileEntry) .Distinct() @@ -82,10 +82,10 @@ private void AddUpdates() DownloadTask task = new DownloadTask(file); task.TaskCompleted += Task_TaskCompleted; - tasks.Add(task); + m_tasks.Add(task); } - IEnumerable keys = file.Registry + IEnumerable keys = m_updateInfo.Registry .SelectMany(dir => dir.GetItems()) .Select(e => e as RegistryKeyEntry) .Distinct() @@ -95,12 +95,12 @@ private void AddUpdates() return; hasRegUpdate = true; - amountToDownload.Increment(); + m_amountToDownload.Increment(); UpdateRegistryTask regTask = new UpdateRegistryTask(keys); regTask.TaskCompleted += Task_TaskCompleted; - tasks.Add(regTask); + m_tasks.Add(regTask); } private void Task_TaskCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e) @@ -112,7 +112,7 @@ private void Task_TaskCompleted(object sender, System.ComponentModel.AsyncComple CancelOtherTasks(); } - int left = amountToDownload.Decrement(); + int left = m_amountToDownload.Decrement(); if (hasErrors) return; @@ -126,7 +126,7 @@ private void Task_TaskCompleted(object sender, System.ComponentModel.AsyncComple private void CancelOtherTasks() { - foreach (UpdatableTask task in tasks) + foreach (UpdatableTask task in m_tasks) if (!task.IsCancelled) task.Cancel(); } diff --git a/UpdateLib/UpdateLib/Tasks/UpdateFileProcessorTask.cs b/UpdateLib/UpdateLib/Tasks/UpdateFileProcessorTask.cs index b459014..39337e1 100644 --- a/UpdateLib/UpdateLib/Tasks/UpdateFileProcessorTask.cs +++ b/UpdateLib/UpdateLib/Tasks/UpdateFileProcessorTask.cs @@ -21,13 +21,13 @@ namespace MatthiWare.UpdateLib.Tasks { - public class UpdateFileProcessorTask : AsyncTask + public class UpdateInfoPostProcessorTask : AsyncTask { - private UpdateFile file; + private UpdateInfo m_updateInfo; - public UpdateFileProcessorTask(UpdateFile file) + public UpdateInfoPostProcessorTask(UpdateInfo updateInfo) { - this.file = file; + m_updateInfo = updateInfo; } @@ -50,10 +50,10 @@ private void PostProcessDirectory(DirectoryEntry dir) protected override void DoWork() { - foreach (DirectoryEntry dir in file.Folders) + foreach (DirectoryEntry dir in m_updateInfo.Folders) PostProcessDirectory(dir); - foreach (DirectoryEntry dir in file.Registry) + foreach (DirectoryEntry dir in m_updateInfo.Registry) PostProcessDirectory(dir); AwaitWorkers(); diff --git a/UpdateLib/UpdateLib/UI/Components/FinishPage.cs b/UpdateLib/UpdateLib/UI/Components/FinishPage.cs index 916930a..7afca27 100644 --- a/UpdateLib/UpdateLib/UI/Components/FinishPage.cs +++ b/UpdateLib/UpdateLib/UI/Components/FinishPage.cs @@ -15,6 +15,7 @@ * along with this program. If not, see . */ +using MatthiWare.UpdateLib.Common; using MatthiWare.UpdateLib.Files; using System; using System.Windows.Forms; @@ -23,25 +24,28 @@ namespace MatthiWare.UpdateLib.UI.Components { public partial class FinishPage : UserControl, IWizardPage { + + private UpdaterForm _updaterForm; + public FinishPage(UpdaterForm parent) { InitializeComponent(); _updaterForm = parent; - txtDescription.Text = txtDescription.Text.Replace("%AppName%", parent.updateInfoFile.ApplicationName); - txtDescription.Text = txtDescription.Text.Replace("%version%", parent.updateInfoFile.Version.Value); + txtDescription.Text = txtDescription.Text.Replace("%AppName%", parent.updateInfo.ApplicationName); + txtDescription.Text = txtDescription.Text.Replace("%version%", parent.updateInfo.Version.Value); } public void UpdateState() { + UpdateInfo file = _updaterForm.updateInfo; + if (_updaterForm.hasHadErrors) { cbRestart.Checked = false; cbRestart.Enabled = false; - - UpdateFile file = _updaterForm.updateInfoFile; - + txtDescription.Text = $"{file.ApplicationName} was unable to update to version {file.Version}!\n\n" + "Check the log files for more information!\n\n" + "Press Finish to close this wizard."; @@ -52,9 +56,7 @@ public void UpdateState() { cbRestart.Checked = false; cbRestart.Enabled = false; - - UpdateFile file = _updaterForm.updateInfoFile; - + txtDescription.Text = $"{file.ApplicationName} was unable to update to version {file.Version}!\n\n" + "Update process cancelled by the user.\n\n" + "Press Finish to close this wizard."; @@ -128,7 +130,7 @@ public string Title } } - private UpdaterForm _updaterForm; + public UpdaterForm UpdaterForm { get diff --git a/UpdateLib/UpdateLib/UI/Components/IntroPage.cs b/UpdateLib/UpdateLib/UI/Components/IntroPage.cs index 02fcc62..0033192 100644 --- a/UpdateLib/UpdateLib/UI/Components/IntroPage.cs +++ b/UpdateLib/UpdateLib/UI/Components/IntroPage.cs @@ -28,8 +28,8 @@ public IntroPage(UpdaterForm parent) _updateForm = parent; - txtDesc.Text = txtDesc.Text.Replace("%AppName%", parent.updateInfoFile.ApplicationName); - txtWelcome.Text = txtWelcome.Text.Replace("%AppName%", parent.updateInfoFile.ApplicationName); + txtDesc.Text = txtDesc.Text.Replace("%AppName%", parent.updateInfo.ApplicationName); + txtWelcome.Text = txtWelcome.Text.Replace("%AppName%", parent.updateInfo.ApplicationName); } public UserControl Conent diff --git a/UpdateLib/UpdateLib/UI/Components/UpdatePage.cs b/UpdateLib/UpdateLib/UI/Components/UpdatePage.cs index ca9351e..03d0945 100644 --- a/UpdateLib/UpdateLib/UI/Components/UpdatePage.cs +++ b/UpdateLib/UpdateLib/UI/Components/UpdatePage.cs @@ -32,7 +32,7 @@ namespace MatthiWare.UpdateLib.UI.Components public partial class UpdatePage : UserControl, IWizardPage { - public UpdateFile UpdateFile { get; set; } + public UpdateInfo UpdateInfo { get; set; } public event EventHandler PageUpdate; @@ -46,7 +46,7 @@ public UpdatePage(UpdaterForm parent) _updaterForm = parent; - UpdateFile = parent.updateInfoFile; + UpdateInfo = parent.updateInfo; ImageList ilItems = MakeImageList(); lvItems.SmallImageList = ilItems; @@ -73,18 +73,18 @@ private ImageList MakeImageList() private void FillListView() { - amountToDownload.Value = UpdateFile.FileCount; + amountToDownload.Value = UpdateInfo.FileCount; lvItems.BeginUpdate(); AddDirectoryToListView( - UpdateFile.Folders + UpdateInfo.Folders .SelectMany(dir => dir.GetItems()) .Select(e => e as FileEntry) .Distinct() .NotNull()); - AddRegistryToListView(UpdateFile.Registry + AddRegistryToListView(UpdateInfo.Registry .SelectMany(dir => dir.GetItems()) .Select(e => e as RegistryKeyEntry) .Distinct() diff --git a/UpdateLib/UpdateLib/UI/UpdaterForm.cs b/UpdateLib/UpdateLib/UI/UpdaterForm.cs index 8cc21c8..ddd634c 100644 --- a/UpdateLib/UpdateLib/UI/UpdaterForm.cs +++ b/UpdateLib/UpdateLib/UI/UpdaterForm.cs @@ -15,6 +15,7 @@ * along with this program. If not, see . */ +using MatthiWare.UpdateLib.Common; using MatthiWare.UpdateLib.Files; using MatthiWare.UpdateLib.UI.Components; using System; @@ -26,18 +27,18 @@ namespace MatthiWare.UpdateLib.UI { public partial class UpdaterForm : Form { - internal UpdateFile updateInfoFile; + internal UpdateInfo updateInfo; internal bool NeedsRestart = true; internal bool hasHadErrors = false; internal bool UserCancelled = false; private WizardPageCollection pages; - public UpdaterForm(UpdateFile updateFile) + public UpdaterForm(UpdateInfo updateInfo) { InitializeComponent(); - updateInfoFile = updateFile; + this.updateInfo = updateInfo; pages = new WizardPageCollection(); AddPage(new IntroPage(this)); diff --git a/UpdateLib/UpdateLib/UpdateLib.csproj b/UpdateLib/UpdateLib/UpdateLib.csproj index 6159a43..cebc002 100644 --- a/UpdateLib/UpdateLib/UpdateLib.csproj +++ b/UpdateLib/UpdateLib/UpdateLib.csproj @@ -52,6 +52,7 @@ + UserControl diff --git a/UpdateLib/UpdateLib/Updater.cs b/UpdateLib/UpdateLib/Updater.cs index 71110b6..fb16621 100644 --- a/UpdateLib/UpdateLib/Updater.cs +++ b/UpdateLib/UpdateLib/Updater.cs @@ -467,10 +467,10 @@ public CheckForUpdatesTask CheckForUpdatesAsync(IWin32Window owner) return; if (UpdateSilently) - UpdateWithoutGUI(task.Result.UpdateFile); + UpdateWithoutGUI(task.Result.UpdateInfo); else { - UpdaterForm updateForm = new UpdaterForm(task.Result.UpdateFile); + UpdaterForm updateForm = new UpdaterForm(task.Result.UpdateInfo); updateForm.ShowDialog(owner); } @@ -552,10 +552,11 @@ public HashCacheFile GetCache() /// /// Updates without user interaction /// - /// The update specifications file - private void UpdateWithoutGUI(UpdateFile file) + /// The update specifications file + private void UpdateWithoutGUI(UpdateInfo updateInfo) { - DownloadManager downloader = new DownloadManager(file); + DownloadManager downloader = new DownloadManager(updateInfo); + downloader.Completed += (o, e) => { GetCache().Save(); diff --git a/UpdateLib/UpdateLib/Utils/CmdLineParser.cs b/UpdateLib/UpdateLib/Utils/CmdLineParser.cs index 2abcf94..77f2d37 100644 --- a/UpdateLib/UpdateLib/Utils/CmdLineParser.cs +++ b/UpdateLib/UpdateLib/Utils/CmdLineParser.cs @@ -14,6 +14,7 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ + using MatthiWare.UpdateLib.Common; using System; using System.Collections.Generic; From ebf2a0d4b98028373231b6de9117c2f66fbdf2a2 Mon Sep 17 00:00:00 2001 From: Matthias Beerens Date: Wed, 15 Nov 2017 22:02:41 +0100 Subject: [PATCH 12/40] First part of the VCDiffDecoder Import --- UpdateLib/UpdateLib/Common/Enums.cs | 8 ++ .../Compression/VCDiff/AddressCache.cs | 68 +++++++++++++ .../UpdateLib/Compression/VCDiff/CodeTable.cs | 98 +++++++++++++++++++ .../Compression/VCDiff/Instruction.cs | 20 ++++ .../Compression/VCDiff/VCDiffDecoder.cs | 15 +++ .../VCDiff/VCDiffFormatException.cs | 15 +++ UpdateLib/UpdateLib/UpdateLib.csproj | 5 + UpdateLib/UpdateLib/Utils/IOUtils.cs | 45 +++++++++ 8 files changed, 274 insertions(+) create mode 100644 UpdateLib/UpdateLib/Compression/VCDiff/AddressCache.cs create mode 100644 UpdateLib/UpdateLib/Compression/VCDiff/CodeTable.cs create mode 100644 UpdateLib/UpdateLib/Compression/VCDiff/Instruction.cs create mode 100644 UpdateLib/UpdateLib/Compression/VCDiff/VCDiffDecoder.cs create mode 100644 UpdateLib/UpdateLib/Compression/VCDiff/VCDiffFormatException.cs diff --git a/UpdateLib/UpdateLib/Common/Enums.cs b/UpdateLib/UpdateLib/Common/Enums.cs index 0b9ef12..ce6eedc 100644 --- a/UpdateLib/UpdateLib/Common/Enums.cs +++ b/UpdateLib/UpdateLib/Common/Enums.cs @@ -89,4 +89,12 @@ public enum VersionLabel : byte RC=2, None=3 } + + internal enum InstructionType : byte + { + NoOp = 0, + Add = 1, + Run = 2, + Copy = 3 + } } diff --git a/UpdateLib/UpdateLib/Compression/VCDiff/AddressCache.cs b/UpdateLib/UpdateLib/Compression/VCDiff/AddressCache.cs new file mode 100644 index 0000000..c0a972a --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/VCDiff/AddressCache.cs @@ -0,0 +1,68 @@ +using System; +using System.IO; +using MatthiWare.UpdateLib.Utils; + +namespace MatthiWare.UpdateLib.Compression.VCDiff +{ + internal class AddressCache + { + const byte SelfMode = 0; + const byte HereMode = 1; + + int m_nearSize, m_sameSize, m_nextNearSlot; + int[] m_near, m_same; + + Stream m_addressStream; + + internal AddressCache(int nearSize, int sameSize) + { + m_nearSize = nearSize; + m_sameSize = sameSize; + m_near = new int[nearSize]; + m_same = new int[sameSize * 256]; + } + + public void Reset(byte[] addresses) + { + m_nextNearSlot = 0; + Array.Clear(m_near, 0, m_near.Length); + Array.Clear(m_same, 0, m_same.Length); + + m_addressStream = new MemoryStream(addresses, false); + } + + internal int DecodeAddress(int here, byte mode) + { + int ret; + + if (mode == SelfMode) + ret = m_addressStream.ReadBigEndian7BitEncodedInt(); + else if (mode == HereMode) + ret = here - m_addressStream.ReadBigEndian7BitEncodedInt(); + else if (mode - 2 < m_nearSize) // near cache + ret = m_near[mode - 2] + m_addressStream.ReadBigEndian7BitEncodedInt(); + else // same cache + { + int m = mode - (2 + m_nearSize); + ret = m_same[(m * 256) + m_addressStream.CheckedReadByte()]; + } + + Update(ret); + + return ret; + } + + private void Update(int address) + { + if (m_nearSize > 0) + { + m_near[m_nextNearSlot] = address; + m_nextNearSlot = (m_nextNearSlot + 1) % m_nearSize; + } + + if (m_sameSize > 0) + m_same[address % (m_sameSize * 256)] = address; + } + + } +} diff --git a/UpdateLib/UpdateLib/Compression/VCDiff/CodeTable.cs b/UpdateLib/UpdateLib/Compression/VCDiff/CodeTable.cs new file mode 100644 index 0000000..6c768ce --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/VCDiff/CodeTable.cs @@ -0,0 +1,98 @@ +using MatthiWare.UpdateLib.Common; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace MatthiWare.UpdateLib.Compression.VCDiff +{ + internal class CodeTable + { + internal static CodeTable Default = BuildDefaultCodeTable(); + Instruction[,] m_instructions = new Instruction[256, 2]; + + internal CodeTable(Instruction[,] instructions) + { + if (instructions == null) + throw new ArgumentNullException(nameof(instructions)); + if (instructions.Rank != 2) + throw new ArgumentException("Array must have a rank of 2", nameof(instructions)); + if (instructions.GetLength(0) != 256) + throw new ArgumentException("Array must have a outer length of 256", nameof(instructions)); + if (instructions.GetLength(1) != 2) + throw new ArgumentException("Array must have a innter length of 2", nameof(instructions)); + + Array.Copy(instructions, 0, m_instructions, 0, 512); + } + + internal Instruction this[int x, int y] + { + get + { + return m_instructions[x, y]; + } + } + + internal static CodeTable BuildDefaultCodeTable() + { + // default are NoOps with size and mode 0. + Instruction[,] instructions = new Instruction[256, 2]; + instructions[0, 0] = new Instruction(InstructionType.Run, 0, 0); + + for (byte i = 0; i < 18; i++) + instructions[i + 1, 0] = new Instruction(InstructionType.Add, i, 0); + + int index = 19; + + // instructions 19-162 + for (byte mode = 0; mode < 9; mode++) + { + instructions[index++, 0] = new Instruction(InstructionType.Copy, 0, mode); + for (byte size = 4; size < 19; size++) + instructions[index++, 0] = new Instruction(InstructionType.Copy, size, mode); + } + + // instructions 163-234 + for (byte mode = 0; mode < 6; mode++) + for (byte addSize = 1; addSize < 5; addSize++) + for (byte copySize = 4; copySize < 7; copySize++) + { + instructions[index, 0] = new Instruction(InstructionType.Add, addSize, 0); + instructions[index++, 0] = new Instruction(InstructionType.Copy, copySize, mode); + } + + // instructions 235-246 + for (byte mode = 6; mode < 9; mode++) + for (byte addSize = 1; addSize < 5; addSize++) + { + instructions[index, 0] = new Instruction(InstructionType.Add, addSize, 0); + instructions[index++, 1] = new Instruction(InstructionType.Copy, 4, mode); + } + + for (byte mode = 0; mode < 9; mode++) + { + instructions[index, 0] = new Instruction(InstructionType.Copy, 4, mode); + instructions[index++, 1] = new Instruction(InstructionType.Add, 1, 0); + } + + return new CodeTable(instructions); + } + + internal byte[] GetBytes() + { + byte[] ret = new byte[1536]; + + for (int i = 0; i < 256; i++) + { + ret[i] = (byte)m_instructions[i, 0].Type; + ret[i + 256] = (byte)m_instructions[i, 1].Type; + ret[i + 512] = m_instructions[i, 0].Size; + ret[i + 768] = m_instructions[i, 1].Size; + ret[i + 1024] = m_instructions[i, 0].Size; + ret[i + 1028] = m_instructions[i, 1].Size; + } + + return ret; + } + } +} diff --git a/UpdateLib/UpdateLib/Compression/VCDiff/Instruction.cs b/UpdateLib/UpdateLib/Compression/VCDiff/Instruction.cs new file mode 100644 index 0000000..a9bfa0f --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/VCDiff/Instruction.cs @@ -0,0 +1,20 @@ +using MatthiWare.UpdateLib.Common; + +namespace MatthiWare.UpdateLib.Compression.VCDiff +{ + internal struct Instruction + { + public readonly InstructionType Type; + + public readonly byte Size; + + public readonly byte Mode; + + internal Instruction(InstructionType type, byte size, byte mode) + { + Type = type; + Size = size; + Mode = mode; + } + } +} diff --git a/UpdateLib/UpdateLib/Compression/VCDiff/VCDiffDecoder.cs b/UpdateLib/UpdateLib/Compression/VCDiff/VCDiffDecoder.cs new file mode 100644 index 0000000..6d2c1c8 --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/VCDiff/VCDiffDecoder.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; + +namespace MatthiWare.UpdateLib.Compression.VCDiff +{ + public sealed class VCDiffDecoder + { + + private Stream + + } +} diff --git a/UpdateLib/UpdateLib/Compression/VCDiff/VCDiffFormatException.cs b/UpdateLib/UpdateLib/Compression/VCDiff/VCDiffFormatException.cs new file mode 100644 index 0000000..0382692 --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/VCDiff/VCDiffFormatException.cs @@ -0,0 +1,15 @@ +using System; + +namespace MatthiWare.UpdateLib.Compression.VCDiff +{ + [Serializable] + public class VCDiffFormatException : Exception + { + public VCDiffFormatException() { } + public VCDiffFormatException(string message) : base(message) { } + public VCDiffFormatException(string message, Exception inner) : base(message, inner) { } + protected VCDiffFormatException( + System.Runtime.Serialization.SerializationInfo info, + System.Runtime.Serialization.StreamingContext context) : base(info, context) { } + } +} diff --git a/UpdateLib/UpdateLib/UpdateLib.csproj b/UpdateLib/UpdateLib/UpdateLib.csproj index cebc002..ec19b3a 100644 --- a/UpdateLib/UpdateLib/UpdateLib.csproj +++ b/UpdateLib/UpdateLib/UpdateLib.csproj @@ -54,6 +54,11 @@ + + + + + UserControl diff --git a/UpdateLib/UpdateLib/Utils/IOUtils.cs b/UpdateLib/UpdateLib/Utils/IOUtils.cs index 08e8c29..2c853d4 100644 --- a/UpdateLib/UpdateLib/Utils/IOUtils.cs +++ b/UpdateLib/UpdateLib/Utils/IOUtils.cs @@ -17,6 +17,7 @@ using MatthiWare.UpdateLib.Common; using System; +using System.IO; using System.Text; namespace MatthiWare.UpdateLib.Utils @@ -78,5 +79,49 @@ private static string GetPathPrefix() } } + internal static byte[] CheckedReadBytes(this Stream stream, int size) + { + byte[] ret = new byte[size]; + int index = 0; + + while (index < size) + { + int read = stream.Read(ret, index, size - index); + if (read == 0) + throw new EndOfStreamException(); + + index += read; + } + + return ret; + } + + internal static byte CheckedReadByte(this Stream stream) + { + int ret = stream.ReadByte(); + + if (ret == -1) + throw new IOException("Unable to read byte from stream"); + + return (byte)ret; + } + + internal static int ReadBigEndian7BitEncodedInt(this Stream stream) + { + int ret = 0; + + for (int i = 0; i < 5; i++) + { + int b = stream.ReadByte(); + if (b == -1) + throw new EndOfStreamException(); + + ret = (ret << 7) | (b & 0x7f); + if ((b & 0x80) == 0) + return ret; + } + + throw new IOException("Invalid 7-bit encoded integer in stream"); + } } } From c000dff8ac6a4581d1ddbeb917b1521a8238f0e6 Mon Sep 17 00:00:00 2001 From: Matthias Beerens Date: Thu, 16 Nov 2017 21:36:12 +0100 Subject: [PATCH 13/40] Finished VCDiffDecoder --- .../UpdateLib/Compression/VCDiff/CodeTable.cs | 2 +- .../Compression/VCDiff/VCDiffDecoder.cs | 168 +++++++++++++++++- 2 files changed, 168 insertions(+), 2 deletions(-) diff --git a/UpdateLib/UpdateLib/Compression/VCDiff/CodeTable.cs b/UpdateLib/UpdateLib/Compression/VCDiff/CodeTable.cs index 6c768ce..44debb1 100644 --- a/UpdateLib/UpdateLib/Compression/VCDiff/CodeTable.cs +++ b/UpdateLib/UpdateLib/Compression/VCDiff/CodeTable.cs @@ -33,7 +33,7 @@ internal CodeTable(Instruction[,] instructions) } } - internal static CodeTable BuildDefaultCodeTable() + private static CodeTable BuildDefaultCodeTable() { // default are NoOps with size and mode 0. Instruction[,] instructions = new Instruction[256, 2]; diff --git a/UpdateLib/UpdateLib/Compression/VCDiff/VCDiffDecoder.cs b/UpdateLib/UpdateLib/Compression/VCDiff/VCDiffDecoder.cs index 6d2c1c8..b4472c8 100644 --- a/UpdateLib/UpdateLib/Compression/VCDiff/VCDiffDecoder.cs +++ b/UpdateLib/UpdateLib/Compression/VCDiff/VCDiffDecoder.cs @@ -3,13 +3,179 @@ using System.IO; using System.Linq; using System.Text; +using MatthiWare.UpdateLib.Utils; +using MatthiWare.UpdateLib.Common; namespace MatthiWare.UpdateLib.Compression.VCDiff { public sealed class VCDiffDecoder { - private Stream + private Stream m_original, m_delta, m_output; + private CodeTable m_codeTable = CodeTable.Default; + + private AddressCache m_cache = new AddressCache(4, 3); + + private VCDiffDecoder(Stream original, Stream delta, Stream output) + { + m_original = original; + m_delta = delta; + m_output = output; + } + + public static void Decode(Stream original, Stream delta, Stream output) + { + if (original == null) throw new ArgumentNullException(nameof(original)); + if (delta == null) throw new ArgumentNullException(nameof(delta)); + if (output == null) throw new ArgumentNullException(nameof(output)); + + if (!original.CanRead || !original.CanSeek) + throw new ArgumentException("Must be able to read and seek in stream", nameof(original)); + + if (!delta.CanRead) + throw new ArgumentException("Must be able to read in stream", nameof(delta)); + + if (!output.CanWrite || !output.CanSeek || !output.CanRead) + throw new ArgumentException("Must be able to read, seek and write in stream", nameof(output)); + + VCDiffDecoder decoder = new VCDiffDecoder(original, delta, output); + decoder.Decode(); + } + + private void Decode() + { + ReadHeader(); + } + + private void ReadHeader() + { + byte[] header = m_delta.CheckedReadBytes(4); + if (header[0] != 0xd6 || + header[1] != 0xc3 || + header[2] != 0xc4) + throw new VCDiffFormatException("Invalid header in delta stream"); + + if (header[3] != 0) + throw new VCDiffFormatException("Only VCDiff Version 0 is supported"); + + byte headerIndicator = m_delta.CheckedReadByte(); + + if ((headerIndicator & 1) != 0) + throw new VCDiffFormatException("Secondary compressors are not supported"); + + if ((headerIndicator & 0xf8) != 0) + throw new VCDiffFormatException("Invalid header indicator, bits 3-7 not all zero"); + } + + private bool DecodeWindow() + { + int windowIndicator = m_delta.ReadByte(); + + if (windowIndicator == -1) + return false; + + Stream sourceStream; + int sourceStreamPostReadSeek = -1; + windowIndicator &= 0xfb; + + switch (windowIndicator & 3) + { + case 0: + sourceStream = null; + break; + case 1: + sourceStream = m_original; + break; + case 2: + sourceStream = m_output; + sourceStreamPostReadSeek = (int)m_output.Position; + break; + default: + throw new VCDiffFormatException("Invalid window indicator"); + } + + + int sourceLength = m_delta.ReadBigEndian7BitEncodedInt(); + int sourcePosition = m_delta.ReadBigEndian7BitEncodedInt(); + + sourceStream.Position = sourcePosition; + byte[] sourceData = sourceStream.CheckedReadBytes(sourceLength); + if (sourceStreamPostReadSeek != -1) + sourceStream.Position = sourceStreamPostReadSeek; + + m_delta.ReadBigEndian7BitEncodedInt(); + + int targetLength = m_delta.ReadBigEndian7BitEncodedInt(); + byte[] targetData = new byte[targetLength]; + MemoryStream targetDataStream = new MemoryStream(targetData, true); + + if (m_delta.CheckedReadByte() != 0) + throw new VCDiffFormatException("Unable to handle compressed delta sections"); + + int addRunDataLength = m_delta.ReadBigEndian7BitEncodedInt(); + int instructionsLength = m_delta.ReadBigEndian7BitEncodedInt(); + int addressesLength = m_delta.ReadBigEndian7BitEncodedInt(); + + byte[] addRunData = m_delta.CheckedReadBytes(addRunDataLength); + byte[] instructions = m_delta.CheckedReadBytes(instructionsLength); + byte[] addresses = m_delta.CheckedReadBytes(addressesLength); + + int addRunDataIndex = 0; + MemoryStream instructionStream = new MemoryStream(instructions, false); + + m_cache.Reset(addresses); + + while (true) + { + int instructionIndex = instructionStream.ReadByte(); + if (instructionIndex == -1) + break; + + for (int i = 0; i < 2; i++) + { + Instruction instruction = m_codeTable[instructionIndex, i]; + int size = instruction.Size; + + if (size == 0 && instruction.Type != InstructionType.NoOp) + size = instructionStream.ReadBigEndian7BitEncodedInt(); + + switch (instruction.Type) + { + case InstructionType.NoOp: + break; + case InstructionType.Add: + targetDataStream.Write(addRunData, addRunDataIndex, size); + addRunDataIndex += size; + break; + case InstructionType.Copy: + int addr = m_cache.DecodeAddress((int)targetDataStream.Position + sourceLength, instruction.Mode); + if (addr < sourceData.Length) + targetDataStream.Write(sourceData, addr, size); + else + { + addr -= sourceLength; + if (addr + size < targetDataStream.Position) + targetDataStream.Write(targetData, addr, size); + else + for (int j = 0; j < size; j++) + targetDataStream.WriteByte(targetData[addr++]); + } + break; + case InstructionType.Run: + byte data = addRunData[addRunDataIndex++]; + for (int j = 0; j < size; j++) + targetDataStream.WriteByte(data); + break; + default: + throw new VCDiffFormatException("Invalid instruction type found"); + } + } + + m_output.Write(targetData, 0, targetLength); + + return true; + } + } } } From ec66e2d5f3069d1e224fbc7e21d7aaa7ce5a4bcd Mon Sep 17 00:00:00 2001 From: Matthias Beerens Date: Thu, 16 Nov 2017 23:31:49 +0100 Subject: [PATCH 14/40] Add GZip support --- UpdateLib/UpdateLib/Compression/GZip/GZip.cs | 31 +++++++++++++++++++ .../Compression/GZip/GZipException.cs | 19 ++++++++++++ UpdateLib/UpdateLib/UpdateLib.csproj | 5 +++ UpdateLib/UpdateLib/Utils/IOUtils.cs | 20 ++++++++++++ 4 files changed, 75 insertions(+) create mode 100644 UpdateLib/UpdateLib/Compression/GZip/GZip.cs create mode 100644 UpdateLib/UpdateLib/Compression/GZip/GZipException.cs diff --git a/UpdateLib/UpdateLib/Compression/GZip/GZip.cs b/UpdateLib/UpdateLib/Compression/GZip/GZip.cs new file mode 100644 index 0000000..7e3b15f --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/GZip/GZip.cs @@ -0,0 +1,31 @@ +using MatthiWare.UpdateLib.Utils; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; + +namespace MatthiWare.UpdateLib.Compression.GZip +{ + public static class GZip + { + + public static void Decompress(Stream inStream, Stream outStream) + { + if (inStream == null || outStream == null) + throw new ArgumentNullException("Streams"); + + using (var gzip = new GZipInputStream(inStream)) + IOUtils.Copy(gzip, outStream, new byte[4096]); + } + + public static void Decompress(Stream inStream, Stream outStream, int level) + { + if (inStream == null || outStream == null) + throw new ArgumentNullException("Streams"); + + using (var gzip = new GZipOutputStream(outStream, level)) + IOUtils.Copy(inStream, gzip, new byte[4096]); + } + } +} diff --git a/UpdateLib/UpdateLib/Compression/GZip/GZipException.cs b/UpdateLib/UpdateLib/Compression/GZip/GZipException.cs new file mode 100644 index 0000000..e3d120f --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/GZip/GZipException.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace MatthiWare.UpdateLib.Compression.GZip +{ + + [Serializable] + public class GZipException : Exception + { + public GZipException() { } + public GZipException(string message) : base(message) { } + public GZipException(string message, Exception inner) : base(message, inner) { } + protected GZipException( + System.Runtime.Serialization.SerializationInfo info, + System.Runtime.Serialization.StreamingContext context) : base(info, context) { } + } +} diff --git a/UpdateLib/UpdateLib/UpdateLib.csproj b/UpdateLib/UpdateLib/UpdateLib.csproj index ec19b3a..c5c2253 100644 --- a/UpdateLib/UpdateLib/UpdateLib.csproj +++ b/UpdateLib/UpdateLib/UpdateLib.csproj @@ -54,6 +54,8 @@ + + @@ -199,6 +201,9 @@ UpdaterForm.cs + + + INIT_FINISHING_STATE ---. + * / | (2) (5) | + * / v (5) | + * (3)| SETDICT_STATE ---> SETDICT_FINISHING_STATE |(3) + * \ | (3) | ,--------' + * | | | (3) / + * v v (5) v v + * (1) -> BUSY_STATE ----> FINISHING_STATE + * | (6) + * v + * FINISHED_STATE + * \_____________________________________/ + * | (7) + * v + * CLOSED_STATE + * + * (1) If we should produce a header we start in INIT_STATE, otherwise + * we start in BUSY_STATE. + * (2) A dictionary may be set only when we are in INIT_STATE, then + * we change the state as indicated. + * (3) Whether a dictionary is set or not, on the first call of deflate + * we change to BUSY_STATE. + * (4) -- intentionally left blank -- :) + * (5) FINISHING_STATE is entered, when flush() is called to indicate that + * there is no more INPUT. There are also states indicating, that + * the header wasn't written yet. + * (6) FINISHED_STATE is entered, when everything has been flushed to the + * internal pending output buffer. + * (7) At any time (7) + * + */ + #endregion + #region Public Constants + /// + /// The best and slowest compression level. This tries to find very + /// long and distant string repetitions. + /// + public const int BEST_COMPRESSION = 9; + + /// + /// The worst but fastest compression level. + /// + public const int BEST_SPEED = 1; + + /// + /// The default compression level. + /// + public const int DEFAULT_COMPRESSION = -1; + + /// + /// This level won't compress at all but output uncompressed blocks. + /// + public const int NO_COMPRESSION = 0; + + /// + /// The compression method. This is the only method supported so far. + /// There is no need to use this constant at all. + /// + public const int DEFLATED = 8; + #endregion + #region Public Enum + + /// + /// Compression Level as an enum for safer use + /// + public enum CompressionLevel + { + /// + /// The best and slowest compression level. This tries to find very + /// long and distant string repetitions. + /// + BEST_COMPRESSION = Deflater.BEST_COMPRESSION, + + /// + /// The worst but fastest compression level. + /// + BEST_SPEED = Deflater.BEST_SPEED, + + /// + /// The default compression level. + /// + DEFAULT_COMPRESSION = Deflater.DEFAULT_COMPRESSION, + + /// + /// This level won't compress at all but output uncompressed blocks. + /// + NO_COMPRESSION = Deflater.NO_COMPRESSION, + + /// + /// The compression method. This is the only method supported so far. + /// There is no need to use this constant at all. + /// + DEFLATED = Deflater.DEFLATED + } + + #endregion + #region Local Constants + private const int IS_SETDICT = 0x01; + private const int IS_FLUSHING = 0x04; + private const int IS_FINISHING = 0x08; + + private const int INIT_STATE = 0x00; + private const int SETDICT_STATE = 0x01; + // private static int INIT_FINISHING_STATE = 0x08; + // private static int SETDICT_FINISHING_STATE = 0x09; + private const int BUSY_STATE = 0x10; + private const int FLUSHING_STATE = 0x14; + private const int FINISHING_STATE = 0x1c; + private const int FINISHED_STATE = 0x1e; + private const int CLOSED_STATE = 0x7f; + #endregion + #region Constructors + /// + /// Creates a new deflater with default compression level. + /// + public Deflater() : this(DEFAULT_COMPRESSION, false) + { + + } + + /// + /// Creates a new deflater with given compression level. + /// + /// + /// the compression level, a value between NO_COMPRESSION + /// and BEST_COMPRESSION, or DEFAULT_COMPRESSION. + /// + /// if lvl is out of range. + public Deflater(int level) : this(level, false) + { + + } + + /// + /// Creates a new deflater with given compression level. + /// + /// + /// the compression level, a value between NO_COMPRESSION + /// and BEST_COMPRESSION. + /// + /// + /// true, if we should suppress the Zlib/RFC1950 header at the + /// beginning and the adler checksum at the end of the output. This is + /// useful for the GZIP/PKZIP formats. + /// + /// if lvl is out of range. + public Deflater(int level, bool noZlibHeaderOrFooter) + { + if (level == DEFAULT_COMPRESSION) + { + level = 6; + } + else if (level < NO_COMPRESSION || level > BEST_COMPRESSION) + { + throw new ArgumentOutOfRangeException(nameof(level)); + } + + pending = new DeflaterPending(); + engine = new DeflaterEngine(pending); + this.noZlibHeaderOrFooter = noZlibHeaderOrFooter; + SetStrategy(DeflateStrategy.Default); + SetLevel(level); + Reset(); + } + #endregion + + /// + /// Resets the deflater. The deflater acts afterwards as if it was + /// just created with the same compression level and strategy as it + /// had before. + /// + public void Reset() + { + state = (noZlibHeaderOrFooter ? BUSY_STATE : INIT_STATE); + totalOut = 0; + pending.Reset(); + engine.Reset(); + } + + /// + /// Gets the current adler checksum of the data that was processed so far. + /// + public int Adler + { + get + { + return engine.Adler; + } + } + + /// + /// Gets the number of input bytes processed so far. + /// + public long TotalIn + { + get + { + return engine.TotalIn; + } + } + + /// + /// Gets the number of output bytes so far. + /// + public long TotalOut + { + get + { + return totalOut; + } + } + + /// + /// Flushes the current input block. Further calls to deflate() will + /// produce enough output to inflate everything in the current input + /// block. This is not part of Sun's JDK so I have made it package + /// private. It is used by DeflaterOutputStream to implement + /// flush(). + /// + public void Flush() + { + state |= IS_FLUSHING; + } + + /// + /// Finishes the deflater with the current input block. It is an error + /// to give more input after this method was called. This method must + /// be called to force all bytes to be flushed. + /// + public void Finish() + { + state |= (IS_FLUSHING | IS_FINISHING); + } + + /// + /// Returns true if the stream was finished and no more output bytes + /// are available. + /// + public bool IsFinished + { + get + { + return (state == FINISHED_STATE) && pending.IsFlushed; + } + } + + /// + /// Returns true, if the input buffer is empty. + /// You should then call setInput(). + /// NOTE: This method can also return true when the stream + /// was finished. + /// + public bool IsNeedingInput + { + get + { + return engine.NeedsInput(); + } + } + + /// + /// Sets the data which should be compressed next. This should be only + /// called when needsInput indicates that more input is needed. + /// If you call setInput when needsInput() returns false, the + /// previous input that is still pending will be thrown away. + /// The given byte array should not be changed, before needsInput() returns + /// true again. + /// This call is equivalent to setInput(input, 0, input.length). + /// + /// + /// the buffer containing the input data. + /// + /// + /// if the buffer was finished() or ended(). + /// + public void SetInput(byte[] input) + { + SetInput(input, 0, input.Length); + } + + /// + /// Sets the data which should be compressed next. This should be + /// only called when needsInput indicates that more input is needed. + /// The given byte array should not be changed, before needsInput() returns + /// true again. + /// + /// + /// the buffer containing the input data. + /// + /// + /// the start of the data. + /// + /// + /// the number of data bytes of input. + /// + /// + /// if the buffer was Finish()ed or if previous input is still pending. + /// + public void SetInput(byte[] input, int offset, int count) + { + if ((state & IS_FINISHING) != 0) + { + throw new InvalidOperationException("Finish() already called"); + } + engine.SetInput(input, offset, count); + } + + /// + /// Sets the compression level. There is no guarantee of the exact + /// position of the change, but if you call this when needsInput is + /// true the change of compression level will occur somewhere near + /// before the end of the so far given input. + /// + /// + /// the new compression level. + /// + public void SetLevel(int level) + { + if (level == DEFAULT_COMPRESSION) + { + level = 6; + } + else if (level < NO_COMPRESSION || level > BEST_COMPRESSION) + { + throw new ArgumentOutOfRangeException(nameof(level)); + } + + if (this.level != level) + { + this.level = level; + engine.SetLevel(level); + } + } + + /// + /// Get current compression level + /// + /// Returns the current compression level + public int GetLevel() + { + return level; + } + + /// + /// Sets the compression strategy. Strategy is one of + /// DEFAULT_STRATEGY, HUFFMAN_ONLY and FILTERED. For the exact + /// position where the strategy is changed, the same as for + /// SetLevel() applies. + /// + /// + /// The new compression strategy. + /// + public void SetStrategy(DeflateStrategy strategy) + { + engine.Strategy = strategy; + } + + /// + /// Deflates the current input block with to the given array. + /// + /// + /// The buffer where compressed data is stored + /// + /// + /// The number of compressed bytes added to the output, or 0 if either + /// IsNeedingInput() or IsFinished returns true or length is zero. + /// + public int Deflate(byte[] output) + { + return Deflate(output, 0, output.Length); + } + + /// + /// Deflates the current input block to the given array. + /// + /// + /// Buffer to store the compressed data. + /// + /// + /// Offset into the output array. + /// + /// + /// The maximum number of bytes that may be stored. + /// + /// + /// The number of compressed bytes added to the output, or 0 if either + /// needsInput() or finished() returns true or length is zero. + /// + /// + /// If Finish() was previously called. + /// + /// + /// If offset or length don't match the array length. + /// + public int Deflate(byte[] output, int offset, int length) + { + int origLength = length; + + if (state == CLOSED_STATE) + { + throw new InvalidOperationException("Deflater closed"); + } + + if (state < BUSY_STATE) + { + // output header + int header = (DEFLATED + + ((DeflaterConstants.MAX_WBITS - 8) << 4)) << 8; + int level_flags = (level - 1) >> 1; + if (level_flags < 0 || level_flags > 3) + { + level_flags = 3; + } + header |= level_flags << 6; + if ((state & IS_SETDICT) != 0) + { + // Dictionary was set + header |= DeflaterConstants.PRESET_DICT; + } + header += 31 - (header % 31); + + pending.WriteShortMSB(header); + if ((state & IS_SETDICT) != 0) + { + int chksum = engine.Adler; + engine.ResetAdler(); + pending.WriteShortMSB(chksum >> 16); + pending.WriteShortMSB(chksum & 0xffff); + } + + state = BUSY_STATE | (state & (IS_FLUSHING | IS_FINISHING)); + } + + for (;;) + { + int count = pending.Flush(output, offset, length); + offset += count; + totalOut += count; + length -= count; + + if (length == 0 || state == FINISHED_STATE) + { + break; + } + + if (!engine.Deflate((state & IS_FLUSHING) != 0, (state & IS_FINISHING) != 0)) + { + switch (state) + { + case BUSY_STATE: + // We need more input now + return origLength - length; + case FLUSHING_STATE: + if (level != NO_COMPRESSION) + { + /* We have to supply some lookahead. 8 bit lookahead + * is needed by the zlib inflater, and we must fill + * the next byte, so that all bits are flushed. + */ + int neededbits = 8 + ((-pending.BitCount) & 7); + while (neededbits > 0) + { + /* write a static tree block consisting solely of + * an EOF: + */ + pending.WriteBits(2, 10); + neededbits -= 10; + } + } + state = BUSY_STATE; + break; + case FINISHING_STATE: + pending.AlignToByte(); + + // Compressed data is complete. Write footer information if required. + if (!noZlibHeaderOrFooter) + { + int adler = engine.Adler; + pending.WriteShortMSB(adler >> 16); + pending.WriteShortMSB(adler & 0xffff); + } + state = FINISHED_STATE; + break; + } + } + } + return origLength - length; + } + + /// + /// Sets the dictionary which should be used in the deflate process. + /// This call is equivalent to setDictionary(dict, 0, dict.Length). + /// + /// + /// the dictionary. + /// + /// + /// if SetInput () or Deflate () were already called or another dictionary was already set. + /// + public void SetDictionary(byte[] dictionary) + { + SetDictionary(dictionary, 0, dictionary.Length); + } + + /// + /// Sets the dictionary which should be used in the deflate process. + /// The dictionary is a byte array containing strings that are + /// likely to occur in the data which should be compressed. The + /// dictionary is not stored in the compressed output, only a + /// checksum. To decompress the output you need to supply the same + /// dictionary again. + /// + /// + /// The dictionary data + /// + /// + /// The index where dictionary information commences. + /// + /// + /// The number of bytes in the dictionary. + /// + /// + /// If SetInput () or Deflate() were already called or another dictionary was already set. + /// + public void SetDictionary(byte[] dictionary, int index, int count) + { + if (state != INIT_STATE) + { + throw new InvalidOperationException(); + } + + state = SETDICT_STATE; + engine.SetDictionary(dictionary, index, count); + } + + #region Instance Fields + /// + /// Compression level. + /// + int level; + + /// + /// If true no Zlib/RFC1950 headers or footers are generated + /// + bool noZlibHeaderOrFooter; + + /// + /// The current state. + /// + int state; + + /// + /// The total bytes of output written. + /// + long totalOut; + + /// + /// The pending output. + /// + DeflaterPending pending; + + /// + /// The deflater engine. + /// + DeflaterEngine engine; + #endregion + } +} diff --git a/UpdateLib/UpdateLib/Compression/DeflaterConstants.cs b/UpdateLib/UpdateLib/Compression/DeflaterConstants.cs new file mode 100644 index 0000000..90e1e6d --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/DeflaterConstants.cs @@ -0,0 +1,149 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace MatthiWare.UpdateLib.Compression +{ + /// + /// This class contains constants used for deflation. + /// + public static class DeflaterConstants + { + /// + /// Set to true to enable debugging + /// + public const bool DEBUGGING = false; + + /// + /// Written to Zip file to identify a stored block + /// + public const int STORED_BLOCK = 0; + + /// + /// Identifies static tree in Zip file + /// + public const int STATIC_TREES = 1; + + /// + /// Identifies dynamic tree in Zip file + /// + public const int DYN_TREES = 2; + + /// + /// Header flag indicating a preset dictionary for deflation + /// + public const int PRESET_DICT = 0x20; + + /// + /// Sets internal buffer sizes for Huffman encoding + /// + public const int DEFAULT_MEM_LEVEL = 8; + + /// + /// Internal compression engine constant + /// + public const int MAX_MATCH = 258; + + /// + /// Internal compression engine constant + /// + public const int MIN_MATCH = 3; + + /// + /// Internal compression engine constant + /// + public const int MAX_WBITS = 15; + + /// + /// Internal compression engine constant + /// + public const int WSIZE = 1 << MAX_WBITS; + + /// + /// Internal compression engine constant + /// + public const int WMASK = WSIZE - 1; + + /// + /// Internal compression engine constant + /// + public const int HASH_BITS = DEFAULT_MEM_LEVEL + 7; + + /// + /// Internal compression engine constant + /// + public const int HASH_SIZE = 1 << HASH_BITS; + + /// + /// Internal compression engine constant + /// + public const int HASH_MASK = HASH_SIZE - 1; + + /// + /// Internal compression engine constant + /// + public const int HASH_SHIFT = (HASH_BITS + MIN_MATCH - 1) / MIN_MATCH; + + /// + /// Internal compression engine constant + /// + public const int MIN_LOOKAHEAD = MAX_MATCH + MIN_MATCH + 1; + + /// + /// Internal compression engine constant + /// + public const int MAX_DIST = WSIZE - MIN_LOOKAHEAD; + + /// + /// Internal compression engine constant + /// + public const int PENDING_BUF_SIZE = 1 << (DEFAULT_MEM_LEVEL + 8); + + /// + /// Internal compression engine constant + /// + public static int MAX_BLOCK_SIZE = Math.Min(65535, PENDING_BUF_SIZE - 5); + + /// + /// Internal compression engine constant + /// + public const int DEFLATE_STORED = 0; + + /// + /// Internal compression engine constant + /// + public const int DEFLATE_FAST = 1; + + /// + /// Internal compression engine constant + /// + public const int DEFLATE_SLOW = 2; + + /// + /// Internal compression engine constant + /// + public static int[] GOOD_LENGTH = { 0, 4, 4, 4, 4, 8, 8, 8, 32, 32 }; + + /// + /// Internal compression engine constant + /// + public static int[] MAX_LAZY = { 0, 4, 5, 6, 4, 16, 16, 32, 128, 258 }; + + /// + /// Internal compression engine constant + /// + public static int[] NICE_LENGTH = { 0, 8, 16, 32, 16, 32, 128, 128, 258, 258 }; + + /// + /// Internal compression engine constant + /// + public static int[] MAX_CHAIN = { 0, 4, 8, 32, 16, 32, 128, 256, 1024, 4096 }; + + /// + /// Internal compression engine constant + /// + public static int[] COMPR_FUNC = { 0, 1, 1, 1, 1, 2, 2, 2, 2, 2 }; + + } +} diff --git a/UpdateLib/UpdateLib/Compression/DeflaterEngine.cs b/UpdateLib/UpdateLib/Compression/DeflaterEngine.cs new file mode 100644 index 0000000..d925729 --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/DeflaterEngine.cs @@ -0,0 +1,920 @@ +using MatthiWare.UpdateLib.Compression.Checksum; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace MatthiWare.UpdateLib.Compression +{ + /// + /// Strategies for deflater + /// + public enum DeflateStrategy + { + /// + /// The default strategy + /// + Default = 0, + + /// + /// This strategy will only allow longer string repetitions. It is + /// useful for random data with a small character set. + /// + Filtered = 1, + + + /// + /// This strategy will not look for string repetitions at all. It + /// only encodes with Huffman trees (which means, that more common + /// characters get a smaller encoding. + /// + HuffmanOnly = 2 + } + + // DEFLATE ALGORITHM: + // + // The uncompressed stream is inserted into the window array. When + // the window array is full the first half is thrown away and the + // second half is copied to the beginning. + // + // The head array is a hash table. Three characters build a hash value + // and they the value points to the corresponding index in window of + // the last string with this hash. The prev array implements a + // linked list of matches with the same hash: prev[index & WMASK] points + // to the previous index with the same hash. + // + + + /// + /// Low level compression engine for deflate algorithm which uses a 32K sliding window + /// with secondary compression from Huffman/Shannon-Fano codes. + /// + public class DeflaterEngine + { + #region Constants + const int TooFar = 4096; + #endregion + + #region Constructors + /// + /// Construct instance with pending buffer + /// + /// + /// Pending buffer to use + /// > + public DeflaterEngine(DeflaterPending pending) + { + this.pending = pending; + huffman = new DeflaterHuffman(pending); + checksum = new Adler32(); + + window = new byte[2 * DeflaterConstants.WSIZE]; + head = new short[DeflaterConstants.HASH_SIZE]; + prev = new short[DeflaterConstants.WSIZE]; + + // We start at index 1, to avoid an implementation deficiency, that + // we cannot build a repeat pattern at index 0. + blockStart = strstart = 1; + } + + #endregion + + /// + /// Deflate drives actual compression of data + /// + /// True to flush input buffers + /// Finish deflation with the current input. + /// Returns true if progress has been made. + public bool Deflate(bool flush, bool finish) + { + bool progress; + do + { + FillWindow(); + bool canFlush = flush && (inputOff == inputEnd); + +#if DebugDeflation + if (DeflaterConstants.DEBUGGING) { + Console.WriteLine("window: [" + blockStart + "," + strstart + "," + + lookahead + "], " + compressionFunction + "," + canFlush); + } +#endif + switch (compressionFunction) + { + case DeflaterConstants.DEFLATE_STORED: + progress = DeflateStored(canFlush, finish); + break; + case DeflaterConstants.DEFLATE_FAST: + progress = DeflateFast(canFlush, finish); + break; + case DeflaterConstants.DEFLATE_SLOW: + progress = DeflateSlow(canFlush, finish); + break; + default: + throw new InvalidOperationException("unknown compressionFunction"); + } + } while (pending.IsFlushed && progress); // repeat while we have no pending output and progress was made + return progress; + } + + /// + /// Sets input data to be deflated. Should only be called when NeedsInput() + /// returns true + /// + /// The buffer containing input data. + /// The offset of the first byte of data. + /// The number of bytes of data to use as input. + public void SetInput(byte[] buffer, int offset, int count) + { + if (buffer == null) + { + throw new ArgumentNullException(nameof(buffer)); + } + + if (offset < 0) + { + throw new ArgumentOutOfRangeException(nameof(offset)); + } + + if (count < 0) + { + throw new ArgumentOutOfRangeException(nameof(count)); + } + + if (inputOff < inputEnd) + { + throw new InvalidOperationException("Old input was not completely processed"); + } + + int end = offset + count; + + /* We want to throw an ArrayIndexOutOfBoundsException early. The + * check is very tricky: it also handles integer wrap around. + */ + if ((offset > end) || (end > buffer.Length)) + { + throw new ArgumentOutOfRangeException(nameof(count)); + } + + inputBuf = buffer; + inputOff = offset; + inputEnd = end; + } + + /// + /// Determines if more input is needed. + /// + /// Return true if input is needed via SetInput + public bool NeedsInput() + { + return (inputEnd == inputOff); + } + + /// + /// Set compression dictionary + /// + /// The buffer containing the dictionary data + /// The offset in the buffer for the first byte of data + /// The length of the dictionary data. + public void SetDictionary(byte[] buffer, int offset, int length) + { +#if DebugDeflation + if (DeflaterConstants.DEBUGGING && (strstart != 1) ) + { + throw new InvalidOperationException("strstart not 1"); + } +#endif + checksum.Update(buffer, offset, length); + if (length < DeflaterConstants.MIN_MATCH) + { + return; + } + + if (length > DeflaterConstants.MAX_DIST) + { + offset += length - DeflaterConstants.MAX_DIST; + length = DeflaterConstants.MAX_DIST; + } + + System.Array.Copy(buffer, offset, window, strstart, length); + + UpdateHash(); + --length; + while (--length > 0) + { + InsertString(); + strstart++; + } + strstart += 2; + blockStart = strstart; + } + + /// + /// Reset internal state + /// + public void Reset() + { + huffman.Reset(); + checksum.Reset(); + blockStart = strstart = 1; + lookahead = 0; + totalIn = 0; + prevAvailable = false; + matchLen = DeflaterConstants.MIN_MATCH - 1; + + for (int i = 0; i < DeflaterConstants.HASH_SIZE; i++) + { + head[i] = 0; + } + + for (int i = 0; i < DeflaterConstants.WSIZE; i++) + { + prev[i] = 0; + } + } + + /// + /// Reset Adler checksum + /// + public void ResetAdler() + { + checksum.Reset(); + } + + /// + /// Get current value of Adler checksum + /// + public int Adler + { + get + { + return unchecked((int)checksum.Value); + } + } + + /// + /// Total data processed + /// + public long TotalIn + { + get + { + return totalIn; + } + } + + /// + /// Get/set the deflate strategy + /// + public DeflateStrategy Strategy + { + get + { + return strategy; + } + set + { + strategy = value; + } + } + + /// + /// Set the deflate level (0-9) + /// + /// The value to set the level to. + public void SetLevel(int level) + { + if ((level < 0) || (level > 9)) + { + throw new ArgumentOutOfRangeException(nameof(level)); + } + + goodLength = DeflaterConstants.GOOD_LENGTH[level]; + max_lazy = DeflaterConstants.MAX_LAZY[level]; + niceLength = DeflaterConstants.NICE_LENGTH[level]; + max_chain = DeflaterConstants.MAX_CHAIN[level]; + + if (DeflaterConstants.COMPR_FUNC[level] != compressionFunction) + { + +#if DebugDeflation + if (DeflaterConstants.DEBUGGING) { + Console.WriteLine("Change from " + compressionFunction + " to " + + DeflaterConstants.COMPR_FUNC[level]); + } +#endif + switch (compressionFunction) + { + case DeflaterConstants.DEFLATE_STORED: + if (strstart > blockStart) + { + huffman.FlushStoredBlock(window, blockStart, + strstart - blockStart, false); + blockStart = strstart; + } + UpdateHash(); + break; + + case DeflaterConstants.DEFLATE_FAST: + if (strstart > blockStart) + { + huffman.FlushBlock(window, blockStart, strstart - blockStart, + false); + blockStart = strstart; + } + break; + + case DeflaterConstants.DEFLATE_SLOW: + if (prevAvailable) + { + huffman.TallyLit(window[strstart - 1] & 0xff); + } + if (strstart > blockStart) + { + huffman.FlushBlock(window, blockStart, strstart - blockStart, false); + blockStart = strstart; + } + prevAvailable = false; + matchLen = DeflaterConstants.MIN_MATCH - 1; + break; + } + compressionFunction = DeflaterConstants.COMPR_FUNC[level]; + } + } + + /// + /// Fill the window + /// + public void FillWindow() + { + /* If the window is almost full and there is insufficient lookahead, + * move the upper half to the lower one to make room in the upper half. + */ + if (strstart >= DeflaterConstants.WSIZE + DeflaterConstants.MAX_DIST) + { + SlideWindow(); + } + + /* If there is not enough lookahead, but still some input left, + * read in the input + */ + if (lookahead < DeflaterConstants.MIN_LOOKAHEAD && inputOff < inputEnd) + { + int more = 2 * DeflaterConstants.WSIZE - lookahead - strstart; + + if (more > inputEnd - inputOff) + { + more = inputEnd - inputOff; + } + + System.Array.Copy(inputBuf, inputOff, window, strstart + lookahead, more); + checksum.Update(inputBuf, inputOff, more); + + inputOff += more; + totalIn += more; + lookahead += more; + } + + if (lookahead >= DeflaterConstants.MIN_MATCH) + { + UpdateHash(); + } + } + + void UpdateHash() + { + /* + if (DEBUGGING) { + Console.WriteLine("updateHash: "+strstart); + } + */ + ins_h = (window[strstart] << DeflaterConstants.HASH_SHIFT) ^ window[strstart + 1]; + } + + /// + /// Inserts the current string in the head hash and returns the previous + /// value for this hash. + /// + /// The previous hash value + int InsertString() + { + short match; + int hash = ((ins_h << DeflaterConstants.HASH_SHIFT) ^ window[strstart + (DeflaterConstants.MIN_MATCH - 1)]) & DeflaterConstants.HASH_MASK; + +#if DebugDeflation + if (DeflaterConstants.DEBUGGING) + { + if (hash != (((window[strstart] << (2*HASH_SHIFT)) ^ + (window[strstart + 1] << HASH_SHIFT) ^ + (window[strstart + 2])) & HASH_MASK)) { + throw new SharpZipBaseException("hash inconsistent: " + hash + "/" + +window[strstart] + "," + +window[strstart + 1] + "," + +window[strstart + 2] + "," + HASH_SHIFT); + } + } +#endif + prev[strstart & DeflaterConstants.WMASK] = match = head[hash]; + head[hash] = unchecked((short)strstart); + ins_h = hash; + return match & 0xffff; + } + + void SlideWindow() + { + Array.Copy(window, DeflaterConstants.WSIZE, window, 0, DeflaterConstants.WSIZE); + matchStart -= DeflaterConstants.WSIZE; + strstart -= DeflaterConstants.WSIZE; + blockStart -= DeflaterConstants.WSIZE; + + // Slide the hash table (could be avoided with 32 bit values + // at the expense of memory usage). + for (int i = 0; i < DeflaterConstants.HASH_SIZE; ++i) + { + int m = head[i] & 0xffff; + head[i] = (short)(m >= DeflaterConstants.WSIZE ? (m - DeflaterConstants.WSIZE) : 0); + } + + // Slide the prev table. + for (int i = 0; i < DeflaterConstants.WSIZE; i++) + { + int m = prev[i] & 0xffff; + prev[i] = (short)(m >= DeflaterConstants.WSIZE ? (m - DeflaterConstants.WSIZE) : 0); + } + } + + /// + /// Find the best (longest) string in the window matching the + /// string starting at strstart. + /// + /// Preconditions: + /// + /// strstart + DeflaterConstants.MAX_MATCH <= window.length. + /// + /// + /// True if a match greater than the minimum length is found + bool FindLongestMatch(int curMatch) + { + int match; + int scan = strstart; + // scanMax is the highest position that we can look at + int scanMax = scan + Math.Min(DeflaterConstants.MAX_MATCH, lookahead) - 1; + int limit = Math.Max(scan - DeflaterConstants.MAX_DIST, 0); + + byte[] window = this.window; + short[] prev = this.prev; + int chainLength = this.max_chain; + int niceLength = Math.Min(this.niceLength, lookahead); + + matchLen = Math.Max(matchLen, DeflaterConstants.MIN_MATCH - 1); + + if (scan + matchLen > scanMax) return false; + + byte scan_end1 = window[scan + matchLen - 1]; + byte scan_end = window[scan + matchLen]; + + // Do not waste too much time if we already have a good match: + if (matchLen >= this.goodLength) chainLength >>= 2; + + do + { + match = curMatch; + scan = strstart; + + if (window[match + matchLen] != scan_end + || window[match + matchLen - 1] != scan_end1 + || window[match] != window[scan] + || window[++match] != window[++scan]) + { + continue; + } + + // scan is set to strstart+1 and the comparison passed, so + // scanMax - scan is the maximum number of bytes we can compare. + // below we compare 8 bytes at a time, so first we compare + // (scanMax - scan) % 8 bytes, so the remainder is a multiple of 8 + + switch ((scanMax - scan) % 8) + { + case 1: + if (window[++scan] == window[++match]) break; + break; + case 2: + if (window[++scan] == window[++match] + && window[++scan] == window[++match]) break; + break; + case 3: + if (window[++scan] == window[++match] + && window[++scan] == window[++match] + && window[++scan] == window[++match]) break; + break; + case 4: + if (window[++scan] == window[++match] + && window[++scan] == window[++match] + && window[++scan] == window[++match] + && window[++scan] == window[++match]) break; + break; + case 5: + if (window[++scan] == window[++match] + && window[++scan] == window[++match] + && window[++scan] == window[++match] + && window[++scan] == window[++match] + && window[++scan] == window[++match]) break; + break; + case 6: + if (window[++scan] == window[++match] + && window[++scan] == window[++match] + && window[++scan] == window[++match] + && window[++scan] == window[++match] + && window[++scan] == window[++match] + && window[++scan] == window[++match]) break; + break; + case 7: + if (window[++scan] == window[++match] + && window[++scan] == window[++match] + && window[++scan] == window[++match] + && window[++scan] == window[++match] + && window[++scan] == window[++match] + && window[++scan] == window[++match] + && window[++scan] == window[++match]) break; + break; + } + + if (window[scan] == window[match]) + { + /* We check for insufficient lookahead only every 8th comparison; + * the 256th check will be made at strstart + 258 unless lookahead is + * exhausted first. + */ + do + { + if (scan == scanMax) + { + ++scan; // advance to first position not matched + ++match; + + break; + } + } + while (window[++scan] == window[++match] + && window[++scan] == window[++match] + && window[++scan] == window[++match] + && window[++scan] == window[++match] + && window[++scan] == window[++match] + && window[++scan] == window[++match] + && window[++scan] == window[++match] + && window[++scan] == window[++match]); + } + + if (scan - strstart > matchLen) + { +#if DebugDeflation + if (DeflaterConstants.DEBUGGING && (ins_h == 0) ) + Console.Error.WriteLine("Found match: " + curMatch + "-" + (scan - strstart)); +#endif + + matchStart = curMatch; + matchLen = scan - strstart; + + if (matchLen >= niceLength) + break; + + scan_end1 = window[scan - 1]; + scan_end = window[scan]; + } + } while ((curMatch = (prev[curMatch & DeflaterConstants.WMASK] & 0xffff)) > limit && 0 != --chainLength); + + return matchLen >= DeflaterConstants.MIN_MATCH; + } + + bool DeflateStored(bool flush, bool finish) + { + if (!flush && (lookahead == 0)) + { + return false; + } + + strstart += lookahead; + lookahead = 0; + + int storedLength = strstart - blockStart; + + if ((storedLength >= DeflaterConstants.MAX_BLOCK_SIZE) || // Block is full + (blockStart < DeflaterConstants.WSIZE && storedLength >= DeflaterConstants.MAX_DIST) || // Block may move out of window + flush) + { + bool lastBlock = finish; + if (storedLength > DeflaterConstants.MAX_BLOCK_SIZE) + { + storedLength = DeflaterConstants.MAX_BLOCK_SIZE; + lastBlock = false; + } + +#if DebugDeflation + if (DeflaterConstants.DEBUGGING) + { + Console.WriteLine("storedBlock[" + storedLength + "," + lastBlock + "]"); + } +#endif + + huffman.FlushStoredBlock(window, blockStart, storedLength, lastBlock); + blockStart += storedLength; + return !lastBlock; + } + return true; + } + + bool DeflateFast(bool flush, bool finish) + { + if (lookahead < DeflaterConstants.MIN_LOOKAHEAD && !flush) + { + return false; + } + + while (lookahead >= DeflaterConstants.MIN_LOOKAHEAD || flush) + { + if (lookahead == 0) + { + // We are flushing everything + huffman.FlushBlock(window, blockStart, strstart - blockStart, finish); + blockStart = strstart; + return false; + } + + if (strstart > 2 * DeflaterConstants.WSIZE - DeflaterConstants.MIN_LOOKAHEAD) + { + /* slide window, as FindLongestMatch needs this. + * This should only happen when flushing and the window + * is almost full. + */ + SlideWindow(); + } + + int hashHead; + if (lookahead >= DeflaterConstants.MIN_MATCH && + (hashHead = InsertString()) != 0 && + strategy != DeflateStrategy.HuffmanOnly && + strstart - hashHead <= DeflaterConstants.MAX_DIST && + FindLongestMatch(hashHead)) + { + // longestMatch sets matchStart and matchLen +#if DebugDeflation + if (DeflaterConstants.DEBUGGING) + { + for (int i = 0 ; i < matchLen; i++) { + if (window[strstart + i] != window[matchStart + i]) { + throw new SharpZipBaseException("Match failure"); + } + } + } +#endif + + bool full = huffman.TallyDist(strstart - matchStart, matchLen); + + lookahead -= matchLen; + if (matchLen <= max_lazy && lookahead >= DeflaterConstants.MIN_MATCH) + { + while (--matchLen > 0) + { + ++strstart; + InsertString(); + } + ++strstart; + } + else + { + strstart += matchLen; + if (lookahead >= DeflaterConstants.MIN_MATCH - 1) + { + UpdateHash(); + } + } + matchLen = DeflaterConstants.MIN_MATCH - 1; + if (!full) + { + continue; + } + } + else + { + // No match found + huffman.TallyLit(window[strstart] & 0xff); + ++strstart; + --lookahead; + } + + if (huffman.IsFull()) + { + bool lastBlock = finish && (lookahead == 0); + huffman.FlushBlock(window, blockStart, strstart - blockStart, lastBlock); + blockStart = strstart; + return !lastBlock; + } + } + return true; + } + + bool DeflateSlow(bool flush, bool finish) + { + if (lookahead < DeflaterConstants.MIN_LOOKAHEAD && !flush) + { + return false; + } + + while (lookahead >= DeflaterConstants.MIN_LOOKAHEAD || flush) + { + if (lookahead == 0) + { + if (prevAvailable) + { + huffman.TallyLit(window[strstart - 1] & 0xff); + } + prevAvailable = false; + + // We are flushing everything +#if DebugDeflation + if (DeflaterConstants.DEBUGGING && !flush) + { + throw new SharpZipBaseException("Not flushing, but no lookahead"); + } +#endif + huffman.FlushBlock(window, blockStart, strstart - blockStart, + finish); + blockStart = strstart; + return false; + } + + if (strstart >= 2 * DeflaterConstants.WSIZE - DeflaterConstants.MIN_LOOKAHEAD) + { + /* slide window, as FindLongestMatch needs this. + * This should only happen when flushing and the window + * is almost full. + */ + SlideWindow(); + } + + int prevMatch = matchStart; + int prevLen = matchLen; + if (lookahead >= DeflaterConstants.MIN_MATCH) + { + + int hashHead = InsertString(); + + if (strategy != DeflateStrategy.HuffmanOnly && + hashHead != 0 && + strstart - hashHead <= DeflaterConstants.MAX_DIST && + FindLongestMatch(hashHead)) + { + + // longestMatch sets matchStart and matchLen + + // Discard match if too small and too far away + if (matchLen <= 5 && (strategy == DeflateStrategy.Filtered || (matchLen == DeflaterConstants.MIN_MATCH && strstart - matchStart > TooFar))) + { + matchLen = DeflaterConstants.MIN_MATCH - 1; + } + } + } + + // previous match was better + if ((prevLen >= DeflaterConstants.MIN_MATCH) && (matchLen <= prevLen)) + { +#if DebugDeflation + if (DeflaterConstants.DEBUGGING) + { + for (int i = 0 ; i < matchLen; i++) { + if (window[strstart-1+i] != window[prevMatch + i]) + throw new SharpZipBaseException(); + } + } +#endif + huffman.TallyDist(strstart - 1 - prevMatch, prevLen); + prevLen -= 2; + do + { + strstart++; + lookahead--; + if (lookahead >= DeflaterConstants.MIN_MATCH) + { + InsertString(); + } + } while (--prevLen > 0); + + strstart++; + lookahead--; + prevAvailable = false; + matchLen = DeflaterConstants.MIN_MATCH - 1; + } + else + { + if (prevAvailable) + { + huffman.TallyLit(window[strstart - 1] & 0xff); + } + prevAvailable = true; + strstart++; + lookahead--; + } + + if (huffman.IsFull()) + { + int len = strstart - blockStart; + if (prevAvailable) + { + len--; + } + bool lastBlock = (finish && (lookahead == 0) && !prevAvailable); + huffman.FlushBlock(window, blockStart, len, lastBlock); + blockStart += len; + return !lastBlock; + } + } + return true; + } + + #region Instance Fields + + // Hash index of string to be inserted + int ins_h; + + /// + /// Hashtable, hashing three characters to an index for window, so + /// that window[index]..window[index+2] have this hash code. + /// Note that the array should really be unsigned short, so you need + /// to and the values with 0xffff. + /// + short[] head; + + /// + /// prev[index & WMASK] points to the previous index that has the + /// same hash code as the string starting at index. This way + /// entries with the same hash code are in a linked list. + /// Note that the array should really be unsigned short, so you need + /// to and the values with 0xffff. + /// + short[] prev; + + int matchStart; + // Length of best match + int matchLen; + // Set if previous match exists + bool prevAvailable; + int blockStart; + + /// + /// Points to the current character in the window. + /// + int strstart; + + /// + /// lookahead is the number of characters starting at strstart in + /// window that are valid. + /// So window[strstart] until window[strstart+lookahead-1] are valid + /// characters. + /// + int lookahead; + + /// + /// This array contains the part of the uncompressed stream that + /// is of relevance. The current character is indexed by strstart. + /// + byte[] window; + + DeflateStrategy strategy; + int max_chain, max_lazy, niceLength, goodLength; + + /// + /// The current compression function. + /// + int compressionFunction; + + /// + /// The input data for compression. + /// + byte[] inputBuf; + + /// + /// The total bytes of input read. + /// + long totalIn; + + /// + /// The offset into inputBuf, where input data starts. + /// + int inputOff; + + /// + /// The end offset of the input data. + /// + int inputEnd; + + DeflaterPending pending; + DeflaterHuffman huffman; + + /// + /// The adler checksum + /// + IChecksum checksum; + #endregion + } +} diff --git a/UpdateLib/UpdateLib/Compression/DeflaterHuffman.cs b/UpdateLib/UpdateLib/Compression/DeflaterHuffman.cs new file mode 100644 index 0000000..1e45300 --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/DeflaterHuffman.cs @@ -0,0 +1,953 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace MatthiWare.UpdateLib.Compression +{ + /// + /// This is the DeflaterHuffman class. + /// + /// This class is not thread safe. This is inherent in the API, due + /// to the split of Deflate and SetInput. + /// + /// author of the original java version : Jochen Hoenicke + /// + public class DeflaterHuffman + { + const int BUFSIZE = 1 << (DeflaterConstants.DEFAULT_MEM_LEVEL + 6); + const int LITERAL_NUM = 286; + + // Number of distance codes + const int DIST_NUM = 30; + // Number of codes used to transfer bit lengths + const int BITLEN_NUM = 19; + + // repeat previous bit length 3-6 times (2 bits of repeat count) + const int REP_3_6 = 16; + // repeat a zero length 3-10 times (3 bits of repeat count) + const int REP_3_10 = 17; + // repeat a zero length 11-138 times (7 bits of repeat count) + const int REP_11_138 = 18; + + const int EOF_SYMBOL = 256; + + // The lengths of the bit length codes are sent in order of decreasing + // probability, to avoid transmitting the lengths for unused bit length codes. + static readonly int[] BL_ORDER = { 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 }; + + static readonly byte[] bit4Reverse = { + 0, + 8, + 4, + 12, + 2, + 10, + 6, + 14, + 1, + 9, + 5, + 13, + 3, + 11, + 7, + 15 + }; + + static short[] staticLCodes; + static byte[] staticLLength; + static short[] staticDCodes; + static byte[] staticDLength; + + class Tree + { + #region Instance Fields + public short[] freqs; + + public byte[] length; + + public int minNumCodes; + + public int numCodes; + + short[] codes; + readonly int[] bl_counts; + readonly int maxLength; + DeflaterHuffman dh; + #endregion + + #region Constructors + public Tree(DeflaterHuffman dh, int elems, int minCodes, int maxLength) + { + this.dh = dh; + this.minNumCodes = minCodes; + this.maxLength = maxLength; + freqs = new short[elems]; + bl_counts = new int[maxLength]; + } + + #endregion + + /// + /// Resets the internal state of the tree + /// + public void Reset() + { + for (int i = 0; i < freqs.Length; i++) + { + freqs[i] = 0; + } + codes = null; + length = null; + } + + public void WriteSymbol(int code) + { + // if (DeflaterConstants.DEBUGGING) { + // freqs[code]--; + // // Console.Write("writeSymbol("+freqs.length+","+code+"): "); + // } + dh.pending.WriteBits(codes[code] & 0xffff, length[code]); + } + + /// + /// Check that all frequencies are zero + /// + /// + /// At least one frequency is non-zero + /// + public void CheckEmpty() + { + bool empty = true; + for (int i = 0; i < freqs.Length; i++) + empty &= freqs[i] == 0; + + if (!empty) + throw new InvalidOperationException("!Empty"); + } + + /// + /// Set static codes and length + /// + /// new codes + /// length for new codes + public void SetStaticCodes(short[] staticCodes, byte[] staticLengths) + { + codes = staticCodes; + length = staticLengths; + } + + /// + /// Build dynamic codes and lengths + /// + public void BuildCodes() + { + int numSymbols = freqs.Length; + int[] nextCode = new int[maxLength]; + int code = 0; + + codes = new short[freqs.Length]; + + // if (DeflaterConstants.DEBUGGING) { + // //Console.WriteLine("buildCodes: "+freqs.Length); + // } + + for (int bits = 0; bits < maxLength; bits++) + { + nextCode[bits] = code; + code += bl_counts[bits] << (15 - bits); + + // if (DeflaterConstants.DEBUGGING) { + // //Console.WriteLine("bits: " + ( bits + 1) + " count: " + bl_counts[bits] + // +" nextCode: "+code); + // } + } + +#if DebugDeflation + if ( DeflaterConstants.DEBUGGING && (code != 65536) ) + { + throw new SharpZipBaseException("Inconsistent bl_counts!"); + } +#endif + for (int i = 0; i < numCodes; i++) + { + int bits = length[i]; + if (bits > 0) + { + + // if (DeflaterConstants.DEBUGGING) { + // //Console.WriteLine("codes["+i+"] = rev(" + nextCode[bits-1]+"), + // +bits); + // } + + codes[i] = BitReverse(nextCode[bits - 1]); + nextCode[bits - 1] += 1 << (16 - bits); + } + } + } + + public void BuildTree() + { + int numSymbols = freqs.Length; + + /* heap is a priority queue, sorted by frequency, least frequent + * nodes first. The heap is a binary tree, with the property, that + * the parent node is smaller than both child nodes. This assures + * that the smallest node is the first parent. + * + * The binary tree is encoded in an array: 0 is root node and + * the nodes 2*n+1, 2*n+2 are the child nodes of node n. + */ + int[] heap = new int[numSymbols]; + int heapLen = 0; + int maxCode = 0; + for (int n = 0; n < numSymbols; n++) + { + int freq = freqs[n]; + if (freq != 0) + { + // Insert n into heap + int pos = heapLen++; + int ppos; + while (pos > 0 && freqs[heap[ppos = (pos - 1) / 2]] > freq) + { + heap[pos] = heap[ppos]; + pos = ppos; + } + heap[pos] = n; + + maxCode = n; + } + } + + /* We could encode a single literal with 0 bits but then we + * don't see the literals. Therefore we force at least two + * literals to avoid this case. We don't care about order in + * this case, both literals get a 1 bit code. + */ + while (heapLen < 2) + { + int node = maxCode < 2 ? ++maxCode : 0; + heap[heapLen++] = node; + } + + numCodes = Math.Max(maxCode + 1, minNumCodes); + + int numLeafs = heapLen; + int[] childs = new int[4 * heapLen - 2]; + int[] values = new int[2 * heapLen - 1]; + int numNodes = numLeafs; + for (int i = 0; i < heapLen; i++) + { + int node = heap[i]; + childs[2 * i] = node; + childs[2 * i + 1] = -1; + values[i] = freqs[node] << 8; + heap[i] = i; + } + + /* Construct the Huffman tree by repeatedly combining the least two + * frequent nodes. + */ + do + { + int first = heap[0]; + int last = heap[--heapLen]; + + // Propagate the hole to the leafs of the heap + int ppos = 0; + int path = 1; + + while (path < heapLen) + { + if (path + 1 < heapLen && values[heap[path]] > values[heap[path + 1]]) + { + path++; + } + + heap[ppos] = heap[path]; + ppos = path; + path = path * 2 + 1; + } + + /* Now propagate the last element down along path. Normally + * it shouldn't go too deep. + */ + int lastVal = values[last]; + while ((path = ppos) > 0 && values[heap[ppos = (path - 1) / 2]] > lastVal) + { + heap[path] = heap[ppos]; + } + heap[path] = last; + + + int second = heap[0]; + + // Create a new node father of first and second + last = numNodes++; + childs[2 * last] = first; + childs[2 * last + 1] = second; + int mindepth = Math.Min(values[first] & 0xff, values[second] & 0xff); + values[last] = lastVal = values[first] + values[second] - mindepth + 1; + + // Again, propagate the hole to the leafs + ppos = 0; + path = 1; + + while (path < heapLen) + { + if (path + 1 < heapLen && values[heap[path]] > values[heap[path + 1]]) + { + path++; + } + + heap[ppos] = heap[path]; + ppos = path; + path = ppos * 2 + 1; + } + + // Now propagate the new element down along path + while ((path = ppos) > 0 && values[heap[ppos = (path - 1) / 2]] > lastVal) + { + heap[path] = heap[ppos]; + } + heap[path] = last; + } while (heapLen > 1); + + if (heap[0] != childs.Length / 2 - 1) + { + throw new AccessViolationException("Heap invariant violated"); + } + + BuildLength(childs); + } + + /// + /// Get encoded length + /// + /// Encoded length, the sum of frequencies * lengths + public int GetEncodedLength() + { + int len = 0; + for (int i = 0; i < freqs.Length; i++) + { + len += freqs[i] * length[i]; + } + return len; + } + + /// + /// Scan a literal or distance tree to determine the frequencies of the codes + /// in the bit length tree. + /// + public void CalcBLFreq(Tree blTree) + { + int max_count; /* max repeat count */ + int min_count; /* min repeat count */ + int count; /* repeat count of the current code */ + int curlen = -1; /* length of current code */ + + int i = 0; + while (i < numCodes) + { + count = 1; + int nextlen = length[i]; + if (nextlen == 0) + { + max_count = 138; + min_count = 3; + } + else + { + max_count = 6; + min_count = 3; + if (curlen != nextlen) + { + blTree.freqs[nextlen]++; + count = 0; + } + } + curlen = nextlen; + i++; + + while (i < numCodes && curlen == length[i]) + { + i++; + if (++count >= max_count) + { + break; + } + } + + if (count < min_count) + { + blTree.freqs[curlen] += (short)count; + } + else if (curlen != 0) + { + blTree.freqs[REP_3_6]++; + } + else if (count <= 10) + { + blTree.freqs[REP_3_10]++; + } + else + { + blTree.freqs[REP_11_138]++; + } + } + } + + /// + /// Write tree values + /// + /// Tree to write + public void WriteTree(Tree blTree) + { + int max_count; // max repeat count + int min_count; // min repeat count + int count; // repeat count of the current code + int curlen = -1; // length of current code + + int i = 0; + while (i < numCodes) + { + count = 1; + int nextlen = length[i]; + if (nextlen == 0) + { + max_count = 138; + min_count = 3; + } + else + { + max_count = 6; + min_count = 3; + if (curlen != nextlen) + { + blTree.WriteSymbol(nextlen); + count = 0; + } + } + curlen = nextlen; + i++; + + while (i < numCodes && curlen == length[i]) + { + i++; + if (++count >= max_count) + { + break; + } + } + + if (count < min_count) + { + while (count-- > 0) + { + blTree.WriteSymbol(curlen); + } + } + else if (curlen != 0) + { + blTree.WriteSymbol(REP_3_6); + dh.pending.WriteBits(count - 3, 2); + } + else if (count <= 10) + { + blTree.WriteSymbol(REP_3_10); + dh.pending.WriteBits(count - 3, 3); + } + else + { + blTree.WriteSymbol(REP_11_138); + dh.pending.WriteBits(count - 11, 7); + } + } + } + + void BuildLength(int[] childs) + { + this.length = new byte[freqs.Length]; + int numNodes = childs.Length / 2; + int numLeafs = (numNodes + 1) / 2; + int overflow = 0; + + for (int i = 0; i < maxLength; i++) + { + bl_counts[i] = 0; + } + + // First calculate optimal bit lengths + int[] lengths = new int[numNodes]; + lengths[numNodes - 1] = 0; + + for (int i = numNodes - 1; i >= 0; i--) + { + if (childs[2 * i + 1] != -1) + { + int bitLength = lengths[i] + 1; + if (bitLength > maxLength) + { + bitLength = maxLength; + overflow++; + } + lengths[childs[2 * i]] = lengths[childs[2 * i + 1]] = bitLength; + } + else + { + // A leaf node + int bitLength = lengths[i]; + bl_counts[bitLength - 1]++; + this.length[childs[2 * i]] = (byte)lengths[i]; + } + } + + // if (DeflaterConstants.DEBUGGING) { + // //Console.WriteLine("Tree "+freqs.Length+" lengths:"); + // for (int i=0; i < numLeafs; i++) { + // //Console.WriteLine("Node "+childs[2*i]+" freq: "+freqs[childs[2*i]] + // + " len: "+length[childs[2*i]]); + // } + // } + + if (overflow == 0) + { + return; + } + + int incrBitLen = maxLength - 1; + do + { + // Find the first bit length which could increase: + while (bl_counts[--incrBitLen] == 0) + { + } + + // Move this node one down and remove a corresponding + // number of overflow nodes. + do + { + bl_counts[incrBitLen]--; + bl_counts[++incrBitLen]++; + overflow -= 1 << (maxLength - 1 - incrBitLen); + } while (overflow > 0 && incrBitLen < maxLength - 1); + } while (overflow > 0); + + /* We may have overshot above. Move some nodes from maxLength to + * maxLength-1 in that case. + */ + bl_counts[maxLength - 1] += overflow; + bl_counts[maxLength - 2] -= overflow; + + /* Now recompute all bit lengths, scanning in increasing + * frequency. It is simpler to reconstruct all lengths instead of + * fixing only the wrong ones. This idea is taken from 'ar' + * written by Haruhiko Okumura. + * + * The nodes were inserted with decreasing frequency into the childs + * array. + */ + int nodePtr = 2 * numLeafs; + for (int bits = maxLength; bits != 0; bits--) + { + int n = bl_counts[bits - 1]; + while (n > 0) + { + int childPtr = 2 * childs[nodePtr++]; + if (childs[childPtr + 1] == -1) + { + // We found another leaf + length[childs[childPtr]] = (byte)bits; + n--; + } + } + } + // if (DeflaterConstants.DEBUGGING) { + // //Console.WriteLine("*** After overflow elimination. ***"); + // for (int i=0; i < numLeafs; i++) { + // //Console.WriteLine("Node "+childs[2*i]+" freq: "+freqs[childs[2*i]] + // + " len: "+length[childs[2*i]]); + // } + // } + } + + } + + #region Instance Fields + /// + /// Pending buffer to use + /// + public DeflaterPending pending; + + Tree literalTree; + Tree distTree; + Tree blTree; + + // Buffer for distances + short[] d_buf; + byte[] l_buf; + int last_lit; + int extra_bits; + #endregion + + static DeflaterHuffman() + { + // See RFC 1951 3.2.6 + // Literal codes + staticLCodes = new short[LITERAL_NUM]; + staticLLength = new byte[LITERAL_NUM]; + + int i = 0; + while (i < 144) + { + staticLCodes[i] = BitReverse((0x030 + i) << 8); + staticLLength[i++] = 8; + } + + while (i < 256) + { + staticLCodes[i] = BitReverse((0x190 - 144 + i) << 7); + staticLLength[i++] = 9; + } + + while (i < 280) + { + staticLCodes[i] = BitReverse((0x000 - 256 + i) << 9); + staticLLength[i++] = 7; + } + + while (i < LITERAL_NUM) + { + staticLCodes[i] = BitReverse((0x0c0 - 280 + i) << 8); + staticLLength[i++] = 8; + } + + // Distance codes + staticDCodes = new short[DIST_NUM]; + staticDLength = new byte[DIST_NUM]; + for (i = 0; i < DIST_NUM; i++) + { + staticDCodes[i] = BitReverse(i << 11); + staticDLength[i] = 5; + } + } + + /// + /// Construct instance with pending buffer + /// + /// Pending buffer to use + public DeflaterHuffman(DeflaterPending pending) + { + this.pending = pending; + + literalTree = new Tree(this, LITERAL_NUM, 257, 15); + distTree = new Tree(this, DIST_NUM, 1, 15); + blTree = new Tree(this, BITLEN_NUM, 4, 7); + + d_buf = new short[BUFSIZE]; + l_buf = new byte[BUFSIZE]; + } + + /// + /// Reset internal state + /// + public void Reset() + { + last_lit = 0; + extra_bits = 0; + literalTree.Reset(); + distTree.Reset(); + blTree.Reset(); + } + + /// + /// Write all trees to pending buffer + /// + /// The number/rank of treecodes to send. + public void SendAllTrees(int blTreeCodes) + { + blTree.BuildCodes(); + literalTree.BuildCodes(); + distTree.BuildCodes(); + pending.WriteBits(literalTree.numCodes - 257, 5); + pending.WriteBits(distTree.numCodes - 1, 5); + pending.WriteBits(blTreeCodes - 4, 4); + for (int rank = 0; rank < blTreeCodes; rank++) + { + pending.WriteBits(blTree.length[BL_ORDER[rank]], 3); + } + literalTree.WriteTree(blTree); + distTree.WriteTree(blTree); + +#if DebugDeflation + if (DeflaterConstants.DEBUGGING) { + blTree.CheckEmpty(); + } +#endif + } + + /// + /// Compress current buffer writing data to pending buffer + /// + public void CompressBlock() + { + for (int i = 0; i < last_lit; i++) + { + int litlen = l_buf[i] & 0xff; + int dist = d_buf[i]; + if (dist-- != 0) + { + // if (DeflaterConstants.DEBUGGING) { + // Console.Write("["+(dist+1)+","+(litlen+3)+"]: "); + // } + + int lc = Lcode(litlen); + literalTree.WriteSymbol(lc); + + int bits = (lc - 261) / 4; + if (bits > 0 && bits <= 5) + { + pending.WriteBits(litlen & ((1 << bits) - 1), bits); + } + + int dc = Dcode(dist); + distTree.WriteSymbol(dc); + + bits = dc / 2 - 1; + if (bits > 0) + { + pending.WriteBits(dist & ((1 << bits) - 1), bits); + } + } + else + { + // if (DeflaterConstants.DEBUGGING) { + // if (litlen > 32 && litlen < 127) { + // Console.Write("("+(char)litlen+"): "); + // } else { + // Console.Write("{"+litlen+"}: "); + // } + // } + literalTree.WriteSymbol(litlen); + } + } + +#if DebugDeflation + if (DeflaterConstants.DEBUGGING) { + Console.Write("EOF: "); + } +#endif + literalTree.WriteSymbol(EOF_SYMBOL); + +#if DebugDeflation + if (DeflaterConstants.DEBUGGING) { + literalTree.CheckEmpty(); + distTree.CheckEmpty(); + } +#endif + } + + /// + /// Flush block to output with no compression + /// + /// Data to write + /// Index of first byte to write + /// Count of bytes to write + /// True if this is the last block + public void FlushStoredBlock(byte[] stored, int storedOffset, int storedLength, bool lastBlock) + { +#if DebugDeflation + // if (DeflaterConstants.DEBUGGING) { + // //Console.WriteLine("Flushing stored block "+ storedLength); + // } +#endif + pending.WriteBits((DeflaterConstants.STORED_BLOCK << 1) + (lastBlock ? 1 : 0), 3); + pending.AlignToByte(); + pending.WriteShort(storedLength); + pending.WriteShort(~storedLength); + pending.WriteBlock(stored, storedOffset, storedLength); + Reset(); + } + + /// + /// Flush block to output with compression + /// + /// Data to flush + /// Index of first byte to flush + /// Count of bytes to flush + /// True if this is the last block + public void FlushBlock(byte[] stored, int storedOffset, int storedLength, bool lastBlock) + { + literalTree.freqs[EOF_SYMBOL]++; + + // Build trees + literalTree.BuildTree(); + distTree.BuildTree(); + + // Calculate bitlen frequency + literalTree.CalcBLFreq(blTree); + distTree.CalcBLFreq(blTree); + + // Build bitlen tree + blTree.BuildTree(); + + int blTreeCodes = 4; + for (int i = 18; i > blTreeCodes; i--) + { + if (blTree.length[BL_ORDER[i]] > 0) + { + blTreeCodes = i + 1; + } + } + int opt_len = 14 + blTreeCodes * 3 + blTree.GetEncodedLength() + + literalTree.GetEncodedLength() + distTree.GetEncodedLength() + + extra_bits; + + int static_len = extra_bits; + for (int i = 0; i < LITERAL_NUM; i++) + { + static_len += literalTree.freqs[i] * staticLLength[i]; + } + for (int i = 0; i < DIST_NUM; i++) + { + static_len += distTree.freqs[i] * staticDLength[i]; + } + if (opt_len >= static_len) + { + // Force static trees + opt_len = static_len; + } + + if (storedOffset >= 0 && storedLength + 4 < opt_len >> 3) + { + // Store Block + + // if (DeflaterConstants.DEBUGGING) { + // //Console.WriteLine("Storing, since " + storedLength + " < " + opt_len + // + " <= " + static_len); + // } + FlushStoredBlock(stored, storedOffset, storedLength, lastBlock); + } + else if (opt_len == static_len) + { + // Encode with static tree + pending.WriteBits((DeflaterConstants.STATIC_TREES << 1) + (lastBlock ? 1 : 0), 3); + literalTree.SetStaticCodes(staticLCodes, staticLLength); + distTree.SetStaticCodes(staticDCodes, staticDLength); + CompressBlock(); + Reset(); + } + else + { + // Encode with dynamic tree + pending.WriteBits((DeflaterConstants.DYN_TREES << 1) + (lastBlock ? 1 : 0), 3); + SendAllTrees(blTreeCodes); + CompressBlock(); + Reset(); + } + } + + /// + /// Get value indicating if internal buffer is full + /// + /// true if buffer is full + public bool IsFull() + { + return last_lit >= BUFSIZE; + } + + /// + /// Add literal to buffer + /// + /// Literal value to add to buffer. + /// Value indicating internal buffer is full + public bool TallyLit(int literal) + { + // if (DeflaterConstants.DEBUGGING) { + // if (lit > 32 && lit < 127) { + // //Console.WriteLine("("+(char)lit+")"); + // } else { + // //Console.WriteLine("{"+lit+"}"); + // } + // } + d_buf[last_lit] = 0; + l_buf[last_lit++] = (byte)literal; + literalTree.freqs[literal]++; + return IsFull(); + } + + /// + /// Add distance code and length to literal and distance trees + /// + /// Distance code + /// Length + /// Value indicating if internal buffer is full + public bool TallyDist(int distance, int length) + { + // if (DeflaterConstants.DEBUGGING) { + // //Console.WriteLine("[" + distance + "," + length + "]"); + // } + + d_buf[last_lit] = (short)distance; + l_buf[last_lit++] = (byte)(length - 3); + + int lc = Lcode(length - 3); + literalTree.freqs[lc]++; + if (lc >= 265 && lc < 285) + { + extra_bits += (lc - 261) / 4; + } + + int dc = Dcode(distance - 1); + distTree.freqs[dc]++; + if (dc >= 4) + { + extra_bits += dc / 2 - 1; + } + return IsFull(); + } + + + /// + /// Reverse the bits of a 16 bit value. + /// + /// Value to reverse bits + /// Value with bits reversed + public static short BitReverse(int toReverse) + { + return (short)(bit4Reverse[toReverse & 0xF] << 12 | + bit4Reverse[(toReverse >> 4) & 0xF] << 8 | + bit4Reverse[(toReverse >> 8) & 0xF] << 4 | + bit4Reverse[toReverse >> 12]); + } + + static int Lcode(int length) + { + if (length == 255) + { + return 285; + } + + int code = 257; + while (length >= 8) + { + code += 4; + length >>= 1; + } + return code + length; + } + + static int Dcode(int distance) + { + int code = 0; + while (distance >= 4) + { + code += 2; + distance >>= 1; + } + return code + distance; + } + } +} diff --git a/UpdateLib/UpdateLib/Compression/DeflaterPending.cs b/UpdateLib/UpdateLib/Compression/DeflaterPending.cs new file mode 100644 index 0000000..25d59bf --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/DeflaterPending.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace MatthiWare.UpdateLib.Compression +{ + /// + /// This class stores the pending output of the Deflater. + /// + /// author of the original java version : Jochen Hoenicke + /// + public class DeflaterPending : PendingBuffer + { + /// + /// Construct instance with default buffer size + /// + public DeflaterPending() : base(DeflaterConstants.PENDING_BUF_SIZE) + { + } + } +} diff --git a/UpdateLib/UpdateLib/Compression/Inflater.cs b/UpdateLib/UpdateLib/Compression/Inflater.cs new file mode 100644 index 0000000..d184f9b --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/Inflater.cs @@ -0,0 +1,863 @@ +using MatthiWare.UpdateLib.Compression.Checksum; +using MatthiWare.UpdateLib.Compression.Streams; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace MatthiWare.UpdateLib.Compression +{ + /// + /// Inflater is used to decompress data that has been compressed according + /// to the "deflate" standard described in rfc1951. + /// + /// By default Zlib (rfc1950) headers and footers are expected in the input. + /// You can use constructor public Inflater(bool noHeader) passing true + /// if there is no Zlib header information + /// + /// The usage is as following. First you have to set some input with + /// SetInput(), then Inflate() it. If inflate doesn't + /// inflate any bytes there may be three reasons: + ///
    + ///
  • IsNeedingInput() returns true because the input buffer is empty. + /// You have to provide more input with SetInput(). + /// NOTE: IsNeedingInput() also returns true when, the stream is finished. + ///
  • + ///
  • IsNeedingDictionary() returns true, you have to provide a preset + /// dictionary with SetDictionary().
  • + ///
  • IsFinished returns true, the inflater has finished.
  • + ///
+ /// Once the first output byte is produced, a dictionary will not be + /// needed at a later stage. + /// + /// author of the original java version : John Leuner, Jochen Hoenicke + ///
+ public class Inflater + { + #region Constants/Readonly + /// + /// Copy lengths for literal codes 257..285 + /// + static readonly int[] CPLENS = { + 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, + 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258 + }; + + /// + /// Extra bits for literal codes 257..285 + /// + static readonly int[] CPLEXT = { + 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, + 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0 + }; + + /// + /// Copy offsets for distance codes 0..29 + /// + static readonly int[] CPDIST = { + 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, + 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, + 8193, 12289, 16385, 24577 + }; + + /// + /// Extra bits for distance codes + /// + static readonly int[] CPDEXT = { + 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, + 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, + 12, 12, 13, 13 + }; + + /// + /// These are the possible states for an inflater + /// + const int DECODE_HEADER = 0; + const int DECODE_DICT = 1; + const int DECODE_BLOCKS = 2; + const int DECODE_STORED_LEN1 = 3; + const int DECODE_STORED_LEN2 = 4; + const int DECODE_STORED = 5; + const int DECODE_DYN_HEADER = 6; + const int DECODE_HUFFMAN = 7; + const int DECODE_HUFFMAN_LENBITS = 8; + const int DECODE_HUFFMAN_DIST = 9; + const int DECODE_HUFFMAN_DISTBITS = 10; + const int DECODE_CHKSUM = 11; + const int FINISHED = 12; + #endregion + + #region Instance Fields + /// + /// This variable contains the current state. + /// + int mode; + + /// + /// The adler checksum of the dictionary or of the decompressed + /// stream, as it is written in the header resp. footer of the + /// compressed stream. + /// Only valid if mode is DECODE_DICT or DECODE_CHKSUM. + /// + int readAdler; + + /// + /// The number of bits needed to complete the current state. This + /// is valid, if mode is DECODE_DICT, DECODE_CHKSUM, + /// DECODE_HUFFMAN_LENBITS or DECODE_HUFFMAN_DISTBITS. + /// + int neededBits; + int repLength; + int repDist; + int uncomprLen; + + /// + /// True, if the last block flag was set in the last block of the + /// inflated stream. This means that the stream ends after the + /// current block. + /// + bool isLastBlock; + + /// + /// The total number of inflated bytes. + /// + long totalOut; + + /// + /// The total number of bytes set with setInput(). This is not the + /// value returned by the TotalIn property, since this also includes the + /// unprocessed input. + /// + long totalIn; + + /// + /// This variable stores the noHeader flag that was given to the constructor. + /// True means, that the inflated stream doesn't contain a Zlib header or + /// footer. + /// + bool noHeader; + readonly StreamManipulator input; + OutputWindow outputWindow; + InflaterDynHeader dynHeader; + InflaterHuffmanTree litlenTree, distTree; + IChecksum checksum; + #endregion + + #region Constructors + /// + /// Creates a new inflater or RFC1951 decompressor + /// RFC1950/Zlib headers and footers will be expected in the input data + /// + public Inflater() : this(false) + { + } + + /// + /// Creates a new inflater. + /// + /// + /// True if no RFC1950/Zlib header and footer fields are expected in the input data + /// + /// This is used for GZIPed/Zipped input. + /// + /// For compatibility with + /// Sun JDK you should provide one byte of input more than needed in + /// this case. + /// + public Inflater(bool NoHeader) + { + noHeader = NoHeader; + checksum = new Adler32(); + input = new StreamManipulator(); + outputWindow = new OutputWindow(); + mode = NoHeader ? DECODE_BLOCKS : DECODE_HEADER; + } + #endregion + + /// + /// Resets the inflater so that a new stream can be decompressed. All + /// pending input and output will be discarded. + /// + public void Reset() + { + mode = noHeader ? DECODE_BLOCKS : DECODE_HEADER; + totalIn = 0; + totalOut = 0; + input.Reset(); + outputWindow.Reset(); + dynHeader = null; + litlenTree = null; + distTree = null; + isLastBlock = false; + checksum.Reset(); + } + + /// + /// Decodes a zlib/RFC1950 header. + /// + /// + /// False if more input is needed. + /// + /// + /// The header is invalid. + /// + private bool DecodeHeader() + { + int header = input.PeekBits(16); + if (header < 0) + { + return false; + } + input.DropBits(16); + + // The header is written in "wrong" byte order + header = ((header << 8) | (header >> 8)) & 0xffff; + if (header % 31 != 0) + throw new NotSupportedException("Header checksum invalid"); + + if ((header & 0x0f00) != (Deflater.DEFLATED << 8)) + throw new NotSupportedException("Compression Method unknown"); + + /* Maximum size of the backwards window in bits. + * We currently ignore this, but we could use it to make the + * inflater window more space efficient. On the other hand the + * full window (15 bits) is needed most times, anyway. + int max_wbits = ((header & 0x7000) >> 12) + 8; + */ + + if ((header & 0x0020) == 0) + { // Dictionary flag? + mode = DECODE_BLOCKS; + } + else + { + mode = DECODE_DICT; + neededBits = 32; + } + return true; + } + + /// + /// Decodes the dictionary checksum after the deflate header. + /// + /// + /// False if more input is needed. + /// + private bool DecodeDict() + { + while (neededBits > 0) + { + int dictByte = input.PeekBits(8); + if (dictByte < 0) + { + return false; + } + input.DropBits(8); + readAdler = (readAdler << 8) | dictByte; + neededBits -= 8; + } + return false; + } + + /// + /// Decodes the huffman encoded symbols in the input stream. + /// + /// + /// false if more input is needed, true if output window is + /// full or the current block ends. + /// + /// + /// if deflated stream is invalid. + /// + private bool DecodeHuffman() + { + int free = outputWindow.GetFreeSpace(); + while (free >= 258) + { + int symbol; + switch (mode) + { + case DECODE_HUFFMAN: + // This is the inner loop so it is optimized a bit + while (((symbol = litlenTree.GetSymbol(input)) & ~0xff) == 0) + { + outputWindow.Write(symbol); + if (--free < 258) + { + return true; + } + } + + if (symbol < 257) + { + if (symbol < 0) + { + return false; + } + else + { + // symbol == 256: end of block + distTree = null; + litlenTree = null; + mode = DECODE_BLOCKS; + return true; + } + } + + try + { + repLength = CPLENS[symbol - 257]; + neededBits = CPLEXT[symbol - 257]; + } + catch (Exception e) + { + throw new Exception("Illegal rep length code", e); + } + goto case DECODE_HUFFMAN_LENBITS; // fall through + + case DECODE_HUFFMAN_LENBITS: + if (neededBits > 0) + { + mode = DECODE_HUFFMAN_LENBITS; + int i = input.PeekBits(neededBits); + if (i < 0) + { + return false; + } + input.DropBits(neededBits); + repLength += i; + } + mode = DECODE_HUFFMAN_DIST; + goto case DECODE_HUFFMAN_DIST; // fall through + + case DECODE_HUFFMAN_DIST: + symbol = distTree.GetSymbol(input); + if (symbol < 0) + { + return false; + } + + try + { + repDist = CPDIST[symbol]; + neededBits = CPDEXT[symbol]; + } + catch (Exception e) + { + throw new Exception("Illegal rep dist code", e); + } + + goto case DECODE_HUFFMAN_DISTBITS; // fall through + + case DECODE_HUFFMAN_DISTBITS: + if (neededBits > 0) + { + mode = DECODE_HUFFMAN_DISTBITS; + int i = input.PeekBits(neededBits); + if (i < 0) + { + return false; + } + input.DropBits(neededBits); + repDist += i; + } + + outputWindow.Repeat(repLength, repDist); + free -= repLength; + mode = DECODE_HUFFMAN; + break; + + default: + throw new NotSupportedException("Inflater unknown mode"); + } + } + return true; + } + + /// + /// Decodes the adler checksum after the deflate stream. + /// + /// + /// false if more input is needed. + /// + /// + /// If checksum doesn't match. + /// + private bool DecodeChksum() + { + while (neededBits > 0) + { + int chkByte = input.PeekBits(8); + if (chkByte < 0) + { + return false; + } + input.DropBits(8); + readAdler = (readAdler << 8) | chkByte; + neededBits -= 8; + } + + if ((int)checksum.Value != readAdler) + { + throw new Exception("Adler chksum doesn't match: " + (int)checksum.Value + " vs. " + readAdler); + } + + mode = FINISHED; + return false; + } + + /// + /// Decodes the deflated stream. + /// + /// + /// false if more input is needed, or if finished. + /// + /// + /// if deflated stream is invalid. + /// + private bool Decode() + { + switch (mode) + { + case DECODE_HEADER: + return DecodeHeader(); + + case DECODE_DICT: + return DecodeDict(); + + case DECODE_CHKSUM: + return DecodeChksum(); + + case DECODE_BLOCKS: + if (isLastBlock) + { + if (noHeader) + { + mode = FINISHED; + return false; + } + else + { + input.SkipToByteBoundary(); + neededBits = 32; + mode = DECODE_CHKSUM; + return true; + } + } + + int type = input.PeekBits(3); + if (type < 0) + { + return false; + } + input.DropBits(3); + + isLastBlock |= (type & 1) != 0; + switch (type >> 1) + { + case DeflaterConstants.STORED_BLOCK: + input.SkipToByteBoundary(); + mode = DECODE_STORED_LEN1; + break; + case DeflaterConstants.STATIC_TREES: + litlenTree = InflaterHuffmanTree.defLitLenTree; + distTree = InflaterHuffmanTree.defDistTree; + mode = DECODE_HUFFMAN; + break; + case DeflaterConstants.DYN_TREES: + dynHeader = new InflaterDynHeader(); + mode = DECODE_DYN_HEADER; + break; + default: + throw new NotSupportedException("Unknown block type " + type); + } + return true; + + case DECODE_STORED_LEN1: + { + if ((uncomprLen = input.PeekBits(16)) < 0) + { + return false; + } + input.DropBits(16); + mode = DECODE_STORED_LEN2; + } + goto case DECODE_STORED_LEN2; // fall through + + case DECODE_STORED_LEN2: + { + int nlen = input.PeekBits(16); + if (nlen < 0) + { + return false; + } + input.DropBits(16); + if (nlen != (uncomprLen ^ 0xffff)) + { + throw new FormatException("broken uncompressed block"); + } + mode = DECODE_STORED; + } + goto case DECODE_STORED; // fall through + + case DECODE_STORED: + { + int more = outputWindow.CopyStored(input, uncomprLen); + uncomprLen -= more; + if (uncomprLen == 0) + { + mode = DECODE_BLOCKS; + return true; + } + return !input.IsNeedingInput; + } + + case DECODE_DYN_HEADER: + if (!dynHeader.Decode(input)) + { + return false; + } + + litlenTree = dynHeader.BuildLitLenTree(); + distTree = dynHeader.BuildDistTree(); + mode = DECODE_HUFFMAN; + goto case DECODE_HUFFMAN; // fall through + + case DECODE_HUFFMAN: + case DECODE_HUFFMAN_LENBITS: + case DECODE_HUFFMAN_DIST: + case DECODE_HUFFMAN_DISTBITS: + return DecodeHuffman(); + + case FINISHED: + return false; + + default: + throw new SharpZipBaseException("Inflater.Decode unknown mode"); + } + } + + /// + /// Sets the preset dictionary. This should only be called, if + /// needsDictionary() returns true and it should set the same + /// dictionary, that was used for deflating. The getAdler() + /// function returns the checksum of the dictionary needed. + /// + /// + /// The dictionary. + /// + public void SetDictionary(byte[] buffer) + { + SetDictionary(buffer, 0, buffer.Length); + } + + /// + /// Sets the preset dictionary. This should only be called, if + /// needsDictionary() returns true and it should set the same + /// dictionary, that was used for deflating. The getAdler() + /// function returns the checksum of the dictionary needed. + /// + /// + /// The dictionary. + /// + /// + /// The index into buffer where the dictionary starts. + /// + /// + /// The number of bytes in the dictionary. + /// + /// + /// No dictionary is needed. + /// + /// + /// The adler checksum for the buffer is invalid + /// + public void SetDictionary(byte[] buffer, int index, int count) + { + if (buffer == null) + { + throw new ArgumentNullException(nameof(buffer)); + } + + if (index < 0) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + + if (count < 0) + { + throw new ArgumentOutOfRangeException(nameof(count)); + } + + if (!IsNeedingDictionary) + { + throw new InvalidOperationException("Dictionary is not needed"); + } + + checksum.Update(buffer, index, count); + + if ((int)checksum.Value != readAdler) + { + throw new SharpZipBaseException("Wrong adler checksum"); + } + checksum.Reset(); + outputWindow.CopyDict(buffer, index, count); + mode = DECODE_BLOCKS; + } + + /// + /// Sets the input. This should only be called, if needsInput() + /// returns true. + /// + /// + /// the input. + /// + public void SetInput(byte[] buffer) + { + SetInput(buffer, 0, buffer.Length); + } + + /// + /// Sets the input. This should only be called, if needsInput() + /// returns true. + /// + /// + /// The source of input data + /// + /// + /// The index into buffer where the input starts. + /// + /// + /// The number of bytes of input to use. + /// + /// + /// No input is needed. + /// + /// + /// The index and/or count are wrong. + /// + public void SetInput(byte[] buffer, int index, int count) + { + input.SetInput(buffer, index, count); + totalIn += (long)count; + } + + /// + /// Inflates the compressed stream to the output buffer. If this + /// returns 0, you should check, whether IsNeedingDictionary(), + /// IsNeedingInput() or IsFinished() returns true, to determine why no + /// further output is produced. + /// + /// + /// the output buffer. + /// + /// + /// The number of bytes written to the buffer, 0 if no further + /// output can be produced. + /// + /// + /// if buffer has length 0. + /// + /// + /// if deflated stream is invalid. + /// + public int Inflate(byte[] buffer) + { + if (buffer == null) + { + throw new ArgumentNullException(nameof(buffer)); + } + + return Inflate(buffer, 0, buffer.Length); + } + + /// + /// Inflates the compressed stream to the output buffer. If this + /// returns 0, you should check, whether needsDictionary(), + /// needsInput() or finished() returns true, to determine why no + /// further output is produced. + /// + /// + /// the output buffer. + /// + /// + /// the offset in buffer where storing starts. + /// + /// + /// the maximum number of bytes to output. + /// + /// + /// the number of bytes written to the buffer, 0 if no further output can be produced. + /// + /// + /// if count is less than 0. + /// + /// + /// if the index and / or count are wrong. + /// + /// + /// if deflated stream is invalid. + /// + public int Inflate(byte[] buffer, int offset, int count) + { + if (buffer == null) + { + throw new ArgumentNullException(nameof(buffer)); + } + + if (count < 0) + { + throw new ArgumentOutOfRangeException(nameof(count), "count cannot be negative"); + } + + if (offset < 0) + { + throw new ArgumentOutOfRangeException(nameof(offset), "offset cannot be negative"); + } + + if (offset + count > buffer.Length) + { + throw new ArgumentException("count exceeds buffer bounds"); + } + + // Special case: count may be zero + if (count == 0) + { + if (!IsFinished) + { // -jr- 08-Nov-2003 INFLATE_BUG fix.. + Decode(); + } + return 0; + } + + int bytesCopied = 0; + + do + { + if (mode != DECODE_CHKSUM) + { + /* Don't give away any output, if we are waiting for the + * checksum in the input stream. + * + * With this trick we have always: + * IsNeedingInput() and not IsFinished() + * implies more output can be produced. + */ + int more = outputWindow.CopyOutput(buffer, offset, count); + if (more > 0) + { + checksum.Update(buffer, offset, more); + offset += more; + bytesCopied += more; + totalOut += (long)more; + count -= more; + if (count == 0) + { + return bytesCopied; + } + } + } + } while (Decode() || ((outputWindow.GetAvailable() > 0) && (mode != DECODE_CHKSUM))); + return bytesCopied; + } + + /// + /// Returns true, if the input buffer is empty. + /// You should then call setInput(). + /// NOTE: This method also returns true when the stream is finished. + /// + public bool IsNeedingInput + { + get + { + return input.IsNeedingInput; + } + } + + /// + /// Returns true, if a preset dictionary is needed to inflate the input. + /// + public bool IsNeedingDictionary + { + get + { + return mode == DECODE_DICT && neededBits == 0; + } + } + + /// + /// Returns true, if the inflater has finished. This means, that no + /// input is needed and no output can be produced. + /// + public bool IsFinished + { + get + { + return mode == FINISHED && outputWindow.GetAvailable() == 0; + } + } + + /// + /// Gets the adler checksum. This is either the checksum of all + /// uncompressed bytes returned by inflate(), or if needsDictionary() + /// returns true (and thus no output was yet produced) this is the + /// adler checksum of the expected dictionary. + /// + /// + /// the adler checksum. + /// + public int Adler + { + get + { + return IsNeedingDictionary ? readAdler : (int)checksum.Value; + } + } + + /// + /// Gets the total number of output bytes returned by Inflate(). + /// + /// + /// the total number of output bytes. + /// + public long TotalOut + { + get + { + return totalOut; + } + } + + /// + /// Gets the total number of processed compressed input bytes. + /// + /// + /// The total number of bytes of processed input bytes. + /// + public long TotalIn + { + get + { + return totalIn - (long)RemainingInput; + } + } + + /// + /// Gets the number of unprocessed input bytes. Useful, if the end of the + /// stream is reached and you want to further process the bytes after + /// the deflate stream. + /// + /// + /// The number of bytes of the input which have not been processed. + /// + public int RemainingInput + { + // TODO: This should be a long? + get + { + return input.AvailableBytes; + } + + } + } +} diff --git a/UpdateLib/UpdateLib/Compression/InflaterDynHeader.cs b/UpdateLib/UpdateLib/Compression/InflaterDynHeader.cs new file mode 100644 index 0000000..ddff663 --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/InflaterDynHeader.cs @@ -0,0 +1,188 @@ +using MatthiWare.UpdateLib.Compression.Streams; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace MatthiWare.UpdateLib.Compression +{ + public class InflaterDynHeader + { + #region Constants + const int LNUM = 0; + const int DNUM = 1; + const int BLNUM = 2; + const int BLLENS = 3; + const int LENS = 4; + const int REPS = 5; + + static readonly int[] repMin = { 3, 3, 11 }; + static readonly int[] repBits = { 2, 3, 7 }; + + static readonly int[] BL_ORDER = + { 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 }; + #endregion + + public bool Decode(StreamManipulator input) + { + decode_loop: + for (;;) + { + switch (mode) + { + case LNUM: + lnum = input.PeekBits(5); + if (lnum < 0) + { + return false; + } + lnum += 257; + input.DropBits(5); + // System.err.println("LNUM: "+lnum); + mode = DNUM; + goto case DNUM; // fall through + case DNUM: + dnum = input.PeekBits(5); + if (dnum < 0) + { + return false; + } + dnum++; + input.DropBits(5); + // System.err.println("DNUM: "+dnum); + num = lnum + dnum; + litdistLens = new byte[num]; + mode = BLNUM; + goto case BLNUM; // fall through + case BLNUM: + blnum = input.PeekBits(4); + if (blnum < 0) + { + return false; + } + blnum += 4; + input.DropBits(4); + blLens = new byte[19]; + ptr = 0; + // System.err.println("BLNUM: "+blnum); + mode = BLLENS; + goto case BLLENS; // fall through + case BLLENS: + while (ptr < blnum) + { + int len = input.PeekBits(3); + if (len < 0) + { + return false; + } + input.DropBits(3); + // System.err.println("blLens["+BL_ORDER[ptr]+"]: "+len); + blLens[BL_ORDER[ptr]] = (byte)len; + ptr++; + } + blTree = new InflaterHuffmanTree(blLens); + blLens = null; + ptr = 0; + mode = LENS; + goto case LENS; // fall through + case LENS: + { + int symbol; + while (((symbol = blTree.GetSymbol(input)) & ~15) == 0) + { + /* Normal case: symbol in [0..15] */ + + // System.err.println("litdistLens["+ptr+"]: "+symbol); + litdistLens[ptr++] = lastLen = (byte)symbol; + + if (ptr == num) + { + /* Finished */ + return true; + } + } + + /* need more input ? */ + if (symbol < 0) + { + return false; + } + + /* otherwise repeat code */ + if (symbol >= 17) + { + /* repeat zero */ + // System.err.println("repeating zero"); + lastLen = 0; + } + else + { + if (ptr == 0) + { + throw new Exception("Repeating zero"); + } + } + repSymbol = symbol - 16; + } + mode = REPS; + goto case REPS; // fall through + case REPS: + { + int bits = repBits[repSymbol]; + int count = input.PeekBits(bits); + + if (count < 0) + return false; + + input.DropBits(bits); + count += repMin[repSymbol]; + // System.err.println("litdistLens repeated: "+count); + + if (ptr + count > num) + throw new Exception($"litdistLens repeated: {count}"); + + while (count-- > 0) + litdistLens[ptr++] = lastLen; + + if (ptr == num) + return true; + } + + mode = LENS; + goto decode_loop; + } + } + } + + public InflaterHuffmanTree BuildLitLenTree() + { + byte[] litlenLens = new byte[lnum]; + Array.Copy(litdistLens, 0, litlenLens, 0, lnum); + return new InflaterHuffmanTree(litlenLens); + } + + public InflaterHuffmanTree BuildDistTree() + { + byte[] distLens = new byte[dnum]; + Array.Copy(litdistLens, lnum, distLens, 0, dnum); + return new InflaterHuffmanTree(distLens); + } + + #region Instance Fields + byte[] blLens; + byte[] litdistLens; + + InflaterHuffmanTree blTree; + + /// + /// The current decode mode + /// + int mode; + int lnum, dnum, blnum, num; + int repSymbol; + byte lastLen; + int ptr; + #endregion + + } +} diff --git a/UpdateLib/UpdateLib/Compression/InflaterHuffmanTree.cs b/UpdateLib/UpdateLib/Compression/InflaterHuffmanTree.cs new file mode 100644 index 0000000..1313197 --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/InflaterHuffmanTree.cs @@ -0,0 +1,229 @@ +using MatthiWare.UpdateLib.Compression.Streams; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace MatthiWare.UpdateLib.Compression +{ + /// + /// Huffman tree used for inflation + /// + public class InflaterHuffmanTree + { + #region Constants + const int MAX_BITLEN = 15; + #endregion + + #region Instance Fields + short[] tree; + #endregion + + /// + /// Literal length tree + /// + public static InflaterHuffmanTree defLitLenTree; + + /// + /// Distance tree + /// + public static InflaterHuffmanTree defDistTree; + + static InflaterHuffmanTree() + { + try + { + byte[] codeLengths = new byte[288]; + int i = 0; + while (i < 144) + { + codeLengths[i++] = 8; + } + while (i < 256) + { + codeLengths[i++] = 9; + } + while (i < 280) + { + codeLengths[i++] = 7; + } + while (i < 288) + { + codeLengths[i++] = 8; + } + defLitLenTree = new InflaterHuffmanTree(codeLengths); + + codeLengths = new byte[32]; + i = 0; + while (i < 32) + { + codeLengths[i++] = 5; + } + defDistTree = new InflaterHuffmanTree(codeLengths); + } + catch (Exception e) + { + throw new Exception("InflaterHuffmanTree: static tree length illegal", e); + } + } + + #region Constructors + /// + /// Constructs a Huffman tree from the array of code lengths. + /// + /// + /// the array of code lengths + /// + public InflaterHuffmanTree(byte[] codeLengths) + { + BuildTree(codeLengths); + } + #endregion + + void BuildTree(byte[] codeLengths) + { + int[] blCount = new int[MAX_BITLEN + 1]; + int[] nextCode = new int[MAX_BITLEN + 1]; + + for (int i = 0; i < codeLengths.Length; i++) + { + int bits = codeLengths[i]; + if (bits > 0) + { + blCount[bits]++; + } + } + + int code = 0; + int treeSize = 512; + for (int bits = 1; bits <= MAX_BITLEN; bits++) + { + nextCode[bits] = code; + code += blCount[bits] << (16 - bits); + if (bits >= 10) + { + /* We need an extra table for bit lengths >= 10. */ + int start = nextCode[bits] & 0x1ff80; + int end = code & 0x1ff80; + treeSize += (end - start) >> (16 - bits); + } + } + + /* -jr comment this out! doesnt work for dynamic trees and pkzip 2.04g + if (code != 65536) + { + throw new SharpZipBaseException("Code lengths don't add up properly."); + } + */ + /* Now create and fill the extra tables from longest to shortest + * bit len. This way the sub trees will be aligned. + */ + tree = new short[treeSize]; + int treePtr = 512; + for (int bits = MAX_BITLEN; bits >= 10; bits--) + { + int end = code & 0x1ff80; + code -= blCount[bits] << (16 - bits); + int start = code & 0x1ff80; + for (int i = start; i < end; i += 1 << 7) + { + tree[DeflaterHuffman.BitReverse(i)] = (short)((-treePtr << 4) | bits); + treePtr += 1 << (bits - 9); + } + } + + for (int i = 0; i < codeLengths.Length; i++) + { + int bits = codeLengths[i]; + if (bits == 0) + { + continue; + } + code = nextCode[bits]; + int revcode = DeflaterHuffman.BitReverse(code); + if (bits <= 9) + { + do + { + tree[revcode] = (short)((i << 4) | bits); + revcode += 1 << bits; + } while (revcode < 512); + } + else + { + int subTree = tree[revcode & 511]; + int treeLen = 1 << (subTree & 15); + subTree = -(subTree >> 4); + do + { + tree[subTree | (revcode >> 9)] = (short)((i << 4) | bits); + revcode += 1 << bits; + } while (revcode < treeLen); + } + nextCode[bits] = code + (1 << (16 - bits)); + } + + } + + /// + /// Reads the next symbol from input. The symbol is encoded using the + /// huffman tree. + /// + /// + /// input the input source. + /// + /// + /// the next symbol, or -1 if not enough input is available. + /// + public int GetSymbol(StreamManipulator input) + { + int lookahead, symbol; + if ((lookahead = input.PeekBits(9)) >= 0) + { + if ((symbol = tree[lookahead]) >= 0) + { + input.DropBits(symbol & 15); + return symbol >> 4; + } + int subtree = -(symbol >> 4); + int bitlen = symbol & 15; + if ((lookahead = input.PeekBits(bitlen)) >= 0) + { + symbol = tree[subtree | (lookahead >> 9)]; + input.DropBits(symbol & 15); + return symbol >> 4; + } + else + { + int bits = input.AvailableBits; + lookahead = input.PeekBits(bits); + symbol = tree[subtree | (lookahead >> 9)]; + if ((symbol & 15) <= bits) + { + input.DropBits(symbol & 15); + return symbol >> 4; + } + else + { + return -1; + } + } + } + else + { + int bits = input.AvailableBits; + lookahead = input.PeekBits(bits); + symbol = tree[lookahead]; + if (symbol >= 0 && (symbol & 15) <= bits) + { + input.DropBits(symbol & 15); + return symbol >> 4; + } + else + { + return -1; + } + } + } + } +} diff --git a/UpdateLib/UpdateLib/Compression/PendingBuffer.cs b/UpdateLib/UpdateLib/Compression/PendingBuffer.cs new file mode 100644 index 0000000..537aa4a --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/PendingBuffer.cs @@ -0,0 +1,270 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace MatthiWare.UpdateLib.Compression +{ + /// + /// This class is general purpose class for writing data to a buffer. + /// + /// It allows you to write bits as well as bytes + /// Based on DeflaterPending.java + /// + /// author of the original java version : Jochen Hoenicke + /// + public class PendingBuffer + { + #region Instance Fields + /// + /// Internal work buffer + /// + readonly byte[] buffer; + + int start; + int end; + + uint bits; + int bitCount; + #endregion + + #region Constructors + /// + /// construct instance using default buffer size of 4096 + /// + public PendingBuffer() : this(4096) + { + } + + /// + /// construct instance using specified buffer size + /// + /// + /// size to use for internal buffer + /// + public PendingBuffer(int bufferSize) + { + buffer = new byte[bufferSize]; + } + + #endregion + + /// + /// Clear internal state/buffers + /// + public void Reset() + { + start = end = bitCount = 0; + } + + /// + /// Write a byte to buffer + /// + /// + /// The value to write + /// + public void WriteByte(int value) + { +#if DebugDeflation + if (DeflaterConstants.DEBUGGING && (start != 0) ) + { + throw new SharpZipBaseException("Debug check: start != 0"); + } +#endif + buffer[end++] = unchecked((byte)value); + } + + /// + /// Write a short value to buffer LSB first + /// + /// + /// The value to write. + /// + public void WriteShort(int value) + { +#if DebugDeflation + if (DeflaterConstants.DEBUGGING && (start != 0) ) + { + throw new SharpZipBaseException("Debug check: start != 0"); + } +#endif + buffer[end++] = unchecked((byte)value); + buffer[end++] = unchecked((byte)(value >> 8)); + } + + /// + /// write an integer LSB first + /// + /// The value to write. + public void WriteInt(int value) + { +#if DebugDeflation + if (DeflaterConstants.DEBUGGING && (start != 0) ) + { + throw new SharpZipBaseException("Debug check: start != 0"); + } +#endif + buffer[end++] = unchecked((byte)value); + buffer[end++] = unchecked((byte)(value >> 8)); + buffer[end++] = unchecked((byte)(value >> 16)); + buffer[end++] = unchecked((byte)(value >> 24)); + } + + /// + /// Write a block of data to buffer + /// + /// data to write + /// offset of first byte to write + /// number of bytes to write + public void WriteBlock(byte[] block, int offset, int length) + { +#if DebugDeflation + if (DeflaterConstants.DEBUGGING && (start != 0) ) + { + throw new SharpZipBaseException("Debug check: start != 0"); + } +#endif + System.Array.Copy(block, offset, buffer, end, length); + end += length; + } + + /// + /// The number of bits written to the buffer + /// + public int BitCount + { + get + { + return bitCount; + } + } + + /// + /// Align internal buffer on a byte boundary + /// + public void AlignToByte() + { +#if DebugDeflation + if (DeflaterConstants.DEBUGGING && (start != 0) ) + { + throw new SharpZipBaseException("Debug check: start != 0"); + } +#endif + if (bitCount > 0) + { + buffer[end++] = unchecked((byte)bits); + if (bitCount > 8) + { + buffer[end++] = unchecked((byte)(bits >> 8)); + } + } + bits = 0; + bitCount = 0; + } + + /// + /// Write bits to internal buffer + /// + /// source of bits + /// number of bits to write + public void WriteBits(int b, int count) + { +#if DebugDeflation + if (DeflaterConstants.DEBUGGING && (start != 0) ) + { + throw new SharpZipBaseException("Debug check: start != 0"); + } + + // if (DeflaterConstants.DEBUGGING) { + // //Console.WriteLine("writeBits("+b+","+count+")"); + // } +#endif + bits |= (uint)(b << bitCount); + bitCount += count; + if (bitCount >= 16) + { + buffer[end++] = unchecked((byte)bits); + buffer[end++] = unchecked((byte)(bits >> 8)); + bits >>= 16; + bitCount -= 16; + } + } + + /// + /// Write a short value to internal buffer most significant byte first + /// + /// value to write + public void WriteShortMSB(int s) + { +#if DebugDeflation + if (DeflaterConstants.DEBUGGING && (start != 0) ) + { + throw new SharpZipBaseException("Debug check: start != 0"); + } +#endif + buffer[end++] = unchecked((byte)(s >> 8)); + buffer[end++] = unchecked((byte)s); + } + + /// + /// Indicates if buffer has been flushed + /// + public bool IsFlushed + { + get + { + return end == 0; + } + } + + /// + /// Flushes the pending buffer into the given output array. If the + /// output array is to small, only a partial flush is done. + /// + /// The output array. + /// The offset into output array. + /// The maximum number of bytes to store. + /// The number of bytes flushed. + public int Flush(byte[] output, int offset, int length) + { + if (bitCount >= 8) + { + buffer[end++] = unchecked((byte)bits); + bits >>= 8; + bitCount -= 8; + } + + if (length > end - start) + { + length = end - start; + System.Array.Copy(buffer, start, output, offset, length); + start = 0; + end = 0; + } + else + { + System.Array.Copy(buffer, start, output, offset, length); + start += length; + } + return length; + } + + /// + /// Convert internal buffer to byte array. + /// Buffer is empty on completion + /// + /// + /// The internal buffer contents converted to a byte array. + /// + public byte[] ToByteArray() + { + AlignToByte(); + + byte[] result = new byte[end - start]; + System.Array.Copy(buffer, start, result, 0, result.Length); + start = 0; + end = 0; + return result; + } + } +} diff --git a/UpdateLib/UpdateLib/Compression/Streams/DeflaterOutputStream.cs b/UpdateLib/UpdateLib/Compression/Streams/DeflaterOutputStream.cs new file mode 100644 index 0000000..744e9fd --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/Streams/DeflaterOutputStream.cs @@ -0,0 +1,485 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Security.Cryptography; +using System.Text; + +namespace MatthiWare.UpdateLib.Compression.Streams +{ + /// + /// A special stream deflating or compressing the bytes that are + /// written to it. It uses a Deflater to perform actual deflating.
+ /// Authors of the original java version : Tom Tromey, Jochen Hoenicke + ///
+ public class DeflaterOutputStream : Stream + { + #region Constructors + /// + /// Creates a new DeflaterOutputStream with a default Deflater and default buffer size. + /// + /// + /// the output stream where deflated output should be written. + /// + public DeflaterOutputStream(Stream baseOutputStream) + : this(baseOutputStream, new Deflater(), 512) + { + } + + /// + /// Creates a new DeflaterOutputStream with the given Deflater and + /// default buffer size. + /// + /// + /// the output stream where deflated output should be written. + /// + /// + /// the underlying deflater. + /// + public DeflaterOutputStream(Stream baseOutputStream, Deflater deflater) + : this(baseOutputStream, deflater, 512) + { + } + + /// + /// Creates a new DeflaterOutputStream with the given Deflater and + /// buffer size. + /// + /// + /// The output stream where deflated output is written. + /// + /// + /// The underlying deflater to use + /// + /// + /// The buffer size in bytes to use when deflating (minimum value 512) + /// + /// + /// bufsize is less than or equal to zero. + /// + /// + /// baseOutputStream does not support writing + /// + /// + /// deflater instance is null + /// + public DeflaterOutputStream(Stream baseOutputStream, Deflater deflater, int bufferSize) + { + if (baseOutputStream == null) + { + throw new ArgumentNullException(nameof(baseOutputStream)); + } + + if (baseOutputStream.CanWrite == false) + { + throw new ArgumentException("Must support writing", nameof(baseOutputStream)); + } + + if (deflater == null) + { + throw new ArgumentNullException(nameof(deflater)); + } + + if (bufferSize < 512) + { + throw new ArgumentOutOfRangeException(nameof(bufferSize)); + } + + baseOutputStream_ = baseOutputStream; + buffer_ = new byte[bufferSize]; + deflater_ = deflater; + } + #endregion + + #region Public API + /// + /// Finishes the stream by calling finish() on the deflater. + /// + /// + /// Not all input is deflated + /// + public virtual void Finish() + { + deflater_.Finish(); + while (!deflater_.IsFinished) + { + int len = deflater_.Deflate(buffer_, 0, buffer_.Length); + if (len <= 0) + { + break; + } + + if (cryptoTransform_ != null) + { + EncryptBlock(buffer_, 0, len); + } + + baseOutputStream_.Write(buffer_, 0, len); + } + + if (!deflater_.IsFinished) + { + throw new SharpZipBaseException("Can't deflate all input?"); + } + + baseOutputStream_.Flush(); + + if (cryptoTransform_ != null) + { + if (cryptoTransform_ is ZipAESTransform) + { + AESAuthCode = ((ZipAESTransform)cryptoTransform_).GetAuthCode(); + } + cryptoTransform_.Dispose(); + cryptoTransform_ = null; + } + } + + /// + /// Gets or sets a flag indicating ownership of underlying stream. + /// When the flag is true will close the underlying stream also. + /// + /// The default value is true. + public bool IsStreamOwner { get; set; } = true; + + /// + /// Allows client to determine if an entry can be patched after its added + /// + public bool CanPatchEntries + { + get + { + return baseOutputStream_.CanSeek; + } + } + + #endregion + + #region Encryption + + string password; + + ICryptoTransform cryptoTransform_; + + /// + /// Returns the 10 byte AUTH CODE to be appended immediately following the AES data stream. + /// + protected byte[] AESAuthCode; + + /// + /// Get/set the password used for encryption. + /// + /// When set to null or if the password is empty no encryption is performed + public string Password + { + get + { + return password; + } + set + { + if ((value != null) && (value.Length == 0)) + { + password = null; + } + else + { + password = value; + } + } + } + + /// + /// Encrypt a block of data + /// + /// + /// Data to encrypt. NOTE the original contents of the buffer are lost + /// + /// + /// Offset of first byte in buffer to encrypt + /// + /// + /// Number of bytes in buffer to encrypt + /// + protected void EncryptBlock(byte[] buffer, int offset, int length) + { + cryptoTransform_.TransformBlock(buffer, 0, length, buffer, 0); + } + + /// + /// Initializes encryption keys based on given . + /// + /// The password. + protected void InitializePassword(string password) + { + var pkManaged = new PkzipClassicManaged(); + byte[] key = PkzipClassic.GenerateKeys(ZipConstants.ConvertToArray(password)); + cryptoTransform_ = pkManaged.CreateEncryptor(key, null); + } + + /// + /// Initializes encryption keys based on given password. + /// + protected void InitializeAESPassword(ZipEntry entry, string rawPassword, + out byte[] salt, out byte[] pwdVerifier) + { + salt = new byte[entry.AESSaltLen]; + // Salt needs to be cryptographically random, and unique per file + if (_aesRnd == null) + _aesRnd = RandomNumberGenerator.Create(); + _aesRnd.GetBytes(salt); + int blockSize = entry.AESKeySize / 8; // bits to bytes + + cryptoTransform_ = new ZipAESTransform(rawPassword, salt, blockSize, true); + pwdVerifier = ((ZipAESTransform)cryptoTransform_).PwdVerifier; + } + + #endregion + + #region Deflation Support + /// + /// Deflates everything in the input buffers. This will call + /// def.deflate() until all bytes from the input buffers + /// are processed. + /// + protected void Deflate() + { + while (!deflater_.IsNeedingInput) + { + int deflateCount = deflater_.Deflate(buffer_, 0, buffer_.Length); + + if (deflateCount <= 0) + { + break; + } + if (cryptoTransform_ != null) + { + EncryptBlock(buffer_, 0, deflateCount); + } + + baseOutputStream_.Write(buffer_, 0, deflateCount); + } + + if (!deflater_.IsNeedingInput) + { + throw new SharpZipBaseException("DeflaterOutputStream can't deflate all input?"); + } + } + #endregion + + #region Stream Overrides + /// + /// Gets value indicating stream can be read from + /// + public override bool CanRead + { + get + { + return false; + } + } + + /// + /// Gets a value indicating if seeking is supported for this stream + /// This property always returns false + /// + public override bool CanSeek + { + get + { + return false; + } + } + + /// + /// Get value indicating if this stream supports writing + /// + public override bool CanWrite + { + get + { + return baseOutputStream_.CanWrite; + } + } + + /// + /// Get current length of stream + /// + public override long Length + { + get + { + return baseOutputStream_.Length; + } + } + + /// + /// Gets the current position within the stream. + /// + /// Any attempt to set position + public override long Position + { + get + { + return baseOutputStream_.Position; + } + set + { + throw new NotSupportedException("Position property not supported"); + } + } + + /// + /// Sets the current position of this stream to the given value. Not supported by this class! + /// + /// The offset relative to the to seek. + /// The to seek from. + /// The new position in the stream. + /// Any access + public override long Seek(long offset, SeekOrigin origin) + { + throw new NotSupportedException("DeflaterOutputStream Seek not supported"); + } + + /// + /// Sets the length of this stream to the given value. Not supported by this class! + /// + /// The new stream length. + /// Any access + public override void SetLength(long value) + { + throw new NotSupportedException("DeflaterOutputStream SetLength not supported"); + } + + /// + /// Read a byte from stream advancing position by one + /// + /// The byte read cast to an int. THe value is -1 if at the end of the stream. + /// Any access + public override int ReadByte() + { + throw new NotSupportedException("DeflaterOutputStream ReadByte not supported"); + } + + /// + /// Read a block of bytes from stream + /// + /// The buffer to store read data in. + /// The offset to start storing at. + /// The maximum number of bytes to read. + /// The actual number of bytes read. Zero if end of stream is detected. + /// Any access + public override int Read(byte[] buffer, int offset, int count) + { + throw new NotSupportedException("DeflaterOutputStream Read not supported"); + } + + /// + /// Flushes the stream by calling Flush on the deflater and then + /// on the underlying stream. This ensures that all bytes are flushed. + /// + public override void Flush() + { + deflater_.Flush(); + Deflate(); + baseOutputStream_.Flush(); + } + + /// + /// Calls and closes the underlying + /// stream when is true. + /// + protected override void Dispose(bool disposing) + { + if (!isClosed_) + { + isClosed_ = true; + + try + { + Finish(); + if (cryptoTransform_ != null) + { + GetAuthCodeIfAES(); + cryptoTransform_.Dispose(); + cryptoTransform_ = null; + } + } + finally + { + if (IsStreamOwner) + { + baseOutputStream_.Dispose(); + } + } + } + } + + private void GetAuthCodeIfAES() + { + if (cryptoTransform_ is ZipAESTransform) + { + AESAuthCode = ((ZipAESTransform)cryptoTransform_).GetAuthCode(); + } + } + + /// + /// Writes a single byte to the compressed output stream. + /// + /// + /// The byte value. + /// + public override void WriteByte(byte value) + { + byte[] b = new byte[1]; + b[0] = value; + Write(b, 0, 1); + } + + /// + /// Writes bytes from an array to the compressed stream. + /// + /// + /// The byte array + /// + /// + /// The offset into the byte array where to start. + /// + /// + /// The number of bytes to write. + /// + public override void Write(byte[] buffer, int offset, int count) + { + deflater_.SetInput(buffer, offset, count); + Deflate(); + } + #endregion + + #region Instance Fields + /// + /// This buffer is used temporarily to retrieve the bytes from the + /// deflater and write them to the underlying output stream. + /// + byte[] buffer_; + + /// + /// The deflater which is used to deflate the stream. + /// + protected Deflater deflater_; + + /// + /// Base stream the deflater depends on. + /// + protected Stream baseOutputStream_; + + bool isClosed_; + #endregion + + #region Static Fields + + // Static to help ensure that multiple files within a zip will get different random salt + private static RandomNumberGenerator _aesRnd = RandomNumberGenerator.Create(); + #endregion + } +} +} diff --git a/UpdateLib/UpdateLib/Compression/Streams/InflaterInputStream.cs b/UpdateLib/UpdateLib/Compression/Streams/InflaterInputStream.cs new file mode 100644 index 0000000..228cf04 --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/Streams/InflaterInputStream.cs @@ -0,0 +1,706 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; + +namespace MatthiWare.UpdateLib.Compression.Streams +{ + /// + /// An input buffer customised for use by + /// + /// + /// The buffer supports decryption of incoming data. + /// + public class InflaterInputBuffer + { + #region Constructors + /// + /// Initialise a new instance of with a default buffer size + /// + /// The stream to buffer. + public InflaterInputBuffer(Stream stream) : this(stream, 4096) + { + } + + /// + /// Initialise a new instance of + /// + /// The stream to buffer. + /// The size to use for the buffer + /// A minimum buffer size of 1KB is permitted. Lower sizes are treated as 1KB. + public InflaterInputBuffer(Stream stream, int bufferSize) + { + inputStream = stream; + if (bufferSize < 1024) + { + bufferSize = 1024; + } + rawData = new byte[bufferSize]; + clearText = rawData; + } + #endregion + + /// + /// Get the length of bytes bytes in the + /// + public int RawLength + { + get + { + return rawLength; + } + } + + /// + /// Get the contents of the raw data buffer. + /// + /// This may contain encrypted data. + public byte[] RawData + { + get + { + return rawData; + } + } + + /// + /// Get the number of useable bytes in + /// + public int ClearTextLength + { + get + { + return clearTextLength; + } + } + + /// + /// Get the contents of the clear text buffer. + /// + public byte[] ClearText + { + get + { + return clearText; + } + } + + /// + /// Get/set the number of bytes available + /// + public int Available + { + get { return available; } + set { available = value; } + } + + /// + /// Call passing the current clear text buffer contents. + /// + /// The inflater to set input for. + public void SetInflaterInput(Inflater inflater) + { + if (available > 0) + { + inflater.SetInput(clearText, clearTextLength - available, available); + available = 0; + } + } + + /// + /// Fill the buffer from the underlying input stream. + /// + public void Fill() + { + rawLength = 0; + int toRead = rawData.Length; + + while (toRead > 0) + { + int count = inputStream.Read(rawData, rawLength, toRead); + if (count <= 0) + { + break; + } + rawLength += count; + toRead -= count; + } + + if (cryptoTransform != null) + { + clearTextLength = cryptoTransform.TransformBlock(rawData, 0, rawLength, clearText, 0); + } + else + { + clearTextLength = rawLength; + } + + available = clearTextLength; + } + + /// + /// Read a buffer directly from the input stream + /// + /// The buffer to fill + /// Returns the number of bytes read. + public int ReadRawBuffer(byte[] buffer) + { + return ReadRawBuffer(buffer, 0, buffer.Length); + } + + /// + /// Read a buffer directly from the input stream + /// + /// The buffer to read into + /// The offset to start reading data into. + /// The number of bytes to read. + /// Returns the number of bytes read. + public int ReadRawBuffer(byte[] outBuffer, int offset, int length) + { + if (length < 0) + { + throw new ArgumentOutOfRangeException(nameof(length)); + } + + int currentOffset = offset; + int currentLength = length; + + while (currentLength > 0) + { + if (available <= 0) + { + Fill(); + if (available <= 0) + { + return 0; + } + } + int toCopy = Math.Min(currentLength, available); + System.Array.Copy(rawData, rawLength - (int)available, outBuffer, currentOffset, toCopy); + currentOffset += toCopy; + currentLength -= toCopy; + available -= toCopy; + } + return length; + } + + /// + /// Read clear text data from the input stream. + /// + /// The buffer to add data to. + /// The offset to start adding data at. + /// The number of bytes to read. + /// Returns the number of bytes actually read. + public int ReadClearTextBuffer(byte[] outBuffer, int offset, int length) + { + if (length < 0) + { + throw new ArgumentOutOfRangeException(nameof(length)); + } + + int currentOffset = offset; + int currentLength = length; + + while (currentLength > 0) + { + if (available <= 0) + { + Fill(); + if (available <= 0) + { + return 0; + } + } + + int toCopy = Math.Min(currentLength, available); + Array.Copy(clearText, clearTextLength - (int)available, outBuffer, currentOffset, toCopy); + currentOffset += toCopy; + currentLength -= toCopy; + available -= toCopy; + } + return length; + } + + /// + /// Read a from the input stream. + /// + /// Returns the byte read. + public int ReadLeByte() + { + if (available <= 0) + { + Fill(); + if (available <= 0) + { + throw new ZipException("EOF in header"); + } + } + byte result = rawData[rawLength - available]; + available -= 1; + return result; + } + + /// + /// Read an in little endian byte order. + /// + /// The short value read case to an int. + public int ReadLeShort() + { + return ReadLeByte() | (ReadLeByte() << 8); + } + + /// + /// Read an in little endian byte order. + /// + /// The int value read. + public int ReadLeInt() + { + return ReadLeShort() | (ReadLeShort() << 16); + } + + /// + /// Read a in little endian byte order. + /// + /// The long value read. + public long ReadLeLong() + { + return (uint)ReadLeInt() | ((long)ReadLeInt() << 32); + } + + /// + /// Get/set the to apply to any data. + /// + /// Set this value to null to have no transform applied. + public ICryptoTransform CryptoTransform + { + set + { + cryptoTransform = value; + if (cryptoTransform != null) + { + if (rawData == clearText) + { + if (internalClearText == null) + { + internalClearText = new byte[rawData.Length]; + } + clearText = internalClearText; + } + clearTextLength = rawLength; + if (available > 0) + { + cryptoTransform.TransformBlock(rawData, rawLength - available, available, clearText, rawLength - available); + } + } + else + { + clearText = rawData; + clearTextLength = rawLength; + } + } + } + + #region Instance Fields + int rawLength; + byte[] rawData; + + int clearTextLength; + byte[] clearText; + byte[] internalClearText; + + int available; + + ICryptoTransform cryptoTransform; + Stream inputStream; + #endregion + } + + /// + /// This filter stream is used to decompress data compressed using the "deflate" + /// format. The "deflate" format is described in RFC 1951. + /// + /// This stream may form the basis for other decompression filters, such + /// as the GZipInputStream. + /// + /// Author of the original java version : John Leuner. + /// + public class InflaterInputStream : Stream + { + #region Constructors + /// + /// Create an InflaterInputStream with the default decompressor + /// and a default buffer size of 4KB. + /// + /// + /// The InputStream to read bytes from + /// + public InflaterInputStream(Stream baseInputStream) + : this(baseInputStream, new Inflater(), 4096) + { + } + + /// + /// Create an InflaterInputStream with the specified decompressor + /// and a default buffer size of 4KB. + /// + /// + /// The source of input data + /// + /// + /// The decompressor used to decompress data read from baseInputStream + /// + public InflaterInputStream(Stream baseInputStream, Inflater inf) + : this(baseInputStream, inf, 4096) + { + } + + /// + /// Create an InflaterInputStream with the specified decompressor + /// and the specified buffer size. + /// + /// + /// The InputStream to read bytes from + /// + /// + /// The decompressor to use + /// + /// + /// Size of the buffer to use + /// + public InflaterInputStream(Stream baseInputStream, Inflater inflater, int bufferSize) + { + if (baseInputStream == null) + { + throw new ArgumentNullException(nameof(baseInputStream)); + } + + if (inflater == null) + { + throw new ArgumentNullException(nameof(inflater)); + } + + if (bufferSize <= 0) + { + throw new ArgumentOutOfRangeException(nameof(bufferSize)); + } + + this.baseInputStream = baseInputStream; + this.inf = inflater; + + inputBuffer = new InflaterInputBuffer(baseInputStream, bufferSize); + } + + #endregion + + /// + /// Gets or sets a flag indicating ownership of underlying stream. + /// When the flag is true will close the underlying stream also. + /// + /// The default value is true. + public bool IsStreamOwner { get; set; } = true; + + /// + /// Skip specified number of bytes of uncompressed data + /// + /// + /// Number of bytes to skip + /// + /// + /// The number of bytes skipped, zero if the end of + /// stream has been reached + /// + /// + /// The number of bytes to skip is less than or equal to zero. + /// + public long Skip(long count) + { + if (count <= 0) + { + throw new ArgumentOutOfRangeException(nameof(count)); + } + + // v0.80 Skip by seeking if underlying stream supports it... + if (baseInputStream.CanSeek) + { + baseInputStream.Seek(count, SeekOrigin.Current); + return count; + } + else + { + int length = 2048; + if (count < length) + { + length = (int)count; + } + + byte[] tmp = new byte[length]; + int readCount = 1; + long toSkip = count; + + while ((toSkip > 0) && (readCount > 0)) + { + if (toSkip < length) + { + length = (int)toSkip; + } + + readCount = baseInputStream.Read(tmp, 0, length); + toSkip -= readCount; + } + + return count - toSkip; + } + } + + /// + /// Clear any cryptographic state. + /// + protected void StopDecrypting() + { + inputBuffer.CryptoTransform = null; + } + + /// + /// Returns 0 once the end of the stream (EOF) has been reached. + /// Otherwise returns 1. + /// + public virtual int Available + { + get + { + return inf.IsFinished ? 0 : 1; + } + } + + /// + /// Fills the buffer with more data to decompress. + /// + /// + /// Stream ends early + /// + protected void Fill() + { + // Protect against redundant calls + if (inputBuffer.Available <= 0) + { + inputBuffer.Fill(); + if (inputBuffer.Available <= 0) + { + throw new SharpZipBaseException("Unexpected EOF"); + } + } + inputBuffer.SetInflaterInput(inf); + } + + #region Stream Overrides + /// + /// Gets a value indicating whether the current stream supports reading + /// + public override bool CanRead + { + get + { + return baseInputStream.CanRead; + } + } + + /// + /// Gets a value of false indicating seeking is not supported for this stream. + /// + public override bool CanSeek + { + get + { + return false; + } + } + + /// + /// Gets a value of false indicating that this stream is not writeable. + /// + public override bool CanWrite + { + get + { + return false; + } + } + + /// + /// A value representing the length of the stream in bytes. + /// + public override long Length + { + get + { + //return inputBuffer.RawLength; + throw new NotSupportedException("InflaterInputStream Length is not supported"); + } + } + + /// + /// The current position within the stream. + /// Throws a NotSupportedException when attempting to set the position + /// + /// Attempting to set the position + public override long Position + { + get + { + return baseInputStream.Position; + } + set + { + throw new NotSupportedException("InflaterInputStream Position not supported"); + } + } + + /// + /// Flushes the baseInputStream + /// + public override void Flush() + { + baseInputStream.Flush(); + } + + /// + /// Sets the position within the current stream + /// Always throws a NotSupportedException + /// + /// The relative offset to seek to. + /// The defining where to seek from. + /// The new position in the stream. + /// Any access + public override long Seek(long offset, SeekOrigin origin) + { + throw new NotSupportedException("Seek not supported"); + } + + /// + /// Set the length of the current stream + /// Always throws a NotSupportedException + /// + /// The new length value for the stream. + /// Any access + public override void SetLength(long value) + { + throw new NotSupportedException("InflaterInputStream SetLength not supported"); + } + + /// + /// Writes a sequence of bytes to stream and advances the current position + /// This method always throws a NotSupportedException + /// + /// Thew buffer containing data to write. + /// The offset of the first byte to write. + /// The number of bytes to write. + /// Any access + public override void Write(byte[] buffer, int offset, int count) + { + throw new NotSupportedException("InflaterInputStream Write not supported"); + } + + /// + /// Writes one byte to the current stream and advances the current position + /// Always throws a NotSupportedException + /// + /// The byte to write. + /// Any access + public override void WriteByte(byte value) + { + throw new NotSupportedException("InflaterInputStream WriteByte not supported"); + } + + /// + /// Closes the input stream. When + /// is true the underlying stream is also closed. + /// + protected override void Dispose(bool disposing) + { + if (!isClosed) + { + isClosed = true; + if (IsStreamOwner) + { + baseInputStream.Dispose(); + } + } + } + + /// + /// Reads decompressed data into the provided buffer byte array + /// + /// + /// The array to read and decompress data into + /// + /// + /// The offset indicating where the data should be placed + /// + /// + /// The number of bytes to decompress + /// + /// The number of bytes read. Zero signals the end of stream + /// + /// Inflater needs a dictionary + /// + public override int Read(byte[] buffer, int offset, int count) + { + if (inf.IsNeedingDictionary) + { + throw new SharpZipBaseException("Need a dictionary"); + } + + int remainingBytes = count; + while (true) + { + int bytesRead = inf.Inflate(buffer, offset, remainingBytes); + offset += bytesRead; + remainingBytes -= bytesRead; + + if (remainingBytes == 0 || inf.IsFinished) + { + break; + } + + if (inf.IsNeedingInput) + { + Fill(); + } + else if (bytesRead == 0) + { + throw new ZipException("Dont know what to do"); + } + } + return count - remainingBytes; + } + #endregion + + #region Instance Fields + /// + /// Decompressor for this stream + /// + protected Inflater inf; + + /// + /// Input buffer for this stream. + /// + protected InflaterInputBuffer inputBuffer; + + /// + /// Base stream the inflater reads from. + /// + private Stream baseInputStream; + + /// + /// The compressed size + /// + protected long csize; + + /// + /// Flag indicating wether this instance has been closed or not. + /// + bool isClosed; + #endregion + } +} diff --git a/UpdateLib/UpdateLib/Compression/Streams/OutputWindow.cs b/UpdateLib/UpdateLib/Compression/Streams/OutputWindow.cs new file mode 100644 index 0000000..79b6a05 --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/Streams/OutputWindow.cs @@ -0,0 +1,204 @@ +using System; + +namespace MatthiWare.UpdateLib.Compression.Streams +{ + /// + /// Contains the output from the Inflation process. + /// We need to have a window so that we can refer backwards into the output stream + /// to repeat stuff.
+ /// Author of the original java version : John Leuner + ///
+ public class OutputWindow + { + #region Constants + const int WindowSize = 1 << 15; + const int WindowMask = WindowSize - 1; + #endregion + + #region Instance Fields + byte[] window = new byte[WindowSize]; //The window is 2^15 bytes + int windowEnd; + int windowFilled; + #endregion + + /// + /// Write a byte to this output window + /// + /// value to write + /// + /// if window is full + /// + public void Write(int value) + { + if (windowFilled++ == WindowSize) + throw new InvalidOperationException("Window full"); + + window[windowEnd++] = (byte)value; + windowEnd &= WindowMask; + } + + + private void SlowRepeat(int repStart, int length, int distance) + { + while (length-- > 0) + { + window[windowEnd++] = window[repStart++]; + windowEnd &= WindowMask; + repStart &= WindowMask; + } + } + + /// + /// Append a byte pattern already in the window itself + /// + /// length of pattern to copy + /// distance from end of window pattern occurs + /// + /// If the repeated data overflows the window + /// + public void Repeat(int length, int distance) + { + if ((windowFilled += length) > WindowSize) + throw new InvalidOperationException("Window full"); + + int repStart = (windowEnd - distance) & WindowMask; + int border = WindowSize - length; + if ((repStart <= border) && (windowEnd < border)) + { + if (length <= distance) + { + Array.Copy(window, repStart, window, windowEnd, length); + windowEnd += length; + } + else + { + // We have to copy manually, since the repeat pattern overlaps. + while (length-- > 0) + { + window[windowEnd++] = window[repStart++]; + } + } + } + else + { + SlowRepeat(repStart, length, distance); + } + } + + /// + /// Copy from input manipulator to internal window + /// + /// source of data + /// length of data to copy + /// the number of bytes copied + public int CopyStored(StreamManipulator input, int length) + { + length = Math.Min(Math.Min(length, WindowSize - windowFilled), input.AvailableBytes); + int copied; + + int tailLen = WindowSize - windowEnd; + if (length > tailLen) + { + copied = input.CopyBytes(window, windowEnd, tailLen); + if (copied == tailLen) + copied += input.CopyBytes(window, 0, length - tailLen); + } + else + copied = input.CopyBytes(window, windowEnd, length); + + windowEnd = (windowEnd + copied) & WindowMask; + windowFilled += copied; + return copied; + } + + /// + /// Copy dictionary to window + /// + /// source dictionary + /// offset of start in source dictionary + /// length of dictionary + /// + /// If window isnt empty + /// + public void CopyDict(byte[] dictionary, int offset, int length) + { + if (dictionary == null) + throw new ArgumentNullException(nameof(dictionary)); + + if (windowFilled > 0) + throw new InvalidOperationException(); + + if (length > WindowSize) + { + offset += length - WindowSize; + length = WindowSize; + } + Array.Copy(dictionary, offset, window, 0, length); + windowEnd = length & WindowMask; + } + + /// + /// Get remaining unfilled space in window + /// + /// Number of bytes left in window + public int GetFreeSpace() + { + return WindowSize - windowFilled; + } + + /// + /// Get bytes available for output in window + /// + /// Number of bytes filled + public int GetAvailable() + { + return windowFilled; + } + + /// + /// Copy contents of window to output + /// + /// buffer to copy to + /// offset to start at + /// number of bytes to count + /// The number of bytes copied + /// + /// If a window underflow occurs + /// + public int CopyOutput(byte[] output, int offset, int len) + { + int copyEnd = windowEnd; + + if (len > windowFilled) + len = windowFilled; + else + copyEnd = (windowEnd - windowFilled + len) & WindowMask; + + int copied = len; + int tailLen = len - copyEnd; + + if (tailLen > 0) + { + Array.Copy(window, WindowSize - tailLen, output, offset, tailLen); + offset += tailLen; + len = copyEnd; + } + + Array.Copy(window, copyEnd - len, output, offset, len); + windowFilled -= copied; + + if (windowFilled < 0) + throw new InvalidOperationException(); + + return copied; + } + + /// + /// Reset by clearing window so GetAvailable returns 0 + /// + public void Reset() + { + windowFilled = windowEnd = 0; + } + } +} diff --git a/UpdateLib/UpdateLib/Compression/Streams/StreamManipulator.cs b/UpdateLib/UpdateLib/Compression/Streams/StreamManipulator.cs new file mode 100644 index 0000000..08fcc97 --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/Streams/StreamManipulator.cs @@ -0,0 +1,265 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace MatthiWare.UpdateLib.Compression.Streams +{ + /// + /// This class allows us to retrieve a specified number of bits from + /// the input buffer, as well as copy big byte blocks. + /// + /// It uses an int buffer to store up to 31 bits for direct + /// manipulation. This guarantees that we can get at least 16 bits, + /// but we only need at most 15, so this is all safe. + /// + /// There are some optimizations in this class, for example, you must + /// never peek more than 8 bits more than needed, and you must first + /// peek bits before you may drop them. This is not a general purpose + /// class but optimized for the behaviour of the Inflater. + /// + /// authors of the original java version : John Leuner, Jochen Hoenicke + /// + public class StreamManipulator + { + /// + /// Get the next sequence of bits but don't increase input pointer. bitCount must be + /// less or equal 16 and if this call succeeds, you must drop + /// at least n - 8 bits in the next call. + /// + /// The number of bits to peek. + /// + /// the value of the bits, or -1 if not enough bits available. */ + /// + public int PeekBits(int bitCount) + { + if (bitsInBuffer_ < bitCount) + { + if (windowStart_ == windowEnd_) + { + return -1; // ok + } + buffer_ |= (uint)((window_[windowStart_++] & 0xff | + (window_[windowStart_++] & 0xff) << 8) << bitsInBuffer_); + bitsInBuffer_ += 16; + } + return (int)(buffer_ & ((1 << bitCount) - 1)); + } + + /// + /// Drops the next n bits from the input. You should have called PeekBits + /// with a bigger or equal n before, to make sure that enough bits are in + /// the bit buffer. + /// + /// The number of bits to drop. + public void DropBits(int bitCount) + { + buffer_ >>= bitCount; + bitsInBuffer_ -= bitCount; + } + + /// + /// Gets the next n bits and increases input pointer. This is equivalent + /// to followed by , except for correct error handling. + /// + /// The number of bits to retrieve. + /// + /// the value of the bits, or -1 if not enough bits available. + /// + public int GetBits(int bitCount) + { + int bits = PeekBits(bitCount); + if (bits >= 0) + { + DropBits(bitCount); + } + return bits; + } + + /// + /// Gets the number of bits available in the bit buffer. This must be + /// only called when a previous PeekBits() returned -1. + /// + /// + /// the number of bits available. + /// + public int AvailableBits + { + get + { + return bitsInBuffer_; + } + } + + /// + /// Gets the number of bytes available. + /// + /// + /// The number of bytes available. + /// + public int AvailableBytes + { + get + { + return windowEnd_ - windowStart_ + (bitsInBuffer_ >> 3); + } + } + + /// + /// Skips to the next byte boundary. + /// + public void SkipToByteBoundary() + { + buffer_ >>= (bitsInBuffer_ & 7); + bitsInBuffer_ &= ~7; + } + + /// + /// Returns true when SetInput can be called + /// + public bool IsNeedingInput + { + get + { + return windowStart_ == windowEnd_; + } + } + + /// + /// Copies bytes from input buffer to output buffer starting + /// at output[offset]. You have to make sure, that the buffer is + /// byte aligned. If not enough bytes are available, copies fewer + /// bytes. + /// + /// + /// The buffer to copy bytes to. + /// + /// + /// The offset in the buffer at which copying starts + /// + /// + /// The length to copy, 0 is allowed. + /// + /// + /// The number of bytes copied, 0 if no bytes were available. + /// + /// + /// Length is less than zero + /// + /// + /// Bit buffer isnt byte aligned + /// + public int CopyBytes(byte[] output, int offset, int length) + { + if (length < 0) + { + throw new ArgumentOutOfRangeException(nameof(length)); + } + + if ((bitsInBuffer_ & 7) != 0) + { + // bits_in_buffer may only be 0 or a multiple of 8 + throw new InvalidOperationException("Bit buffer is not byte aligned!"); + } + + int count = 0; + while ((bitsInBuffer_ > 0) && (length > 0)) + { + output[offset++] = (byte)buffer_; + buffer_ >>= 8; + bitsInBuffer_ -= 8; + length--; + count++; + } + + if (length == 0) + { + return count; + } + + int avail = windowEnd_ - windowStart_; + if (length > avail) + { + length = avail; + } + System.Array.Copy(window_, windowStart_, output, offset, length); + windowStart_ += length; + + if (((windowStart_ - windowEnd_) & 1) != 0) + { + // We always want an even number of bytes in input, see peekBits + buffer_ = (uint)(window_[windowStart_++] & 0xff); + bitsInBuffer_ = 8; + } + return count + length; + } + + /// + /// Resets state and empties internal buffers + /// + public void Reset() + { + buffer_ = 0; + windowStart_ = windowEnd_ = bitsInBuffer_ = 0; + } + + /// + /// Add more input for consumption. + /// Only call when IsNeedingInput returns true + /// + /// data to be input + /// offset of first byte of input + /// number of bytes of input to add. + public void SetInput(byte[] buffer, int offset, int count) + { + if (buffer == null) + { + throw new ArgumentNullException(nameof(buffer)); + } + + if (offset < 0) + { + throw new ArgumentOutOfRangeException(nameof(offset), "Cannot be negative"); + } + + if (count < 0) + { + throw new ArgumentOutOfRangeException(nameof(count), "Cannot be negative"); + } + + if (windowStart_ < windowEnd_) + { + throw new InvalidOperationException("Old input was not completely processed"); + } + + int end = offset + count; + + // We want to throw an ArrayIndexOutOfBoundsException early. + // Note the check also handles integer wrap around. + if ((offset > end) || (end > buffer.Length)) + { + throw new ArgumentOutOfRangeException(nameof(count)); + } + + if ((count & 1) != 0) + { + // We always want an even number of bytes in input, see PeekBits + buffer_ |= (uint)((buffer[offset++] & 0xff) << bitsInBuffer_); + bitsInBuffer_ += 8; + } + + window_ = buffer; + windowStart_ = offset; + windowEnd_ = end; + } + + #region Instance Fields + private byte[] window_; + private int windowStart_; + private int windowEnd_; + + private uint buffer_; + private int bitsInBuffer_; + #endregion + } +} diff --git a/UpdateLib/UpdateLib/UpdateLib.csproj b/UpdateLib/UpdateLib/UpdateLib.csproj index c5c2253..070a360 100644 --- a/UpdateLib/UpdateLib/UpdateLib.csproj +++ b/UpdateLib/UpdateLib/UpdateLib.csproj @@ -54,13 +54,34 @@ + + + + + + + + + + + + + + + + + + + + + UserControl @@ -201,9 +222,7 @@ UpdaterForm.cs
- - - + INIT_FINISHING_STATE ---. - * / | (2) (5) | - * / v (5) | - * (3)| SETDICT_STATE ---> SETDICT_FINISHING_STATE |(3) - * \ | (3) | ,--------' - * | | | (3) / - * v v (5) v v - * (1) -> BUSY_STATE ----> FINISHING_STATE - * | (6) - * v - * FINISHED_STATE - * \_____________________________________/ - * | (7) - * v - * CLOSED_STATE - * - * (1) If we should produce a header we start in INIT_STATE, otherwise - * we start in BUSY_STATE. - * (2) A dictionary may be set only when we are in INIT_STATE, then - * we change the state as indicated. - * (3) Whether a dictionary is set or not, on the first call of deflate - * we change to BUSY_STATE. - * (4) -- intentionally left blank -- :) - * (5) FINISHING_STATE is entered, when flush() is called to indicate that - * there is no more INPUT. There are also states indicating, that - * the header wasn't written yet. - * (6) FINISHED_STATE is entered, when everything has been flushed to the - * internal pending output buffer. - * (7) At any time (7) - * - */ - #endregion #region Public Constants /// /// The best and slowest compression level. This tries to find very @@ -112,42 +76,6 @@ public class Deflater /// There is no need to use this constant at all. /// public const int DEFLATED = 8; - #endregion - #region Public Enum - - /// - /// Compression Level as an enum for safer use - /// - public enum CompressionLevel - { - /// - /// The best and slowest compression level. This tries to find very - /// long and distant string repetitions. - /// - BEST_COMPRESSION = Deflater.BEST_COMPRESSION, - - /// - /// The worst but fastest compression level. - /// - BEST_SPEED = Deflater.BEST_SPEED, - - /// - /// The default compression level. - /// - DEFAULT_COMPRESSION = Deflater.DEFAULT_COMPRESSION, - - /// - /// This level won't compress at all but output uncompressed blocks. - /// - NO_COMPRESSION = Deflater.NO_COMPRESSION, - - /// - /// The compression method. This is the only method supported so far. - /// There is no need to use this constant at all. - /// - DEFLATED = Deflater.DEFLATED - } - #endregion #region Local Constants private const int IS_SETDICT = 0x01; @@ -173,19 +101,6 @@ public Deflater() : this(DEFAULT_COMPRESSION, false) } - /// - /// Creates a new deflater with given compression level. - /// - /// - /// the compression level, a value between NO_COMPRESSION - /// and BEST_COMPRESSION, or DEFAULT_COMPRESSION. - /// - /// if lvl is out of range. - public Deflater(int level) : this(level, false) - { - - } - /// /// Creates a new deflater with given compression level. /// @@ -228,17 +143,6 @@ public void Reset() engine.Reset(); } - /// - /// Gets the current adler checksum of the data that was processed so far. - /// - public int Adler - { - get - { - return engine.Adler; - } - } - /// /// Gets the number of input bytes processed so far. /// @@ -309,26 +213,6 @@ public bool IsNeedingInput } } - /// - /// Sets the data which should be compressed next. This should be only - /// called when needsInput indicates that more input is needed. - /// If you call setInput when needsInput() returns false, the - /// previous input that is still pending will be thrown away. - /// The given byte array should not be changed, before needsInput() returns - /// true again. - /// This call is equivalent to setInput(input, 0, input.length). - /// - /// - /// the buffer containing the input data. - /// - /// - /// if the buffer was finished() or ended(). - /// - public void SetInput(byte[] input) - { - SetInput(input, 0, input.Length); - } - /// /// Sets the data which should be compressed next. This should be /// only called when needsInput indicates that more input is needed. @@ -399,18 +283,6 @@ public void SetStrategy(DeflateStrategy strategy) engine.Strategy = strategy; } - /// - /// Deflates the current input block with to the given array. - /// - /// - /// The buffer where compressed data is stored - /// - /// - /// The number of compressed bytes added to the output, or 0 if either - /// IsNeedingInput() or IsFinished returns true or length is zero. - /// - public int Deflate(byte[] output) => Deflate(output, 0, output.Length); - /// /// Deflates the current input block to the given array. /// @@ -528,18 +400,6 @@ public int Deflate(byte[] output, int offset, int length) return origLength - length; } - /// - /// Sets the dictionary which should be used in the deflate process. - /// This call is equivalent to setDictionary(dict, 0, dict.Length). - /// - /// - /// the dictionary. - /// - /// - /// if SetInput () or Deflate () were already called or another dictionary was already set. - /// - public void SetDictionary(byte[] dictionary) => SetDictionary(dictionary, 0, dictionary.Length); - /// /// Sets the dictionary which should be used in the deflate process. /// The dictionary is a byte array containing strings that are diff --git a/UpdateLib/UpdateLib/Compression/GZip/GZip.cs b/UpdateLib/UpdateLib/Compression/GZip/GZip.cs index 46fd103..3af8332 100644 --- a/UpdateLib/UpdateLib/Compression/GZip/GZip.cs +++ b/UpdateLib/UpdateLib/Compression/GZip/GZip.cs @@ -41,7 +41,6 @@ namespace MatthiWare.UpdateLib.Compression.GZip { public static class GZip { - public static void Decompress(Stream inStream, Stream outStream) { if (inStream == null || outStream == null) diff --git a/UpdateLib/UpdateLib/Compression/VCDiff/VCDiffFormatException.cs b/UpdateLib/UpdateLib/Compression/VCDiff/VCDiffFormatException.cs index d87c4f1..02f9621 100644 --- a/UpdateLib/UpdateLib/Compression/VCDiff/VCDiffFormatException.cs +++ b/UpdateLib/UpdateLib/Compression/VCDiff/VCDiffFormatException.cs @@ -15,6 +15,7 @@ */ using System; +using System.Runtime.Serialization; namespace MatthiWare.UpdateLib.Compression.VCDiff { @@ -28,7 +29,7 @@ public VCDiffFormatException(string message) : base(message) { } public VCDiffFormatException(string message, Exception inner) : base(message, inner) { } protected VCDiffFormatException( - System.Runtime.Serialization.SerializationInfo info, - System.Runtime.Serialization.StreamingContext context) : base(info, context) { } + SerializationInfo info, + StreamingContext context) : base(info, context) { } } } diff --git a/UpdateLib/UpdateLib/Files/UpdateFile.cs b/UpdateLib/UpdateLib/Files/UpdateFile.cs index 5e65004..609e287 100644 --- a/UpdateLib/UpdateLib/Files/UpdateFile.cs +++ b/UpdateLib/UpdateLib/Files/UpdateFile.cs @@ -37,7 +37,9 @@ public class UpdateFile [XmlAttribute] public string ApplicationName { get; set; } = "UpdateLib"; - public List Updates { get; private set; } = new List(); + public List DownloadURIs { get; } = new List(); + + public List Updates { get; } = new List(); public UpdateFile() { @@ -45,7 +47,7 @@ public UpdateFile() } public UpdateInfo GetLatestUpdate() - => Updates.Maxx(u => u.Version); + => Updates.MaxOrDefault(u => u.Version); /// /// Saves the current to the output diff --git a/UpdateLib/UpdateLib/Tasks/CheckForUpdatesTask.cs b/UpdateLib/UpdateLib/Tasks/CheckForUpdatesTask.cs index fe2248a..540d656 100644 --- a/UpdateLib/UpdateLib/Tasks/CheckForUpdatesTask.cs +++ b/UpdateLib/UpdateLib/Tasks/CheckForUpdatesTask.cs @@ -22,28 +22,24 @@ using MatthiWare.UpdateLib.Utils; using static MatthiWare.UpdateLib.Tasks.CheckForUpdatesTask; using MatthiWare.UpdateLib.Common; +using System.Collections.Generic; namespace MatthiWare.UpdateLib.Tasks { public class CheckForUpdatesTask : AsyncTask { - public string Url { get; set; } + private IList m_uris; - private WebClient wcDownloader; + private WebClient m_wc; - public CheckForUpdatesTask(string url) + public CheckForUpdatesTask(IList uris) { - if (string.IsNullOrEmpty(url)) throw new ArgumentNullException(nameof(url)); - - Url = url; - - wcDownloader = new WebClient(); + m_uris = uris; + m_wc = new WebClient(); } protected override void DoWork() { - if (string.IsNullOrEmpty(Url)) throw new WebException("Invalid Url", WebExceptionStatus.NameResolutionFailure); - Result = new CheckForUpdatesResult(); Updater updater = Updater.Instance; @@ -59,7 +55,7 @@ protected override void DoWork() if (IsUpdateFileInvalid(localFile)) { updater.Logger.Warn(nameof(CheckForUpdatesTask), nameof(DoWork), "Cached update file validity expired, downloading new one.."); - wcDownloader.DownloadFile(Url, localFile); + m_wc.DownloadFile(Url, localFile); } // load the updatefile from disk diff --git a/UpdateLib/UpdateLib/Updater.cs b/UpdateLib/UpdateLib/Updater.cs index fb16621..f37f70e 100644 --- a/UpdateLib/UpdateLib/Updater.cs +++ b/UpdateLib/UpdateLib/Updater.cs @@ -61,8 +61,6 @@ public static Updater Instance #region Fields private const string m_strUpdateLib = "UpdateLib"; - - private string m_updateUrl = string.Empty; private const string m_argUpdateSilent = "silent"; private const string m_argUpdate = "update"; private const string m_argWait = "wait"; @@ -105,21 +103,16 @@ public static Updater Instance internal static string UpdaterName { get { return m_lazyUpdaterName.Value; } } + /// + /// Gets the command line parser. Use this to add additional command line arguments that need to be parsed. + /// public CmdLineParser CommandLine { get; } = new CmdLineParser(); /// - /// Gets or sets the url to update from + /// Gets the collection of Uri's to update from /// /// If you want to specify an unsafe connection you should enable - public string UpdateURL - { - get { return m_updateUrl; } - set - { - m_updateUrl = value; - RemoteBasePath = IOUtils.GetRemoteBasePath(value); - } - } + public IList UpdateURIs { get; } = new List(); /// /// Gets the logger for the application. @@ -308,11 +301,11 @@ public Updater ConfigureInstallationMode(InstallationMode mode) /// Configures the update url /// /// To use HTTP you should enable - /// Url to update from + /// Uri to update from /// - public Updater ConfigureUpdateUrl(string url) + public Updater ConfigureAddUpdateUri(Uri uri) { - UpdateURL = url; + UpdateURIs.Add(uri); return this; } @@ -340,7 +333,6 @@ public void Initialize() // parse the command line CommandLine.Parse(); - WaitForProcessExit = CommandLine[m_argWait]?.IsFound ?? false; StartUpdating = CommandLine[m_argUpdate]?.IsFound ?? false; UpdateSilently = CommandLine[m_argUpdateSilent]?.IsFound ?? false; @@ -373,13 +365,10 @@ private void StartInitializationTasks() /// Process ID private void WaitForProcessToExit(int pid) { - Process[] processes = Process.GetProcesses(); - Process toWatch = processes.FirstOrDefault(p => p.Id == pid); + var process = Process.GetProcesses().FirstOrDefault(p => p.Id == pid); - if (toWatch == null) return; - - toWatch.CloseMainWindow(); - toWatch.WaitForExit(); + process?.CloseMainWindow(); + process?.WaitForExit(); } /// @@ -387,9 +376,7 @@ private void WaitForProcessToExit(int pid) /// /// Whether or not there is an update available and the latest version public CheckForUpdatesTask.CheckForUpdatesResult CheckForUpdates() - { - return CheckForUpdatesAsync().AwaitTask().Result; - } + => CheckForUpdatesAsync().AwaitTask().Result; /// /// Starting the update process @@ -397,18 +384,14 @@ public CheckForUpdatesTask.CheckForUpdatesResult CheckForUpdates() /// The owner window /// Whether or not there is an update available and the latest version public CheckForUpdatesTask.CheckForUpdatesResult CheckForUpdates(IWin32Window owner) - { - return CheckForUpdatesAsync(owner).AwaitTask().Result; - } + => CheckForUpdatesAsync(owner).AwaitTask().Result; /// /// Start the update process asynchronously /// /// The update checker task. public CheckForUpdatesTask CheckForUpdatesAsync() - { - return CheckForUpdatesAsync(null); - } + => CheckForUpdatesAsync(null); /// /// Start the update process asynchronously @@ -418,15 +401,22 @@ public CheckForUpdatesTask CheckForUpdatesAsync() public CheckForUpdatesTask CheckForUpdatesAsync(IWin32Window owner) { if (!IsInitialized) - throw new InvalidOperationException("The updater needs to be initialized first."); + throw new InvalidOperationException("The updater needs to be initialized first"); + + if (UpdateURIs.Count == 0) + throw new ArgumentException("No uri's specified", nameof(UpdateURIs)); + + IEnumerable uris = UpdateURIs.AsEnumerable(); - if (string.IsNullOrEmpty(UpdateURL)) - throw new ArgumentException("You need to specifify an update url", nameof(UpdateURL)); + if (!AllowUnsafeConnection) + { + uris = uris.Where(u => u.Scheme == Uri.UriSchemeHttps); - if (!AllowUnsafeConnection && new Uri(UpdateURL).Scheme != Uri.UriSchemeHttps) - throw new SecurityException("Using unsafe connections to update from is not allowed"); + if (uris.Count() == 0) + throw new SecurityException("Using unsafe connections to update from is not allowed"); + } - CheckForUpdatesTask task = new CheckForUpdatesTask(UpdateURL); + CheckForUpdatesTask task = new CheckForUpdatesTask(uris.ToList()); task.TaskCompleted += (o, e) => { bool error = e.Error != null; @@ -461,10 +451,10 @@ public CheckForUpdatesTask CheckForUpdatesAsync(IWin32Window owner) if (result != DialogResult.Yes) return; - if ((!StartUpdating && NeedsRestartBeforeUpdate) + if (((!StartUpdating && NeedsRestartBeforeUpdate) || (adminReq && !PermissionUtil.IsProcessElevated)) - if (!RestartApp(true, UpdateSilently, true, adminReq)) - return; + && !RestartApp(true, UpdateSilently, true, adminReq)) + return; if (UpdateSilently) UpdateWithoutGUI(task.Result.UpdateInfo); @@ -473,9 +463,6 @@ public CheckForUpdatesTask CheckForUpdatesAsync(IWin32Window owner) UpdaterForm updateForm = new UpdaterForm(task.Result.UpdateInfo); updateForm.ShowDialog(owner); } - - - }; return (CheckForUpdatesTask)task.Start(); diff --git a/UpdateLib/UpdateLib/Utils/ExtensionMethods.cs b/UpdateLib/UpdateLib/Utils/ExtensionMethods.cs index 4995de9..bfa7d66 100644 --- a/UpdateLib/UpdateLib/Utils/ExtensionMethods.cs +++ b/UpdateLib/UpdateLib/Utils/ExtensionMethods.cs @@ -43,12 +43,12 @@ public static string AppendAll(this IEnumerable collection, string seperat } [DebuggerStepThrough] - public static T Maxx(this IEnumerable collection, Func resolve) where K : IComparable + public static T MaxOrDefault(this IEnumerable collection, Func resolve) where K : IComparable { using (var enumerator = collection.GetEnumerator()) { T max = default(T); - + while (enumerator.MoveNext()) { T other = enumerator.Current; From 79636282b30246b44e77964d6770ebe662fb789e Mon Sep 17 00:00:00 2001 From: Matthias Beerens Date: Sun, 17 Dec 2017 15:44:41 +0100 Subject: [PATCH 23/40] Add progress reporting functionality --- .../UpdateLib/Compression/VCDiff/VCDiffDecoder.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/UpdateLib/UpdateLib/Compression/VCDiff/VCDiffDecoder.cs b/UpdateLib/UpdateLib/Compression/VCDiff/VCDiffDecoder.cs index f788e14..481fed7 100644 --- a/UpdateLib/UpdateLib/Compression/VCDiff/VCDiffDecoder.cs +++ b/UpdateLib/UpdateLib/Compression/VCDiff/VCDiffDecoder.cs @@ -24,12 +24,16 @@ namespace MatthiWare.UpdateLib.Compression.VCDiff public sealed class VCDiffDecoder { + public delegate void ProgressChangedHandler(bool completed, double progress); + private Stream m_original, m_delta, m_output; private CodeTable m_codeTable = CodeTable.Default; private AddressCache m_cache = new AddressCache(4, 3); + public event ProgressChangedHandler ProgressChanged; + private VCDiffDecoder(Stream original, Stream delta, Stream output) { m_original = original; @@ -59,11 +63,20 @@ public static void Decode(Stream original, Stream delta, Stream output) private void Decode() { ReadHeader(); + + while (DecodeWindow()) + OnProgressChanged(false, (m_delta.Position * 1.0) / m_delta.Length); + + OnProgressChanged(true, 1); } + private void OnProgressChanged(bool completed, double progress) + => ProgressChanged?.Invoke(completed, progress); + private void ReadHeader() { byte[] header = m_delta.CheckedReadBytes(4); + if (header[0] != 0xd6 || header[1] != 0xc3 || header[2] != 0xc4) From 208ecae7e6df0d570fd11bfd163588f5f2ab3020 Mon Sep 17 00:00:00 2001 From: Matthias Beerens Date: Sun, 17 Dec 2017 15:44:52 +0100 Subject: [PATCH 24/40] Change namespace --- .../Compression/{ => Deflaters}/Deflater.cs | 2 +- .../{ => Deflaters}/DeflaterConstants.cs | 2 +- .../{ => Deflaters}/DeflaterEngine.cs | 2 +- .../{ => Deflaters}/DeflaterHuffman.cs | 2 +- .../{ => Deflaters}/DeflaterPending.cs | 2 +- .../Compression/{ => Deflaters}/Inflater.cs | 2 +- .../{ => Deflaters}/InflaterDynHeader.cs | 2 +- .../{ => Deflaters}/InflaterHuffmanTree.cs | 2 +- .../{ => Deflaters}/PendingBuffer.cs | 2 +- .../Compression/GZip/GZipInputStream.cs | 1 + .../Compression/GZip/GZipOutputStream.cs | 1 + .../Streams/DeflaterOutputStream.cs | 1 + .../Compression/Streams/InflaterInputStream.cs | 1 + .../Compression/Zip/ZipInputStream.cs | 1 + .../Compression/Zip/ZipOutputStream.cs | 1 + UpdateLib/UpdateLib/UpdateLib.csproj | 18 +++++++++--------- 16 files changed, 24 insertions(+), 18 deletions(-) rename UpdateLib/UpdateLib/Compression/{ => Deflaters}/Deflater.cs (99%) rename UpdateLib/UpdateLib/Compression/{ => Deflaters}/DeflaterConstants.cs (99%) rename UpdateLib/UpdateLib/Compression/{ => Deflaters}/DeflaterEngine.cs (99%) rename UpdateLib/UpdateLib/Compression/{ => Deflaters}/DeflaterHuffman.cs (99%) rename UpdateLib/UpdateLib/Compression/{ => Deflaters}/DeflaterPending.cs (97%) rename UpdateLib/UpdateLib/Compression/{ => Deflaters}/Inflater.cs (99%) rename UpdateLib/UpdateLib/Compression/{ => Deflaters}/InflaterDynHeader.cs (99%) rename UpdateLib/UpdateLib/Compression/{ => Deflaters}/InflaterHuffmanTree.cs (99%) rename UpdateLib/UpdateLib/Compression/{ => Deflaters}/PendingBuffer.cs (99%) diff --git a/UpdateLib/UpdateLib/Compression/Deflater.cs b/UpdateLib/UpdateLib/Compression/Deflaters/Deflater.cs similarity index 99% rename from UpdateLib/UpdateLib/Compression/Deflater.cs rename to UpdateLib/UpdateLib/Compression/Deflaters/Deflater.cs index 7710e6f..17feee8 100644 --- a/UpdateLib/UpdateLib/Compression/Deflater.cs +++ b/UpdateLib/UpdateLib/Compression/Deflaters/Deflater.cs @@ -35,7 +35,7 @@ using System; -namespace MatthiWare.UpdateLib.Compression +namespace MatthiWare.UpdateLib.Compression.Deflaters { /// /// This is the Deflater class. The deflater class compresses input diff --git a/UpdateLib/UpdateLib/Compression/DeflaterConstants.cs b/UpdateLib/UpdateLib/Compression/Deflaters/DeflaterConstants.cs similarity index 99% rename from UpdateLib/UpdateLib/Compression/DeflaterConstants.cs rename to UpdateLib/UpdateLib/Compression/Deflaters/DeflaterConstants.cs index 73c6c8a..965c189 100644 --- a/UpdateLib/UpdateLib/Compression/DeflaterConstants.cs +++ b/UpdateLib/UpdateLib/Compression/Deflaters/DeflaterConstants.cs @@ -35,7 +35,7 @@ using System; -namespace MatthiWare.UpdateLib.Compression +namespace MatthiWare.UpdateLib.Compression.Deflaters { /// /// This class contains constants used for deflation. diff --git a/UpdateLib/UpdateLib/Compression/DeflaterEngine.cs b/UpdateLib/UpdateLib/Compression/Deflaters/DeflaterEngine.cs similarity index 99% rename from UpdateLib/UpdateLib/Compression/DeflaterEngine.cs rename to UpdateLib/UpdateLib/Compression/Deflaters/DeflaterEngine.cs index a82d7da..63f5010 100644 --- a/UpdateLib/UpdateLib/Compression/DeflaterEngine.cs +++ b/UpdateLib/UpdateLib/Compression/Deflaters/DeflaterEngine.cs @@ -36,7 +36,7 @@ using MatthiWare.UpdateLib.Compression.Checksum; using System; -namespace MatthiWare.UpdateLib.Compression +namespace MatthiWare.UpdateLib.Compression.Deflaters { /// /// Strategies for deflater diff --git a/UpdateLib/UpdateLib/Compression/DeflaterHuffman.cs b/UpdateLib/UpdateLib/Compression/Deflaters/DeflaterHuffman.cs similarity index 99% rename from UpdateLib/UpdateLib/Compression/DeflaterHuffman.cs rename to UpdateLib/UpdateLib/Compression/Deflaters/DeflaterHuffman.cs index 043d4ed..41d8c2a 100644 --- a/UpdateLib/UpdateLib/Compression/DeflaterHuffman.cs +++ b/UpdateLib/UpdateLib/Compression/Deflaters/DeflaterHuffman.cs @@ -35,7 +35,7 @@ using System; -namespace MatthiWare.UpdateLib.Compression +namespace MatthiWare.UpdateLib.Compression.Deflaters { /// /// This is the DeflaterHuffman class. diff --git a/UpdateLib/UpdateLib/Compression/DeflaterPending.cs b/UpdateLib/UpdateLib/Compression/Deflaters/DeflaterPending.cs similarity index 97% rename from UpdateLib/UpdateLib/Compression/DeflaterPending.cs rename to UpdateLib/UpdateLib/Compression/Deflaters/DeflaterPending.cs index e9d9c60..6376660 100644 --- a/UpdateLib/UpdateLib/Compression/DeflaterPending.cs +++ b/UpdateLib/UpdateLib/Compression/Deflaters/DeflaterPending.cs @@ -34,7 +34,7 @@ */ -namespace MatthiWare.UpdateLib.Compression +namespace MatthiWare.UpdateLib.Compression.Deflaters { /// /// This class stores the pending output of the Deflater. diff --git a/UpdateLib/UpdateLib/Compression/Inflater.cs b/UpdateLib/UpdateLib/Compression/Deflaters/Inflater.cs similarity index 99% rename from UpdateLib/UpdateLib/Compression/Inflater.cs rename to UpdateLib/UpdateLib/Compression/Deflaters/Inflater.cs index 7ed96ec..df7df7d 100644 --- a/UpdateLib/UpdateLib/Compression/Inflater.cs +++ b/UpdateLib/UpdateLib/Compression/Deflaters/Inflater.cs @@ -37,7 +37,7 @@ using MatthiWare.UpdateLib.Compression.Streams; using System; -namespace MatthiWare.UpdateLib.Compression +namespace MatthiWare.UpdateLib.Compression.Deflaters { /// /// Inflater is used to decompress data that has been compressed according diff --git a/UpdateLib/UpdateLib/Compression/InflaterDynHeader.cs b/UpdateLib/UpdateLib/Compression/Deflaters/InflaterDynHeader.cs similarity index 99% rename from UpdateLib/UpdateLib/Compression/InflaterDynHeader.cs rename to UpdateLib/UpdateLib/Compression/Deflaters/InflaterDynHeader.cs index 6379a9f..d115e8f 100644 --- a/UpdateLib/UpdateLib/Compression/InflaterDynHeader.cs +++ b/UpdateLib/UpdateLib/Compression/Deflaters/InflaterDynHeader.cs @@ -36,7 +36,7 @@ using MatthiWare.UpdateLib.Compression.Streams; using System; -namespace MatthiWare.UpdateLib.Compression +namespace MatthiWare.UpdateLib.Compression.Deflaters { public class InflaterDynHeader { diff --git a/UpdateLib/UpdateLib/Compression/InflaterHuffmanTree.cs b/UpdateLib/UpdateLib/Compression/Deflaters/InflaterHuffmanTree.cs similarity index 99% rename from UpdateLib/UpdateLib/Compression/InflaterHuffmanTree.cs rename to UpdateLib/UpdateLib/Compression/Deflaters/InflaterHuffmanTree.cs index e6961f4..c1e838d 100644 --- a/UpdateLib/UpdateLib/Compression/InflaterHuffmanTree.cs +++ b/UpdateLib/UpdateLib/Compression/Deflaters/InflaterHuffmanTree.cs @@ -36,7 +36,7 @@ using MatthiWare.UpdateLib.Compression.Streams; using System; -namespace MatthiWare.UpdateLib.Compression +namespace MatthiWare.UpdateLib.Compression.Deflaters { /// /// Huffman tree used for inflation diff --git a/UpdateLib/UpdateLib/Compression/PendingBuffer.cs b/UpdateLib/UpdateLib/Compression/Deflaters/PendingBuffer.cs similarity index 99% rename from UpdateLib/UpdateLib/Compression/PendingBuffer.cs rename to UpdateLib/UpdateLib/Compression/Deflaters/PendingBuffer.cs index d500689..30c15a3 100644 --- a/UpdateLib/UpdateLib/Compression/PendingBuffer.cs +++ b/UpdateLib/UpdateLib/Compression/Deflaters/PendingBuffer.cs @@ -36,7 +36,7 @@ using System; -namespace MatthiWare.UpdateLib.Compression +namespace MatthiWare.UpdateLib.Compression.Deflaters { /// /// This class is general purpose class for writing data to a buffer. diff --git a/UpdateLib/UpdateLib/Compression/GZip/GZipInputStream.cs b/UpdateLib/UpdateLib/Compression/GZip/GZipInputStream.cs index c9b0c74..f2e03b2 100644 --- a/UpdateLib/UpdateLib/Compression/GZip/GZipInputStream.cs +++ b/UpdateLib/UpdateLib/Compression/GZip/GZipInputStream.cs @@ -34,6 +34,7 @@ */ using MatthiWare.UpdateLib.Compression.Checksum; +using MatthiWare.UpdateLib.Compression.Deflaters; using MatthiWare.UpdateLib.Compression.Streams; using System; using System.IO; diff --git a/UpdateLib/UpdateLib/Compression/GZip/GZipOutputStream.cs b/UpdateLib/UpdateLib/Compression/GZip/GZipOutputStream.cs index 8b90e40..825e70f 100644 --- a/UpdateLib/UpdateLib/Compression/GZip/GZipOutputStream.cs +++ b/UpdateLib/UpdateLib/Compression/GZip/GZipOutputStream.cs @@ -34,6 +34,7 @@ */ using MatthiWare.UpdateLib.Compression.Checksum; +using MatthiWare.UpdateLib.Compression.Deflaters; using MatthiWare.UpdateLib.Compression.Streams; using System; using System.IO; diff --git a/UpdateLib/UpdateLib/Compression/Streams/DeflaterOutputStream.cs b/UpdateLib/UpdateLib/Compression/Streams/DeflaterOutputStream.cs index 183276c..4e814c2 100644 --- a/UpdateLib/UpdateLib/Compression/Streams/DeflaterOutputStream.cs +++ b/UpdateLib/UpdateLib/Compression/Streams/DeflaterOutputStream.cs @@ -33,6 +33,7 @@ * DEALINGS IN THE SOFTWARE. */ +using MatthiWare.UpdateLib.Compression.Deflaters; using System; using System.IO; using System.Security.Cryptography; diff --git a/UpdateLib/UpdateLib/Compression/Streams/InflaterInputStream.cs b/UpdateLib/UpdateLib/Compression/Streams/InflaterInputStream.cs index 8486dac..187212f 100644 --- a/UpdateLib/UpdateLib/Compression/Streams/InflaterInputStream.cs +++ b/UpdateLib/UpdateLib/Compression/Streams/InflaterInputStream.cs @@ -33,6 +33,7 @@ * DEALINGS IN THE SOFTWARE. */ +using MatthiWare.UpdateLib.Compression.Deflaters; using System; using System.IO; diff --git a/UpdateLib/UpdateLib/Compression/Zip/ZipInputStream.cs b/UpdateLib/UpdateLib/Compression/Zip/ZipInputStream.cs index 931cd97..f3c925b 100644 --- a/UpdateLib/UpdateLib/Compression/Zip/ZipInputStream.cs +++ b/UpdateLib/UpdateLib/Compression/Zip/ZipInputStream.cs @@ -34,6 +34,7 @@ */ using MatthiWare.UpdateLib.Compression.Checksum; +using MatthiWare.UpdateLib.Compression.Deflaters; using MatthiWare.UpdateLib.Compression.Streams; using System; using System.IO; diff --git a/UpdateLib/UpdateLib/Compression/Zip/ZipOutputStream.cs b/UpdateLib/UpdateLib/Compression/Zip/ZipOutputStream.cs index 97deaff..3ca7c4c 100644 --- a/UpdateLib/UpdateLib/Compression/Zip/ZipOutputStream.cs +++ b/UpdateLib/UpdateLib/Compression/Zip/ZipOutputStream.cs @@ -34,6 +34,7 @@ */ using MatthiWare.UpdateLib.Compression.Checksum; +using MatthiWare.UpdateLib.Compression.Deflaters; using MatthiWare.UpdateLib.Compression.Streams; using System; using System.Collections.Generic; diff --git a/UpdateLib/UpdateLib/UpdateLib.csproj b/UpdateLib/UpdateLib/UpdateLib.csproj index 0ecee40..0b880ee 100644 --- a/UpdateLib/UpdateLib/UpdateLib.csproj +++ b/UpdateLib/UpdateLib/UpdateLib.csproj @@ -57,20 +57,20 @@ - - - - - + + + + + - - - - + + + + From 8878738432f9247a2f7cce27dc7fa320264bd990 Mon Sep 17 00:00:00 2001 From: Matthias Beerens Date: Tue, 26 Dec 2017 13:37:52 +0100 Subject: [PATCH 25/40] Add SharedAssemblyInfo --- UpdateLib/.shared/SharedAssemblyInfo.cs | 11 +++++++ UpdateLib/TestApp/Properties/AssemblyInfo.cs | 30 +------------------ UpdateLib/TestApp/TestApp.csproj | 3 ++ .../Properties/AssemblyInfo.cs | 30 +------------------ .../UpdateLib.Generator.csproj | 3 ++ .../Properties/AssemblyInfo.cs | 30 +------------------ .../UpdateLib/Properties/AssemblyInfo.cs | 28 ----------------- 7 files changed, 20 insertions(+), 115 deletions(-) create mode 100644 UpdateLib/.shared/SharedAssemblyInfo.cs diff --git a/UpdateLib/.shared/SharedAssemblyInfo.cs b/UpdateLib/.shared/SharedAssemblyInfo.cs new file mode 100644 index 0000000..fb349eb --- /dev/null +++ b/UpdateLib/.shared/SharedAssemblyInfo.cs @@ -0,0 +1,11 @@ +using System.Reflection; +using System.Runtime.InteropServices; + +[assembly: AssemblyCompany("MatthiWare")] +[assembly: AssemblyProduct("UpdateLib")] +[assembly: AssemblyCopyright("Copyright © MatthiWare 2016")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] +[assembly: ComVisible(false)] +[assembly: AssemblyVersion("0.5.0.0")] +[assembly: AssemblyFileVersion("0.5.0.0")] diff --git a/UpdateLib/TestApp/Properties/AssemblyInfo.cs b/UpdateLib/TestApp/Properties/AssemblyInfo.cs index 3138a30..b6a84c7 100644 --- a/UpdateLib/TestApp/Properties/AssemblyInfo.cs +++ b/UpdateLib/TestApp/Properties/AssemblyInfo.cs @@ -1,35 +1,7 @@ using System.Reflection; -using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("TestApp")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("TestApp")] -[assembly: AssemblyCopyright("Copyright © 2017")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("7c3c0345-6d01-40a6-9f01-60d8d6451fb1")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.4.3.0")] -[assembly: AssemblyFileVersion("0.4.3.0")] +[assembly: AssemblyDescription("Test App for UpdateLib")] diff --git a/UpdateLib/TestApp/TestApp.csproj b/UpdateLib/TestApp/TestApp.csproj index 91f86a9..7ebd714 100644 --- a/UpdateLib/TestApp/TestApp.csproj +++ b/UpdateLib/TestApp/TestApp.csproj @@ -53,6 +53,9 @@ + + Properties\SharedAssemblyInfo.cs + Form diff --git a/UpdateLib/UpdateLib.Generator/Properties/AssemblyInfo.cs b/UpdateLib/UpdateLib.Generator/Properties/AssemblyInfo.cs index dab727a..d459ada 100644 --- a/UpdateLib/UpdateLib.Generator/Properties/AssemblyInfo.cs +++ b/UpdateLib/UpdateLib.Generator/Properties/AssemblyInfo.cs @@ -1,35 +1,7 @@ using System.Reflection; -using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("UpdateLib Generator")] -[assembly: AssemblyDescription("Update Generator")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("MatthiWare")] -[assembly: AssemblyProduct("UpdateLib")] -[assembly: AssemblyCopyright("Copyright © MatthiWare 2017")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("5194ff71-49f6-4adb-9b0e-4beb418dc6f3")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyDescription("Update Generator for UpdateLib")] diff --git a/UpdateLib/UpdateLib.Generator/UpdateLib.Generator.csproj b/UpdateLib/UpdateLib.Generator/UpdateLib.Generator.csproj index 15f5262..6f6d44d 100644 --- a/UpdateLib/UpdateLib.Generator/UpdateLib.Generator.csproj +++ b/UpdateLib/UpdateLib.Generator/UpdateLib.Generator.csproj @@ -49,6 +49,9 @@ + + Properties\SharedAssemblyInfo.cs + diff --git a/UpdateLib/UpdateLib.Tests/Properties/AssemblyInfo.cs b/UpdateLib/UpdateLib.Tests/Properties/AssemblyInfo.cs index 7b0c098..3388a78 100644 --- a/UpdateLib/UpdateLib.Tests/Properties/AssemblyInfo.cs +++ b/UpdateLib/UpdateLib.Tests/Properties/AssemblyInfo.cs @@ -1,35 +1,7 @@ using System.Reflection; -using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("UpdateLib.Tests")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("UpdateLib.Tests")] -[assembly: AssemblyCopyright("Copyright © 2017")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("c47b8cc3-abab-4f56-8ca2-1323f902d1c3")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyDescription("Unit Tests For UpdateLib")] diff --git a/UpdateLib/UpdateLib/Properties/AssemblyInfo.cs b/UpdateLib/UpdateLib/Properties/AssemblyInfo.cs index 279a776..019f700 100644 --- a/UpdateLib/UpdateLib/Properties/AssemblyInfo.cs +++ b/UpdateLib/UpdateLib/Properties/AssemblyInfo.cs @@ -1,35 +1,7 @@ using System.Reflection; -using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("UpdateLib")] [assembly: AssemblyDescription("Auto Update Library")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("MatthiWare")] -[assembly: AssemblyProduct("UpdateLib")] -[assembly: AssemblyCopyright("Copyright © MatthiWare 2016")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("4394be57-95e2-45b1-a968-1404b0590b35")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.4.3.0")] -[assembly: AssemblyFileVersion("0.4.3.0")] From 4dc304d781badfdb238722c47250839dd6b0523a Mon Sep 17 00:00:00 2001 From: Matthias Beerens Date: Tue, 26 Dec 2017 13:38:01 +0100 Subject: [PATCH 26/40] Rework AsyncTask generic methods Reorganizing files/namespaces --- .../UpdateLib.Tests/Files/UpdateFileTest.cs | 11 +- .../UpdateLib.Tests/UpdateLib.Tests.csproj | 3 + UpdateLib/UpdateLib.sln | 12 +- .../Common/{ => Abstraction}/EntryBase.cs | 2 +- .../UpdateLib/Common/Abstraction/FileBase.cs | 106 ++++++++++++++ UpdateLib/UpdateLib/Common/Delegates.cs | 9 ++ UpdateLib/UpdateLib/Common/DirectoryEntry.cs | 1 + .../Exceptions}/InvalidHashException.cs | 2 +- .../Common/Exceptions/NoInternetException.cs | 38 +++++ .../Exceptions/NoVersionSpecifiedException.cs | 40 +++++ UpdateLib/UpdateLib/Common/FileEntry.cs | 3 +- UpdateLib/UpdateLib/Common/FileManager.cs | 41 ++++++ UpdateLib/UpdateLib/Common/Interfaces.cs | 19 +++ .../UpdateLib/Common/RegistryKeyEntry.cs | 1 + .../Compression/GZip/GZipInputStream.cs | 8 +- .../UpdateLib/Compression/PatchBuilder.cs | 23 +++ UpdateLib/UpdateLib/Compression/Patcher.cs | 37 +++++ .../Streams/InflaterInputStream.cs | 26 ++-- .../Compression/VCDiff/VCDiffDecoder.cs | 19 +-- .../Compression/Zip/ZipInputStream.cs | 29 ++-- UpdateLib/UpdateLib/Files/HashCacheFile.cs | 56 +------ UpdateLib/UpdateLib/Files/ServerFile.cs | 39 +++++ UpdateLib/UpdateLib/Files/UpdateFile.cs | 111 +++----------- UpdateLib/UpdateLib/Tasks/AsyncTask.cs | 126 +++++++++------- UpdateLib/UpdateLib/Tasks/AsyncTaskFactory.cs | 71 ++++++--- .../Tasks/CheckForUpdatedItemsTask.cs | 25 ++-- .../CheckForUpdatesCompletedEventArgs.cs | 13 +- .../UpdateLib/Tasks/CheckForUpdatesTask.cs | 71 ++++----- .../Tasks/CheckRequiredPrivilegesTask.cs | 15 +- UpdateLib/UpdateLib/Tasks/CleanUpTask.cs | 17 ++- UpdateLib/UpdateLib/Tasks/DownloadManager.cs | 15 +- UpdateLib/UpdateLib/Tasks/DownloadTask.cs | 25 +++- UpdateLib/UpdateLib/Tasks/UpdatableTask.cs | 13 +- UpdateLib/UpdateLib/Tasks/UpdateCacheTask.cs | 19 ++- .../Tasks/UpdateFileProcessorTask.cs | 61 -------- .../UpdateLib/Tasks/UpdateRegistryTask.cs | 33 +++-- .../UpdateLib/UI/Components/FinishPage.cs | 11 +- .../UpdateLib/UI/UpdaterForm.Designer.cs | 2 +- UpdateLib/UpdateLib/UI/UpdaterForm.cs | 2 +- UpdateLib/UpdateLib/UpdateLib.csproj | 17 ++- UpdateLib/UpdateLib/Updater.cs | 138 +++++++++--------- 41 files changed, 795 insertions(+), 515 deletions(-) rename UpdateLib/UpdateLib/Common/{ => Abstraction}/EntryBase.cs (97%) create mode 100644 UpdateLib/UpdateLib/Common/Abstraction/FileBase.cs create mode 100644 UpdateLib/UpdateLib/Common/Delegates.cs rename UpdateLib/UpdateLib/{Security => Common/Exceptions}/InvalidHashException.cs (96%) create mode 100644 UpdateLib/UpdateLib/Common/Exceptions/NoInternetException.cs create mode 100644 UpdateLib/UpdateLib/Common/Exceptions/NoVersionSpecifiedException.cs create mode 100644 UpdateLib/UpdateLib/Common/FileManager.cs create mode 100644 UpdateLib/UpdateLib/Common/Interfaces.cs create mode 100644 UpdateLib/UpdateLib/Compression/PatchBuilder.cs create mode 100644 UpdateLib/UpdateLib/Compression/Patcher.cs create mode 100644 UpdateLib/UpdateLib/Files/ServerFile.cs delete mode 100644 UpdateLib/UpdateLib/Tasks/UpdateFileProcessorTask.cs diff --git a/UpdateLib/UpdateLib.Tests/Files/UpdateFileTest.cs b/UpdateLib/UpdateLib.Tests/Files/UpdateFileTest.cs index e7a1d7b..c8a160e 100644 --- a/UpdateLib/UpdateLib.Tests/Files/UpdateFileTest.cs +++ b/UpdateLib/UpdateLib.Tests/Files/UpdateFileTest.cs @@ -18,6 +18,7 @@ using System; using System.IO; using MatthiWare.UpdateLib.Common; +using MatthiWare.UpdateLib.Common.Abstraction; using MatthiWare.UpdateLib.Files; using Moq; using NUnit.Framework; @@ -41,7 +42,7 @@ public void SaveAndLoadUpdateFileShouldBeTheSame() UpdateInfo info = file.GetLatestUpdate(); file.Save(temp_file); - UpdateFile updateFile = UpdateFile.Load(temp_file); + UpdateFile updateFile = FileManager.LoadFile(temp_file); UpdateInfo updateInfo = updateFile.GetLatestUpdate(); Assert.AreEqual(file.ApplicationName, updateFile.ApplicationName); @@ -70,17 +71,17 @@ public void LoadInvalidParameterShouldThrowExceptions() { Stream nullStream = null; - Assert.Catch(() => { UpdateFile.Load(nullStream); }); - Assert.Catch(() => { UpdateFile.Load(string.Empty); }); + Assert.Catch(() => { FileManager.LoadFile(nullStream); }); + Assert.Catch(() => { FileManager.LoadFile(string.Empty); }); CleanUp(); - Assert.Catch(() => { UpdateFile.Load(temp_file); }); + Assert.Catch(() => { FileManager.LoadFile(temp_file); }); Mock unreadableStream = new Mock(); unreadableStream.SetupGet(s => s.CanRead).Returns(false); - Assert.Catch(() => { UpdateFile.Load(unreadableStream.Object); }); + Assert.Catch(() => { FileManager.LoadFile(unreadableStream.Object); }); } private UpdateFile MakeUpdateFile() diff --git a/UpdateLib/UpdateLib.Tests/UpdateLib.Tests.csproj b/UpdateLib/UpdateLib.Tests/UpdateLib.Tests.csproj index 72e9c81..45d9276 100644 --- a/UpdateLib/UpdateLib.Tests/UpdateLib.Tests.csproj +++ b/UpdateLib/UpdateLib.Tests/UpdateLib.Tests.csproj @@ -54,6 +54,9 @@ + + Properties\SharedAssemblyInfo.cs + diff --git a/UpdateLib/UpdateLib.sln b/UpdateLib/UpdateLib.sln index 135c16a..2957dee 100644 --- a/UpdateLib/UpdateLib.sln +++ b/UpdateLib/UpdateLib.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 +# Visual Studio 15 +VisualStudioVersion = 15.0.27130.2010 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UpdateLib", "UpdateLib\UpdateLib.csproj", "{4394BE57-95E2-45B1-A968-1404B0590B35}" EndProject @@ -13,6 +13,11 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UpdateLib.Tests", "UpdateLi EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UpdateLib.Generator", "UpdateLib.Generator\UpdateLib.Generator.csproj", "{5194FF71-49F6-4ADB-9B0E-4BEB418DC6F3}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{CDD5CD43-2D33-4654-8680-2352806AE394}" + ProjectSection(SolutionItems) = preProject + .shared\SharedAssemblyInfo.cs = .shared\SharedAssemblyInfo.cs + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -42,4 +47,7 @@ Global GlobalSection(NestedProjects) = preSolution {C47B8CC3-ABAB-4F56-8CA2-1323F902D1C3} = {4FDF7C41-4B30-4153-A06A-6DE8989B4EFF} EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {95EA950A-A44A-4CF2-BEF3-CE45E2B42596} + EndGlobalSection EndGlobal diff --git a/UpdateLib/UpdateLib/Common/EntryBase.cs b/UpdateLib/UpdateLib/Common/Abstraction/EntryBase.cs similarity index 97% rename from UpdateLib/UpdateLib/Common/EntryBase.cs rename to UpdateLib/UpdateLib/Common/Abstraction/EntryBase.cs index 8fc9864..cdb7cde 100644 --- a/UpdateLib/UpdateLib/Common/EntryBase.cs +++ b/UpdateLib/UpdateLib/Common/Abstraction/EntryBase.cs @@ -19,7 +19,7 @@ using System.Text; using System.Xml.Serialization; -namespace MatthiWare.UpdateLib.Common +namespace MatthiWare.UpdateLib.Common.Abstraction { [Serializable] public abstract class EntryBase diff --git a/UpdateLib/UpdateLib/Common/Abstraction/FileBase.cs b/UpdateLib/UpdateLib/Common/Abstraction/FileBase.cs new file mode 100644 index 0000000..9942311 --- /dev/null +++ b/UpdateLib/UpdateLib/Common/Abstraction/FileBase.cs @@ -0,0 +1,106 @@ +/* UpdateLib - .Net auto update library + * Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using System; +using System.IO; +using System.Xml.Serialization; + +namespace MatthiWare.UpdateLib.Common.Abstraction +{ + /// + /// The base class for all the files that need to be able to save/load from disk. + /// + /// Serializable file class + [Serializable] + public abstract class FileBase where T : new() + { + /// + /// Default ctor needed for serialization + /// + protected FileBase() { } + + /// + /// Saves the file using the default path + /// + public abstract void Save(); + + /// + /// Saves the file using a specified path + /// + /// The path to save the file to + public virtual void Save(string path) + { + if (string.IsNullOrEmpty(path)) throw new ArgumentNullException(nameof(path)); + + FileInfo fi = new FileInfo(path); + + if (!fi.Directory.Exists) + fi.Directory.Create(); + + using (var stream = fi.Open(FileMode.Create, FileAccess.Write)) + Save(stream); + } + + /// + /// Saves the file using a specified stream + /// + /// The stream to save the file to. + public virtual void Save(Stream stream) + { + if (!stream.CanWrite) throw new ArgumentException("Unwritable stream", nameof(stream)); + + XmlSerializer serializer = new XmlSerializer(typeof(T)); + serializer.Serialize(stream, this); + } + + /// + /// Loads the file from the default path + /// + /// A loaded instance of the file. + public abstract T Load(); + + /// + /// Loads the file from a specified path + /// + /// The path to load the file from + /// A loaded instance of the file. + public virtual T Load(string path) + { + if (string.IsNullOrEmpty(path)) throw new ArgumentNullException(nameof(path)); + + FileInfo fi = new FileInfo(path); + + if (!fi.Exists) throw new FileNotFoundException("File does not exist", path); + + using (var stream = fi.Open(FileMode.Open, FileAccess.Read)) + return Load(stream); + } + + /// + /// Loads the file from a specified stream + /// + /// + /// A loaded instance of the file. + public virtual T Load(Stream stream) + { + if (!stream.CanRead) throw new ArgumentException("Unreadable stream", nameof(stream)); + + XmlSerializer serializer = new XmlSerializer(typeof(T)); + return (T)serializer.Deserialize(stream); + } + } +} diff --git a/UpdateLib/UpdateLib/Common/Delegates.cs b/UpdateLib/UpdateLib/Common/Delegates.cs new file mode 100644 index 0000000..6b97523 --- /dev/null +++ b/UpdateLib/UpdateLib/Common/Delegates.cs @@ -0,0 +1,9 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace MatthiWare.UpdateLib.Common +{ + public delegate void ProgressChangedHandler(bool completed, double progress); +} diff --git a/UpdateLib/UpdateLib/Common/DirectoryEntry.cs b/UpdateLib/UpdateLib/Common/DirectoryEntry.cs index 8e31430..b022cb3 100644 --- a/UpdateLib/UpdateLib/Common/DirectoryEntry.cs +++ b/UpdateLib/UpdateLib/Common/DirectoryEntry.cs @@ -21,6 +21,7 @@ using System.Xml.Serialization; using System.Linq; using System.Diagnostics; +using MatthiWare.UpdateLib.Common.Abstraction; namespace MatthiWare.UpdateLib.Common { diff --git a/UpdateLib/UpdateLib/Security/InvalidHashException.cs b/UpdateLib/UpdateLib/Common/Exceptions/InvalidHashException.cs similarity index 96% rename from UpdateLib/UpdateLib/Security/InvalidHashException.cs rename to UpdateLib/UpdateLib/Common/Exceptions/InvalidHashException.cs index 9647bdb..fceb24a 100644 --- a/UpdateLib/UpdateLib/Security/InvalidHashException.cs +++ b/UpdateLib/UpdateLib/Common/Exceptions/InvalidHashException.cs @@ -18,7 +18,7 @@ using System; using System.Runtime.Serialization; -namespace MatthiWare.UpdateLib.Security +namespace MatthiWare.UpdateLib.Common.Exceptions { [Serializable] public class InvalidHashException : Exception diff --git a/UpdateLib/UpdateLib/Common/Exceptions/NoInternetException.cs b/UpdateLib/UpdateLib/Common/Exceptions/NoInternetException.cs new file mode 100644 index 0000000..b9b34b8 --- /dev/null +++ b/UpdateLib/UpdateLib/Common/Exceptions/NoInternetException.cs @@ -0,0 +1,38 @@ +/* UpdateLib - .Net auto update library + * + * File: NoInternetException.cs + * + * Author: Matthias Beerens + * + * Copyright (C) 2016 - MatthiWare + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using System; + +namespace MatthiWare.UpdateLib.Common.Exceptions +{ + + [Serializable] + public class NoInternetException : Exception + { + public NoInternetException() { } + public NoInternetException(string message) : base(message) { } + public NoInternetException(string message, Exception inner) : base(message, inner) { } + protected NoInternetException( + System.Runtime.Serialization.SerializationInfo info, + System.Runtime.Serialization.StreamingContext context) : base(info, context) { } + } +} diff --git a/UpdateLib/UpdateLib/Common/Exceptions/NoVersionSpecifiedException.cs b/UpdateLib/UpdateLib/Common/Exceptions/NoVersionSpecifiedException.cs new file mode 100644 index 0000000..321fd40 --- /dev/null +++ b/UpdateLib/UpdateLib/Common/Exceptions/NoVersionSpecifiedException.cs @@ -0,0 +1,40 @@ +/* Copyright + * + * UpdateLib - .Net auto update library + * + * File: NoVersionSpecifiedException.cs v0.5 + * + * Author: Matthias Beerens + * + * Copyright (C) 2017 - MatthiWare + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using System; + +namespace MatthiWare.UpdateLib.Common.Exceptions +{ + + [Serializable] + public class NoVersionSpecifiedException : Exception + { + public NoVersionSpecifiedException() { } + public NoVersionSpecifiedException(string message) : base(message) { } + public NoVersionSpecifiedException(string message, Exception inner) : base(message, inner) { } + protected NoVersionSpecifiedException( + System.Runtime.Serialization.SerializationInfo info, + System.Runtime.Serialization.StreamingContext context) : base(info, context) { } + } +} diff --git a/UpdateLib/UpdateLib/Common/FileEntry.cs b/UpdateLib/UpdateLib/Common/FileEntry.cs index 165ee43..cfcefe6 100644 --- a/UpdateLib/UpdateLib/Common/FileEntry.cs +++ b/UpdateLib/UpdateLib/Common/FileEntry.cs @@ -14,7 +14,8 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ - + +using MatthiWare.UpdateLib.Common.Abstraction; using System; using System.Xml.Serialization; diff --git a/UpdateLib/UpdateLib/Common/FileManager.cs b/UpdateLib/UpdateLib/Common/FileManager.cs new file mode 100644 index 0000000..06c4cd0 --- /dev/null +++ b/UpdateLib/UpdateLib/Common/FileManager.cs @@ -0,0 +1,41 @@ +/* Copyright + * + * UpdateLib - .Net auto update library + * + * File: FileManager.cs v0.5 + * + * Author: Matthias Beerens + * + * Copyright (C) 2017 - MatthiWare + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using System.IO; +using MatthiWare.UpdateLib.Common.Abstraction; + +namespace MatthiWare.UpdateLib.Common +{ + public static class FileManager + { + public static T LoadFile() where T : FileBase, new() + => new T().Load(); + + public static T LoadFile(string path) where T : FileBase, new() + => new T().Load(path); + + public static T LoadFile(Stream stream) where T : FileBase, new() + => new T().Load(stream); + } +} diff --git a/UpdateLib/UpdateLib/Common/Interfaces.cs b/UpdateLib/UpdateLib/Common/Interfaces.cs new file mode 100644 index 0000000..d4cc281 --- /dev/null +++ b/UpdateLib/UpdateLib/Common/Interfaces.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace MatthiWare.UpdateLib.Common +{ + public interface IPatchGenerator + { + event ProgressChangedHandler ProgressChanged; + void Generate(); + } + + public interface IPatcher + { + event ProgressChangedHandler ProgressChanged; + void Patch(); + } +} diff --git a/UpdateLib/UpdateLib/Common/RegistryKeyEntry.cs b/UpdateLib/UpdateLib/Common/RegistryKeyEntry.cs index 10b9048..69994a0 100644 --- a/UpdateLib/UpdateLib/Common/RegistryKeyEntry.cs +++ b/UpdateLib/UpdateLib/Common/RegistryKeyEntry.cs @@ -15,6 +15,7 @@ * along with this program. If not, see . */ +using MatthiWare.UpdateLib.Common.Abstraction; using Microsoft.Win32; using System; using System.Diagnostics; diff --git a/UpdateLib/UpdateLib/Compression/GZip/GZipInputStream.cs b/UpdateLib/UpdateLib/Compression/GZip/GZipInputStream.cs index f2e03b2..8be8b4b 100644 --- a/UpdateLib/UpdateLib/Compression/GZip/GZipInputStream.cs +++ b/UpdateLib/UpdateLib/Compression/GZip/GZipInputStream.cs @@ -165,7 +165,7 @@ public override int Read(byte[] buffer, int offset, int count) crc.Update(buffer, offset, bytesRead); // If this is the end of stream, read the footer - if (inf.IsFinished) + if (inflater.IsFinished) ReadFooter(); if (bytesRead > 0) @@ -339,9 +339,9 @@ void ReadFooter() byte[] footer = new byte[8]; // End of stream; reclaim all bytes from inf, read the final byte count, and reset the inflator - long bytesRead = inf.TotalOut & 0xffffffff; - inputBuffer.Available += inf.RemainingInput; - inf.Reset(); + long bytesRead = inflater.TotalOut & 0xffffffff; + inputBuffer.Available += inflater.RemainingInput; + inflater.Reset(); // Read footer from inputBuffer int needed = 8; diff --git a/UpdateLib/UpdateLib/Compression/PatchBuilder.cs b/UpdateLib/UpdateLib/Compression/PatchBuilder.cs new file mode 100644 index 0000000..5e9936a --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/PatchBuilder.cs @@ -0,0 +1,23 @@ +using MatthiWare.UpdateLib.Common; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace MatthiWare.UpdateLib.Compression +{ + public class PatchBuilder + { + + public event ProgressChangedHandler ProgressChanged; + + public void Generate() + { + + } + + protected void OnProgressChanged(bool completed, double progress) + => ProgressChanged?.Invoke(completed, progress); + + } +} diff --git a/UpdateLib/UpdateLib/Compression/Patcher.cs b/UpdateLib/UpdateLib/Compression/Patcher.cs new file mode 100644 index 0000000..b0dcec8 --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/Patcher.cs @@ -0,0 +1,37 @@ +/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using MatthiWare.UpdateLib.Common; + +namespace MatthiWare.UpdateLib.Compression +{ + public class Patcher + { + public event ProgressChangedHandler ProgressChanged; + + public void Patch() + { + + } + + protected void OnProgressChanged(bool completed, double progress) + => ProgressChanged?.Invoke(completed, progress); + } +} diff --git a/UpdateLib/UpdateLib/Compression/Streams/InflaterInputStream.cs b/UpdateLib/UpdateLib/Compression/Streams/InflaterInputStream.cs index 187212f..8c81083 100644 --- a/UpdateLib/UpdateLib/Compression/Streams/InflaterInputStream.cs +++ b/UpdateLib/UpdateLib/Compression/Streams/InflaterInputStream.cs @@ -343,17 +343,11 @@ public InflaterInputStream(Stream baseInputStream, Inflater inf) /// public InflaterInputStream(Stream baseInputStream, Inflater inflater, int bufferSize) { - if (baseInputStream == null) - throw new ArgumentNullException(nameof(baseInputStream)); - - if (inflater == null) - throw new ArgumentNullException(nameof(inflater)); - if (bufferSize <= 0) throw new ArgumentOutOfRangeException(nameof(bufferSize)); - this.baseInputStream = baseInputStream; - this.inf = inflater; + this.baseInputStream = baseInputStream ?? throw new ArgumentNullException(nameof(baseInputStream)); + this.inflater = inflater ?? throw new ArgumentNullException(nameof(inflater)); inputBuffer = new InflaterInputBuffer(baseInputStream, bufferSize); } @@ -422,7 +416,7 @@ public virtual int Available { get { - return inf.IsFinished ? 0 : 1; + return inflater.IsFinished ? 0 : 1; } } @@ -443,7 +437,7 @@ protected void Fill() throw new EndOfStreamException("Unexpected EOF"); } - inputBuffer.SetInflaterInput(inf); + inputBuffer.SetInflaterInput(inflater); } #region Stream Overrides @@ -512,7 +506,7 @@ public override long Position /// /// Flushes the baseInputStream /// - public override void Flush()=> baseInputStream.Flush(); + public override void Flush() => baseInputStream.Flush(); /// /// Sets the position within the current stream @@ -595,20 +589,20 @@ protected override void Dispose(bool disposing) /// public override int Read(byte[] buffer, int offset, int count) { - if (inf.IsNeedingDictionary) + if (inflater.IsNeedingDictionary) throw new InvalidOperationException("Need a dictionary"); int remainingBytes = count; while (true) { - int bytesRead = inf.Inflate(buffer, offset, remainingBytes); + int bytesRead = inflater.Inflate(buffer, offset, remainingBytes); offset += bytesRead; remainingBytes -= bytesRead; - if (remainingBytes == 0 || inf.IsFinished) + if (remainingBytes == 0 || inflater.IsFinished) break; - if (inf.IsNeedingInput) + if (inflater.IsNeedingInput) Fill(); else if (bytesRead == 0) throw new IOException("Nothing reead"); @@ -622,7 +616,7 @@ public override int Read(byte[] buffer, int offset, int count) /// /// Decompressor for this stream /// - protected Inflater inf; + protected Inflater inflater; /// /// Input buffer for this stream. diff --git a/UpdateLib/UpdateLib/Compression/VCDiff/VCDiffDecoder.cs b/UpdateLib/UpdateLib/Compression/VCDiff/VCDiffDecoder.cs index 481fed7..b8e32d8 100644 --- a/UpdateLib/UpdateLib/Compression/VCDiff/VCDiffDecoder.cs +++ b/UpdateLib/UpdateLib/Compression/VCDiff/VCDiffDecoder.cs @@ -23,9 +23,6 @@ namespace MatthiWare.UpdateLib.Compression.VCDiff { public sealed class VCDiffDecoder { - - public delegate void ProgressChangedHandler(bool completed, double progress); - private Stream m_original, m_delta, m_output; private CodeTable m_codeTable = CodeTable.Default; @@ -34,14 +31,7 @@ public sealed class VCDiffDecoder public event ProgressChangedHandler ProgressChanged; - private VCDiffDecoder(Stream original, Stream delta, Stream output) - { - m_original = original; - m_delta = delta; - m_output = output; - } - - public static void Decode(Stream original, Stream delta, Stream output) + public VCDiffDecoder(Stream original, Stream delta, Stream output) { if (original == null) throw new ArgumentNullException(nameof(original)); if (delta == null) throw new ArgumentNullException(nameof(delta)); @@ -56,11 +46,12 @@ public static void Decode(Stream original, Stream delta, Stream output) if (!output.CanWrite || !output.CanSeek || !output.CanRead) throw new ArgumentException("Must be able to read, seek and write in stream", nameof(output)); - VCDiffDecoder decoder = new VCDiffDecoder(original, delta, output); - decoder.Decode(); + m_original = original; + m_delta = delta; + m_output = output; } - private void Decode() + public void Decode() { ReadHeader(); diff --git a/UpdateLib/UpdateLib/Compression/Zip/ZipInputStream.cs b/UpdateLib/UpdateLib/Compression/Zip/ZipInputStream.cs index f3c925b..995a5c6 100644 --- a/UpdateLib/UpdateLib/Compression/Zip/ZipInputStream.cs +++ b/UpdateLib/UpdateLib/Compression/Zip/ZipInputStream.cs @@ -228,10 +228,11 @@ public ZipEntry GetNextEntry() string name = ZipConstants.ConvertToStringExt(flags, buffer); - entry = new ZipEntry(name, versionRequiredToExtract); - entry.Flags = flags; - - entry.CompressionMethod = (CompressionMethod)method; + entry = new ZipEntry(name, versionRequiredToExtract) + { + Flags = flags, + CompressionMethod = (CompressionMethod)method + }; if ((flags & 8) == 0) { @@ -330,7 +331,7 @@ void CompleteCloseEntry(bool testCrc) checksum.Reset(); if (method == (int)CompressionMethod.Deflated) - inf.Reset(); + inflater.Reset(); entry = null; } @@ -365,8 +366,8 @@ public void CloseEntry() return; } - csize -= inf.TotalIn; - inputBuffer.Available += inf.RemainingInput; + csize -= inflater.TotalIn; + inputBuffer.Available += inflater.RemainingInput; } if ((inputBuffer.Available > csize) && (csize >= 0)) @@ -470,7 +471,7 @@ int InitialRead(byte[] destination, int offset, int count) if ((csize > 0) || ((flags & (int)GeneralBitFlags.Descriptor) != 0)) { if ((method == (int)CompressionMethod.Deflated) && (inputBuffer.Available > 0)) - inputBuffer.SetInflaterInput(inf); + inputBuffer.SetInflaterInput(inflater); internalReader = new ReadDataHandler(BodyRead); return BodyRead(destination, offset, count); @@ -543,17 +544,17 @@ int BodyRead(byte[] buffer, int offset, int count) if (count <= 0) { - if (!inf.IsFinished) + if (!inflater.IsFinished) throw new ZipException("Inflater not finished!"); - inputBuffer.Available = inf.RemainingInput; + inputBuffer.Available = inflater.RemainingInput; // A csize of -1 is from an unpatched local header if ((flags & 8) == 0 && - (inf.TotalIn != csize && csize != 0xFFFFFFFF && csize != -1 || inf.TotalOut != size)) - throw new ZipException("Size mismatch: " + csize + ";" + size + " <-> " + inf.TotalIn + ";" + inf.TotalOut); + (inflater.TotalIn != csize && csize != 0xFFFFFFFF && csize != -1 || inflater.TotalOut != size)) + throw new ZipException("Size mismatch: " + csize + ";" + size + " <-> " + inflater.TotalIn + ";" + inflater.TotalOut); - inf.Reset(); + inflater.Reset(); finished = true; } break; @@ -578,7 +579,7 @@ int BodyRead(byte[] buffer, int offset, int count) finished = true; else if (count < 0) - throw new ZipException("EOF in stored block"); + throw new ZipException("EOF in stored block"); break; } diff --git a/UpdateLib/UpdateLib/Files/HashCacheFile.cs b/UpdateLib/UpdateLib/Files/HashCacheFile.cs index 15d33fb..198f889 100644 --- a/UpdateLib/UpdateLib/Files/HashCacheFile.cs +++ b/UpdateLib/UpdateLib/Files/HashCacheFile.cs @@ -22,11 +22,12 @@ using System.IO; using System.Xml.Serialization; using System.Linq; +using MatthiWare.UpdateLib.Common.Abstraction; namespace MatthiWare.UpdateLib.Files { [Serializable] - public class HashCacheFile + public class HashCacheFile : FileBase { public const string FILE_NAME = "Cache.xml"; @@ -65,64 +66,21 @@ public void AddOrUpdateEntry(string fullPath, string hash = "") } #region Save/Load - private static string GetStoragePath()=> $@"{IOUtils.AppDataPath}\{FILE_NAME}"; + private static string GetStoragePath() => $@"{IOUtils.AppDataPath}\{FILE_NAME}"; - /// /// Loads the from the default storage location /// /// The loaded or null if it doesn't exist - public static HashCacheFile Load() - { - return Load(GetStoragePath()); - } - - /// - /// Loads the from the given storage location - /// - /// The storage location - /// The loaded or null if it doesn't exist - public static HashCacheFile Load(string path) - { - if (!File.Exists(path)) - return null; - - using (Stream stream = File.Open(path, FileMode.Open, FileAccess.Read)) - { - XmlSerializer serializer = new XmlSerializer(typeof(HashCacheFile)); - return (HashCacheFile)serializer.Deserialize(stream); - } - } + public override HashCacheFile Load() + => Load(GetStoragePath()); /// /// Saves the in the default storage location /// - public void Save() - { - Save(GetStoragePath()); - } - - /// - /// Saves the in the given storage location - /// - /// The storage location - public void Save(string path) - { - FileInfo fi = new FileInfo(path); + public override void Save() + => Save(GetStoragePath()); - if (!fi.Directory.Exists) - fi.Directory.Create(); - - if (fi.Exists) - fi.Delete(); - - - using (Stream stream = fi.Open(FileMode.OpenOrCreate, FileAccess.Write)) - { - XmlSerializer serializer = new XmlSerializer(typeof(HashCacheFile)); - serializer.Serialize(stream, this); - } - } #endregion } diff --git a/UpdateLib/UpdateLib/Files/ServerFile.cs b/UpdateLib/UpdateLib/Files/ServerFile.cs new file mode 100644 index 0000000..1244829 --- /dev/null +++ b/UpdateLib/UpdateLib/Files/ServerFile.cs @@ -0,0 +1,39 @@ +/* Copyright + * + * UpdateLib - .Net auto update library + * + * File: ServerFile.cs v0.5 + * + * Author: Matthias Beerens + * + * Copyright (C) 2017 - MatthiWare + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using MatthiWare.UpdateLib.Common.Abstraction; +using System; + +namespace MatthiWare.UpdateLib.Files +{ + [Serializable] + public class ServerFile : FileBase + { + public override ServerFile Load() + => Load(""); + + public override void Save() + => Save(""); + } +} diff --git a/UpdateLib/UpdateLib/Files/UpdateFile.cs b/UpdateLib/UpdateLib/Files/UpdateFile.cs index 609e287..c1f0b22 100644 --- a/UpdateLib/UpdateLib/Files/UpdateFile.cs +++ b/UpdateLib/UpdateLib/Files/UpdateFile.cs @@ -1,5 +1,12 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) +/* Copyright + * + * UpdateLib - .Net auto update library + * + * File: UpdateFile.cs v0.5 + * + * Author: Matthias Beerens + * + * Copyright (C) 2016 - MatthiWare * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published @@ -12,16 +19,16 @@ * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * along with this program. If not, see . */ using System; using System.Collections.Generic; -using System.IO; using System.Xml; using System.Xml.Serialization; using MatthiWare.UpdateLib.Utils; using MatthiWare.UpdateLib.Common; +using MatthiWare.UpdateLib.Common.Abstraction; namespace MatthiWare.UpdateLib.Files { @@ -29,7 +36,7 @@ namespace MatthiWare.UpdateLib.Files /// The UpdateFile /// [Serializable] - public class UpdateFile + public class UpdateFile : FileBase { /// /// Gets or sets the name of the application @@ -39,99 +46,15 @@ public class UpdateFile public List DownloadURIs { get; } = new List(); - public List Updates { get; } = new List(); - - public UpdateFile() - { - - } + public List Updates { get; } = new List(); public UpdateInfo GetLatestUpdate() => Updates.MaxOrDefault(u => u.Version); - /// - /// Saves the current to the output - /// - /// The output to write the object to - public void Save(Stream output) - { - if (output == null) - throw new ArgumentNullException(nameof(output)); - - if (!output.CanWrite) - throw new ArgumentException("Stream is not writable", nameof(output)); - - XmlSerializerNamespaces ns = new XmlSerializerNamespaces(); - // ns.Add(string.Empty, string.Empty); - - XmlSerializer serializer = new XmlSerializer(typeof(UpdateFile), string.Empty); - serializer.Serialize(output, this, ns); - } - - /// - /// Saves the current to a specified file. - /// This method will delete the file specified in the path parameter if it exists and recreates it. - /// - /// The path of the file where to save - public void Save(string path) - { - if (string.IsNullOrEmpty(path)) - throw new ArgumentNullException(nameof(path)); - - FileInfo file = new FileInfo(path); - - if (file.Exists) - file.Delete(); - - using (var stream = file.Open(FileMode.OpenOrCreate, FileAccess.Write)) - Save(stream); - } - - /// - /// Loads a from a input . - /// This method doesn't close/dispose the . - /// - /// The input that contains this object - /// The loaded instance of - public static UpdateFile Load(Stream input) - { - if (input == null) - throw new ArgumentNullException(nameof(input)); - - if (!input.CanRead) - throw new ArgumentException("Stream is not readable", nameof(input)); - - XmlSerializer serializer = new XmlSerializer(typeof(UpdateFile)); - - XmlReader xml = new XmlTextReader(input); - - if (!serializer.CanDeserialize(xml)) - throw new InvalidOperationException("The current stream cannot be deserialized"); - - UpdateFile file = (UpdateFile)serializer.Deserialize(xml); - - //new UpdateInfoPostProcessorTask(file).ConfigureAwait(false).Start().AwaitTask(); - - return file; - } - - /// - /// Loads a from a path. - /// - /// The path to the save file - /// The loaded instance of - public static UpdateFile Load(string path) - { - if (string.IsNullOrEmpty(path)) - throw new ArgumentNullException(nameof(path)); - - FileInfo file = new FileInfo(path); - - if (!file.Exists) - throw new FileNotFoundException("The UpdateFile doesn't exist.", path); + public override void Save() + => throw new NotImplementedException(); - using (Stream stream = file.OpenRead()) - return Load(stream); - } + public override UpdateFile Load() + => throw new NotImplementedException(); } } diff --git a/UpdateLib/UpdateLib/Tasks/AsyncTask.cs b/UpdateLib/UpdateLib/Tasks/AsyncTask.cs index 944c0bb..1bce5de 100644 --- a/UpdateLib/UpdateLib/Tasks/AsyncTask.cs +++ b/UpdateLib/UpdateLib/Tasks/AsyncTask.cs @@ -1,5 +1,12 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) +/* Copyright + * + * UpdateLib - .Net auto update library + * + * File: AsyncTask.cs v0.5 + * + * Author: Matthias Beerens + * + * Copyright (C) 2016 - MatthiWare * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published @@ -12,7 +19,7 @@ * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * along with this program. If not, see . */ using MatthiWare.UpdateLib.Common; @@ -171,26 +178,6 @@ public AsyncTask ConfigureAwait(bool useSyncContext) return this; } - #endregion - - /// - /// Resets the task back to its initial state - /// - private void Reset() - { - IsCancelled = false; - IsRunning = false; - LastException = null; - IsCompleted = false; - - m_waitHandle.Reset(); - m_childTasks.Clear(); - -#if DEBUG - m_sw.Reset(); -#endif - } - /// /// Starts the task /// @@ -246,6 +233,45 @@ public AsyncTask Start() return this; } + /// + /// Blocks the calling thread until the complete task is done. + /// DO NOT call this in the worker method use method instead. + /// + public AsyncTask AwaitTask() + { + if (IsChildTask && !IsCompleted && !IsRunning) + Reset(); + + if (m_waitHandle != null) + { + m_waitHandle.WaitOne(); + m_waitHandle.Close(); + m_waitHandle = null; + } + + return this; + } + + #endregion + + /// + /// Resets the task back to its initial state + /// + private void Reset() + { + IsCancelled = false; + IsRunning = false; + LastException = null; + IsCompleted = false; + + m_waitHandle.Reset(); + m_childTasks.Clear(); + +#if DEBUG + m_sw.Reset(); +#endif + } + /// /// The worker method. /// @@ -271,7 +297,7 @@ protected void Enqueue(Delegate action, params object[] args) if (HasErrors || IsCancelled) return; - AsyncTask task = AsyncTaskFactory.From(action, args); + var task = AsyncTaskFactory.From(action, args); task.IsChildTask = true; task.TaskCompleted += (o, e) => { @@ -288,33 +314,13 @@ protected void Enqueue(Delegate action, params object[] args) WorkerScheduler.Instance.Schedule(task); } - /// - /// Blocks the calling thread until the complete task is done. - /// DO NOT call this in the worker method use method instead. - /// - public AsyncTask AwaitTask() - { - if (IsChildTask && !IsCompleted && !IsRunning) - Reset(); - - if (m_waitHandle != null) - { - m_waitHandle.WaitOne(); - m_waitHandle.Close(); - m_waitHandle = null; - } - - return this; - } - - private int x = 0; - /// /// Blocks the calling thread until all the workers are done. /// protected void AwaitWorkers() { AsyncTask task = null; + while (m_childTasks.TryDequeue(out task)) task.AwaitTask(); } @@ -385,14 +391,22 @@ protected virtual void OnTaskCompleted(AsyncCompletedEventArgs e) /// /// Base class for all Tasks that need to be run Async /// - /// The type of the Result object - public abstract class AsyncTask : AsyncTask + /// The type of the Result object + public abstract class AsyncTask : AsyncTask { /// /// Gets or sets the result /// - public virtual T Result { get; protected set; } + public virtual ResultType Result { get; protected set; } = default(ResultType); + } + /// + /// Base class for all Tasks that need to be run Async + /// + /// The task type to be returned from the FluentAPI + /// The type of the Result object + public abstract class AsyncTask : AsyncTask where TaskType : AsyncTask + { #region FluentAPI /// @@ -401,18 +415,18 @@ public abstract class AsyncTask : AsyncTask /// default is true. /// Indicate if we should use the synchronization context /// The task object for fluent API. - public new AsyncTask ConfigureAwait(bool useSyncContext) + public new TaskType ConfigureAwait(bool useSyncContext) { - return (AsyncTask)base.ConfigureAwait(useSyncContext); + return (TaskType)base.ConfigureAwait(useSyncContext); } /// /// Starts the task /// /// Returns the current Task. - public new AsyncTask Start() + public new TaskType Start() { - return (AsyncTask)base.Start(); + return (TaskType)base.Start(); } @@ -421,14 +435,14 @@ public abstract class AsyncTask : AsyncTask /// DO NOT call this in the worker method use method instead. /// /// - public new AsyncTask AwaitTask() + public new TaskType AwaitTask() { - return (AsyncTask)base.AwaitTask(); + return (TaskType)base.AwaitTask(); } #endregion - - } + + } diff --git a/UpdateLib/UpdateLib/Tasks/AsyncTaskFactory.cs b/UpdateLib/UpdateLib/Tasks/AsyncTaskFactory.cs index 088e68e..c6ccb2b 100644 --- a/UpdateLib/UpdateLib/Tasks/AsyncTaskFactory.cs +++ b/UpdateLib/UpdateLib/Tasks/AsyncTaskFactory.cs @@ -1,5 +1,12 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) +/* Copyright + * + * UpdateLib - .Net auto update library + * + * File: AsyncTaskFactory.cs v0.5 + * + * Author: Matthias Beerens + * + * Copyright (C) 2016 - MatthiWare * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published @@ -12,39 +19,57 @@ * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * along with this program. If not, see . */ using System; namespace MatthiWare.UpdateLib.Tasks { + /// + /// Factory methods for creating and starting a new task + /// public class AsyncTaskFactory { - + /// + /// Starts a new task + /// + /// The action delegate + /// The parameters to pass to the action + /// The object public static AsyncTask StartNew(Delegate action, params object[] args) - { - AnonymousTask task = new AnonymousTask(action, args); - return task.Start(); - } + => new AnonymousTask(action, args).Start(); + /// + /// Starts a new task + /// + /// The result type + /// The action delegate + /// The parameters to pass to the action + /// The object with result property public static AsyncTask StartNew(Delegate action, params object[] args) - { - AnonymousTask task = new AnonymousTask(action, args); - return task.Start(); - } + => new AnonymousTask(action, args).Start(); + /// + /// Creates a new task + /// + /// The action delegate + /// The parameters to pass to the action + /// The object public static AsyncTask From(Delegate action, params object[] args) - { - return new AnonymousTask(action, args); - } + => new AnonymousTask(action, args); + /// + /// Creates a new task + /// + /// The result type + /// The action delegate + /// The parameters to pass to the action + /// The object with result property public static AsyncTask From(Delegate action, params object[] args) - { - return new AnonymousTask(action, args); - } + => new AnonymousTask(action, args); - private class AnonymousTask : AsyncTask + private class AnonymousTask : AsyncTask { private Delegate action; private object[] args; @@ -56,12 +81,10 @@ public AnonymousTask(Delegate action, params object[] args) } protected override void DoWork() - { - Result = (T)action.DynamicInvoke(args); - } + => action.DynamicInvoke(args); } - private class AnonymousTask : AsyncTask + private class AnonymousTask : AsyncTask> { private Delegate action; private object[] args; @@ -74,7 +97,7 @@ public AnonymousTask(Delegate action, params object[] args) protected override void DoWork() { - action.DynamicInvoke(args); + Result = (TResult)action.DynamicInvoke(args); } } diff --git a/UpdateLib/UpdateLib/Tasks/CheckForUpdatedItemsTask.cs b/UpdateLib/UpdateLib/Tasks/CheckForUpdatedItemsTask.cs index 3f0873e..1521b1a 100644 --- a/UpdateLib/UpdateLib/Tasks/CheckForUpdatedItemsTask.cs +++ b/UpdateLib/UpdateLib/Tasks/CheckForUpdatedItemsTask.cs @@ -1,5 +1,12 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) +/* Copyright + * + * UpdateLib - .Net auto update library + * + * File: CheckForUpdatedItemsTask.cs v0.5 + * + * Author: Matthias Beerens + * + * Copyright (C) 2016 - MatthiWare * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published @@ -12,7 +19,7 @@ * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * along with this program. If not, see . */ using MatthiWare.UpdateLib.Common; @@ -24,18 +31,15 @@ namespace MatthiWare.UpdateLib.Tasks { - public class CheckForUpdatedItemsTask : AsyncTask + public class CheckForUpdatedItemsTask : AsyncTask { private UpdateInfo m_updateFile; private HashCacheFile m_cacheFile; public CheckForUpdatedItemsTask(UpdateInfo update, HashCacheFile cache) { - if (update == null) throw new ArgumentNullException(nameof(update)); - if (cache == null) throw new ArgumentNullException(nameof(cache)); - - m_updateFile = update; - m_cacheFile = cache; + m_updateFile = update ?? throw new ArgumentNullException(nameof(update)); + m_cacheFile = cache ?? throw new ArgumentNullException(nameof(cache)); } protected override void DoWork() @@ -61,8 +65,7 @@ private void CheckFiles(DirectoryEntry dir) if (cacheEntry == null) return false; - bool val = (fe as FileEntry).Hash.Equals(cacheEntry.Hash); - return val; + return (fe as FileEntry)?.Hash.Equals(cacheEntry.Hash) ?? true; }); IEnumerable dirsToCheck = dir.Directories.Where(d => d.Count > 0); diff --git a/UpdateLib/UpdateLib/Tasks/CheckForUpdatesCompletedEventArgs.cs b/UpdateLib/UpdateLib/Tasks/CheckForUpdatesCompletedEventArgs.cs index f56679c..977d103 100644 --- a/UpdateLib/UpdateLib/Tasks/CheckForUpdatesCompletedEventArgs.cs +++ b/UpdateLib/UpdateLib/Tasks/CheckForUpdatesCompletedEventArgs.cs @@ -1,5 +1,12 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) +/* Copyright + * + * UpdateLib - .Net auto update library + * + * File: CheckForUpdatesCompletedEventArgs.cs v0.5 + * + * Author: Matthias Beerens + * + * Copyright (C) 2016 - MatthiWare * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published @@ -12,7 +19,7 @@ * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * along with this program. If not, see . */ using MatthiWare.UpdateLib.Common; diff --git a/UpdateLib/UpdateLib/Tasks/CheckForUpdatesTask.cs b/UpdateLib/UpdateLib/Tasks/CheckForUpdatesTask.cs index 540d656..1ca040b 100644 --- a/UpdateLib/UpdateLib/Tasks/CheckForUpdatesTask.cs +++ b/UpdateLib/UpdateLib/Tasks/CheckForUpdatesTask.cs @@ -1,5 +1,12 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) +/* Copyright + * + * UpdateLib - .Net auto update library + * + * File: CheckForUpdatesTask.cs v0.5 + * + * Author: Matthias Beerens + * + * Copyright (C) 2016 - MatthiWare * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published @@ -12,29 +19,28 @@ * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * along with this program. If not, see . */ using System; using System.Net; using MatthiWare.UpdateLib.Files; -using System.IO; using MatthiWare.UpdateLib.Utils; -using static MatthiWare.UpdateLib.Tasks.CheckForUpdatesTask; using MatthiWare.UpdateLib.Common; -using System.Collections.Generic; +using MatthiWare.UpdateLib.Common.Exceptions; +using static MatthiWare.UpdateLib.Tasks.CheckForUpdatesTask; namespace MatthiWare.UpdateLib.Tasks { - public class CheckForUpdatesTask : AsyncTask + public class CheckForUpdatesTask : AsyncTask { - private IList m_uris; + public Uri Uri { get; set; } private WebClient m_wc; - public CheckForUpdatesTask(IList uris) + public CheckForUpdatesTask(Uri uri) { - m_uris = uris; + Uri = uri; m_wc = new WebClient(); } @@ -44,27 +50,23 @@ protected override void DoWork() Updater updater = Updater.Instance; - if (!NetworkUtils.HasConnection()) throw new WebException("No internet available", WebExceptionStatus.ConnectFailure); + if (!NetworkUtils.HasConnection()) throw new NoInternetException("No internet available"); // Getting the file name from the url string localFile = $@"{IOUtils.AppDataPath}\Update.xml"; - if (IsCancelled) - return; + if (IsCancelled) return; - if (IsUpdateFileInvalid(localFile)) - { - updater.Logger.Warn(nameof(CheckForUpdatesTask), nameof(DoWork), "Cached update file validity expired, downloading new one.."); - m_wc.DownloadFile(Url, localFile); - } + updater.Logger.Debug(nameof(CheckForUpdatesTask), nameof(DoWork), $"Attempting to download update file from {Uri}"); + m_wc.DownloadFile(Uri, localFile); // load the updatefile from disk - Result.UpdateInfo = UpdateFile.Load(localFile).GetLatestUpdate(); + Result.UpdateInfo = FileManager.LoadFile(localFile).GetLatestUpdate() ?? throw new NoVersionSpecifiedException(); - CheckRequiredPrivilegesTask privilegesCheckTask = CheckPrivileges(Result.UpdateInfo); + var privilegesCheckTask = CheckPrivileges(Result.UpdateInfo); // lets wait for the Cache update to complete and get the task - HashCacheFile cache = updater.GetCache(); + var cache = updater.GetCache(); // Wait for the clean up to complete updater.CleanUpTask.AwaitTask(); @@ -76,38 +78,17 @@ protected override void DoWork() * Start a task to get all the files that need to be updated * Returns if there is anything to update */ - CheckForUpdatedItemsTask updatedFilesTask = CheckForUpdatedFiles(Result.UpdateInfo, cache); + var updatedFilesTask = CheckForUpdatedFiles(Result.UpdateInfo, cache); Result.AdminRightsNeeded = privilegesCheckTask.AwaitTask().Result; Result.UpdateAvailable = updatedFilesTask.AwaitTask().Result; } - private bool IsUpdateFileInvalid(string localFile) - { - if (!File.Exists(localFile)) - return true; - - DateTime time = File.GetLastWriteTime(localFile); - - if (time.Add(Updater.Instance.CacheInvalidationTime) < DateTime.Now) - return true; - - return false; - } - private CheckForUpdatedItemsTask CheckForUpdatedFiles(UpdateInfo updateInfo, HashCacheFile cache) - { - CheckForUpdatedItemsTask task = new CheckForUpdatedItemsTask(updateInfo, cache); - task.ConfigureAwait(false).Start(); - return task; - } + => new CheckForUpdatedItemsTask(updateInfo, cache).ConfigureAwait(false).Start(); private CheckRequiredPrivilegesTask CheckPrivileges(UpdateInfo updateInfo) - { - CheckRequiredPrivilegesTask task = new CheckRequiredPrivilegesTask(updateInfo); - task.ConfigureAwait(false).Start(); - return task; - } + => new CheckRequiredPrivilegesTask(updateInfo).ConfigureAwait(false).Start(); public class CheckForUpdatesResult { diff --git a/UpdateLib/UpdateLib/Tasks/CheckRequiredPrivilegesTask.cs b/UpdateLib/UpdateLib/Tasks/CheckRequiredPrivilegesTask.cs index 2908929..76cb1a1 100644 --- a/UpdateLib/UpdateLib/Tasks/CheckRequiredPrivilegesTask.cs +++ b/UpdateLib/UpdateLib/Tasks/CheckRequiredPrivilegesTask.cs @@ -1,5 +1,12 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) +/* Copyright + * + * UpdateLib - .Net auto update library + * + * File: CheckRequiredPrivilegesTask.cs v0.5 + * + * Author: Matthias Beerens + * + * Copyright (C) 2016 - MatthiWare * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published @@ -12,7 +19,7 @@ * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * along with this program. If not, see . */ using MatthiWare.UpdateLib.Security; @@ -22,7 +29,7 @@ namespace MatthiWare.UpdateLib.Tasks { - public class CheckRequiredPrivilegesTask : AsyncTask + public class CheckRequiredPrivilegesTask : AsyncTask { public UpdateInfo UpdateInfo { get; set; } diff --git a/UpdateLib/UpdateLib/Tasks/CleanUpTask.cs b/UpdateLib/UpdateLib/Tasks/CleanUpTask.cs index 27f637e..3487dc2 100644 --- a/UpdateLib/UpdateLib/Tasks/CleanUpTask.cs +++ b/UpdateLib/UpdateLib/Tasks/CleanUpTask.cs @@ -1,5 +1,12 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) +/* Copyright + * + * UpdateLib - .Net auto update library + * + * File: CleanUpTask.cs v0.5 + * + * Author: Matthias Beerens + * + * Copyright (C) 2016 - MatthiWare * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published @@ -12,15 +19,15 @@ * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * along with this program. If not, see . */ - + using System; using System.IO; namespace MatthiWare.UpdateLib.Tasks { - public class CleanUpTask : AsyncTask + public class CleanUpTask : AsyncTask { public string PathToClean { get; set; } public string SearchPattern { get; set; } diff --git a/UpdateLib/UpdateLib/Tasks/DownloadManager.cs b/UpdateLib/UpdateLib/Tasks/DownloadManager.cs index 1b0fb16..cbef0ba 100644 --- a/UpdateLib/UpdateLib/Tasks/DownloadManager.cs +++ b/UpdateLib/UpdateLib/Tasks/DownloadManager.cs @@ -1,5 +1,12 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) +/* Copyright + * + * UpdateLib - .Net auto update library + * + * File: DownloadManager.cs v0.5 + * + * Author: Matthias Beerens + * + * Copyright (C) 2016 - MatthiWare * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published @@ -12,7 +19,7 @@ * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * along with this program. If not, see . */ using MatthiWare.UpdateLib.Common; @@ -37,7 +44,7 @@ public class DownloadManager public DownloadManager(UpdateInfo updateInfo) { m_amountToDownload.Value = updateInfo.FileCount; - this.m_updateInfo = updateInfo; + m_updateInfo = updateInfo; } private void Reset() diff --git a/UpdateLib/UpdateLib/Tasks/DownloadTask.cs b/UpdateLib/UpdateLib/Tasks/DownloadTask.cs index 4e2b78d..637890e 100644 --- a/UpdateLib/UpdateLib/Tasks/DownloadTask.cs +++ b/UpdateLib/UpdateLib/Tasks/DownloadTask.cs @@ -1,5 +1,16 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) +/* Copyright + * + * UpdateLib - .Net auto update library + * +/* Copyright + * + * UpdateLib - .Net auto update library + * + * File: DownloadTask.cs v0.5 + * + * Author: Matthias Beerens + * + * Copyright (C) 2016 - MatthiWare * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published @@ -12,10 +23,11 @@ * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * along with this program. If not, see . */ using MatthiWare.UpdateLib.Common; +using MatthiWare.UpdateLib.Common.Exceptions; using MatthiWare.UpdateLib.Security; using MatthiWare.UpdateLib.Utils; using System; @@ -49,8 +61,7 @@ protected override void DoWork() string localFile = Updater.Instance.Converter.Convert(Entry.DestinationLocation); string remoteFile = string.Concat(Updater.Instance.RemoteBasePath, Entry.SourceLocation); - - + Updater.Instance.Logger.Debug(nameof(DownloadTask), nameof(DoWork), $"LocalFile => {localFile}"); Updater.Instance.Logger.Debug(nameof(DownloadTask), nameof(DoWork), $"RemoteFile => {remoteFile}"); @@ -66,14 +77,14 @@ protected override void DoWork() if (!fi.Directory.Exists) fi.Directory.Create(); - Uri uri = new Uri(remoteFile); + var uri = new Uri(remoteFile); webClient.DownloadFileAsync(uri, localFile); wait.WaitOne(); wait.Close(); wait = null; - string hash = HashUtil.GetHash(localFile); + var hash = HashUtil.GetHash(localFile); if (hash.Length != Entry.Hash.Length || hash != Entry.Hash) throw new InvalidHashException($"Calculated hash doesn't match provided hash for file: {localFile}"); diff --git a/UpdateLib/UpdateLib/Tasks/UpdatableTask.cs b/UpdateLib/UpdateLib/Tasks/UpdatableTask.cs index b4fe7d7..4309a12 100644 --- a/UpdateLib/UpdateLib/Tasks/UpdatableTask.cs +++ b/UpdateLib/UpdateLib/Tasks/UpdatableTask.cs @@ -1,5 +1,12 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) +/* Copyright + * + * UpdateLib - .Net auto update library + * + * File: UpdatableTask.cs v0.5 + * + * Author: Matthias Beerens + * + * Copyright (C) 2016 - MatthiWare * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published @@ -12,7 +19,7 @@ * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * along with this program. If not, see . */ namespace MatthiWare.UpdateLib.Tasks diff --git a/UpdateLib/UpdateLib/Tasks/UpdateCacheTask.cs b/UpdateLib/UpdateLib/Tasks/UpdateCacheTask.cs index 30a98fc..a22e518 100644 --- a/UpdateLib/UpdateLib/Tasks/UpdateCacheTask.cs +++ b/UpdateLib/UpdateLib/Tasks/UpdateCacheTask.cs @@ -1,5 +1,12 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) +/* Copyright + * + * UpdateLib - .Net auto update library + * + * File: UpdateCacheTask.cs v0.5 + * + * Author: Matthias Beerens + * + * Copyright (C) 2016 - MatthiWare * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published @@ -12,7 +19,7 @@ * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * along with this program. If not, see . */ using MatthiWare.UpdateLib.Common; @@ -25,7 +32,7 @@ namespace MatthiWare.UpdateLib.Tasks { - public class UpdateCacheTask : AsyncTask + public class UpdateCacheTask : AsyncTask { private Dictionary existingEntries = null; private IEnumerable files = null; @@ -37,7 +44,7 @@ protected override void DoWork() try { // first of lets load the file, (file might be corrupt..) - Result = HashCacheFile.Load(); + Result = FileManager.LoadFile(); Result.Items.ForEach(e => existingEntries.Add(e, false)); } @@ -47,7 +54,7 @@ protected override void DoWork() Result = null; } - DirectoryInfo dir = new DirectoryInfo(Updater.Instance.Converter.Convert("%appdir%")); + var dir = new DirectoryInfo(Updater.Instance.Converter.Convert("%appdir%")); files = dir.GetFiles("*", SearchOption.AllDirectories).Where(f => !f.FullName.Contains(".old.tmp")); Updater.Instance.Logger.Debug(nameof(UpdateCacheTask), nameof(DoWork), $"found {files.Count()} files to recheck."); diff --git a/UpdateLib/UpdateLib/Tasks/UpdateFileProcessorTask.cs b/UpdateLib/UpdateLib/Tasks/UpdateFileProcessorTask.cs deleted file mode 100644 index d244e67..0000000 --- a/UpdateLib/UpdateLib/Tasks/UpdateFileProcessorTask.cs +++ /dev/null @@ -1,61 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using MatthiWare.UpdateLib.Common; -using System; - -namespace MatthiWare.UpdateLib.Tasks -{ - public class UpdateInfoPostProcessorTask : AsyncTask - { - private UpdateInfo m_updateInfo; - - public UpdateInfoPostProcessorTask(UpdateInfo updateInfo) - { - m_updateInfo = updateInfo; - } - - - private void PostProcessDirectory(DirectoryEntry dir) - { - foreach (EntryBase file in dir.Items) - file.Parent = dir; - - int left = dir.Directories.Count; - foreach (DirectoryEntry subDir in dir.Directories) - { - subDir.Parent = dir; - - if (--left == 0) - PostProcessDirectory(subDir); - else - Enqueue(new Action(PostProcessDirectory), subDir); - } - } - - protected override void DoWork() - { - foreach (DirectoryEntry dir in m_updateInfo.Folders) - PostProcessDirectory(dir); - - foreach (DirectoryEntry dir in m_updateInfo.Registry) - PostProcessDirectory(dir); - - AwaitWorkers(); - } - } -} diff --git a/UpdateLib/UpdateLib/Tasks/UpdateRegistryTask.cs b/UpdateLib/UpdateLib/Tasks/UpdateRegistryTask.cs index 26adba1..5cbbb87 100644 --- a/UpdateLib/UpdateLib/Tasks/UpdateRegistryTask.cs +++ b/UpdateLib/UpdateLib/Tasks/UpdateRegistryTask.cs @@ -1,5 +1,12 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) +/* Copyright + * + * UpdateLib - .Net auto update library + * + * File: UpdateRegistryTask.cs v0.5 + * + * Author: Matthias Beerens + * + * Copyright (C) 2016 - MatthiWare * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published @@ -12,7 +19,7 @@ * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * along with this program. If not, see . */ using MatthiWare.UpdateLib.Common; @@ -28,9 +35,9 @@ public class UpdateRegistryTask : UpdatableTask { public IEnumerable Keys { get; set; } - + private List cachedUpdates = new List(); - + public UpdateRegistryTask(IEnumerable keys) { Keys = keys; @@ -61,7 +68,9 @@ private void UpdateKey(RegistryKeyEntry key) RegistryHelper.Update(key, rollback); - Updater.Instance.Logger.Info(nameof(UpdateRegistryTask), nameof(UpdateKey), + Updater.Instance.Logger.Info( + nameof(UpdateRegistryTask), + nameof(UpdateKey), $"Succesfully updated {key.DestinationLocation}"); } @@ -88,16 +97,20 @@ private void RollbackFailSafe(RollbackData data) { key.DeleteValue(data.key); - Updater.Instance.Logger.Warn(nameof(UpdateRegistryTask), nameof(Rollback), - $"Deleted -> {data.path}\\{data.key}"); + Updater.Instance.Logger.Warn( + nameof(UpdateRegistryTask), + nameof(Rollback), + $"Deleted -> {data.path}\\{data.key}"); return; } key.SetValue(data.key, data.cachedValue, data.type); - Updater.Instance.Logger.Warn(nameof(UpdateRegistryTask), nameof(Rollback), - $"Rolled back -> {data.path}\\{data.key}"); + Updater.Instance.Logger.Warn( + nameof(UpdateRegistryTask), + nameof(Rollback), + $"Rolled back -> {data.path}\\{data.key}"); } catch (Exception e) { diff --git a/UpdateLib/UpdateLib/UI/Components/FinishPage.cs b/UpdateLib/UpdateLib/UI/Components/FinishPage.cs index 45eafc4..d4fcd98 100644 --- a/UpdateLib/UpdateLib/UI/Components/FinishPage.cs +++ b/UpdateLib/UpdateLib/UI/Components/FinishPage.cs @@ -15,10 +15,11 @@ * along with this program. If not, see . */ -using MatthiWare.UpdateLib.Common; using System; using System.Windows.Forms; +using MatthiWare.UpdateLib.Common; + namespace MatthiWare.UpdateLib.UI.Components { public partial class FinishPage : UserControl, IWizardPage @@ -32,7 +33,7 @@ public FinishPage(UpdaterForm parent) _updaterForm = parent; - txtDescription.Text = txtDescription.Text.Replace("%AppName%", parent.updateInfo.ApplicationName); + txtDescription.Text = txtDescription.Text.Replace("%AppName%", parent.ApplicationName); txtDescription.Text = txtDescription.Text.Replace("%version%", parent.updateInfo.Version.Value); } @@ -44,7 +45,7 @@ public void UpdateState() { cbRestart.Checked = false; cbRestart.Enabled = false; - + txtDescription.Text = $"{file.ApplicationName} was unable to update to version {file.Version}!\n\n" + "Check the log files for more information!\n\n" + "Press Finish to close this wizard."; @@ -55,7 +56,7 @@ public void UpdateState() { cbRestart.Checked = false; cbRestart.Enabled = false; - + txtDescription.Text = $"{file.ApplicationName} was unable to update to version {file.Version}!\n\n" + "Update process cancelled by the user.\n\n" + "Press Finish to close this wizard."; @@ -129,7 +130,7 @@ public string Title } } - + public UpdaterForm UpdaterForm { get diff --git a/UpdateLib/UpdateLib/UI/UpdaterForm.Designer.cs b/UpdateLib/UpdateLib/UI/UpdaterForm.Designer.cs index 6dd450e..81839a8 100644 --- a/UpdateLib/UpdateLib/UI/UpdaterForm.Designer.cs +++ b/UpdateLib/UpdateLib/UI/UpdaterForm.Designer.cs @@ -129,7 +129,7 @@ private void InitializeComponent() this.linkSite.TabStop = true; this.linkSite.Text = "Powered by UpdateLib"; this.linkSite.VisitedLinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(43)))), ((int)(((byte)(129)))), ((int)(((byte)(181))))); - this.linkSite.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkSite_LinkClicked); + this.linkSite.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LinkSite_LinkClicked); // // UpdaterForm // diff --git a/UpdateLib/UpdateLib/UI/UpdaterForm.cs b/UpdateLib/UpdateLib/UI/UpdaterForm.cs index 8edbd63..adae182 100644 --- a/UpdateLib/UpdateLib/UI/UpdaterForm.cs +++ b/UpdateLib/UpdateLib/UI/UpdaterForm.cs @@ -249,7 +249,7 @@ private void UpdaterForm_FormClosing(object sender, FormClosingEventArgs e) e.Cancel = true; } - private void linkSite_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + private void LinkSite_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { Process.Start("https://github.com/MatthiWare/UpdateLib"); } diff --git a/UpdateLib/UpdateLib/UpdateLib.csproj b/UpdateLib/UpdateLib/UpdateLib.csproj index 0b880ee..9521100 100644 --- a/UpdateLib/UpdateLib/UpdateLib.csproj +++ b/UpdateLib/UpdateLib/UpdateLib.csproj @@ -50,7 +50,16 @@ + + Properties\SharedAssemblyInfo.cs + + + + + + + @@ -71,6 +80,8 @@ + + @@ -96,19 +107,20 @@ UpdaterControl.cs - + + - + @@ -116,7 +128,6 @@ - diff --git a/UpdateLib/UpdateLib/Updater.cs b/UpdateLib/UpdateLib/Updater.cs index f37f70e..429dcfc 100644 --- a/UpdateLib/UpdateLib/Updater.cs +++ b/UpdateLib/UpdateLib/Updater.cs @@ -1,5 +1,12 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) +/* Copyright + * + * UpdateLib - .Net auto update library + * + * File: Updater.cs v0.5 + * + * Author: Matthias Beerens + * + * Copyright (C) 2015 - MatthiWare * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published @@ -12,26 +19,28 @@ * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * along with this program. If not, see . */ using System; -using MatthiWare.UpdateLib.Files; -using System.Windows.Forms; -using MatthiWare.UpdateLib.UI; -using System.Drawing; -using MatthiWare.UpdateLib.Tasks; -using MatthiWare.UpdateLib.Logging; -using System.Security; +using System.Collections.Generic; +using System.ComponentModel; using System.Diagnostics; +using System.Drawing; using System.Linq; -using MatthiWare.UpdateLib.Utils; -using System.Collections.Generic; -using System.Reflection; using System.Net; -using MatthiWare.UpdateLib.Security; -using System.ComponentModel; +using System.Reflection; +using System.Security; +using System.Windows.Forms; + using MatthiWare.UpdateLib.Common; +using MatthiWare.UpdateLib.Common.Exceptions; +using MatthiWare.UpdateLib.Files; +using MatthiWare.UpdateLib.Logging; +using MatthiWare.UpdateLib.Security; +using MatthiWare.UpdateLib.Tasks; +using MatthiWare.UpdateLib.UI; +using MatthiWare.UpdateLib.Utils; namespace MatthiWare.UpdateLib { @@ -66,7 +75,6 @@ public static Updater Instance private const string m_argWait = "wait"; private const string m_rollback = "rollback"; private Lazy m_lazyPathVarConv = new Lazy(() => new PathVariableConverter()); - private TimeSpan m_cacheInvalidation = TimeSpan.FromMinutes(5); private Lazy m_lazyLogger = new Lazy(() => new Logger()); private InstallationMode m_installationMode = InstallationMode.Shared; @@ -186,15 +194,6 @@ public PathVariableConverter Converter /// public bool IsInitialized { get; private set; } - /// - /// Time before all the cached files become invalid - /// - public TimeSpan CacheInvalidationTime - { - get { return m_cacheInvalidation; } - set { m_cacheInvalidation = value; } - } - /// /// Gets or sets if the updater needs to launch as a new instance. /// True if you want cold-swapping, False if you want hot-swapping @@ -278,9 +277,10 @@ public Updater ConfigureNeedsRestartBeforeUpdate(bool needsRestartBeforeUpdate) /// /// Specify the validity time /// + [Obsolete("No longer used")] public Updater ConfigureCacheInvalidation(TimeSpan timeTillInvalidation) { - CacheInvalidationTime = timeTillInvalidation; + //CacheInvalidationTime = timeTillInvalidation; return this; } @@ -333,18 +333,17 @@ public void Initialize() // parse the command line CommandLine.Parse(); + // Set cmd line flags WaitForProcessExit = CommandLine[m_argWait]?.IsFound ?? false; StartUpdating = CommandLine[m_argUpdate]?.IsFound ?? false; UpdateSilently = CommandLine[m_argUpdateSilent]?.IsFound ?? false; Rollback = CommandLine[m_rollback]?.IsFound ?? false; - if (WaitForProcessExit) - WaitForProcessToExit((int)CommandLine[m_argWait].Value); + if (WaitForProcessExit) WaitForProcessToExit((int)CommandLine[m_argWait].Value); IsInitialized = true; - if (StartUpdating) - CheckForUpdates(); + if (StartUpdating) CheckForUpdates(); } /// @@ -352,11 +351,8 @@ public void Initialize() /// private void StartInitializationTasks() { - CleanUpTask = new CleanUpTask("%appdir%"); - CleanUpTask.ConfigureAwait(false).Start(); - - UpdateCacheTask = new UpdateCacheTask(); - UpdateCacheTask.ConfigureAwait(false).Start(); + CleanUpTask = new CleanUpTask("%appdir%").ConfigureAwait(false).Start(); + UpdateCacheTask = new UpdateCacheTask().ConfigureAwait(false).Start(); } /// @@ -400,23 +396,17 @@ public CheckForUpdatesTask CheckForUpdatesAsync() /// The update checker task. public CheckForUpdatesTask CheckForUpdatesAsync(IWin32Window owner) { - if (!IsInitialized) - throw new InvalidOperationException("The updater needs to be initialized first"); + if (!IsInitialized) throw new InvalidOperationException("The updater needs to be initialized first"); + if (UpdateURIs.Count == 0) throw new ArgumentException("No uri's specified", nameof(UpdateURIs)); - if (UpdateURIs.Count == 0) - throw new ArgumentException("No uri's specified", nameof(UpdateURIs)); + IEnumerable uris = UpdateURIs.Where(u => AllowUnsafeConnection && u.Scheme == Uri.UriSchemeHttps); - IEnumerable uris = UpdateURIs.AsEnumerable(); + if (AllowUnsafeConnection && uris.Count() == 0) + throw new SecurityException("Using unsafe connections to update from is not allowed"); - if (!AllowUnsafeConnection) - { - uris = uris.Where(u => u.Scheme == Uri.UriSchemeHttps); + int skip = 1; - if (uris.Count() == 0) - throw new SecurityException("Using unsafe connections to update from is not allowed"); - } - - CheckForUpdatesTask task = new CheckForUpdatesTask(uris.ToList()); + CheckForUpdatesTask task = new CheckForUpdatesTask(uris.FirstOrDefault()); task.TaskCompleted += (o, e) => { bool error = e.Error != null; @@ -429,7 +419,21 @@ public CheckForUpdatesTask CheckForUpdatesAsync(IWin32Window owner) if (!update || cancelled || error) { if (error) + { + var uri = uris.Skip(skip++).FirstOrDefault(); + + if (e.Error is WebException && uri != null) + { + Logger.Debug(nameof(Updater), nameof(CheckForUpdatesAsync), "Unable to download server file trying again using next specified uri.."); + + task.Uri = uri; + task.Start(); + + return; + } + HandleException(owner, e.Error); + } else if (cancelled) HandleUserCancelled(owner); else if (!update) @@ -451,8 +455,7 @@ public CheckForUpdatesTask CheckForUpdatesAsync(IWin32Window owner) if (result != DialogResult.Yes) return; - if (((!StartUpdating && NeedsRestartBeforeUpdate) - || (adminReq && !PermissionUtil.IsProcessElevated)) + if (((!StartUpdating && NeedsRestartBeforeUpdate) || (adminReq && !PermissionUtil.IsProcessElevated)) && !RestartApp(true, UpdateSilently, true, adminReq)) return; @@ -465,7 +468,7 @@ public CheckForUpdatesTask CheckForUpdatesAsync(IWin32Window owner) } }; - return (CheckForUpdatesTask)task.Start(); + return task.Start(); } private void HandleException(IWin32Window owner, Exception e) @@ -473,13 +476,21 @@ private void HandleException(IWin32Window owner, Exception e) if (UpdateSilently) return; - if (e is WebException) + if (e is NoInternetException) MessageDialog.Show( owner, $"{ProductName} Updater", "Error while updating", - "Unable to connect to the update server!\nPlease check your internet connection!", - SystemIcons.Warning, + "Unable to connect to the update server\nPlease check your internet connection and try again!", + SystemIcons.Error, + MessageBoxButtons.OK); + else if (e is NoVersionSpecifiedException) + MessageDialog.Show( + owner, + $"{ProductName} Updater", + "Error while updating", + "No available versions specified on the download server\nPlease contact the software vendor!", + SystemIcons.Error, MessageBoxButtons.OK); else if (e is Win32Exception) MessageDialog.Show( @@ -532,9 +543,7 @@ private void HandleUserCancelled(IWin32Window owner) /// /// The of the current application public HashCacheFile GetCache() - { - return UpdateCacheTask.AwaitTask().Result; - } + => UpdateCacheTask.AwaitTask().Result; /// /// Updates without user interaction @@ -555,7 +564,7 @@ private void UpdateWithoutGUI(UpdateInfo updateInfo) internal bool RestartApp(bool update = false, bool silent = false, bool waitForPid = true, bool asAdmin = false) { - Logger.Info(nameof(Updater), nameof(RestartApp), $"Restarting app: update={update} silent={silent} waitForPid={waitForPid} asAdmin={asAdmin}"); + Logger.Debug(nameof(Updater), nameof(RestartApp), $"Restarting app: update={update} silent={silent} waitForPid={waitForPid} asAdmin={asAdmin}"); List args = new List(Environment.GetCommandLineArgs()); @@ -587,13 +596,12 @@ internal bool RestartApp(bool update = false, bool silent = false, bool waitForP string arguments = args.NotEmpty().Distinct().AppendAll(" "); - ProcessStartInfo startInfo = new ProcessStartInfo(Assembly.GetEntryAssembly().Location, arguments); - - startInfo.WindowStyle = ProcessWindowStyle.Normal; - startInfo.UseShellExecute = true; - - if (asAdmin) - startInfo.Verb = "runas"; + ProcessStartInfo startInfo = new ProcessStartInfo(Assembly.GetEntryAssembly().Location, arguments) + { + WindowStyle = ProcessWindowStyle.Normal, + UseShellExecute = true, + Verb = (asAdmin) ? "runas" : string.Empty + }; try { From 3219a61f67a213dd2d3baedb6f1ead3459f81a3f Mon Sep 17 00:00:00 2001 From: Matthias Beerens Date: Fri, 12 Jan 2018 14:14:21 +0100 Subject: [PATCH 27/40] update readme --- README.md | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index e2d1c28..8459615 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@

Build Status (Travis-CI) -Buitld Status (AppVeyor) +Build Status (AppVeyor) Open Issues Codecov MIT License Join the chat at https://gitter.im/MatthiWare/UpdateLib

-# UpdateLib v0.4.4 +# UpdateLib v0.5.0-alpha A .Net auto update library made in C# ### Disclaimer @@ -16,14 +16,13 @@ UpdateLib should only be used for testing purposes untill the first stable relea Use UpdateLib at your own risk while it is still in development. ## Features -- Generator for the update file with GUI -- Updating files -- Updating registry -- Fail-safe rollback feature -- Caching system -- FluentAPI to configure the client-side application +- GUI for update generation +- Updating files and registry +- Extensive Fail-safe rollback feature +- FluentAPI to configure the client-side application (minimal configuration needed) +- Minimize network overhead by making use of binary patches ## Future -- Creation of binary patches -- Rework update generator -- Extend rollback feature +- Make UpdateLib more generic and configurable +- Bugfixes +- None planned at the moment From 19d48acd4b89ca12ab52f7a446670537e79e22b2 Mon Sep 17 00:00:00 2001 From: Matthias Beerens Date: Sun, 28 Jan 2018 17:45:35 +0100 Subject: [PATCH 28/40] Added CatalogFile + Unit tests --- UpdateLib/.shared/SharedAssemblyInfo.cs | 3 + .../Common/CatalogEntryTests.cs | 35 ++++++++++ .../Common/UpdateVersionTests.cs | 36 ++++++++++- .../Files/HashCacheFileTest.cs | 25 ++++---- .../Files/UpdateCatalogFileTests.cs | 59 +++++++++++++++++ .../UpdateLib.Tests/Tasks/AsyncTaskTest.cs | 16 +++-- .../UpdateLib.Tests/UpdateLib.Tests.csproj | 2 + UpdateLib/UpdateLib/Common/UpdateInfo.cs | 9 +-- UpdateLib/UpdateLib/Common/UpdateVersion.cs | 54 +++++++++++----- .../UpdateLib/Files/UpdateCatalogFile.cs | 64 +++++++++++++++++++ 10 files changed, 258 insertions(+), 45 deletions(-) create mode 100644 UpdateLib/UpdateLib.Tests/Common/CatalogEntryTests.cs create mode 100644 UpdateLib/UpdateLib.Tests/Files/UpdateCatalogFileTests.cs create mode 100644 UpdateLib/UpdateLib/Files/UpdateCatalogFile.cs diff --git a/UpdateLib/.shared/SharedAssemblyInfo.cs b/UpdateLib/.shared/SharedAssemblyInfo.cs index fb349eb..a8f50be 100644 --- a/UpdateLib/.shared/SharedAssemblyInfo.cs +++ b/UpdateLib/.shared/SharedAssemblyInfo.cs @@ -1,6 +1,8 @@ using System.Reflection; using System.Runtime.InteropServices; +using MatthiWare.UpdateLib.Common; + [assembly: AssemblyCompany("MatthiWare")] [assembly: AssemblyProduct("UpdateLib")] [assembly: AssemblyCopyright("Copyright © MatthiWare 2016")] @@ -9,3 +11,4 @@ [assembly: ComVisible(false)] [assembly: AssemblyVersion("0.5.0.0")] [assembly: AssemblyFileVersion("0.5.0.0")] +[assembly: ApplicationVersion("0.5.0-alpha")] diff --git a/UpdateLib/UpdateLib.Tests/Common/CatalogEntryTests.cs b/UpdateLib/UpdateLib.Tests/Common/CatalogEntryTests.cs new file mode 100644 index 0000000..5983dd7 --- /dev/null +++ b/UpdateLib/UpdateLib.Tests/Common/CatalogEntryTests.cs @@ -0,0 +1,35 @@ +using System; + +using MatthiWare.UpdateLib.Common; + +using NUnit.Framework; + +namespace UpdateLib.Tests.Common +{ + [TestFixture] + public class CatalogEntryTests + { + + [Test] + public void ConstructInvalidCatalogEntryThrowsCorrectExceotion() + { + Assert.Catch(() => new CatalogEntry(null, null, null, null)); + Assert.Catch(() => new CatalogEntry("1.0.0", "0.5.0", null, null)); + Assert.Catch(() => new CatalogEntry("1.0.0", "0.5.0", "test", null)); + + Assert.Catch(() => new CatalogEntry("1.0.0", "1.5.0", "test", null)); + } + + [Test] + public void TestIsPatchProperty() + { + CatalogEntry catalogEntry = new CatalogEntry("1.0", null, "test", "test"); + + Assert.IsFalse(catalogEntry.IsPatch); + + catalogEntry = new CatalogEntry("1.0", "0.9", "test", "test"); + + Assert.IsTrue(catalogEntry.IsPatch); + } + } +} diff --git a/UpdateLib/UpdateLib.Tests/Common/UpdateVersionTests.cs b/UpdateLib/UpdateLib.Tests/Common/UpdateVersionTests.cs index 17a1c66..7602633 100644 --- a/UpdateLib/UpdateLib.Tests/Common/UpdateVersionTests.cs +++ b/UpdateLib/UpdateLib.Tests/Common/UpdateVersionTests.cs @@ -1,6 +1,8 @@ -using MatthiWare.UpdateLib.Common; +using System; + +using MatthiWare.UpdateLib.Common; + using NUnit.Framework; -using System; namespace UpdateLib.Tests.Common { @@ -21,6 +23,19 @@ public void TestTryParseGood() Assert.AreEqual(VersionLabel.Beta, v.Label); } + [Test] + public void TestTryParseGood2() + { + string input = "1.2"; + + var v = new UpdateVersion(input); + + Assert.AreEqual(1, v.Major); + Assert.AreEqual(2, v.Minor); + Assert.AreEqual(0, v.Patch); + Assert.AreEqual(VersionLabel.None, v.Label); + } + [Test] public void TestTryParseReturnsFalseInBadCase() { @@ -74,5 +89,22 @@ public void TestOperators() Assert.IsTrue(v7 > v6, "v7 > v6"); Assert.IsTrue(v6 > v5, "v6 > v5"); } + + [Test] + public void TestConversion() + { + string input = "1.1.1-rc"; + + UpdateVersion v = input; + + Assert.AreEqual(1, v.Major); + Assert.AreEqual(1, v.Minor); + Assert.AreEqual(1, v.Patch); + Assert.AreEqual(VersionLabel.RC, v.Label); + + string output = v; + + Assert.AreEqual(input, output); + } } } diff --git a/UpdateLib/UpdateLib.Tests/Files/HashCacheFileTest.cs b/UpdateLib/UpdateLib.Tests/Files/HashCacheFileTest.cs index e3565d5..4e76b66 100644 --- a/UpdateLib/UpdateLib.Tests/Files/HashCacheFileTest.cs +++ b/UpdateLib/UpdateLib.Tests/Files/HashCacheFileTest.cs @@ -15,14 +15,16 @@ * along with this program. If not, see . */ -using MatthiWare.UpdateLib.Common; -using MatthiWare.UpdateLib.Files; -using NUnit.Framework; using System; using System.IO; using System.Linq; using System.Text; +using MatthiWare.UpdateLib.Common; +using MatthiWare.UpdateLib.Files; + +using NUnit.Framework; + namespace UpdateLib.Tests.Files { [TestFixture] @@ -36,25 +38,24 @@ public void Before() { var path = Path.GetTempPath(); - m_path = $@"{path}\\Cache_{Guid.NewGuid().ToString()}\{HashCacheFile.FILE_NAME}"; + m_path = $@"{path}\\Cache_{Guid.NewGuid().ToString()}\\{HashCacheFile.FILE_NAME}"; m_tempFile = Path.GetTempPath() + Guid.NewGuid().ToString() + "hash_cache_file_test.tmp"; - using (StreamWriter sw = new StreamWriter(File.Open(m_tempFile, FileMode.OpenOrCreate, FileAccess.Write), Encoding.Default)) - { + + using (var sw = new StreamWriter(File.Open(m_tempFile, FileMode.OpenOrCreate, FileAccess.Write), Encoding.Default)) sw.WriteLine("This is a test"); - } } [Test] public void TestLoadAndSaving() { - HashCacheFile file = new HashCacheFile(); + var file = new HashCacheFile(); file.Items.Add(new HashCacheEntry(m_tempFile)); file.Save(m_path); - HashCacheFile loadedFile = HashCacheFile.Load(m_path); + var loadedFile = FileManager.LoadFile(m_path); CheckEntries(file.Items.FirstOrDefault(), loadedFile.Items.FirstOrDefault()); } @@ -89,12 +90,8 @@ private void CheckEntries(HashCacheEntry expected, HashCacheEntry actual) private void EditFile() { - using (StreamWriter sw = new StreamWriter(File.Open(m_tempFile, FileMode.OpenOrCreate, FileAccess.Write), Encoding.Default)) - { + using (var sw = new StreamWriter(File.Open(m_tempFile, FileMode.OpenOrCreate, FileAccess.Write), Encoding.Default)) sw.WriteLine("edited"); - - sw.Flush(); - } } [TearDown] diff --git a/UpdateLib/UpdateLib.Tests/Files/UpdateCatalogFileTests.cs b/UpdateLib/UpdateLib.Tests/Files/UpdateCatalogFileTests.cs new file mode 100644 index 0000000..61dfb18 --- /dev/null +++ b/UpdateLib/UpdateLib.Tests/Files/UpdateCatalogFileTests.cs @@ -0,0 +1,59 @@ +using MatthiWare.UpdateLib.Common; +using MatthiWare.UpdateLib.Files; + +using NUnit.Framework; + +namespace UpdateLib.Tests.Files +{ + [TestFixture] + public class UpdateCatalogFileTests + { + + [Test] + public void TestTryGetLatestVersionGood() + { + var file = GenerateCatalogFile(); + + Assert.IsTrue(file.TryGetLatestUpdateForVersion("0.1", out CatalogEntry entry)); + + Assert.AreEqual(entry.FileName, "version_1.0-full"); + } + + [Test] + public void TestTryGetLatestVersionGood2() + { + var file = GenerateCatalogFile(); + + Assert.IsTrue(file.TryGetLatestUpdateForVersion("0.4", out CatalogEntry entry)); + + Assert.AreEqual(entry.FileName, "version_0.4-1.0"); + } + + [Test] + public void TestTryGetLatestVersionEmptryFileReturnsFalse() + { + var file = GenerateCatalogFile(true); + + Assert.IsFalse(file.TryGetLatestUpdateForVersion("0.1", out _)); + } + + + private UpdateCatalogFile GenerateCatalogFile(bool empty = false) + { + UpdateCatalogFile file = new UpdateCatalogFile(); + + if (!empty) + { + file.Catalog.Add(new CatalogEntry("1.0", "0.4", "version_0.4-1.0", "0x0")); + file.Catalog.Add(new CatalogEntry("0.7", "0.1", "version_0.1-0.7", "0x0")); + file.Catalog.Add(new CatalogEntry("0.8", "0.7", "version_0.7-0.8", "0x0")); + file.Catalog.Add(new CatalogEntry("0.9", "0.8", "version_0.8-0.9", "0x0")); + file.Catalog.Add(new CatalogEntry("1.0", null, "version_1.0-full", "0x0")); + file.Catalog.Add(new CatalogEntry("1.0", "0.5", "version_0.5-1.0", "0x0")); + + } + + return file; + } + } +} diff --git a/UpdateLib/UpdateLib.Tests/Tasks/AsyncTaskTest.cs b/UpdateLib/UpdateLib.Tests/Tasks/AsyncTaskTest.cs index 1e32116..f18f13b 100644 --- a/UpdateLib/UpdateLib.Tests/Tasks/AsyncTaskTest.cs +++ b/UpdateLib/UpdateLib.Tests/Tasks/AsyncTaskTest.cs @@ -15,11 +15,13 @@ * along with this program. If not, see . */ -using MatthiWare.UpdateLib.Tasks; -using NUnit.Framework; using System; -using System.Threading; using System.Runtime.Serialization; +using System.Threading; + +using MatthiWare.UpdateLib.Tasks; + +using NUnit.Framework; namespace UpdateLib.Tests.Tasks { @@ -72,9 +74,9 @@ public void TestMethod() [Test, Parallelizable] public void TestResultReturnsCorrectObject() { - TestResultTask(false); - TestResultTask(19951); - TestResultTask(new object()); + TestResultTask(false); + TestResultTask(19951); + TestResultTask(new object()); } private void TestResultTask(T input) @@ -164,7 +166,7 @@ protected override void DoWork() } } - private class ResultTask : AsyncTask + private class ResultTask : AsyncTask> { private T returnObj; diff --git a/UpdateLib/UpdateLib.Tests/UpdateLib.Tests.csproj b/UpdateLib/UpdateLib.Tests/UpdateLib.Tests.csproj index 45d9276..f3514ac 100644 --- a/UpdateLib/UpdateLib.Tests/UpdateLib.Tests.csproj +++ b/UpdateLib/UpdateLib.Tests/UpdateLib.Tests.csproj @@ -57,12 +57,14 @@ Properties\SharedAssemblyInfo.cs + + diff --git a/UpdateLib/UpdateLib/Common/UpdateInfo.cs b/UpdateLib/UpdateLib/Common/UpdateInfo.cs index e5d7b5f..9b58b3e 100644 --- a/UpdateLib/UpdateLib/Common/UpdateInfo.cs +++ b/UpdateLib/UpdateLib/Common/UpdateInfo.cs @@ -25,17 +25,14 @@ public class UpdateInfo /// and their subdirectories. /// [XmlIgnore] - public int FileCount { get { return Folders.Select(d => d.Count).Sum(); } } + public int FileCount => Folders.Sum(dir => dir.Count); [XmlIgnore] - public int RegistryKeyCount { get { return Registry.Select(r => r.Count).Sum(); } } + public int RegistryKeyCount => Registry.Sum(reg => reg.Count); [XmlArray("Registry"), XmlArrayItem("Directory")] public List Registry { get; private set; } = new List(); - public UpdateInfo() - { - - } + public UpdateInfo() { } } } diff --git a/UpdateLib/UpdateLib/Common/UpdateVersion.cs b/UpdateLib/UpdateLib/Common/UpdateVersion.cs index b1120ae..35ca993 100644 --- a/UpdateLib/UpdateLib/Common/UpdateVersion.cs +++ b/UpdateLib/UpdateLib/Common/UpdateVersion.cs @@ -28,7 +28,7 @@ namespace MatthiWare.UpdateLib.Common /// Partially based on Semantic Versioning /// [Serializable] - + public class UpdateVersion : IComparable, IComparable, IEquatable { private int m_major, m_minor, m_patch; @@ -180,13 +180,25 @@ public bool Equals(UpdateVersion other) && m_label == other.m_label; } - #endregion + public override bool Equals(object obj) + => Equals(obj as UpdateVersion); - public override string ToString() + public override int GetHashCode() { - return $"{m_major}.{m_minor}.{m_patch}{LabelToString()}"; + int hash = 269; + + hash = (hash * 47) + Major.GetHashCode(); + hash = (hash * 47) + Minor.GetHashCode(); + hash = (hash * 47) + Patch.GetHashCode(); + hash = (hash * 47) + Label.GetHashCode(); + + return hash; } + #endregion + + public override string ToString() => $"{m_major}.{m_minor}.{m_patch}{LabelToString()}"; + private string LabelToString() { switch (m_label) @@ -229,12 +241,18 @@ private static bool TryParseVersionLabelString(string input, out VersionLabel la } } + /// + /// Tries to parse the to a + /// + /// Input string should be of format "major.minor.patch(-label)". The (-label) is optional + /// The output parameter + /// True if succesfully parsed, false if failed public static bool TryParse(string input, out UpdateVersion version) { var tokens = input.Split(CharSplitDot); version = new UpdateVersion(); - if (tokens.Length != 3) + if (tokens.Length > 3) // invalid version format, needs to be the following major.minor.patch(-label) return false; if (tokens.Length > 2) @@ -244,20 +262,19 @@ public static bool TryParse(string input, out UpdateVersion version) if (!int.TryParse(extraTokens[0], out version.m_patch)) return false; - if (extraTokens.Length > 1) - if (!TryParseVersionLabelString(extraTokens[1], out version.m_label)) - return false; + if (extraTokens.Length > 1 && !TryParseVersionLabelString(extraTokens[1], out version.m_label)) // unable to parse the version label + return false; + + if (extraTokens.Length > 2) return false; // invalid, can only contain 1 version label string } - if (tokens.Length > 1) - if (!int.TryParse(tokens[1], out version.m_minor)) - return false; + if (tokens.Length > 1 && !int.TryParse(tokens[1], out version.m_minor)) + return false; - if (tokens.Length > 0) - if (!int.TryParse(tokens[0], out version.m_major)) - return false; + if (tokens.Length > 0 && !int.TryParse(tokens[0], out version.m_major)) + return false; - return true; + return true; // everything parsed succesfully } public static bool operator ==(UpdateVersion v1, UpdateVersion v2) @@ -277,6 +294,11 @@ public static bool TryParse(string input, out UpdateVersion version) public static bool operator <=(UpdateVersion v1, UpdateVersion v2) => !ReferenceEquals(v1, null) && v1.CompareTo(v2) <= 0; - + + public static implicit operator UpdateVersion(string value) + => new UpdateVersion(value); + + public static implicit operator string(UpdateVersion version) + => version.Value; } } diff --git a/UpdateLib/UpdateLib/Files/UpdateCatalogFile.cs b/UpdateLib/UpdateLib/Files/UpdateCatalogFile.cs new file mode 100644 index 0000000..fa810df --- /dev/null +++ b/UpdateLib/UpdateLib/Files/UpdateCatalogFile.cs @@ -0,0 +1,64 @@ +/* Copyright + * + * UpdateLib - .Net auto update library + * + * File: ServerFile.cs v0.5 + * + * Author: Matthias Beerens + * + * Copyright (C) 2017 - MatthiWare + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using System; +using System.Collections.Generic; +using System.Linq; + +using MatthiWare.UpdateLib.Common; +using MatthiWare.UpdateLib.Common.Abstraction; +using MatthiWare.UpdateLib.Utils; + +namespace MatthiWare.UpdateLib.Files +{ + [Serializable] + public class UpdateCatalogFile : FileBase + { + public List Catalog { get; private set; } = new List(); + + /// + /// Download Url's + /// + public List DownloadUrls { get; private set; } = new List(); + + /// + /// Tries to get the best update for the current version. + /// + /// + /// + /// True if an update available, false if none available. + public bool TryGetLatestUpdateForVersion(UpdateVersion currentVersion, out CatalogEntry entry) + { + if (currentVersion == null) throw new ArgumentNullException(nameof(currentVersion)); + + entry = Catalog.OrderBy(c => c).Where(c => currentVersion < c.Version && ((c.IsPatch && c.BasedOnVersion == currentVersion) || !c.IsPatch)).FirstOrDefault(); + + return entry != null; + } + + public override UpdateCatalogFile Load() => Load($"{IOUtils.AppDataPath}\\catalogus.xml"); + + public override void Save() => throw new NotImplementedException(); + } +} From 8a389f1fedbf025746654e06734e101916bde0e6 Mon Sep 17 00:00:00 2001 From: Matthias Beerens Date: Thu, 15 Feb 2018 12:23:20 +0100 Subject: [PATCH 29/40] Clearing errors for new feature --- UpdateLib/.shared/SharedAssemblyInfo.cs | 3 - UpdateLib/TestApp/Properties/AssemblyInfo.cs | 3 + .../UpdateLib.Generator/MainForm.Designer.cs | 506 ++- UpdateLib/UpdateLib.Generator/MainForm.cs | 218 +- UpdateLib/UpdateLib.Generator/MainForm.resx | 2900 +---------------- UpdateLib/UpdateLib.Generator/Program.cs | 2 +- .../Tasks/LoadDirectoryTask.cs | 20 +- .../Tasks/UpdateGeneratorTask.cs | 28 +- .../UpdateLib.Generator/TestForm.Designer.cs | 264 -- UpdateLib/UpdateLib.Generator/TestForm.cs | 218 -- UpdateLib/UpdateLib.Generator/TestForm.resx | 202 -- .../UI/Pages/BuilderPage.cs | 15 +- .../UI/Pages/PageControlBase.cs | 2 +- .../UpdateLib.Generator.csproj | 19 +- .../Common/CatalogEntryTests.cs | 35 - .../UpdateLib.Tests/Common/UpdateInfoTests.cs | 35 + .../Files/UpdateCatalogFileTests.cs | 26 +- .../UpdateLib.Tests/Files/UpdateFileTest.cs | 33 +- .../Tasks/DownloadManagerTests.cs | 20 +- .../UpdateLib.Tests/UpdateLib.Tests.csproj | 2 +- .../Util/ExtensionMethodsTest.cs | 34 +- UpdateLib/UpdateLib.Tests/Util/LazyTests.cs | 22 +- .../UpdateLib/Common/Abstraction/FileBase.cs | 6 +- UpdateLib/UpdateLib/Common/Attributes.cs | 19 + UpdateLib/UpdateLib/Common/DirectoryEntry.cs | 18 +- ...ion.cs => InvalidUpdateServerException.cs} | 10 +- .../UnableToDownloadUpdateException.cs | 16 + UpdateLib/UpdateLib/Common/HashCacheEntry.cs | 16 +- .../UpdateLib/Common/ParameterDefinition.cs | 4 +- UpdateLib/UpdateLib/Common/UpdateInfo.cs | 114 +- UpdateLib/UpdateLib/Common/UpdateVersion.cs | 25 +- .../Compression/GZip/GZipInputStream.cs | 8 +- .../Compression/GZip/GZipOutputStream.cs | 8 +- .../Streams/InflaterInputStream.cs | 4 +- .../UpdateLib/Compression/Zip/ZipEntry.cs | 3 - .../UpdateLib/Compression/Zip/ZipFile.cs | 27 +- UpdateLib/UpdateLib/Files/CacheFile.cs | 22 + UpdateLib/UpdateLib/Files/HashCacheFile.cs | 12 +- UpdateLib/UpdateLib/Files/ServerFile.cs | 39 - .../UpdateLib/Files/UpdateCatalogFile.cs | 43 +- UpdateLib/UpdateLib/Files/UpdateFile.cs | 60 - .../UpdateLib/Files/UpdateMetadataFile.cs | 51 + .../Logging/Writers/FileLogWriter.cs | 4 +- .../UpdateLib/Properties/AssemblyInfo.cs | 10 + UpdateLib/UpdateLib/Security/HashUtil.cs | 15 +- .../UpdateLib/Security/PermissionUtil.cs | 44 +- UpdateLib/UpdateLib/Tasks/AsyncTask.cs | 20 +- .../Tasks/CheckForUpdatedItemsTask.cs | 4 +- .../UpdateLib/Tasks/CheckForUpdatesTask.cs | 99 +- .../Tasks/CheckRequiredPrivilegesTask.cs | 16 +- UpdateLib/UpdateLib/Tasks/DownloadManager.cs | 137 +- UpdateLib/UpdateLib/Tasks/DownloadTask.cs | 79 +- UpdateLib/UpdateLib/Tasks/LoadCacheTask.cs | 38 + UpdateLib/UpdateLib/Tasks/UpdateCacheTask.cs | 10 +- .../UpdateLib/UI/Components/FinishPage.cs | 13 +- .../UpdateLib/UI/Components/IntroPage.cs | 4 +- .../UpdateLib/UI/Components/UpdatePage.cs | 18 +- UpdateLib/UpdateLib/UI/UpdaterForm.cs | 27 +- UpdateLib/UpdateLib/UpdateLib.csproj | 10 +- UpdateLib/UpdateLib/Updater.cs | 88 +- UpdateLib/UpdateLib/Utils/ExtensionMethods.cs | 23 +- UpdateLib/UpdateLib/Utils/IOUtils.cs | 21 +- UpdateLib/UpdateLib/Utils/Lazy.cs | 2 + 63 files changed, 1196 insertions(+), 4598 deletions(-) delete mode 100644 UpdateLib/UpdateLib.Generator/TestForm.Designer.cs delete mode 100644 UpdateLib/UpdateLib.Generator/TestForm.cs delete mode 100644 UpdateLib/UpdateLib.Generator/TestForm.resx delete mode 100644 UpdateLib/UpdateLib.Tests/Common/CatalogEntryTests.cs create mode 100644 UpdateLib/UpdateLib.Tests/Common/UpdateInfoTests.cs create mode 100644 UpdateLib/UpdateLib/Common/Attributes.cs rename UpdateLib/UpdateLib/Common/Exceptions/{NoVersionSpecifiedException.cs => InvalidUpdateServerException.cs} (77%) create mode 100644 UpdateLib/UpdateLib/Common/Exceptions/UnableToDownloadUpdateException.cs create mode 100644 UpdateLib/UpdateLib/Files/CacheFile.cs delete mode 100644 UpdateLib/UpdateLib/Files/ServerFile.cs delete mode 100644 UpdateLib/UpdateLib/Files/UpdateFile.cs create mode 100644 UpdateLib/UpdateLib/Files/UpdateMetadataFile.cs create mode 100644 UpdateLib/UpdateLib/Tasks/LoadCacheTask.cs diff --git a/UpdateLib/.shared/SharedAssemblyInfo.cs b/UpdateLib/.shared/SharedAssemblyInfo.cs index a8f50be..fb349eb 100644 --- a/UpdateLib/.shared/SharedAssemblyInfo.cs +++ b/UpdateLib/.shared/SharedAssemblyInfo.cs @@ -1,8 +1,6 @@ using System.Reflection; using System.Runtime.InteropServices; -using MatthiWare.UpdateLib.Common; - [assembly: AssemblyCompany("MatthiWare")] [assembly: AssemblyProduct("UpdateLib")] [assembly: AssemblyCopyright("Copyright © MatthiWare 2016")] @@ -11,4 +9,3 @@ [assembly: ComVisible(false)] [assembly: AssemblyVersion("0.5.0.0")] [assembly: AssemblyFileVersion("0.5.0.0")] -[assembly: ApplicationVersion("0.5.0-alpha")] diff --git a/UpdateLib/TestApp/Properties/AssemblyInfo.cs b/UpdateLib/TestApp/Properties/AssemblyInfo.cs index b6a84c7..ef6ceff 100644 --- a/UpdateLib/TestApp/Properties/AssemblyInfo.cs +++ b/UpdateLib/TestApp/Properties/AssemblyInfo.cs @@ -1,7 +1,10 @@ using System.Reflection; +using MatthiWare.UpdateLib.Common; + // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("TestApp")] [assembly: AssemblyDescription("Test App for UpdateLib")] +[assembly: ApplicationVersion("0.5.0-alpha")] diff --git a/UpdateLib/UpdateLib.Generator/MainForm.Designer.cs b/UpdateLib/UpdateLib.Generator/MainForm.Designer.cs index d874028..4f4dacb 100644 --- a/UpdateLib/UpdateLib.Generator/MainForm.Designer.cs +++ b/UpdateLib/UpdateLib.Generator/MainForm.Designer.cs @@ -28,303 +28,237 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - System.Windows.Forms.TreeNode treeNode1 = new System.Windows.Forms.TreeNode("General Information"); - System.Windows.Forms.TreeNode treeNode2 = new System.Windows.Forms.TreeNode("Files"); - System.Windows.Forms.TreeNode treeNode3 = new System.Windows.Forms.TreeNode("Registry"); - System.Windows.Forms.TreeNode treeNode4 = new System.Windows.Forms.TreeNode("Project", new System.Windows.Forms.TreeNode[] { - treeNode1, - treeNode2, - treeNode3}); + this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); - this.splitContainer = new System.Windows.Forms.SplitContainer(); - this.tvProject = new System.Windows.Forms.TreeView(); - this.lvItems = new System.Windows.Forms.ListView(); - this.clmnName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.clmnDate = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.clmnPath = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.menuStrip = new System.Windows.Forms.MenuStrip(); - this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); - this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.statusStrip = new System.Windows.Forms.StatusStrip(); - this.lblStatus = new System.Windows.Forms.ToolStripStatusLabel(); - this.progressBar = new System.Windows.Forms.ToolStripProgressBar(); - this.toolStrip = new System.Windows.Forms.ToolStrip(); - this.newToolStripButton = new System.Windows.Forms.ToolStripButton(); - this.openToolStripButton = new System.Windows.Forms.ToolStripButton(); - this.saveToolStripButton = new System.Windows.Forms.ToolStripButton(); - this.toolStripSeparator = new System.Windows.Forms.ToolStripSeparator(); - this.buildToolStripButton = new System.Windows.Forms.ToolStripButton(); - this.splitContainer.Panel1.SuspendLayout(); - this.splitContainer.Panel2.SuspendLayout(); - this.splitContainer.SuspendLayout(); - this.menuStrip.SuspendLayout(); - this.statusStrip.SuspendLayout(); - this.toolStrip.SuspendLayout(); + this.SidebarPanel = new System.Windows.Forms.Panel(); + this.ContentPanel = new System.Windows.Forms.Panel(); + this.btnTabBuild = new MatthiWare.UpdateLib.Generator.UI.FlatButton(); + this.btnTabRegistry = new MatthiWare.UpdateLib.Generator.UI.FlatButton(); + this.btnTabFiles = new MatthiWare.UpdateLib.Generator.UI.FlatButton(); + this.btnTabInformation = new MatthiWare.UpdateLib.Generator.UI.FlatButton(); + this.HeaderPanel = new MatthiWare.UpdateLib.Generator.UI.MoveablePanel(); + this.pbMinimize = new MatthiWare.UpdateLib.Generator.UI.HoverPictureBox(); + this.pbMaximize = new MatthiWare.UpdateLib.Generator.UI.HoverPictureBox(); + this.pbClose = new MatthiWare.UpdateLib.Generator.UI.HoverPictureBox(); + this.pbIcon = new System.Windows.Forms.PictureBox(); + this.lblTitle = new System.Windows.Forms.Label(); + this.elipseComponent1 = new MatthiWare.UpdateLib.Generator.UI.ElipseComponent(this.components); + this.SidebarPanel.SuspendLayout(); + this.HeaderPanel.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pbMinimize)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pbMaximize)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pbClose)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pbIcon)).BeginInit(); this.SuspendLayout(); // - // splitContainer - // - this.splitContainer.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.splitContainer.Location = new System.Drawing.Point(0, 52); - this.splitContainer.Name = "splitContainer"; - // - // splitContainer.Panel1 - // - this.splitContainer.Panel1.Controls.Add(this.tvProject); - // - // splitContainer.Panel2 - // - this.splitContainer.Panel2.Controls.Add(this.lvItems); - this.splitContainer.Size = new System.Drawing.Size(968, 308); - this.splitContainer.SplitterDistance = 352; - this.splitContainer.TabIndex = 0; - // - // tvProject - // - this.tvProject.Dock = System.Windows.Forms.DockStyle.Fill; - this.tvProject.Location = new System.Drawing.Point(0, 0); - this.tvProject.Name = "tvProject"; - treeNode1.Name = "nodeInfo"; - treeNode1.Text = "General Information"; - treeNode2.Name = "nodeFiles"; - treeNode2.Text = "Files"; - treeNode3.Name = "nodeRegistry"; - treeNode3.Text = "Registry"; - treeNode4.Name = "root"; - treeNode4.Text = "Project"; - this.tvProject.Nodes.AddRange(new System.Windows.Forms.TreeNode[] { - treeNode4}); - this.tvProject.Size = new System.Drawing.Size(352, 308); - this.tvProject.TabIndex = 0; - this.tvProject.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.tvProject_AfterSelect); - // - // lvItems - // - this.lvItems.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.clmnName, - this.clmnDate, - this.clmnPath}); - this.lvItems.Dock = System.Windows.Forms.DockStyle.Fill; - this.lvItems.FullRowSelect = true; - this.lvItems.Location = new System.Drawing.Point(0, 0); - this.lvItems.MultiSelect = false; - this.lvItems.Name = "lvItems"; - this.lvItems.Size = new System.Drawing.Size(612, 308); - this.lvItems.TabIndex = 0; - this.lvItems.UseCompatibleStateImageBehavior = false; - this.lvItems.View = System.Windows.Forms.View.Details; - this.lvItems.DoubleClick += new System.EventHandler(this.lvItems_DoubleClick); - // - // clmnName - // - this.clmnName.Text = "Name"; - this.clmnName.Width = 139; - // - // clmnPath - // - this.clmnPath.Text = "Path"; - // - // menuStrip - // - this.menuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.fileToolStripMenuItem, - this.helpToolStripMenuItem}); - this.menuStrip.Location = new System.Drawing.Point(0, 0); - this.menuStrip.Name = "menuStrip"; - this.menuStrip.Size = new System.Drawing.Size(968, 24); - this.menuStrip.TabIndex = 1; - this.menuStrip.Text = "menuStrip1"; - // - // fileToolStripMenuItem - // - this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.newToolStripMenuItem, - this.openToolStripMenuItem, - this.saveToolStripMenuItem, - this.toolStripSeparator1, - this.exitToolStripMenuItem}); - this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; - this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); - this.fileToolStripMenuItem.Text = "File"; - // - // newToolStripMenuItem - // - this.newToolStripMenuItem.Name = "newToolStripMenuItem"; - this.newToolStripMenuItem.Size = new System.Drawing.Size(103, 22); - this.newToolStripMenuItem.Text = "New"; - // - // openToolStripMenuItem - // - this.openToolStripMenuItem.Name = "openToolStripMenuItem"; - this.openToolStripMenuItem.Size = new System.Drawing.Size(103, 22); - this.openToolStripMenuItem.Text = "Open"; - // - // saveToolStripMenuItem - // - this.saveToolStripMenuItem.Name = "saveToolStripMenuItem"; - this.saveToolStripMenuItem.Size = new System.Drawing.Size(103, 22); - this.saveToolStripMenuItem.Text = "Save"; - // - // toolStripSeparator1 - // - this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(100, 6); - // - // exitToolStripMenuItem - // - this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; - this.exitToolStripMenuItem.Size = new System.Drawing.Size(103, 22); - this.exitToolStripMenuItem.Text = "Exit"; - // - // helpToolStripMenuItem - // - this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; - this.helpToolStripMenuItem.Size = new System.Drawing.Size(44, 20); - this.helpToolStripMenuItem.Text = "Help"; - // - // statusStrip - // - this.statusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.lblStatus, - this.progressBar}); - this.statusStrip.Location = new System.Drawing.Point(0, 363); - this.statusStrip.Name = "statusStrip"; - this.statusStrip.Size = new System.Drawing.Size(968, 22); - this.statusStrip.TabIndex = 2; - this.statusStrip.Text = "statusStrip1"; - // - // lblStatus - // - this.lblStatus.Name = "lblStatus"; - this.lblStatus.Size = new System.Drawing.Size(39, 17); - this.lblStatus.Text = "Ready"; - // - // progressBar - // - this.progressBar.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; - this.progressBar.Maximum = 110; - this.progressBar.Name = "progressBar"; - this.progressBar.RightToLeft = System.Windows.Forms.RightToLeft.No; - this.progressBar.Size = new System.Drawing.Size(100, 16); - // - // toolStrip - // - this.toolStrip.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden; - this.toolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.newToolStripButton, - this.openToolStripButton, - this.saveToolStripButton, - this.toolStripSeparator, - this.buildToolStripButton}); - this.toolStrip.Location = new System.Drawing.Point(0, 24); - this.toolStrip.Name = "toolStrip"; - this.toolStrip.Size = new System.Drawing.Size(968, 25); - this.toolStrip.TabIndex = 3; - this.toolStrip.Text = "toolStrip1"; - // - // newToolStripButton - // - this.newToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.newToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("newToolStripButton.Image"))); - this.newToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.newToolStripButton.Name = "newToolStripButton"; - this.newToolStripButton.Size = new System.Drawing.Size(23, 22); - this.newToolStripButton.Text = "&New"; - // - // openToolStripButton - // - this.openToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.openToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("openToolStripButton.Image"))); - this.openToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.openToolStripButton.Name = "openToolStripButton"; - this.openToolStripButton.Size = new System.Drawing.Size(23, 22); - this.openToolStripButton.Text = "&Open"; - // - // saveToolStripButton - // - this.saveToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.saveToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("saveToolStripButton.Image"))); - this.saveToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.saveToolStripButton.Name = "saveToolStripButton"; - this.saveToolStripButton.Size = new System.Drawing.Size(23, 22); - this.saveToolStripButton.Text = "&Save"; - // - // toolStripSeparator - // - this.toolStripSeparator.Name = "toolStripSeparator"; - this.toolStripSeparator.Size = new System.Drawing.Size(6, 25); - // - // buildToolStripButton - // - this.buildToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.buildToolStripButton.Image = global::MatthiWare.UpdateLib.Generator.Properties.Resources.gears; - this.buildToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.buildToolStripButton.Name = "buildToolStripButton"; - this.buildToolStripButton.Size = new System.Drawing.Size(23, 22); - this.buildToolStripButton.Text = "C&ut"; - this.buildToolStripButton.Click += new System.EventHandler(this.buildToolStripButton_Click); - // - // MainForm + // SidebarPanel + // + this.SidebarPanel.BackColor = System.Drawing.Color.DarkGray; + this.SidebarPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.SidebarPanel.Controls.Add(this.btnTabBuild); + this.SidebarPanel.Controls.Add(this.btnTabRegistry); + this.SidebarPanel.Controls.Add(this.btnTabFiles); + this.SidebarPanel.Controls.Add(this.btnTabInformation); + this.SidebarPanel.Dock = System.Windows.Forms.DockStyle.Left; + this.SidebarPanel.Location = new System.Drawing.Point(0, 33); + this.SidebarPanel.Name = "SidebarPanel"; + this.SidebarPanel.Size = new System.Drawing.Size(233, 505); + this.SidebarPanel.TabIndex = 1; + // + // ContentPanel + // + this.ContentPanel.AutoScroll = true; + this.ContentPanel.BackColor = System.Drawing.SystemColors.Control; + this.ContentPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.ContentPanel.Dock = System.Windows.Forms.DockStyle.Fill; + this.ContentPanel.Location = new System.Drawing.Point(233, 33); + this.ContentPanel.Name = "ContentPanel"; + this.ContentPanel.Size = new System.Drawing.Size(806, 505); + this.ContentPanel.TabIndex = 2; + // + // btnTabBuild + // + this.btnTabBuild.ActiveItem = false; + this.btnTabBuild.BackHoverColor = System.Drawing.Color.LightGray; + this.btnTabBuild.BackSelectedColor = System.Drawing.Color.DimGray; + this.btnTabBuild.Dock = System.Windows.Forms.DockStyle.Top; + this.btnTabBuild.Font = new System.Drawing.Font("Century Gothic", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.btnTabBuild.InfoImage = ((System.Drawing.Image)(resources.GetObject("btnTabBuild.InfoImage"))); + this.btnTabBuild.Location = new System.Drawing.Point(0, 189); + this.btnTabBuild.Name = "btnTabBuild"; + this.btnTabBuild.Size = new System.Drawing.Size(231, 63); + this.btnTabBuild.TabIndex = 3; + this.btnTabBuild.Text = "Build"; + this.btnTabBuild.Click += new System.EventHandler(this.btnTabBuild_Click); + // + // btnTabRegistry + // + this.btnTabRegistry.ActiveItem = false; + this.btnTabRegistry.BackHoverColor = System.Drawing.Color.LightGray; + this.btnTabRegistry.BackSelectedColor = System.Drawing.Color.DimGray; + this.btnTabRegistry.Dock = System.Windows.Forms.DockStyle.Top; + this.btnTabRegistry.Font = new System.Drawing.Font("Century Gothic", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.btnTabRegistry.InfoImage = global::MatthiWare.UpdateLib.Generator.Properties.Resources.Registry_Editor_32px; + this.btnTabRegistry.Location = new System.Drawing.Point(0, 126); + this.btnTabRegistry.Name = "btnTabRegistry"; + this.btnTabRegistry.Size = new System.Drawing.Size(231, 63); + this.btnTabRegistry.TabIndex = 2; + this.btnTabRegistry.Text = "Registry"; + this.btnTabRegistry.Click += new System.EventHandler(this.btnTabRegistry_Click); + // + // btnTabFiles + // + this.btnTabFiles.ActiveItem = false; + this.btnTabFiles.BackHoverColor = System.Drawing.Color.LightGray; + this.btnTabFiles.BackSelectedColor = System.Drawing.Color.DimGray; + this.btnTabFiles.Dock = System.Windows.Forms.DockStyle.Top; + this.btnTabFiles.Font = new System.Drawing.Font("Century Gothic", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.btnTabFiles.InfoImage = ((System.Drawing.Image)(resources.GetObject("btnTabFiles.InfoImage"))); + this.btnTabFiles.Location = new System.Drawing.Point(0, 63); + this.btnTabFiles.Name = "btnTabFiles"; + this.btnTabFiles.Size = new System.Drawing.Size(231, 63); + this.btnTabFiles.TabIndex = 1; + this.btnTabFiles.Text = "Files"; + this.btnTabFiles.Click += new System.EventHandler(this.flatButton2_Click); + // + // btnTabInformation + // + this.btnTabInformation.ActiveItem = false; + this.btnTabInformation.BackHoverColor = System.Drawing.Color.LightGray; + this.btnTabInformation.BackSelectedColor = System.Drawing.Color.DimGray; + this.btnTabInformation.Dock = System.Windows.Forms.DockStyle.Top; + this.btnTabInformation.Font = new System.Drawing.Font("Century Gothic", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.btnTabInformation.InfoImage = ((System.Drawing.Image)(resources.GetObject("btnTabInformation.InfoImage"))); + this.btnTabInformation.Location = new System.Drawing.Point(0, 0); + this.btnTabInformation.Name = "btnTabInformation"; + this.btnTabInformation.Size = new System.Drawing.Size(231, 63); + this.btnTabInformation.TabIndex = 0; + this.btnTabInformation.Text = "Update Information"; + this.btnTabInformation.Click += new System.EventHandler(this.flatButton1_Click); + // + // HeaderPanel + // + this.HeaderPanel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(78)))), ((int)(((byte)(99)))), ((int)(((byte)(133))))); + this.HeaderPanel.Controls.Add(this.pbMinimize); + this.HeaderPanel.Controls.Add(this.pbMaximize); + this.HeaderPanel.Controls.Add(this.pbClose); + this.HeaderPanel.Controls.Add(this.pbIcon); + this.HeaderPanel.Controls.Add(this.lblTitle); + this.HeaderPanel.Dock = System.Windows.Forms.DockStyle.Top; + this.HeaderPanel.Location = new System.Drawing.Point(0, 0); + this.HeaderPanel.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.HeaderPanel.Name = "HeaderPanel"; + this.HeaderPanel.ParentForm = this; + this.HeaderPanel.Size = new System.Drawing.Size(1039, 33); + this.HeaderPanel.TabIndex = 1; + // + // pbMinimize + // + this.pbMinimize.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.pbMinimize.Image = ((System.Drawing.Image)(resources.GetObject("pbMinimize.Image"))); + this.pbMinimize.Location = new System.Drawing.Point(965, 5); + this.pbMinimize.Name = "pbMinimize"; + this.pbMinimize.Size = new System.Drawing.Size(24, 24); + this.pbMinimize.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pbMinimize.TabIndex = 4; + this.pbMinimize.TabStop = false; + this.pbMinimize.Click += new System.EventHandler(this.pbMinimize_Click); + // + // pbMaximize + // + this.pbMaximize.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.pbMaximize.BackColor = System.Drawing.Color.Transparent; + this.pbMaximize.Image = ((System.Drawing.Image)(resources.GetObject("pbMaximize.Image"))); + this.pbMaximize.Location = new System.Drawing.Point(988, 5); + this.pbMaximize.Name = "pbMaximize"; + this.pbMaximize.Size = new System.Drawing.Size(24, 24); + this.pbMaximize.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pbMaximize.TabIndex = 3; + this.pbMaximize.TabStop = false; + this.pbMaximize.Click += new System.EventHandler(this.pbMaximize_Click); + // + // pbClose + // + this.pbClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.pbClose.Image = ((System.Drawing.Image)(resources.GetObject("pbClose.Image"))); + this.pbClose.Location = new System.Drawing.Point(1011, 5); + this.pbClose.Name = "pbClose"; + this.pbClose.Size = new System.Drawing.Size(24, 24); + this.pbClose.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pbClose.TabIndex = 2; + this.pbClose.TabStop = false; + this.pbClose.Click += new System.EventHandler(this.pbClose_Click); + // + // pbIcon + // + this.pbIcon.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pbIcon.BackgroundImage"))); + this.pbIcon.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.pbIcon.Location = new System.Drawing.Point(5, 5); + this.pbIcon.Name = "pbIcon"; + this.pbIcon.Size = new System.Drawing.Size(24, 24); + this.pbIcon.TabIndex = 1; + this.pbIcon.TabStop = false; + // + // lblTitle + // + this.lblTitle.AutoSize = true; + this.lblTitle.BackColor = System.Drawing.Color.Transparent; + this.lblTitle.Font = new System.Drawing.Font("Century Gothic", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblTitle.ForeColor = System.Drawing.Color.WhiteSmoke; + this.lblTitle.Location = new System.Drawing.Point(31, 6); + this.lblTitle.Name = "lblTitle"; + this.lblTitle.Size = new System.Drawing.Size(157, 21); + this.lblTitle.TabIndex = 0; + this.lblTitle.Text = "Update Generator"; + // + // elipseComponent1 + // + this.elipseComponent1.Control = this; + this.elipseComponent1.Radius = 5; + // + // TestForm // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(968, 385); - this.Controls.Add(this.toolStrip); - this.Controls.Add(this.statusStrip); - this.Controls.Add(this.splitContainer); - this.Controls.Add(this.menuStrip); - this.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.AutoSize = true; + this.BackColor = System.Drawing.SystemColors.ControlLight; + this.ClientSize = new System.Drawing.Size(1039, 538); + this.Controls.Add(this.ContentPanel); + this.Controls.Add(this.SidebarPanel); + this.Controls.Add(this.HeaderPanel); + this.DoubleBuffered = true; + this.Font = new System.Drawing.Font("Century Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.Name = "MainForm"; - this.Text = "Update Generator"; - this.Load += new System.EventHandler(this.MainForm_Load); - this.splitContainer.Panel1.ResumeLayout(false); - this.splitContainer.Panel2.ResumeLayout(false); - this.splitContainer.ResumeLayout(false); - this.menuStrip.ResumeLayout(false); - this.menuStrip.PerformLayout(); - this.statusStrip.ResumeLayout(false); - this.statusStrip.PerformLayout(); - this.toolStrip.ResumeLayout(false); - this.toolStrip.PerformLayout(); + this.Name = "TestForm"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "TestForm"; + this.Click += new System.EventHandler(this.TestForm_Click); + this.SidebarPanel.ResumeLayout(false); + this.HeaderPanel.ResumeLayout(false); + this.HeaderPanel.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pbMinimize)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pbMaximize)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pbClose)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pbIcon)).EndInit(); this.ResumeLayout(false); - this.PerformLayout(); } #endregion - private System.Windows.Forms.SplitContainer splitContainer; - private System.Windows.Forms.MenuStrip menuStrip; - private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem newToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem saveToolStripMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; - private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem helpToolStripMenuItem; - private System.Windows.Forms.StatusStrip statusStrip; - private System.Windows.Forms.ToolStripStatusLabel lblStatus; - private System.Windows.Forms.ToolStrip toolStrip; - private System.Windows.Forms.ToolStripButton newToolStripButton; - private System.Windows.Forms.ToolStripButton openToolStripButton; - private System.Windows.Forms.ToolStripButton saveToolStripButton; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator; - private System.Windows.Forms.ToolStripButton buildToolStripButton; - private System.Windows.Forms.TreeView tvProject; - private System.Windows.Forms.ToolStripProgressBar progressBar; - private System.Windows.Forms.ListView lvItems; - private System.Windows.Forms.ColumnHeader clmnName; - private System.Windows.Forms.ColumnHeader clmnDate; - private System.Windows.Forms.ColumnHeader clmnPath; + private UI.ElipseComponent elipseComponent1; + private System.Windows.Forms.Label lblTitle; + private System.Windows.Forms.Panel SidebarPanel; + private UI.MoveablePanel HeaderPanel; + private System.Windows.Forms.PictureBox pbIcon; + private UI.HoverPictureBox pbClose; + private UI.HoverPictureBox pbMinimize; + private UI.HoverPictureBox pbMaximize; + private UI.FlatButton btnTabInformation; + private UI.FlatButton btnTabFiles; + private UI.FlatButton btnTabBuild; + internal System.Windows.Forms.Panel ContentPanel; + private UI.FlatButton btnTabRegistry; } -} - +} \ No newline at end of file diff --git a/UpdateLib/UpdateLib.Generator/MainForm.cs b/UpdateLib/UpdateLib.Generator/MainForm.cs index 3722220..5e39ca6 100644 --- a/UpdateLib/UpdateLib.Generator/MainForm.cs +++ b/UpdateLib/UpdateLib.Generator/MainForm.cs @@ -16,155 +16,191 @@ */ using System; -using System.ComponentModel; +using System.Collections.Generic; +using System.Data; using System.Drawing; -using System.IO; +using System.Linq; using System.Windows.Forms; -using MatthiWare.UpdateLib.Generator.Tasks; + +using MatthiWare.UpdateLib.Generator.UI; +using MatthiWare.UpdateLib.Generator.UI.Pages; +using MatthiWare.UpdateLib.Tasks; using MatthiWare.UpdateLib.UI; namespace MatthiWare.UpdateLib.Generator { public partial class MainForm : Form { - - private DirectoryInfo applicationFolder = new DirectoryInfo("./ApplicationFolder"); - private DirectoryInfo outputFolder = new DirectoryInfo("./Output"); - - private ImageList iconList; + private Dictionary pageCache; + private AsyncTask loadTask; + private bool shouldShowNewPage = false; public MainForm() { InitializeComponent(); - if (!applicationFolder.Exists) - applicationFolder.Create(); - - if (!outputFolder.Exists) - outputFolder.Create(); + pageCache = new Dictionary(); - iconList = new ImageList(); - iconList.ImageSize = new Size(24, 24); - lvItems.SmallImageList = iconList; - - LoadFolder(applicationFolder); + LoadPagesTask().Start(); } - private LoadDirectoryTask LoadFolder(DirectoryInfo path) + public bool TryGetPage(string key, out PageControlBase page) => pageCache.TryGetValue(key, out page); + + private AsyncTask LoadPagesTask() { - if (path == null) throw new ArgumentNullException(nameof(path)); - if (!path.Exists) throw new DirectoryNotFoundException($"The directory '{path.FullName}' was not found."); + if (loadTask == null) + { + LoaderControl.Show(ContentPanel); - LoadDirectoryTask task = new LoadDirectoryTask(lvItems, iconList, path); - task.Start(); + Action loadAction = new Action(() => + { + var pageType = typeof(PageControlBase); + var types = AppDomain.CurrentDomain.GetAssemblies() + .SelectMany(asm => asm.GetTypes()) + .Where(type => pageType.IsAssignableFrom(type) && !type.IsAbstract && type.IsClass && pageType != type); - return task; - } + foreach (Type type in types) + { + var name = type.Name; - private void Generate() - { + PageControlBase page = Activator.CreateInstance(type) as PageControlBase; + page.TestForm = this; - UpdateGeneratorTask generator = new UpdateGeneratorTask(null, null, null); + pageCache.Add(name, page); + } + }); - generator.TaskCompleted += Generator_TaskCompleted; - generator.TaskProgressChanged += Generator_TaskProgressChanged; + loadTask = AsyncTaskFactory.From(loadAction, null); - SetProgressBarValue(0); - SetProgressBarVisible(true); - SetWaitCursor(true); + loadTask.TaskCompleted += (o, e) => + { + LoaderControl.Hide(ContentPanel); - SetStatusMessage("Generating..."); + btnTabInformation.PerformClick(); + }; + } - generator.Start(); + return loadTask; } - private void SetWaitCursor(bool val) + private void TestForm_Click(object sender, EventArgs e) { - this.InvokeOnUI(() => UseWaitCursor = val); + WindowState = (WindowState == FormWindowState.Maximized) ? FormWindowState.Normal : FormWindowState.Maximized; } - private void SetProgressBarVisible(bool val) + private void pbMinimize_Click(object sender, EventArgs e) { - this.InvokeOnUI(() => progressBar.Visible = val); + WindowState = FormWindowState.Minimized; } - private void SetProgressBarValue(int val) + private void pbMaximize_Click(object sender, EventArgs e) { - this.InvokeOnUI(() => progressBar.Value = val); + MaximumSize = Screen.FromControl(this).WorkingArea.Size; + WindowState = (WindowState == FormWindowState.Normal ? FormWindowState.Maximized : FormWindowState.Normal); } - private void SetStatusMessage(string msg) - { - this.InvokeOnUI(() => lblStatus.Text = msg); - } + private void pbClose_Click(object sender, EventArgs e) => Close(); - private void Generator_TaskProgressChanged(object sender, ProgressChangedEventArgs e) - { - SetStatusMessage($"Generating {e.ProgressPercentage}%"); - SetProgressBarValue(e.ProgressPercentage); - } + private void flatButton1_Click(object sender, EventArgs e) => LoadPage(nameof(InformationPage)); - private void Generator_TaskCompleted(object sender, AsyncCompletedEventArgs e) - { - string filePath = string.Concat(outputFolder.FullName, "\\", "updatefile.xml"); + private void flatButton2_Click(object sender, EventArgs e) => LoadPage(nameof(FilesPage)); - UpdateGeneratorTask gen = (UpdateGeneratorTask)sender; + private bool LoadPage(string pageName) + { + loadTask.AwaitTask(); - gen.Result.Save(filePath); + bool success = TryGetPage(pageName, out PageControlBase page); - SetProgressBarValue(110); + if (success) + { + shouldShowNewPage = true; + + if (page.IsPageInitialized) + { + AddControlToContentPanel(page); + } + else + { + AddControlToContentPanel(null); + + LoaderControl.Show(ContentPanel); + + page.InitializePage((o, e) => + { + LoaderControl.Hide(ContentPanel); + + if (e.Cancelled) + { + ShowMessageBox( + "Page Load", + "Task cancelled", + "The loading of the page got cancelled.", + SystemIcons.Warning, + MessageBoxButtons.OK); + + return; + } + + if (e.Error != null) + { + ShowMessageBox( + "Page Load", + "Error occured when loading the page", + "Check the log files for more information!", + SystemIcons.Error, + MessageBoxButtons.OK); + + return; + } + + AddControlToContentPanel(page); + }); + } + } - SetStatusMessage("Build completed"); + return success; } - private void MainForm_Load(object sender, EventArgs e) + private void ShowMessageBox(string title, string header, string desc, Icon icon, MessageBoxButtons buttons = MessageBoxButtons.YesNo) { - tvProject.ExpandAll(); - tvProject.SelectedNode = tvProject.Nodes["root"].Nodes["nodeInfo"]; + MessageDialog.Show( + this, + title, + header, + desc, + icon, + buttons); } - private void tvProject_AfterSelect(object sender, TreeViewEventArgs e) + private void AddControlToContentPanel(Control toAdd) { - switch (e.Node.Name) - { - case "nodeInfo": - default: + if (!shouldShowNewPage) + return; - break; - case "nodeFiles": + ContentPanel.SuspendLayout(); - break; - case "nodeRegistry": + ContentPanel.Controls.Clear(); - break; + if (toAdd != null) + { + toAdd.Dock = DockStyle.Fill; + ContentPanel.Controls.Add(toAdd); + + shouldShowNewPage = false; } - } - private void buildToolStripButton_Click(object sender, EventArgs e) - { - Action generateAction = new Action(Generate); + ContentPanel.ResumeLayout(); - generateAction.BeginInvoke(new AsyncCallback(r => - { - SetWaitCursor(false); - //SetProgressBarVisible(false); - generateAction.EndInvoke(r); - }), null); } - private void lvItems_DoubleClick(object sender, EventArgs e) + private void btnTabBuild_Click(object sender, EventArgs e) { - if (lvItems.SelectedItems.Count == 0) - return; - - ListViewItem item = lvItems.SelectedItems[0]; - - DirectoryInfo dir = item.Tag as DirectoryInfo; - - if (dir == null) - return; + LoadPage(nameof(BuilderPage)); + } - LoadFolder(dir); + private void btnTabRegistry_Click(object sender, EventArgs e) + { + LoadPage(nameof(RegistryPage)); } } } diff --git a/UpdateLib/UpdateLib.Generator/MainForm.resx b/UpdateLib/UpdateLib.Generator/MainForm.resx index f650a4c..f6759bb 100644 --- a/UpdateLib/UpdateLib.Generator/MainForm.resx +++ b/UpdateLib/UpdateLib.Generator/MainForm.resx @@ -117,2848 +117,86 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 17, 17 - - - 132, 17 - - - 248, 17 - - + - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAERSURBVDhPrZDbSgJRGIXnpewd6jXsjSQvIrwoI0RQMChU - 0iiDPCGiE3ZCRkvR8VzTeBhnyR5/ccaZNnPhB4t9sdf6Ln5hb8QeathNJFVFKF5C8DqL4ksDVHWGDf7j - LHyPg6NjviSaFqlu5yQYR+KpupaIkrMknCxT3Y7v/NYYb0ITK1c3BarbWWhLQ7IR0cTKReyZ6lZ0XYei - ztHpK4bAc+h1FgQijzSxMptrGIxVSO0xX3AaStFki7bUMVFmaMm/eJMGfIH/MkGzLep0AXn4h/r3CJV3 - mS9gn2bY4UY/UzQ7E9TqfeTFtnuB+XAfzSHKr11kSl/uBebDiZ89ZCst3OUkdwL28sIVsE83ock+EIQV - 2Mz2wxeg6/UAAAAASUVORK5CYII= + iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAfpJREFUWEft + 1ctLFVEAx/GJjB5UZGkPopAWYYG1cO+/oP4BbiMkLagEV27qP+gPyb3to8iKSlFX4kIUNTUz6KXf7zgH + LsPcuo8zBHF/8GFmzpw758ycx01a+d9yAt0Hp2mu4vDBafm5hc/4lF4lySHMYAnXLSg7bVjFd2xmfmEZ + pX6F27CBCdjgXo5lIziCHkRNJ77BN/+dnT/ARVzGY/zED6xjA8cRLb2YhY37tsPI5ym8ZyecEzcQNY69 + b6mjFuTSBTvgXCglf+vAFdiBlfQqcm5iDs58GxlCPk/gPYdpEs6bhuODFOKEcmLJ8m04D47hFMbg2LsS + 7OQial6SPiDf23wHTB/O4hnC/bxxXIJ1a8o5TGMe1/AI7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EoCACAg - AAABACAAqBAAAKRZAgAgIAAAAQAIAKgIAABMagIAGBgAAAEAIACICQAA9HICABgYAAABAAgAyAYAAHx8 - AgAQEAAAAQAgAGgEAABEgwIAEBAAAAEACABoBQAArIcCAIlQTkcNChoKAAAADUlIRFIAAAEAAAABAAgG - AAAAXHKoZgAAAAFzUkdCAK7OHOkAAAAEZ0FNQQAAsY8L/GEFAAAACXBIWXMAAA7DAAAOwwHHb6hkAAB3 - c0lEQVR4Xu2dBVhW2faHv3unx8BOQro7xcCgEbu7UClpkBKxW8QWGxNFsVvsbkWxO8accRxnDFj/vTYc - Z3vu8htn7vxn4M5Zz/M+IiUzfO/vrB1nH5VSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSiml - lFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSiml - 1H9f/8rKyvps06ZNX50+fbrM9u3bNdasWVNBoWQxf/78D5g0aVKF0aNHa4wZM6Zc165dy3h7e3/Ffpef - M/6Nv1P8xSql1G8Wyj9r1qxvWQBU3b9/v/6RI0fMd+zYYbVlyxZrZMOGDTYKfx1MdhL2e+IsX77cetGi - RdYLFiywmj59ugULAOOgoCAdFgBVzczMyrJf6ZeMz/gvVymlfqvY1eRr9sKrcerUKZvr16+3uHXrVs9r - 1671zs/P74tcuHAhQOGv4/z58x9w5syZAPa7CTh+/HgAC2ek78GDB/vu27ev99atW3uuXbu205IlS/xZ - GDSIj483adeuXY3iIMBuQOkElFJf7OpSgb2gLK9evdrx6dOnk3744YdV7M/VjDXI8+fPcxT+Otj/c86T - J09yHj16lPPdd9/l3L9/P+fOnTs5t2/fzmHhvAZh4Zx99uzZlceOHcs8cODA9M2bNyezEOgYERHhwroB - Tfar/ZahhIBSautf2Pqzq0l9duWPfPHixdbXr19f++WXX67/9NNPN5Cff/75psJfx8uXLzk//vjjTfb7 - 4Hz//fc3WSDcZIFwkwXCjbt3795gYXCdBcFV1jVcOH369D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AAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABb6+vmP///////////////////// - //////7+/v/+/v7//v7+//7+/v/+/v7//v7+//39/f/9/f3//f39//39/f/9/f3//f39//z8/P/8/Pz/ - /Pz8//z8/P/8/Pz//Pz8//v7+//7+/v/+/v7//v7+//6+vr/+vr6//r6+v/6+vr/+fn5//n5+f/5+fn/ - +fn5//j4+P/4+Pj/+Pj4//j4+P/4+Pj/9/f3//f39//39/f/9/f3//b29v/29vb/9vb2//b29v/19fX/ - 9fX1//X19f/19fX/9PT0//T09P/09PT/8/Pz//Pz8//z8/P/8/Pz//Ly8v/y8vL/8vLy//Ly8v/x8fH/ - 8fHx//Hx8f/x8fH/8PDw//Dw8P/w8PD/7+/v/+/v7//v7+//7+/v/+7u7v/q6ur8EhISYgAAABsAAAAC - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAFvr6+Y/////////////////////////////////7+/v/+/v7//v7+//7+/v/+/v7/ - /v7+//39/f/9/f3//f39//39/f/9/f3//f39//z8/P/8/Pz//Pz8//z8/P/8/Pz/+/v7//v7+//7+/v/ - +/v7//v7+//6+vr/+vr6//r6+v/6+vr/+fn5//n5+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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAABb6+vmP///////////////////////////////////////////7+/v/+/v7/ - /v7+//7+/v/+/v7//v7+//7+/v/9/f3//f39//39/f/9/f3//f39//39/f/8/Pz//Pz8//z8/P/8/Pz/ - /Pz8//v7+//7+/v/+/v7//v7+//7+/v/+vr6//r6+v/6+vr/+vr6//n5+f/5+fn/+fn5//n5+f/5+fn/ - +Pj4//j4+P/4+Pj/+Pj4//f39//39/f/9/f3//f39//29vb/9vb2//b29v/29vb/9fX1//X19f/19fX/ - 9fX1//T09P/09PT/9PT0//Pz8//z8/P/8/Pz//Pz8//y8vL/8vLy//Ly8v/y8vL/8fHx//Hx8f/x8fH/ - 8PDw//Dw8P/w8PD/8PDw/+/v7//r6+v8EhISYgAAABsAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFvr6+Y/////////// - ///////////////////////////////////////////+/v7//v7+//7+/v/+/v7//v7+//7+/v/9/f3/ - /f39//39/f/9/f3//f39//39/f/8/Pz//Pz8//z8/P/8/Pz//Pz8//v7+//7+/v/+/v7//v7+//6+vr/ - +vr6//r6+v/6+vr/+vr6//n5+f/5+fn/+fn5//n5+f/4+Pj/+Pj4//j4+P/4+Pj/9/f3//f39//39/f/ - 9/f3//b29v/29vb/9vb2//b29v/19fX/9fX1//X19f/19fX/9PT0//T09P/09PT/9PT0//Pz8//z8/P/ - 8/Pz//Pz8//y8vL/8vLy//Ly8v/y8vL/8fHx//Hx8f/x8fH/8fHx//Dw8P/w8PD/8PDw/+vr6/wSEhJi - AAAAGwAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAW+vr5j//////////////////////////////////////////////// - ///////////+/v7//v7+//7+/v/+/v7//v7+//7+/v/9/f3//f39//39/f/9/f3//f39//39/f/8/Pz/ - /Pz8//z8/P/8/Pz//Pz8//v7+//7+/v/+/v7//v7+//7+/v/+vr6//r6+v/6+vr/+vr6//n5+f/5+fn/ - +fn5//n5+f/4+Pj/+Pj4//j4+P/4+Pj/9/f3//f39//39/f/9/f3//b29v/29vb/9vb2//b29v/19fX/ - 9fX1//X19f/19fX/9PT0//T09P/09PT/9PT0//Pz8//z8/P/8/Pz//Ly8v/y8vL/8vLy//Ly8v/x8fH/ - 8fHx//Hx8f/x8fH/8fHx//Dw8P/w8PD/6+vr/BISEmIAAAAbAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABb6+vmP///// - ///////////////////////////////////////////////////////////+/v7//v7+//7+/v/+/v7/ - /v7+//7+/v/+/v7//f39//39/f/9/f3//f39//39/f/9/f3//Pz8//z8/P/8/Pz//Pz8//z8/P/7+/v/ - +/v7//v7+//7+/v/+/v7//r6+v/6+vr/+vr6//r6+v/5+fn/+fn5//n5+f/5+fn/+fn5//j4+P/4+Pj/ - +Pj4//j4+P/39/f/9/f3//f39//39/f/9vb2//b29v/29vb/9fX1//X19f/19fX/9fX1//T09P/09PT/ - 9PT0//T09P/z8/P/8/Pz//Pz8//z8/P/8vLy//Ly8v/y8vL/8fHx//Hx8f/x8fH/8fHx//Dw8P/r6+v8 - EhISYgAAABsAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFvr6+Y/////////////////////////////////////////// - ///////////////////////////+/v7//v7+//7+/v/+/v7//v7+//7+/v/+/v7//f39//39/f/9/f3/ - /f39//39/f/9/f3//Pz8//z8/P/8/Pz//Pz8//z8/P/7+/v/+/v7//v7+//7+/v/+vr6//r6+v/6+vr/ - +vr6//r6+v/5+fn/+fn5//n5+f/5+fn/+Pj4//j4+P/4+Pj/+Pj4//f39//39/f/9/f3//f39//29vb/ - 9vb2//b29v/29vb/9fX1//X19f/19fX/9fX1//T09P/09PT/9PT0//T09P/z8/P/8/Pz//Pz8//z8/P/ - 8vLy//Ly8v/y8vL/8vLy//Hx8f/x8fH/8fHx/+vr6/wSEhJiAAAAGwAAAAIAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAW+vr5j - ///////////////////////////////////////////////////////////////////////////+/v7/ - /v7+//7+/v/+/v7//v7+//7+/v/+/v7//f39//39/f/9/f3//f39//39/f/9/f3//Pz8//z8/P/8/Pz/ - /Pz8//v7+//7+/v/+/v7//v7+//7+/v/+vr6//r6+v/6+vr/+vr6//r6+v/5+fn/+fn5//n5+f/5+fn/ - +Pj4//j4+P/4+Pj/+Pj4//f39//39/f/9/f3//f39//29vb/9vb2//b29v/29vb/9fX1//X19f/19fX/ - 9fX1//T09P/09PT/9PT0//Pz8//z8/P/8/Pz//Pz8//y8vL/8vLy//Ly8v/y8vL/8vLy//Hx8f/x8fH/ - 7Ozs/BISEmIAAAAbAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABb6+vmP///////////////////////////////////// - ///////////////////////////////////////////+/v7//v7+//7+/v/+/v7//v7+//7+/v/+/v7/ - /f39//39/f/9/f3//f39//39/f/8/Pz//Pz8//z8/P/8/Pz//Pz8//z8/P/7+/v/+/v7//v7+//7+/v/ - +/v7//r6+v/6+vr/+vr6//r6+v/5+fn/+fn5//n5+f/5+fn/+Pj4//j4+P/4+Pj/+Pj4//f39//39/f/ - 9/f3//f39//29vb/9vb2//b29v/29vb/9fX1//X19f/19fX/9fX1//T09P/09PT/9PT0//T09P/z8/P/ - 8/Pz//Pz8//y8vL/8vLy//Ly8v/y8vL/8fHx//Hx8f/s7Oz8EhISYgAAABsAAAACAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAF - vr6+Y/////////////////////////////////////////////////////////////////////////// - /////////////////v7+//7+/v/+/v7//v7+//7+/v/+/v7//v7+//39/f/9/f3//f39//39/f/9/f3/ - /f39//z8/P/8/Pz//Pz8//z8/P/8/Pz/+/v7//v7+//7+/v/+/v7//v7+//6+vr/+vr6//r6+v/6+vr/ - +fn5//n5+f/5+fn/+fn5//j4+P/4+Pj/+Pj4//j4+P/39/f/9/f3//f39//39/f/9vb2//b29v/29vb/ - 9vb2//X19f/19fX/9fX1//X19f/09PT/9PT0//T09P/09PT/8/Pz//Pz8//z8/P/8/Pz//Ly8v/y8vL/ - 8vLy/+zs7PwSEhJiAAAAGwAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAW+vr5j//////////////////////////////// - /////////////////////////////////////////////////////////////////v7+//7+/v/+/v7/ - /v7+//7+/v/+/v7//v7+//39/f/9/f3//f39//39/f/9/f3//f39//z8/P/8/Pz//Pz8//z8/P/7+/v/ - +/v7//v7+//7+/v/+/v7//r6+v/6+vr/+vr6//r6+v/6+vr/+fn5//n5+f/5+fn/+fn5//j4+P/4+Pj/ - +Pj4//j4+P/39/f/9/f3//f39//39/f/9vb2//b29v/29vb/9vb2//X19f/19fX/9fX1//T09P/09PT/ - 9PT0//T09P/z8/P/8/Pz//Pz8//z8/P/8/Pz//Ly8v/y8vL/7e3t/BISEmIAAAAbAAAAAgAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAABb6+vmP///////////////////////////////////////////////////////////////////// - /////////////////////////////////v7+//7+/v/+/v7//v7+//7+/v/+/v7//v7+//39/f/9/f3/ - /f39//39/f/9/f3//Pz8//z8/P/8/Pz//Pz8//z8/P/7+/v/+/v7//v7+//7+/v/+/v7//r6+v/6+vr/ - +vr6//r6+v/6+vr/+fn5//n5+f/5+fn/+fn5//j4+P/4+Pj/+Pj4//j4+P/39/f/9/f3//f39//39/f/ - 9vb2//b29v/29vb/9vb2//X19f/19fX/9fX1//X19f/09PT/9PT0//T09P/z8/P/8/Pz//Pz8//z8/P/ - 8vLy//Ly8v/t7e38EhISYgAAABsAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFvr6+Y/////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - /v7+//7+/v/+/v7//v7+//7+/v/+/v7//v7+//39/f/9/f3//f39//39/f/9/f3//Pz8//z8/P/8/Pz/ - /Pz8//z8/P/8/Pz/+/v7//v7+//7+/v/+/v7//r6+v/6+vr/+vr6//r6+v/6+vr/+fn5//n5+f/5+fn/ - +fn5//j4+P/4+Pj/+Pj4//j4+P/39/f/9/f3//f39//39/f/9vb2//b29v/29vb/9vb2//X19f/19fX/ - 9fX1//X19f/09PT/9PT0//T09P/z8/P/8/Pz//Pz8//z8/P/8vLy/+3t7fwSEhJiAAAAGwAAAAIAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAW+vr5j//////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////v7+//7+/v/+/v7//v7+//7+/v/+/v7/ - /v7+//39/f/9/f3//f39//39/f/9/f3//Pz8//z8/P/8/Pz//Pz8//z8/P/8/Pz/+/v7//v7+//7+/v/ - +/v7//v7+//6+vr/+vr6//r6+v/6+vr/+fn5//n5+f/5+fn/+fn5//j4+P/4+Pj/+Pj4//j4+P/39/f/ - 9/f3//f39//39/f/9vb2//b29v/29vb/9vb2//X19f/19fX/9fX1//X19f/09PT/9PT0//T09P/09PT/ - 8/Pz//Pz8//z8/P/7u7u/BISEmIAAAAbAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABb6+vmP///////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////7+/v/+/v7//v7+//7+/v/+/v7//v7+//7+/v/9/f3//f39//39/f/9/f3/ - /f39//z8/P/8/Pz//Pz8//z8/P/8/Pz/+/v7//v7+//7+/v/+/v7//v7+//6+vr/+vr6//r6+v/6+vr/ - +vr6//n5+f/5+fn/+fn5//n5+f/4+Pj/+Pj4//j4+P/4+Pj/9/f3//f39//39/f/9/f3//b29v/29vb/ - 9vb2//b29v/19fX/9fX1//X19f/09PT/9PT0//T09P/09PT/8/Pz//Pz8//u7u78EhISYgAAABsAAAAC - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAFvr6+Y/////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////v7+//7+/v/+/v7/ - /v7+//7+/v/+/v7//v7+//7+/v/9/f3//f39//39/f/9/f3//f39//z8/P/8/Pz//Pz8//z8/P/8/Pz/ - +/v7//v7+//7+/v/+/v7//v7+//6+vr/+vr6//r6+v/6+vr/+vr6//n5+f/5+fn/+fn5//n5+f/4+Pj/ - +Pj4//j4+P/4+Pj/9/f3//f39//39/f/9/f3//b29v/29vb/9vb2//b29v/19fX/9fX1//X19f/19fX/ - 9PT0//T09P/09PT/8/Pz/+7u7vwSEhJiAAAAGwAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAW+vr5j//////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////7+/v/+/v7//v7+//7+/v/+/v7//v7+//39/f/9/f3/ - /f39//39/f/9/f3//f39//z8/P/8/Pz//Pz8//z8/P/8/Pz//Pz8//v7+//7+/v/+/v7//v7+//6+vr/ - +vr6//r6+v/6+vr/+vr6//n5+f/5+fn/+fn5//n5+f/4+Pj/+Pj4//j4+P/4+Pj/9/f3//f39//39/f/ - 9/f3//b29v/29vb/9vb2//b29v/19fX/9fX1//X19f/19fX/9PT0//T09P/09PT/7+/v/BISEmIAAAAb - AAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAABb6+vmP///////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////7+/v/+/v7//v7+//7+/v/+/v7//v7+//39/f/9/f3//f39//39/f/9/f3//f39//z8/P/8/Pz/ - /Pz8//z8/P/8/Pz//Pz8//v7+//7+/v/+/v7//v7+//6+vr/+vr6//r6+v/6+vr/+fn5//n5+f/5+fn/ - +fn5//j4+P/4+Pj/+Pj4//j4+P/4+Pj/9/f3//f39//39/f/9/f3//b29v/29vb/9vb2//b29v/19fX/ - 9fX1//X19f/19fX/9PT0//T09P/v7+/8EhISYgAAABsAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFvr6+Y/////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////7+/v/+/v7//v7+//7+/v/+/v7/ - /v7+//7+/v/+/v7//f39//39/f/9/f3//f39//39/f/8/Pz//Pz8//z8/P/8/Pz//Pz8//v7+//7+/v/ - +/v7//v7+//7+/v/+vr6//r6+v/6+vr/+vr6//n5+f/5+fn/+fn5//n5+f/5+fn/+Pj4//j4+P/4+Pj/ - +Pj4//f39//39/f/9/f3//f39//29vb/9vb2//b29v/19fX/9fX1//X19f/19fX/9PT0/+/v7/wSEhJi - AAAAGwAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAW+vr5j//////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////7+/v/+/v7//v7+//7+/v/+/v7//v7+//7+/v/9/f3//f39//39/f/9/f3/ - /f39//39/f/8/Pz//Pz8//z8/P/8/Pz//Pz8//v7+//7+/v/+/v7//v7+//7+/v/+vr6//r6+v/6+vr/ - +vr6//r6+v/5+fn/+fn5//n5+f/5+fn/+Pj4//j4+P/4+Pj/+Pj4//f39//39/f/9/f3//f39//29vb/ - 9vb2//b29v/29vb/9fX1//X19f/19fX/7+/v/BISEmIAAAAbAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABb6+vmP///// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////7+/v/+/v7/ - /v7+//7+/v/+/v7//v7+//7+/v/9/f3//f39//39/f/9/f3//f39//39/f/8/Pz//Pz8//z8/P/8/Pz/ - /Pz8//v7+//7+/v/+/v7//v7+//7+/v/+vr6//r6+v/6+vr/+vr6//n5+f/5+fn/+fn5//n5+f/4+Pj/ - +Pj4//j4+P/4+Pj/9/f3//f39//39/f/9/f3//b29v/29vb/9vb2//b29v/29vb/9fX1//X19f/w8PD8 - EhISYgAAABsAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFvr6+Y/////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - ///////////////////////////////////////////+/v7//v7+//7+/v/+/v7//v7+//7+/v/9/f3/ - /f39//39/f/9/f3//f39//39/f/8/Pz//Pz8//z8/P/8/Pz//Pz8//v7+//7+/v/+/v7//v7+//6+vr/ - +vr6//r6+v/6+vr/+vr6//n5+f/5+fn/+fn5//n5+f/4+Pj/+Pj4//j4+P/4+Pj/9/f3//f39//39/f/ - 9/f3//b29v/29vb/9vb2//b29v/19fX/9fX1//Dw8PwSEhJiAAAAGwAAAAIAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAW+vr5j - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - ///////////+/v7//v7+//7+/v/+/v7//v7+//7+/v/+/v7//v7+//39/f/9/f3//f39//39/f/9/f3/ - /Pz8//z8/P/8/Pz//Pz8//z8/P/7+/v/+/v7//v7+//7+/v/+/v7//r6+v/6+vr/+vr6//r6+v/5+fn/ - +fn5//n5+f/5+fn/+fn5//j4+P/4+Pj/+Pj4//j4+P/39/f/9/f3//f39//39/f/9vb2//b29v/29vb/ - 8PDw/BISEmIAAAAbAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABb6+vmP///////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - ///////////////////////////////////////////////////////////+/v7//v7+//7+/v/+/v7/ - /v7+//7+/v/+/v7//f39//39/f/9/f3//f39//39/f/9/f3//Pz8//z8/P/8/Pz//Pz8//z8/P/7+/v/ - +/v7//v7+//7+/v/+/v7//r6+v/6+vr/+vr6//r6+v/5+fn/+fn5//n5+f/5+fn/+Pj4//j4+P/4+Pj/ - +Pj4//f39//39/f/9/f3//f39//39/f/9vb2//b29v/x8fH8EhISYgAAABsAAAACAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAF - vr6+Y/////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - ///////////////////////////+/v7//v7+//7+/v/+/v7//v7+//7+/v/+/v7//f39//39/f/9/f3/ - /f39//39/f/9/f3//Pz8//z8/P/8/Pz//Pz8//z8/P/7+/v/+/v7//v7+//7+/v/+vr6//r6+v/6+vr/ - +vr6//r6+v/5+fn/+fn5//n5+f/5+fn/+Pj4//j4+P/4+Pj/+Pj4//f39//39/f/9/f3//f39//29vb/ - 9vb2//Hx8fwSEhJiAAAAGwAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAW+vr5j//////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - /v7+//7+/v/+/v7//v7+//7+/v/+/v7//f39//39/f/9/f3//f39//39/f/9/f3//Pz8//z8/P/8/Pz/ - /Pz8//z8/P/7+/v/+/v7//v7+//7+/v/+vr6//r6+v/6+vr/+vr6//r6+v/5+fn/+fn5//n5+f/5+fn/ - +Pj4//j4+P/4+Pj/+Pj4//f39//39/f/9/f3//f39//29vb/8fHx/BISEmIAAAAbAAAAAgAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAABb6+vmP///////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////v7+//7+/v/+/v7//v7+//7+/v/+/v7/ - /v7+//39/f/9/f3//f39//39/f/9/f3//f39//z8/P/8/Pz//Pz8//z8/P/8/Pz/+/v7//v7+//7+/v/ - +/v7//v7+//6+vr/+vr6//r6+v/6+vr/+fn5//n5+f/5+fn/+fn5//j4+P/4+Pj/+Pj4//j4+P/4+Pj/ - 9/f3//f39//y8vL8EhISYgAAABsAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFvr6+Y/////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - /////////////////v7+//7+/v/+/v7//v7+//7+/v/+/v7//v7+//39/f/9/f3//f39//39/f/9/f3/ - /f39//z8/P/8/Pz//Pz8//z8/P/8/Pz/+/v7//v7+//7+/v/+/v7//r6+v/6+vr/+vr6//r6+v/5+fn/ - +fn5//n5+f/5+fn/+fn5//j4+P/4+Pj/+Pj4//j4+P/39/f/9/f3//Ly8vwSEhJiAAAAGwAAAAIAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAW+vr5j//////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////v7+//7+/v/+/v7/ - /v7+//7+/v/+/v7//v7+//39/f/9/f3//f39//39/f/9/f3//f39//z8/P/8/Pz//Pz8//z8/P/7+/v/ - +/v7//v7+//7+/v/+/v7//r6+v/6+vr/+vr6//r6+v/6+vr/+fn5//n5+f/5+fn/+fn5//j4+P/4+Pj/ - +Pj4//j4+P/39/f/8vLy/BISEmIAAAAbAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABb6+vmP///////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - /////////////////////////////////v7+//7+/v/+/v7//v7+//7+/v/+/v7//v7+//39/f/9/f3/ - /f39//39/f/9/f3//Pz8//z8/P/8/Pz//Pz8//z8/P/7+/v/+/v7//v7+//7+/v/+/v7//r6+v/6+vr/ - +vr6//r6+v/6+vr/+fn5//n5+f/5+fn/+fn5//j4+P/4+Pj/+Pj4//j4+P/z8/P8EhISYgAAABsAAAAC - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAFvr6+Y/////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////7+/v/+/v7//v7+//7+/v/+/v7//v7+//39/f/9/f3//f39//39/f/9/f3//f39//z8/P/8/Pz/ - /Pz8//z8/P/8/Pz//Pz8//v7+//7+/v/+/v7//v7+//6+vr/+vr6//r6+v/6+vr/+fn5//n5+f/5+fn/ - +fn5//n5+f/4+Pj/+Pj4//Pz8/wSEhJiAAAAGwAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAW+vr5j//////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////7+/v/+/v7//v7+//7+/v/+/v7/ - /v7+//7+/v/9/f3//f39//39/f/9/f3//f39//39/f/8/Pz//Pz8//z8/P/8/Pz/+/v7//v7+//7+/v/ - +/v7//v7+//6+vr/+vr6//r6+v/6+vr/+fn5//n5+f/5+fn/+fn5//n5+f/4+Pj/8/Pz/BISEmIAAAAb - AAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAABb6+vmP///////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////7+/v/+/v7//v7+//7+/v/+/v7//v7+//7+/v/9/f3//f39//39/f/9/f3/ - /f39//z8/P/8/Pz//Pz8//z8/P/8/Pz/+/v7//v7+//7+/v/+/v7//v7+//6+vr/+vr6//r6+v/6+vr/ - +vr6//n5+f/5+fn/+fn5//n5+f/z8/P8EhISYgAAABsAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFvr6+Y/////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////v7+//7+/v/+/v7/ - /v7+//7+/v/+/v7//v7+//7+/v/9/f3//f39//39/f/9/f3//f39//z8/P/8/Pz//Pz8//z8/P/8/Pz/ - +/v7//v7+//7+/v/+/v7//v7+//6+vr/+vr6//r6+v/6+vr/+vr6//n5+f/5+fn/+fn5//T09PwSEhJi - AAAAGwAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAW+vr5j//////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - ///////////////////////////////////////////+/v7//v7+//7+/v/+/v7//v7+//7+/v/9/f3/ - /f39//39/f/9/f3//f39//39/f/8/Pz//Pz8//z8/P/8/Pz//Pz8//v7+//7+/v/+/v7//v7+//7+/v/ - +vr6//r6+v/6+vr/+vr6//n5+f/5+fn/8/Pz/BISEmIAAAAbAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABb6+vmP///// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - ///////////+/v7//v7+//7+/v/+/v7//v7+//7+/v/9/f3//f39//39/f/9/f3//f39//39/f/8/Pz/ - /Pz8//z8/P/8/Pz//Pz8//v7+//7+/v/+/v7//v7+//7+/v/+vr6//r6+v/6+vr/+fn5//j4+P/w8PD8 - EhISYgAAABsAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFvr6+Y/////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////7+/v/+/v7//v7+//7+/v/+/v7/ - /v7+//7+/v/+/v7//f39//39/f/9/f3//f39//39/f/8/Pz//Pz8//z8/P/8/Pz//Pz8//v7+//7+/v/ - +/v7//v7+//7+/v/+vr6//r6+v/4+Pj/9fX1/+vr6/wSEhJiAAAAGwAAAAIAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAW+vr5j - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////7+/v/+/v7//v7+//7+/v/9/f3//Pz8//v7+//7+/v/+vr6//r6+v/6+vr/ - +/v7//z8/P/8/Pz//Pz8//z8/P/8/Pz//Pz8//v7+//7+/v/+/v7//v7+//6+vr/+Pj4//T09P/u7u7/ - 5eXl/BISEmIAAAAbAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABb6+vmP///////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - /f39//z8/P/6+vr/+Pj4//T09P/z8/P/8vLy//Ly8v/09PT/9vb2//j4+P/5+fn/+Pj4//j4+P/4+Pj/ - +Pj4//j4+P/39/f/9vb2//Pz8//v7+//6enp/+Tk5P/b29v8Dw8PYAAAABoAAAABAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAF - vr6+Y/////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - ///////////////////////////////////////////+/v7//Pz8//f39//x8fH/6urq/+Xl5f/j4+P/ - 4+Pj/+Xl5f/o6Oj/6urq/+zs7P/t7e3/7e3t/+7u7v/t7e3/7Ozs/+vr6//o6Oj/4+Pj/97e3v/a2tr/ - 19fX/8zMzPQSEhJRAAAAEgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAW+vr5j//////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////7+/v/7+/v/9PT0/+3t7f/n5+f/29vb/9DQ0P/MzMz/z8/P/9PT0//W1tb/2NjY/9ra2v/b29v/ - 29vb/9ra2v/Z2dn/1tbW/9LS0v/Nzc3/ycnJ/8rKyv/Pz8//srKywRAQEC8AAAAIAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAABb6+vmP///////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////v7+//z8/P/z8/P/6Ojo/+7u7v/r6+v/ - 5ubm/9zc3P/S0tL/ysrK/8fHx//Dw8P/wsLC/8HBwf/BwcH/wsLC/8TExP/ExMT/xsbG/8vLy//Q0ND/ - 1dXV/8bGxtB5eXlQAAAADwAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFvr6+Y/////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - ///////////+/v7//Pz8//T09P/l5eX/6enp/+/v7//w8PD/8PDw//Hx8f/x8fH/8fHx//Hx8f/y8vL/ - 8vLy//Ly8v/y8vL/7u7u/+rq6v/l5eX/4ODg/9zc3P/Pz8/gbGxsUgAAAA0AAAACAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAW+vr5j//////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////7+/v/8/Pz/9fX1/+fn5//e3t7/ - 7+/v/+/v7//w8PD/8PDw//Dw8P/x8fH/8fHx//Ly8v/x8fH/8fHx/+7u7v/p6en/5eXl/+Dg4P/c3Nz/ - 0NDQ64eHh3EAAAAUAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABb6+vmP///////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////7+/v/39/f/6urq/9vb2//s7Oz/7+/v/+/v7//w8PD/8PDw//Dw8P/x8fH/ - 8fHx//Dw8P/t7e3/6enp/+Tk5P/f39//3Nzc/8fHx+N+fn5xAAAAGgAAAAUAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAFvr6+Y/////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////v7+//n5+f/t7e3/ - 3d3d/+fn5//u7u7/7+/v/+/v7//v7+//8PDw//Dw8P/w8PD/7Ozs/+jo6P/j4+P/3t7e/9vb2//Gxsbj - fn5+bwAAABgAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAW+vr5j//////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - ///////////////////////////+/v7/+vr6//Hx8f/g4OD/4uLi/+7u7v/u7u7/7+/v/+/v7//v7+// - 7+/v/+vr6//n5+f/4uLi/93d3f/a2tr/zc3N7Hl5eXMAAAAYAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAABb6+vmP///////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - ///////////////////////////////////////////////////////////////////////////8/Pz/ - 8vLy/+Li4v/g4OD/7e3t/+3t7f/u7u7/7u7u/+3t7f/q6ur/5ubm/+Hh4f/d3d3/2dnZ/8zMzO2BgYF8 - AAAAGwAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFvr6+Y/////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////z8/P/z8/P/5OTk/9/f3//t7e3/7e3t/+3t7f/s7Oz/ - 6urq/+bm5v/g4OD/3Nzc/9nZ2f/FxcXleXl5dgAAABsAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAW+vr5j//////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - /f39//T09P/k5OT/3d3d/+zs7P/s7Oz/7Ozs/+np6f/k5OT/4ODg/9vb2//Y2Nj/wsLC5Xl5eXEAAAAZ - AAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABb6+vmP///// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - ///////////////////////////////////////////9/f3/9fX1/+Xl5f/d3d3/7Ozs/+vr6//o6Oj/ - 5OTk/97e3v/a2tr/19fX/8fHx+x3d3d1AAAAGQAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFvr6+Y/////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////39/f/19fX/5OTk/9zc3P/q6ur/5+fn/+Pj4//e3t7/2tra/9bW1v/Jycnufn5+fwAAABsAAAAF - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAW+vr5j - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////f39//T09P/k5OT/29vb/+bm5v/i4uL/ - 3d3d/9nZ2f/W1tb/wcHB53Z2dnsAAAAcAAAABgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABb6+vmP///////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - ///////////8/Pz/8/Pz/+Li4v/Z2dn/4eHh/9zc3P/Y2Nj/1NTU/729veZ2dnZ0AAAAGgAAAAUAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAF - vr6+Y/////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////v7+//x8fH/3d3d/9XV1f/b29v/ - 19fX/9TU1P/CwsLscnJyeAkJCRsAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAW+vr5j//////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - ///////////+/v7/+fn5/+zs7P/Z2dn/09PT/9fX1//T09P/xsbG7nh4eIEAAAAcAAAABQAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAABb6+vmP///////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////v7+//39/f/19fX/5ubm/9TU1P/S0tL/ - 0tLS/7+/v+l2dnZ/AAAAHQAAAAYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFvr6+Y/////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - ///////////+/v7/+fn5//Dw8P/i4uL/09PT/9HR0f+/v7/kdXV1dQAAABsAAAAGAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAW+vr5j//////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////v7+//r6+v/09PT/6urq/9/f3//T09P/ - w8PD5n19fWwKCgoYAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABMTExGD///////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - /v7+//7+/v/6+vr/9fX1/+/v7//n5+f/3Nzc/crKyuNzc3NjAAAAEwAAAAIAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///// - //////////////////////////////////////////////////////////////////////////4B//// - ///////////////gAD//////////////////gAAP/////////////////gAAA///////////////3/wA - AAH//////////////8/wAAAAf//////////////D4AAAAD//////////////wMAAAAAf//////////// - /8AAAAAAD//////////////AAAAAAA//////////////wAAAAAAH/////////////8AAAAAAA/////// - ///////AAAH+AAH/////////////wAAH/wAB/////////////8AAD//AB//////AAAAAAAAAAAAD4B// - ////wAAAAAAAAAAAA+A//////8AAAAAAAAAAAAPw/7/////AAAAAAAAAAAAD+/4/////wAAAAAAAAAAA - A//8P////8AAAAAAAAAAAAP/8D/////AAAAAAAAAAAAD/8A/////wAAAAAAAAAAAA/+AP////8AAAAAA - AAAAAAP+AD/////AAAAAAAAAAAAD+AA/////wAAAAAAAAAAAA/AAP////8AAAAAAAAAAAAPAAD/////A - AAAAAAAAAAADAAA/////wAAAAAAAAAAAAAAAP////8AAAAAAAAAAAAAAAD/////AAAAAAAAAAAAAAAA/ - ////wAAAAAAAAAAAAAAAP////8AAAAAAAAAAAAAAAD/////AAAAAAAAAAAADAAA/////wAAAAAAAAAAA - AAAAP////8AAAAAAAAAAAAAAAD/////AAAAAAAAAAAAAAAA/////wAAAAAAAAAAAAAAAP////8AAAAAA - AAAAAAAAAD/////AAAAAAAAAAAAAAAA/////wAAAAAAAAAAAAAAwP////8AAAAAAAAAAAAAAfD/////A - AAAAAAAAAAAAAP8/////wAAAAAAAAAAAAAH/v////8AAAAAAAAAAAAAH///////AAAAAAAAAAAAAD/// - ////wAAAAAAAAAAAAH///////8AAAAAAAAAAAAH////////AAAAAAAAAAAAD////////wAAAAAAAAAAA - A////////8AAAAAAAAAAAAP////////AAAAAAAAAAAAD////////wAAAAAAAAAAAA////////8AAAAAA - AAAAAAP////////AAAAAAAAAAAAD////////wAAAAAAAAAAAA////////8AAAAAAAAAAAAP////////A - AAAAAAAAAAAD////////wAAAAAAAAAAAA////////8AAAAAAAAAAAAP////////AAAAAAAAAAAAD//// - ////wAAAAAAAAAAAA////////8AAAAAAAAAAAAP////////AAAAAAAAAAAAD////////wAAAAAAAAAAA - A////////8AAAAAAAAAAAAP////////AAAAAAAAAAAAD////////wAAAAAAAAAAAA////////8AAAAAA - AAAAAAP////////AAAAAAAAAAAAD////////wAAAAAAAAAAAA////////8AAAAAAAAAAAAP////////A - AAAAAAAAAAAD////////wAAAAAAAAAAAA////////8AAAAAAAAAAAAP////////AAAAAAAAAAAAD//// - ////wAAAAAAAAAAAA////////8AAAAAAAAAAAAP////////AAAAAAAAAAAAD////////wAAAAAAAAAAA - A////////8AAAAAAAAAAAAP////////AAAAAAAAAAAAD////////wAAAAAAAAAAAA////////8AAAAAA - AAAAAAP////////AAAAAAAAAAAAD////////wAAAAAAAAAAAA////////8AAAAAAAAAAAAP////////A - AAAAAAAAAAAD////////wAAAAAAAAAAAA////////8AAAAAAAAAAAAP////////AAAAAAAAAAAAD//// - ////wAAAAAAAAAAAA////////8AAAAAAAAAAAAP////////AAAAAAAAAAAAD////////wAAAAAAAAAAA - B////////8AAAAAAAAAAAA/////////AAAAAAAAAAAAf////////wAAAAAAAAAAAP////////8AAAAAA - AAAAAH/////////AAAAAAAAAAAD/////////wAAAAAAAAAAB/////////8AAAAAAAAAAA//////////A - AAAAAAAAAAf/////////wAAAAAAAAAAP/////////8AAAAAAAAAAH//////////AAAAAAAAAAD////// - ////wAAAAAAAAAB//////////8AAAAAAAAAA///////////AAAAAAAAAAP//////////wAAAAAAAAAP/ - /////////8AAAAAAAAAH///////////AAAAAAAAAD///////////wAAAAAAAAB///////////8AAAAAA - AAA///////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - /////ygAAACAAAAAAAEAAAEACAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/BAQE/woKCv8NDQ3/ - ABgA/xISEv8APwD/ADMJ/wsvFP8SOB3/AEMB/wBDCv8ASgz/AEQS/wFKFf8LRRv/D00f/wBQEf8KVh// - B1sd/wBjEf8AaBX/AGoc/wB8F/8AfRv/Dk0g/xZEIv8cRif/FUoj/xhLJv8ZTij/D1Ag/w5fJf8RVCP/ - Elsm/xtUK/8V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vR/9PT0//R3dT/29vb/8Liy//K5tH/yunT/9Hs1//b493/1Ova/9rr3//f5eH/3e7i/9/z5P/k5OT/ - 5enm/+zs7P/j8ef/5vTq/+r07P/x8fH/9fX1//L69P/5+fn//v7+/wAAAP8AAAD//f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f12dXV1dWxsdXN1dXV4/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f1bYGRpZWhoampm - aWRlZWRgW/39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f0YPT5I - ZHB8l5+qoJ+Zl5R5aGU+OF1b/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f1bYD5IYpXE1M3JxcPBwa2rq6eglnVISWRf/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/XVb - /f39/f39/f39Nj9GZp/Q1MzGw8HBrquqp6Wgn56enpp5SD9d/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39az9gW/39/f39Wzg7PnzU1MnJw8PDw7W1q6umoJ+enpiXl5eHSDxgW/39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f1pRkY+Xf39/V9hRWGl2NTMycnJx8Gnn5eXmJ+goJ+amJeWlJSHaUdhXv39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/WlsejovOF9jYUJrzdfQycnNyZ98cHNzc3R2c3Rzh5eXlZSHh4d8 - bEZIW/39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39aW/7rmEwRmk6atTVzMrNyZdwdHV2eHh4eHZ2eHZ2 - doeUk4eHfHl7b0Y4/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f1OafLq6Zc3LGvU1c3MzcF4dHZ4eHx4 - fHx4fHx7e3h4dnaHh3l4eHh8aToz/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/U5p7tzc6dCH1NfNzNSX - cHR4eHh8eHVORkJGRk51e3h2dnZ8eXZ4eHh4Rjpd/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39Tm3s29nZ - 2dfVzczNlXF2eHh7eE5AQDw1KRYrOkBHc3t5dnh4eHh4eHt7Qjxf/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f1IUuvY19XU1MzMzJNzeHh4e3VCLThfW/39/f1cPS8naXh7eHh4eHh4eHt1QDxb/f39/f39/f39/f39 - /f39/f39/f0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAE5t6tjV1NDMytSVc3h4e3hOQDw2AAAAAAAAAAAAMzgiRnl2eHh4eHh7aUAuOBj9/f39 - /f39/f39/f39/f39/f39/QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAARm3r1dTMzMrQpXF4eHh4RydGLgAAAAAAAAAAAAAAADItQ3t2eHt7dUIi - NVv9/f39/f39/f39/f39/f39/f39/f39AAAAAAAAAAAAAAAAArrm4eDh4eDg4ODg4ODg4ODg4ODg4ODg - 4ODg4ODgwODg4ODgwODgwODAwODA4MDAwL9OUt/Uzc3NzMNzdHh4eHh8aycibri/vr+/v7/ABQAAADEh - aXx8eEYlMDb9/f39/f39/f39/f39/f39/f39/f39/f0AAAAAAAAAAAAAAAACwPr6+vr6+vr6+vr6+vn6 - +vn5+fr5+fn5+fn1+fn59fn19fX59fX19fX19fX19fX19UZu3c3MzMnMdnR4eHh4eHh7fGkjLp3t9PXz - 9PMFAAAAADUjdWkmIjdc/f39/f39/f39/f39/f39/f39/f39/f39/QAAAAAAAAAAAAAAAAO//Pr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8/Pr6+vr6+vr6+vr6+fn6+fn5+fn6+fn1BQAAAAAA - AAAAAAAAAP39/f39/f39/f39/f39/f39/f39/f39/f0AAAAAAAAAAAAAAAADwP39/f39/f39/f39/f39 - /f39/f39/f39/f39/P39/fz9/P39/fz9/Pz8/Pz8/Pz8/Pr8/Pr6/Pr6/Pr6+vr6+vn6+vn6+vn5+vn5 - +fkFAAAAAAAAAAAAAAAA/f39/f39/f39/f39/f39/f39/f39/f39/QAAAAAAAAAAAAAAAALA/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/P39/f39/Pz8/fz8/f38/Pz8/Pz8/Pr8/Pz6/Pz6+vr8+vr6+vr6 - +vn5+vr5+fn59QUAAAAAAAAAAAAAAAD9/f39/f39/f39/f39/f39/f39/f39/f39AAAAAAAAAAAAAAAA - AuD9/f39/f39/f39/f39/f39/f39/f39/f39/f39/Pz9/P39/fz8/P38/P38/fz8/Pz8/Pr8/Pz6+vr6 - /Pr6+vr6+vn6+vr5+fr6+vr1BQAAAAAAAAAAAAAAAP39/f39/f39/f39/f39/f39/f39/f39/f0AAAAA - AAAAAAAAAAACwP39/f39/f39/f39/f39/f39/f39/f39/f39/f39/fz9/Pz8/fz9/Pz8/Pz8/Pz8/Pz8 - /Pr6/Pz8/Pz6+vz6+vr6+vr6+fr6+fn5+fkFAAAAAAAAAAAAAAAA/f39/f39/f39/f39/f39/f39/f39 - /f39/QAAAAAAAAAAAAAAAAPA/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/fz9/f38 - /fz9/Pz8/Pz8/Pz6+vr6+vr6+vz6+vr6+vr6+fn6+vn59QUAAAAAAAAAAAAAAAD9/f39/f39/f39/f39 - /f39/f39/f39/f39AAAAAAAAAAAAAAAAAsD9/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/P39 - /fz9/fz8/P38/Pz9/Pz8/Pz8/Pz8/Pz8/Pz6+vr8+vr6+vr6+vn5+vr5BQAAAAAAAAAAAAAAAP39/f39 - /f39/f39/f39/f39/f39/f39/f0AAAAAAAAAAAAAAAAC4P39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/Pz8/fz9/f38/Pz9/Pz9/Pz8/Pz8/Pz8/Pz6+vz6+vr6/Pr6+vr6+vr5+fkFAAAAAAAAAAAA - AAAA/f39/f39/f39/f39/f39/f39/f39/f39/QAAAAAAAAAAAAAAAALA/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/fz8/P38/fz9/Pz9/Pz8/Pz8/Pz6+vz8+vz8+vr6+vr6+vr6+vr69QUA - AAAAAAAAAAAAAAD9/f39/f39/f39/f39/f39/f39/f39/f39AAAAAAAAAAAAAAAAA8D9/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/fz9/f39/f38/fz9/Pz9/fz8/Pz8/Pz8/Pz8+vr8+vr6+vr6 - +vr5+vn5BQAAAAAAAAAAAAAAAP39/f39/f39/f39/f39/f39/f39/f39/f0AAAAAAAAAAAAAAAACwP39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/fz9/f38/f38/Pz9/Pz8/fz8/Pz8/Pz8+vr8 - /Pr8+vr6+vr6+vr6+vkFAAAAAAAAAAAAAAAA/f39/f39/f39/f39/f39/f39/f39/f39/QAAAAAAAAAA - AAAAAALg/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/fz8/P38/f39/Pz9/Pz8/fz8 - /Pr8/Pz8/Pz8/Pr8/Pr6+vr6+vr6+QUAAAAAAAAAAAAAAAD9/f39/f39/f39/f39/f39/f39/f39/f39 - AAAAAAAAAAAAAAAAAsD9/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f38/P39 - /Pz9/fz8/Pz8/fz8/Pz8+vr6/Pr6/Pz6+vr6+vr5BQAAAAAAAAAAAAAAAP39/f39/f39/f39/f39/f39 - /f39/f39/f0AAAAAAAAAAAAAAAADwP39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f38/f39/P39/Pz8/fz8/fz8/Pz8/Pz8/Pz6/Pz6+vz6+vz6+vkFAAAAAAAAAAAAAAAA/f39/f39/f39 - /f39/f39/f39/f39/f39/QAAAAAAAAAAAAAAAALA/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f38/f39/P39/Pz8/f38/Pz8/Pr8/Pz8/Pz6+vz6+vr8+vr6+QUAAAAAAAAAAAAAAAD9 - /f39/f39/f39/f39/f39/f39/f39/f39AAAAAAAAAAAAAAAAAuD9/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f38/P39/P39/fz8/Pz9/Pz8/fz8/Pz8/Pz8/Pz6/Pr6+vr5BQAAAAAA - AAAAAAAAAP39/f39/f39/f39/f39/f39/f39/f39/f0AAAAAAAAAAAAAAAACwP39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/P39/P39/fz8/fz9/Pz8/Pz8/Pz8/Pz6+vz6/Pz6 - +voFAAAAAAAAAAAAAAAA/f39/f39/f39/f39/f39/f39/f39/f39/QAAAAAAAAAAAAAAAAPA/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/P39/Pz9/f38/fz9/Pz8/Pz8/Pz8 - /Pz8+vz6+vr8+QUAAAAAAAAAAAAAAAD9/f39/f39/f39/f39/f39/f39/f39/f39AAAAAAAAAAAAAAAA - AsD9/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/P39/fz9/Pz8/Pz9 - /P38/Pz8/Pz6/Pz8+vz8/Pr5BQAAAAAAAAAAAAAAAP39/f39/f39/f39/f39/f39/f39/f39/f0AAAAA - AAAAAAAAAAAC4P39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/P39 - /fz9/f39/Pz9/Pz8/Pz8/Pz8/Pz8+vr6+voFAAAAAAAAAAAAAAAA/f39/f39/f39/f39/f39/f39/f39 - /f39/QAAAAAAAAAAAAAAAALA/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/Pz9/f39/Pz9/Pz8/Pz8/Pz8/Pz8/Pz8/Pz8+gUAAAAAAAAAAAAAAAD9/f39/f39/f39/f39 - /f39/f39/f39/f39AAAAAAAAAAAAAAAAA8D9/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/fz9/Pz9/fz9/P39/fz8/Pz8/Pz8/Pz8/Pr5BQAAAAAAAAAAAAAAAP39/f39 - /f39/f39/f39/f39/f39/f39/f0AAAAAAAAAAAAAAAACwP39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/fz9/fz9/fz9/Pz8/f38/Pz8/Pz8/Pz6/PoFAAAAAAAAAAAA - AAAA/f39/f39/f39/f39/f39/f39/f39/f39/QAAAAAAAAAAAAAAAALg/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/fz8/fz9/fz8/Pz8/fz8/Pz8/Pz8+gUA - AAAAAAAAAAAAAAD9/f39/f39/f39/f39/f39/f39/f39/f39AAAAAAAAAAAAAAAAAsD9/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/Pz9/f38/fz8/fz8/fz8/Pz6 - /Pz8/Pz6BQAAAAAAAAAAAAAAAP39/f39/f39/f39/f39/f39/f39/f39/f0AAAAAAAAAAAAAAAADwP39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f38 - /f38/fz8/P38/Pz8/PoFAAAAAAAAAAAAAAAA/f39/f39/f39/f39/f39/f39/f39/f39/QAAAAAAAAAA - AAAAAALA/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /P38/fz9/P38/Pz8/P38/Pz8+vz8+gUAAAAAAAAAAAAAAAD9/f39/f39/f39/f39/f39/f39/f39/f39 - AAAAAAAAAAAAAAAAAuD9/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/P38/fz9/P39/f39/P38/Pz9/Pz6BQAAAAAAAAAAAAAAAP39/f39/f39/f39/f39/f39 - /f39/f39/f0AAAAAAAAAAAAAAAACwP39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/fz9/Pz8/Pz8/Pz8/Pz8+vUFAAAAAAAAAAAAAAAA/f39/f39/f39 - /f39/f39/f39/f39/f39/QAAAAAAAAAAAAAAAAPA/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f38/f38/Pz69QUAAAAAAAAAAAAAAAD9 - /f39/f39/f39/f39/f39/f39/f39/f39AAAAAAAAAAAAAAAAAsD9/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/fz9/fz8/Pz9/P39/fz8/P38/P38+vX1BQAAAAAA - AAAAAAAAAP39/f39/f39/f39/f39/f39/f39/f39/f0AAAAAAAAAAAAAAAAC4P39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/fz6+vr5+fn6+vr6/Pz8+vz8+fnz - 8+gFAAAAAAAAAAAAAAAA/f39/f39/f39/f39/f39/f39/f39/f39/QAAAAAAAAAAAAAAAALA/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39+vn18/Pz8/X19fX1 - 9fX19fPz6Ojo4QUAAAAAAAAAAAAAAAD9/f39/f39/f39/f39/f39/f39/f39/f39AAAAAAAAAAAAAAAA - A8D9/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/fz69fPo - 4uLm5ubo6Ojo6Ojm5uLi4uK9BQAAAAAAAAAAAAAAAP39/f39/f39/f39/f39/f39/f39/f39/f0AAAAA - AAAAAAAAAAACwP39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/fr1+fX16Obh4eDg4ODg4ODg4eLm4VoBAAAAAAAAAAAAAAAA/f39/f39/f39/f39/f39/f39/f39 - /f39/QAAAAAAAAAAAAAAAALg/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f38+vPz9fn1+fn5+fn5+vn19fPz6OJYAAAAAAAAAAAAAAAAAAD9/f39/f39/f39/f39 - /f39/f39/f39/f39AAAAAAAAAAAAAAAAAsD9/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f368/P59fn1+fn5+vn19fXz8+jmsAAAAAAAAAAAAAAAAAAAAP39/f39 - /f39/f39/f39/f39/f39/f39/f0AAAAAAAAAAAAAAAADwP39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/fr16PX5+fn5+fn5+fX18/Po4a8AAAAAAAAAAAAAAAAA - AAAA/f39/f39/f39/f39/f39/f39/f39/f39/QAAAAAAAAAAAAAAAALA/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/PXo8/X5+fX1+fX19fPo6OFaAAAAAAAA - AAAAAAAAAAAAAAD9/f39/f39/f39/f39/f39/f39/f39/f39AAAAAAAAAAAAAAAAAuD9/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f389fPz9fX1+fn19fPz6Oji - WgAAAAAAAAAAAAAAAAAAAAAAAP39/f39/f39/f39/f39/f39/f39/f39/f0AAAAAAAAAAAAAAAACwP39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f368+j59fn1 - 9fX18+jo4q8AAAAAAAAAAAAAAAAAAAAAAAAA/f39/f39/f39/f39/f39/f39/f39/f39/QAAAAAAAAAA - AAAAAAPA/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /fnz8/X59fX18+jo5uBaAAAAAAAAAAAAAAAAAAAAAAAAAAD9/f39/f39/f39/f39/f39/f39/f39/f39 - AAAAAAAAAAAAAAAAAsD9/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f38+vPo9fX19fPz6OjgWgAAAAAAAAAAAAAAAAAAAAAAAAAAAP39/f39/f39/f39/f39/f39 - /f39/f39/f0AAAAAAAAAAAAAAAAC4P39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f368+j19fPz6Ojo4FoBAAAAAAAAAAAAAAAAAAAAAAAAAAAA/f39/f39/f39 - /f39/f39/f39/f39/f39/QAAAAAAAAAAAAAAAALA/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/frz6PXz8+jo5uCvAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD9 - /f39/f39/f39/f39/f39/f39/f39/f39AAAAAAAAAAAAAAAAA8D9/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39+vPo8/Po6ObgWgAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAP39/f39/f39/f39/f39/f39/f39/f39/f0AAAAAAAAAAAAAAAACwP39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/fz58+jz6OjmwFkAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAA/f39/f39/f39/f39/f39/f39/f39/f39/QAAAAAAAAAAAAAAAALg/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/fno5ujm5uBZAwAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD9/f39/f39/f39/f39/f39/f39/f39/f39AAAAAAAAAAAAAAAA - AsD9/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f389ejm - 5ubhWgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP39/f39/f39/f39/f39/f39/f39/f39/f0AAAAA - AAAAAAAAAAADwP39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/frz5uLm4FkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/f39/f39/f39/f39/f39/f39/f39 - /f39/QAAAAAAAAAAAAAAAALA/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f389fPm5uBZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD9/f39/f39/f39/f39 - /f39/f39/f39/f39AAAAAAAAAAAAAAAAA+D9/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/Pr18+bgWgMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP39/f39 - /f39/f39/f39/f39/f39/f39/f0AAAAAAAAAAAAAAAAC4P39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/fz69fPo4VkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAA/f39/f39/f39/f39/f39/f39/f39/f39/QAAAAAAAAAAAAAAAAPh+vr5+fn5+fn5+fn5+fn5+fn5 - +fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+vn59fPz6OGvAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAD9/f39/f39/f39/f39/f39/f39/f39/f39AAAAAAAAAAAAAAAABb3iv7+/v7+/v7+/ - v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7++vr29vLqxVAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAP39/f39/f39/f39/f39/f39/f39/f39/f0AAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f////////// - /////////////////////////////////////////////////////////////////////gH///////// - /////////+AAP/////////////////+AAA/////////////////+AAAD///////////////f/AAAAf// - ////////////z/AAAAB//////////////8PgAAAAP//////////////AwAAAAB//////////////wAAA - AAAP/////////////8AAAAAAD//////////////AAAAAAAf/////////////wAAAAAAD//////////// - /8AAAf4AAf/////////////AAAf/AAH/////////////wAAP/8AH/////8AAAAAAAAAAAAPgH//////A - AAAAAAAAAAAD4D//////wAAAAAAAAAAAA/D/v////8AAAAAAAAAAAAP7/j/////AAAAAAAAAAAAD//w/ - ////wAAAAAAAAAAAA//wP////8AAAAAAAAAAAAP/wD/////AAAAAAAAAAAAD/4A/////wAAAAAAAAAAA - A/4AP////8AAAAAAAAAAAAP4AD/////AAAAAAAAAAAAD8AA/////wAAAAAAAAAAAA8AAP////8AAAAAA - AAAAAAMAAD/////AAAAAAAAAAAAAAAA/////wAAAAAAAAAAAAAAAP////8AAAAAAAAAAAAAAAD/////A - AAAAAAAAAAAAAAA/////wAAAAAAAAAAAAAAAP////8AAAAAAAAAAAAMAAD/////AAAAAAAAAAAAAAAA/ - ////wAAAAAAAAAAAAAAAP////8AAAAAAAAAAAAAAAD/////AAAAAAAAAAAAAAAA/////wAAAAAAAAAAA - AAAAP////8AAAAAAAAAAAAAAAD/////AAAAAAAAAAAAAADA/////wAAAAAAAAAAAAAB8P////8AAAAAA - AAAAAAAA/z/////AAAAAAAAAAAAAAf+/////wAAAAAAAAAAAAAf//////8AAAAAAAAAAAAAP///////A - AAAAAAAAAAAAf///////wAAAAAAAAAAAAf///////8AAAAAAAAAAAAP////////AAAAAAAAAAAAD//// - ////wAAAAAAAAAAAA////////8AAAAAAAAAAAAP////////AAAAAAAAAAAAD////////wAAAAAAAAAAA - A////////8AAAAAAAAAAAAP////////AAAAAAAAAAAAD////////wAAAAAAAAAAAA////////8AAAAAA - AAAAAAP////////AAAAAAAAAAAAD////////wAAAAAAAAAAAA////////8AAAAAAAAAAAAP////////A - AAAAAAAAAAAD////////wAAAAAAAAAAAA////////8AAAAAAAAAAAAP////////AAAAAAAAAAAAD//// - ////wAAAAAAAAAAAA////////8AAAAAAAAAAAAP////////AAAAAAAAAAAAD////////wAAAAAAAAAAA - A////////8AAAAAAAAAAAAP////////AAAAAAAAAAAAD////////wAAAAAAAAAAAA////////8AAAAAA - AAAAAAP////////AAAAAAAAAAAAD////////wAAAAAAAAAAAA////////8AAAAAAAAAAAAP////////A - AAAAAAAAAAAD////////wAAAAAAAAAAAA////////8AAAAAAAAAAAAP////////AAAAAAAAAAAAD//// - ////wAAAAAAAAAAAA////////8AAAAAAAAAAAAP////////AAAAAAAAAAAAD////////wAAAAAAAAAAA - A////////8AAAAAAAAAAAAP////////AAAAAAAAAAAAD////////wAAAAAAAAAAAA////////8AAAAAA - AAAAAAP////////AAAAAAAAAAAAD////////wAAAAAAAAAAAA////////8AAAAAAAAAAAAP////////A - AAAAAAAAAAAD////////wAAAAAAAAAAAA////////8AAAAAAAAAAAAP////////AAAAAAAAAAAAH//// - ////wAAAAAAAAAAAD////////8AAAAAAAAAAAB/////////AAAAAAAAAAAA/////////wAAAAAAAAAAA - f////////8AAAAAAAAAAAP/////////AAAAAAAAAAAH/////////wAAAAAAAAAAD/////////8AAAAAA - AAAAB//////////AAAAAAAAAAA//////////wAAAAAAAAAAf/////////8AAAAAAAAAAP//////////A - AAAAAAAAAH//////////wAAAAAAAAAD//////////8AAAAAAAAAA///////////AAAAAAAAAA/////// - ////wAAAAAAAAAf//////////8AAAAAAAAAP///////////AAAAAAAAAH///////////wAAAAAAAAD// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - KAAAAEAAAACAAAAAAQAgAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - MJFIFS+RSEYvj0hwL45Jay6SSlIylEo3AFVVAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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/ - 9fX1//X19f/09PT/8/Pz//Pz8//y8vL/8vLy//Hx8f/x8fH/8PDw//Dw8P/s7Oz9DAwMPgAAAAEAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALW1tTT///////////////////////////7+/v/+/v7/ - /v7+//39/f/9/f3//f39//z8/P/8/Pz//Pz8//v7+//7+/v/+vr6//r6+v/5+fn/+fn5//j4+P/4+Pj/ - 9/f3//f39//29vb/9vb2//X19f/19fX/9PT0//T09P/z8/P/8/Pz//Ly8v/y8vL/8fHx//Hx8f/w8PD/ - 7Ozs/QwMDD4AAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC1tbU0//////////////// - /////////////////v7+//7+/v/+/v7//v7+//39/f/9/f3//f39//z8/P/8/Pz/+/v7//v7+//6+vr/ - +vr6//r6+v/5+fn/+fn5//j4+P/4+Pj/9/f3//f39//29vb/9vb2//X19f/19fX/9PT0//T09P/z8/P/ - 8/Pz//Ly8v/y8vL/8fHx/+3t7f0MDAw+AAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - tbW1NP/////////////////////////////////////+/v7//v7+//7+/v/+/v7//f39//39/f/8/Pz/ - /Pz8//z8/P/7+/v/+/v7//v7+//6+vr/+vr6//n5+f/5+fn/+Pj4//j4+P/39/f/9/f3//b29v/29vb/ - 9fX1//X19f/09PT/9PT0//Pz8//y8vL/8vLy//Hx8f/t7e39DAwMPgAAAAEAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAALW1tTT////////////////////////////////////////////////+/v7/ - /v7+//7+/v/9/f3//f39//39/f/8/Pz//Pz8//v7+//7+/v/+/v7//r6+v/6+vr/+fn5//n5+f/4+Pj/ - +Pj4//f39//39/f/9vb2//b29v/19fX/9fX1//T09P/09PT/8/Pz//Pz8//y8vL/7u7u/QwMDD4AAAAB - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC1tbU0//////////////////////////////// - //////////////////////7+/v/+/v7//v7+//39/f/9/f3//f39//z8/P/8/Pz//Pz8//v7+//7+/v/ - +vr6//r6+v/5+fn/+fn5//j4+P/4+Pj/9/f3//f39//29vb/9vb2//X19f/19fX/9PT0//T09P/z8/P/ - 8/Pz/+7u7v0MDAw+AAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAtbW1NP////////// - /////////////////////////////////////////////////v7+//7+/v/+/v7//v7+//39/f/9/f3/ - /Pz8//z8/P/8/Pz/+/v7//v7+//6+vr/+vr6//r6+v/5+fn/+fn5//j4+P/4+Pj/9/f3//f39//29vb/ - 9vb2//X19f/09PT/9PT0//Pz8//v7+/9DAwMPgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAALW1tTT////////////////////////////////////////////////////////////////+/v7/ - /v7+//7+/v/9/f3//f39//39/f/8/Pz//Pz8//z8/P/7+/v/+/v7//r6+v/6+vr/+vr6//n5+f/5+fn/ - +Pj4//j4+P/39/f/9/f3//b29v/29vb/9fX1//X19f/09PT/8PDw/QwMDD4AAAABAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAC1tbU0//////////////////////////////////////////////// - //////////////////////7+/v/+/v7//v7+//7+/v/9/f3//f39//39/f/8/Pz//Pz8//v7+//7+/v/ - +/v7//r6+v/6+vr/+fn5//n5+f/4+Pj/+Pj4//f39//39/f/9vb2//b29v/19fX/9fX1//Dw8P0MDAw+ - AAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAtbW1NP////////////////////////// - /////////////////////////////////////////////////v7+//7+/v/+/v7//v7+//39/f/9/f3/ - /f39//z8/P/8/Pz/+/v7//v7+//7+/v/+vr6//r6+v/5+fn/+fn5//j4+P/4+Pj/9/f3//f39//29vb/ - 9vb2//X19f/x8fH9DAwMPgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALW1tTT///// - //////////////////////////////////////////////////////////////////////////////// - /v7+//7+/v/+/v7//v7+//39/f/9/f3//Pz8//z8/P/8/Pz/+/v7//v7+//6+vr/+vr6//n5+f/5+fn/ - +fn5//j4+P/4+Pj/9/f3//f39//29vb/8vLy/QwMDD4AAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAC1tbU0//////////////////////////////////////////////////////////////// - ///////////////////////////+/v7//v7+//7+/v/9/f3//f39//39/f/8/Pz//Pz8//z8/P/7+/v/ - +/v7//r6+v/6+vr/+fn5//n5+f/4+Pj/+Pj4//f39//39/f/9vb2//Ly8v0MDAw+AAAAAQAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAtbW1NP////////////////////////////////////////// - //////////////////////////////////////////////////////7+/v/+/v7//v7+//7+/v/9/f3/ - /f39//39/f/8/Pz//Pz8//v7+//7+/v/+/v7//r6+v/6+vr/+fn5//n5+f/4+Pj/+Pj4//f39//z8/P9 - DAwMPgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALW1tTT///////////////////// - //////////////////////////////////////////////////////////////////////////////// - /v7+//7+/v/+/v7//v7+//39/f/9/f3//f39//z8/P/8/Pz/+/v7//v7+//6+vr/+vr6//r6+v/5+fn/ - +fn5//j4+P/4+Pj/8/Pz/QwMDD4AAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC1tbU0 - //////////////////////////////////////////////////////////////////////////////// - /////////////////////////////////v7+//7+/v/+/v7//f39//39/f/9/f3//Pz8//z8/P/8/Pz/ - +/v7//v7+//6+vr/+vr6//n5+f/5+fn/+Pj4//T09P0MDAw+AAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAtbW1NP////////////////////////////////////////////////////////// - ///////////////////////////////////////////////////////////+/v7//v7+//7+/v/9/f3/ - /f39//39/f/8/Pz//Pz8//v7+//7+/v/+/v7//r6+v/6+vr/+fn5//n5+f/19fX9DAwMPgAAAAEAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALW1tTT///////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////7+/v/+/v7//v7+//39/f/9/f3//f39//z8/P/8/Pz//Pz8//v7+//7+/v/+vr6//r6+v/5+fn/ - 9PT0/QwMDD4AAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC1tbU0//////////////// - //////////////////////////////////////////////////////////////////////////////// - /////////////////////////////////v7+//7+/v/9/f3//Pz8//v7+//7+/v/+/v7//z8/P/8/Pz/ - +/v7//v7+//6+vr/9/f3/+vr6/0MDAw+AAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - tbW1NP////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////Pz8//b29v/t7e3/ - 6urq/+3t7f/x8fH/8vLy//Ly8v/x8fH/7Ozs/+Tk5P/Y2Nj7DQ0NNwAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAALW1tTT///////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////z8/P/u7u7/5ubm/9fX1//Pz8//zs7O/83Nzf/Nzc3/zc3N/8vLy//Nzc3/u7u7uAAAABEAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC1tbU0//////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - ///////////////////////////9/f3/7e3t/+np6f/v7+//8PDw//Hx8f/x8fH/8PDw/+np6f/g4OD/ - yMjIzkZGRh0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAtbW1NP////////// - //////////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////v7+//Hx8f/i4uL/7u7u/+/v7//w8PD/ - 7+/v/+jo6P/e3t7/w8PDzVdXVykAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAALW1tTT///////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////7+/v/29vb/ - 4eHh/+3t7f/u7u7/7e3t/+bm5v/d3d3/xsbG1E5OTioAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAC1tbU0//////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - ////////////////9/f3/+Dg4P/s7Oz/6+vr/+Xl5f/b29v/vr6+zlNTUysAAAABAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAtbW1NP////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////n5+f/g4OD/6enp/+Pj4//a2tr/wMDA1U1NTSsAAAAB - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALW1tTT///// - //////////////////////////////////////////////////////////////////////////////// - ///////////////////////////////////////////////////////////39/f/3t7e/+Hh4f/Y2Nj/ - u7u70E9PTy0AAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAC1tbU0//////////////////////////////////////////////////////////////// - ///////////////////////////////////////////////////////////////////////////+/v7/ - 9PT0/9fX1//X19f/vb291ktLSywAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAtbW1NP////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - /////////////////Pz8/+vr6//S0tL/urq60EtLSy8AAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALm5uTP///////////////////// - //////////////////////////////////////////////////////////////////////////////// - ///////////////////////////+/v7//f39//T09P/h4eH+vr6+yldXVyYAAAABAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC8vLwX - 6urqh+Xl5Yvl5eWL5eXli+Xl5Yvl5eWL5eXli+Xl5Yvl5eWL5eXli+Xl5Yvl5eWL5eXli+Xl5Yvl5eWL - 5eXli+Xl5Yvl5eWL5eXli+Xl5Yvl5eWL5eXli+Xl5Yvl5eWL4+Pji9zc3IvW1taKv7+/eF1dXR4AAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAA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AAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////// - ///////4B////////+AB///////5wAB///////iAAD//////+AAAP//////4AOAf//////gD8B//+AAA - AAAYf//4AAAAABz3//gAAAAAH8f/+AAAAAAfh//4AAAAAB4H//gAAAAAGAf/+AAAAAAAB//4AAAAAAAH - //gAAAAAAAf/+AAAAAAAB//4AAAAAAAH//gAAAAAAAf/+AAAAAAAB//4AAAAAADn//gAAAAAAf//+AAA - AAAH///4AAAAAB////gAAAAAH///+AAAAAAf///4AAAAAB////gAAAAAH///+AAAAAAf///4AAAAAB// - //gAAAAAH///+AAAAAAf///4AAAAAB////gAAAAAH///+AAAAAAf///4AAAAAB////gAAAAAH///+AAA - AAAf///4AAAAAB////gAAAAAH///+AAAAAAf///4AAAAAB////gAAAAAH///+AAAAAAf///4AAAAAB// - //gAAAAAH///+AAAAAAf///4AAAAAD////gAAAAAf///+AAAAAD////4AAAAAf////gAAAAD////+AAA - AAf////4AAAAD/////gAAAAf////+AAAAD/////4AAAA//////////////////////////////////// - /////////////////////ygAAABAAAAAgAAAAAEACAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/ - Dg4O/wAVBv8AGAD/FS8c/wBDAv8AQwr/AEUP/wVHFf8LRxr/Dk4d/xFFH/8AYxH/A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AA - AAAAAN329PT09PT09PT09PT09PT09PT09PT09PT05+XdTwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAP////////////////////////////gH////////4AH///////nAAH////// - +IAAP//////4AAA///////gA4B//////+APwH//4AAAAABh///gAAAAAHPf/+AAAAAAfx//4AAAAAB+H - //gAAAAAHgf/+AAAAAAYB//4AAAAAAAH//gAAAAAAAf/+AAAAAAAB//4AAAAAAAH//gAAAAAAAf/+AAA - AAAAB//4AAAAAAAH//gAAAAAAOf/+AAAAAAB///4AAAAAAf///gAAAAAH///+AAAAAAf///4AAAAAB// - //gAAAAAH///+AAAAAAf///4AAAAAB////gAAAAAH///+AAAAAAf///4AAAAAB////gAAAAAH///+AAA - AAAf///4AAAAAB////gAAAAAH///+AAAAAAf///4AAAAAB////gAAAAAH///+AAAAAAf///4AAAAAB// - //gAAAAAH///+AAAAAAf///4AAAAAB////gAAAAAH///+AAAAAAf///4AAAAAB////gAAAAAP///+AAA - AAB////4AAAAAP////gAAAAB////+AAAAAP////4AAAAB/////gAAAAP////+AAAAB/////4AAAAP/// - //gAAAD/////////////////////////////////////////////////////////KAAAADAAAABgAAAA - AQAgA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AAAAAAAAAAAAAAAAAAAAA - AAAAALu7u1P//////v7+//7+/v/+/v7//f39//39/f/8/Pz/+/v7//v7+//6+vr/+vr6//n5+f/5+fn/ - +Pj4//f39//39/f/9vb2//X19f/19fX/9PT0//Pz8//y8vL/8vLy//Hx8f/w8PD/7+/v/+/v7//u7u7/ - Dg4OVgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAALu7u1P///////////7+/v/+/v7//f39//39/f/8/Pz//Pz8//v7+//7+/v/ - +vr6//r6+v/5+fn/+Pj4//j4+P/39/f/9vb2//b29v/19fX/9PT0//T09P/z8/P/8vLy//Ly8v/x8fH/ - 8PDw//Dw8P/v7+//Dg4OVgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALu7u1P////////////////+/v7//v7+//7+/v/9/f3/ - /f39//z8/P/8/Pz/+/v7//r6+v/6+vr/+fn5//n5+f/4+Pj/9/f3//f39//29vb/9fX1//X19f/09PT/ - 8/Pz//Pz8//y8vL/8fHx//Hx8f/w8PD/Dg4OVgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALu7u1P///////////////////// - /v7+//7+/v/+/v7//f39//39/f/8/Pz//Pz8//v7+//7+/v/+vr6//r6+v/5+fn/+Pj4//j4+P/39/f/ - 9vb2//b29v/19fX/9PT0//T09P/z8/P/8vLy//Ly8v/x8fH/Dg4OVgAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALu7u1P///// - //////////////////////7+/v/+/v7//v7+//39/f/9/f3//Pz8//z8/P/7+/v/+/v7//r6+v/5+fn/ - +fn5//j4+P/39/f/9/f3//b29v/19fX/9fX1//T09P/z8/P/8vLy//Ly8v/x8fH/Dg4OVgAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAALu7u1P//////////////////////////////////////v7+//7+/v/9/f3//f39//z8/P/8/Pz/ - +/v7//v7+//6+vr/+vr6//n5+f/4+Pj/+Pj4//f39//29vb/9vb2//X19f/09PT/8/Pz//Pz8//y8vL/ - Dg4OVgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAALu7u1P///////////////////////////////////////////7+/v/+/v7/ - /v7+//39/f/9/f3//Pz8//z8/P/7+/v/+vr6//r6+v/5+fn/+fn5//j4+P/39/f/9/f3//b29v/19fX/ - 9PT0//T09P/z8/P/Dg4OVgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALu7u1P///////////////////////////////////// - ///////////+/v7//v7+//39/f/9/f3//Pz8//z8/P/8/Pz/+/v7//r6+v/6+vr/+fn5//n5+f/4+Pj/ - 9/f3//f39//29vb/9fX1//X19f/09PT/Dg4OVgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALu7u1P///////////////////// - /////////////////////////////////v7+//7+/v/+/v7//f39//39/f/8/Pz//Pz8//v7+//7+/v/ - +vr6//r6+v/5+fn/+Pj4//j4+P/39/f/9vb2//b29v/19fX/Dg4OVgAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALu7u1P///// - ///////////////////////////////////////////////////////////+/v7//v7+//7+/v/9/f3/ - /Pz8//z8/P/7+/v/+/v7//r6+v/6+vr/+fn5//n5+f/4+Pj/9/f3//f39//29vb/Dg4OVgAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAALu7u1P////////////////////////////////////////////////////////////////+/v7/ - /v7+//7+/v/9/f3//f39//z8/P/8/Pz/+/v7//v7+//6+vr/+fn5//n5+f/4+Pj/9/f3//f39//29vb/ - Dg4OVgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAALu7u1P///////////////////////////////////////////////////// - //////////////////////7+/v/+/v7//f39//39/f/9/f3//Pz8//z8/P/7+/v/+vr6//r6+v/5+fn/ - +Pj4//j4+P/39/f/Dg4OVgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALu7u1P///////////////////////////////////// - ///////////////////////////////////////////+/v7//v7+//7+/v/9/f3//f39//z8/P/8/Pz/ - +/v7//v7+//6+vr/+fn5//n5+f/4+Pj/Dg4OVgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALu7u1P///////////////////// - /////////////////////////////////////////////////////////////////v7+//7+/v/+/v7/ - /f39//39/f/8/Pz/+/v7//v7+//6+vr/+vr6//n5+f/5+fn/Dg4OVgAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALu7u1P///// - //////////////////////////////////////////////////////////////////////////////// - ///////////+/v7//v7+//39/f/9/f3//Pz8//z8/P/7+/v/+/v7//r6+v/29vb/Dg4OVgAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAALu7u1P///////////////////////////////////////////////////////////////////// - /////////////////////////////////Pz8//b29v/v7+//8fHx//X19f/29vb/9PT0//Dw8P/j4+P/ - Dw8PUQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAALu7u1P///////////////////////////////////////////////////// - /////////////////////////////////////////////////f39/+np6f/k5OT/z8/P/8bGxv/FxcX/ - x8fH/8rKyv/MzMzqAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALu7u1P///////////////////////////////////// - /////////////////////////////////////////////////////////////////f39/+rq6v/t7e3/ - 8PDw//Dw8P/v7+//5eXl/9PT0/JZWVkoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALu7u1P///////////////////// - //////////////////////////////////////////////////////////////////////////////// - /v7+//Ly8v/m5ub/7u7u/+7u7v/j4+P/1dXV9TY2NiEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALu7u1P///// - //////////////////////////////////////////////////////////////////////////////// - //////////////////////T09P/k5OT/6+vr/+Dg4P/Nzc30NDQ0IgAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAALu7u1P///////////////////////////////////////////////////////////////////// - //////////////////////////////////////X19f/g4OD/3t7e/8zMzPRTU1MuAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAALu7u1P///////////////////////////////////////////////////// - /////////////////////////////////////////////////v7+//Hx8f/W1tb/zs7O9TExMSQAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALu7u1P///////////////////////////////////// - /////////////////////////////////////////////////////////////////f39/+Tk5P/Jycnz - Nzc3JQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMTExEb5+fnp+Pj46vj4+Or4+Pjq - +Pj46vj4+Or4+Pjq+Pj46vj4+Or4+Pjq+Pj46vj4+Or4+Pjq+Pj46vj4+Or4+Pjq+Pj46vj4+Or39/fq - 7e3t6dbW1tpLS0siAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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 - HFYsfwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADp6emx/f39//z8/P/7+/v/+vr6//n5+f/4+Pj/ - 9/f3//b29v/19fX/9PT0//Pz8//y8vL/8fHx//Dw8P8kczr/Mp1P/0WjXv9QqWn/OJ1T/zWfUf8MSBvf - AAAAAAAAAAAeWi1lAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOzs7LH+/v7//f39//z8/P/7+/v/ - +vr6//r6+v/5+fn/+Pj4//f39//29vb/9fX1//Pz8//y8vL/8fHx//Dw8P+tw7P/N2lF/yBZL/8wYDzn - AD8AFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA7Ozssf7+/v/+/v7/ - /f39//z8/P/7+/v/+/v7//r6+v/5+fn/+Pj4//f39//29vb/9fX1//T09P/z8/P/8vLy//Dw8P/v7+// - 7+/v/62tra8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADs7Oyx - //////7+/v/+/v7//f39//z8/P/8/Pz/+/v7//r6+v/5+fn/+Pj4//f39//29vb/9fX1//T09P/z8/P/ - 8vLy//Hx8f/w8PD/ra2trwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAOzs7LH///////////7+/v/+/v7//f39//39/f/8/Pz/+/v7//r6+v/5+fn/+Pj4//f39//29vb/ - 9fX1//T09P/z8/P/8vLy//Hx8f+tra2vAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAA7Ozssf/////////////////////+/v7//f39//39/f/8/Pz/+/v7//r6+v/5+fn/ - +Pj4//f39//29vb/9fX1//T09P/z8/P/8vLy/62tra8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAADs7Oyx///////////////////////////+/v7//f39//39/f/8/Pz/ - +/v7//r6+v/5+fn/+Pj4//f39//29vb/9fX1//T09P/z8/P/sLCwrwAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOzs7LH////////////////////////////////+/v7/ - /f39//39/f/8/Pz/+/v7//r6+v/5+fn/+Pj4//j4+P/39/f/9vb2//X19f+wsLCvAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA7Ozssf////////////////////////// - ///////////+/v7//v7+//39/f/8/Pz/+/v7//r6+v/6+vr/+fn5//j4+P/39/f/9vb2/7CwsK8AAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADs7Oyx//////////////// - ///////////////////////////+/v7//v7+//39/f/8/Pz//Pz8//v7+//6+vr/+fn5//j4+P/39/f/ - s7OzrwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOzs7LH///// - ///////////////////////////////////////////+/v7//v7+//39/f/8/Pz//Pz8//v7+//6+vr/ - +fn5//j4+P+0tLSvAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - 7Ozssf/////////////////////////////////////////////////////+/v7//v7+//39/f/9/f3/ - /Pz8//v7+//6+vr/+fn5/7S0tK8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAADs7Oyx//////////////////////////////////////////////////////////////// - /v7+//j4+P/29vb/+vr6//n5+f/19fX/p6enrgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAOzs7LH///////////////////////////////////////////////////// - ///////////+/v7/6enp/+Pj4//Z2dn/2dnZ/9XV1f9UVFQbAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA7Ozssf////////////////////////////////////////// - ///////////////////////////m5ub/7u7u/+7u7v/d3d3/UlJSKAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADs7Oyx//////////////////////////////// - /////////////////////////////////////+zs7P/q6ur/2tra/1BQUCkAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOzs7LH///////////////////// - ////////////////////////////////////////////////6Ojo/9fX1/9NTU0rAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA7Ozssf////////// - //////////////////////////////////////////////////////39/f/Z2dn/TU1NKwAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC7u7sT - t7e3ILe3tyC3t7cgt7e3ILe3tyC3t7cgt7e3ILe3tyC3t7cgt7e3ILe3tyC3t7cgp6enIEVFRQsAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///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k - jDwySUg9IgwEAgcAAAAAAAAApbGwr6+urayrqqmop6aln2VDQBoDAQAAAAAAAAAAAACmsbGwr6+urayr - qqmop6alpKOhfgAAAAAAAAAAAAAAAKaysbGwsK+urayrqqmop6alpKN/AAAAAAAAAAAAAAAAprKysrGw - sK+urayrqqmop6alpIAAAAAAAAAAAAAAAACmsrKysrGxsK+ura2sq6qpqKalgQAAAAAAAAAAAAAAAKay - srKysrGxsK+urq2sq6qpqKeCAAAAAAAAAAAAAAAAprKysrKysrGxsK+vrq2sq6qpqIMAAAAAAAAAAAAA - AACmsrKysrKysrGxsLCvrq2sq6qphAAAAAAAAAAAAAAAAKaysrKysrKysrKxsLCvrq2sq6qFAAAAAAAA - AAAAAAAAprKysrKysrKysrKxsLCvrq2srIYAAAAAAAAAAAAAAACmsrKysrKysrKysrKxsbCvrq6thgAA - AAAAAAAAAAAAAKaysrKysrKysrKysrKxqqeqqqRqAAAAAAAAAAAAAAAAprKysrKysrKysrKysrGclJOQ - iWAAAAAAAAAAAAAAAACmsrKysrKysrKysrKyspyhno9mAAAAAAAAAAAAAAAAAKaysrKysrKysrKysrKy - npmNYAAAAAAAAAAAAAAAAAAAprKysrKysrKysrKysrKZil4AAAAAAAAAAAAAAAAAAACmsrKysrKysrKy - srKyro5fAAAAAAAAAAAAAAAAAAAAAJaXl5eXl5eXl5eXl5eOZwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////wf - ///oB///4Af//8Dn/AAAP/wAADP8AAAD/AAAA/wAAAP8AAAD/AAAD/wAAD/8AAA//AAAP/wAAD/8AAA/ - /AAAP/wAAD/8AAA//AAAP/wAAD/8AAA//AAAP/wAAH/8AAD//AAB//wAA//8AAf///////////////// - KAAAABgAAAAwAAAAAQAgAAAAAAAAEgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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vr/ - +fn5//j4+P/39/f/9fX1//T09P/y8vL/8fHx/8XXyv8znlD/V6xu/3W7iP8ymk7/IGQy/wAAAAAJSxq6 - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC/v7+//39/f/8/Pz/+/v7//r6+v/4+Pj/9/f3//b29v/09PT/ - 8/Pz//Hx8f/w8PD/iKmQ/0Z2VP8KKhUYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC - //////7+/v/9/f3//Pz8//v7+//6+vr/+Pj4//f39//29vb/9fX1//Pz8//y8vL/8PDw/+/v7/8AAAAO - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC///////////+/v7//f39//z8/P/7+/v/ - +vr6//j4+P/39/f/9vb2//T09P/z8/P/8vLy//Dw8P8AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAC/////////////////v7+//39/f/9/f3/+/v7//r6+v/5+fn/+Pj4//b29v/19fX/ - 9PT0//Ly8v8AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC//////////////// - //////7+/v/+/v7//f39//v7+//6+vr/+fn5//j4+P/39/f/9fX1//T09P8AAAAOAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC///////////////////////////+/v7//v7+//39/f/8/Pz/ - +/v7//n5+f/4+Pj/9/f3//X19f8AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC - //////////////////////////////////////7+/v/9/f3//Pz8//v7+//6+vr/+fn5//f39/8AAAAO - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC//////////////////////////////// - ///////////+/v7//f39//z8/P/7+/v/+vr6//n5+f8AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAC/////////////////////////////////////////////////v7+//r6+v/8/Pz/ - +/v7//f39/8AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC//////////////// - /////////////////////////////////////+fn5//w8PD/8fHx/9fX1/MAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC//////////////////////////////////////////////// - /////+Li4v/r6+v/z8/P8wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC - /////////////////////////////////////////////////////+Dg4P/Jycn0AAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////////////////////// - /////////////////f39/83NzfIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAP///wD//wcA//wDAPgAEwD4AB0A+AARAPgAAQD4AAEA+AAFAPgAHwD4AB8A+AAfAPgAHwD4AB8A - +AAfAPgAHwD4AB8A+AAfAPgAHwD4AD8A+AB/APgA/wD///8A////ACgAAAAYAAAAMAAAAAEACAAAAAAA - gAQAAAAAAAAAAAAAAAAAAAAAAAAAAAD/AEcO/xJPIv8YVyj/Cm0k/xB9Lv8Qfy//HHIz/xt2M/8yYT// - I3s7/yV4O/8ifjv/I347/yp+Qf8yekb/R3JT/21tbf9ycnL/eHh4/35+fv8jgDz/K4FC/ymDQv8sgkP/ - LYdF/ymJQ/8pikT/L4lH/y6LR/8tjkf/MZJL/zORTf8zmE7/OZZS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AfAPgAPwD4AH8A+AD/AP///wD///8AKAAAABAAAAAgAAAAAQAgAAAAAAAACAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - G4A4ZymIQt4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACLv5n/ - hsKX/y2XSv81nlH/QaJc/xJzLXwAAAAAAAAAAAAAAAAAAAAA9vb2//T09P/y8vL/8PDw/+7u7v/s7Oz/ - d6+G/zKaTv8zmk//5+fn/xVjKqcAAAAAAAAAAAAAAAAAAAAAAAAAAPn5+f/39/f/9PT0//Ly8v/w8PD/ - 7u7u/2aid/95oIT/6enp/+jo6P8QcSlcsdi7/wAAAAAAAAAAAAAAAAAAAAD7+/v/+fn5//f39//19fX/ - 8/Pz//Hx8f/v7+//otCv/+rq6v/p6en/jcSd/zSbUP8AAAAAAAAAAAAAAAAAAAAA/f39//v7+//5+fn/ - 9/f3//X19f/z8/P/8fHx/yiAP/+dzqr/dbqI/zOcT/8ATBM1AAAAAAAAAAAAAAAAAAAAAP7+/v/9/f3/ - +/v7//r6+v/4+Pj/9vb2//T09P/x8fH/7+/v/+3t7f8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///// - /v7+//39/f/8/Pz/+vr6//j4+P/29vb/9PT0//Ly8v/w8PD/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - /////////////////f39//z8/P/6+vr/+Pj4//b29v/09PT/8vLy/wAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAP/////////////////////+/v7//Pz8//v7+//5+fn/9/f3//X19f8AAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAD///////////////////////////7+/v/9/f3/+/v7//n5+f/39/f/AAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAA/////////////////////////////////v7+//39/f/7+/v/9/f3/wAAAAAAAAAA - AAAAAAAAAAAAAAA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ABARUVFRUVFNC4mAAAAAAAAQEVFRUVFRTMnAAAAAAAAADw/Pz8/ - Pz0pAAAAAAAAAAAAAAAAAAAAAAAAAAAA//cAAP+DAADgAwAA4AUAAOABAADgAwAA4AcAAOAHAADgBwAA - 4AcAAOAHAADgBwAA4A8AAOAfAADgPwAA//8AAA== + iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABGdBTUEAALGPC/xhBQAAAHhJREFUSEtj + GAUkgffv3wt8/vzZgRIMMgNqHCYAKfj69et/SjDIDKhxmABmwbdv3wpgLiIWg/QQbQFeRTgAUXpHLRi1 + AC8YgRZ8//7dDsQmBgPVO5FjgTyQ3UAMBqpVJNkCqBDRgCQLaF7YUYLxWkDzCmcUYAIGBgDTAbB9WZmz + lgAAAABJRU5ErkJggg== + + + iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABGdBTUEAALGPC/xhBQAAAN9JREFUSEvt + VTkOwjAQzA/gBRQ8hOs/CERDm5Jn8MK4sBO7g11pLY20TrSO24w08ioz40mR2N2GKjjn9jHGcwuHYdjJ + dhre+9s4jr8WUslJttPIBdM0PWi+1pAyL3PBomkGpiyaUkpHequPheytLqD5wrOF7F1dwKvICujBrMga + aMrhEMKX1r5E0doKLGwq4FVkBfRgVmQNNGFYZAX0YFZkDTRhWGQF9GBWZA005bCFqwqIB/pK3hayt7pA + HplRVUC//52MxeN4jpR5mgtauFjAFw6VFI9jKxcvnA0aXfcH9fiuLoI2qioAAAAASUVORK5CYII= + + + + + iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABGdBTUEAALGPC/xhBQAAATNJREFUSEvt + lc1qwkAUhVO79ocudOOzVPR9SqWbbtNi60YUXLizLvs6voHbQkhCyN8yPXc4EUJimMxs/eDg3Js75zhR + EudOJ8IwHOV5PrNREARD2tWJ43iRpmlhI4Q8065OGZBl2SvW8y7CnjftgNahG2jtbRryfX/AZYWiKB48 + z+uzNAtAPUZ9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XZ2lqdqVJyyA1920415Syoe4xFtOUOs0t19TIXg4s8QXdDoCNtJ7XcJwCD+A36BpR16B+ + hc/g0ejNNsIIKSqVv+0vKJgA+u+XAAAAAElFTkSuQmCC + + + + 17, 17 + \ No newline at end of file diff --git a/UpdateLib/UpdateLib.Generator/Program.cs b/UpdateLib/UpdateLib.Generator/Program.cs index 456755c..5b2e883 100644 --- a/UpdateLib/UpdateLib.Generator/Program.cs +++ b/UpdateLib/UpdateLib.Generator/Program.cs @@ -33,7 +33,7 @@ static void Main() Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new TestForm()); + Application.Run(new MainForm()); } } } diff --git a/UpdateLib/UpdateLib.Generator/Tasks/LoadDirectoryTask.cs b/UpdateLib/UpdateLib.Generator/Tasks/LoadDirectoryTask.cs index 003555c..2177efb 100644 --- a/UpdateLib/UpdateLib.Generator/Tasks/LoadDirectoryTask.cs +++ b/UpdateLib/UpdateLib.Generator/Tasks/LoadDirectoryTask.cs @@ -15,13 +15,14 @@ * along with this program. If not, see . */ -using MatthiWare.UpdateLib.Tasks; -using MatthiWare.UpdateLib.UI; using System; using System.Drawing; using System.IO; using System.Windows.Forms; +using MatthiWare.UpdateLib.Tasks; +using MatthiWare.UpdateLib.UI; + namespace MatthiWare.UpdateLib.Generator.Tasks { public class LoadDirectoryTask : AsyncTask @@ -32,14 +33,11 @@ public class LoadDirectoryTask : AsyncTask public LoadDirectoryTask(ListView lv, ImageList iconCache, DirectoryInfo dirPath) { - if (lv == null) throw new ArgumentNullException(nameof(lv)); - if (iconCache == null) throw new ArgumentNullException(nameof(iconCache)); - if (dirPath == null) throw new ArgumentNullException(nameof(dirPath)); - if (!dirPath.Exists) throw new DirectoryNotFoundException($"The directory '{dirPath.FullName}' was not found."); - - ItemsListView = lv; - IconList = iconCache; - DirectoryPath = dirPath; + ItemsListView = lv ?? throw new ArgumentNullException(nameof(lv)); + IconList = iconCache ?? throw new ArgumentNullException(nameof(iconCache)); + DirectoryPath = dirPath ?? throw new ArgumentNullException(nameof(dirPath)); + + if (!DirectoryPath.Exists) throw new DirectoryNotFoundException($"The directory '{dirPath.FullName}' was not found."); } protected override void DoWork() @@ -75,7 +73,7 @@ protected override void DoWork() SetColumnAutoSize(2); EndUpdate(); - + } private void SetColumnAutoSize(int clmn) diff --git a/UpdateLib/UpdateLib.Generator/Tasks/UpdateGeneratorTask.cs b/UpdateLib/UpdateLib.Generator/Tasks/UpdateGeneratorTask.cs index 845628b..5b1e3b7 100644 --- a/UpdateLib/UpdateLib.Generator/Tasks/UpdateGeneratorTask.cs +++ b/UpdateLib/UpdateLib.Generator/Tasks/UpdateGeneratorTask.cs @@ -15,21 +15,22 @@ * along with this program. If not, see . */ -using MatthiWare.UpdateLib.Files; -using MatthiWare.UpdateLib.Security; using System; +using System.Collections.Generic; +using System.IO; using System.Linq; using System.Threading; -using System.IO; -using MatthiWare.UpdateLib.Tasks; + +using MatthiWare.UpdateLib.Common; +using MatthiWare.UpdateLib.Files; using MatthiWare.UpdateLib.Generator.Data.FilesPage; -using System.Collections.Generic; using MatthiWare.UpdateLib.Generator.UI.Pages; -using MatthiWare.UpdateLib.Common; +using MatthiWare.UpdateLib.Security; +using MatthiWare.UpdateLib.Tasks; namespace MatthiWare.UpdateLib.Generator.Tasks { - public class UpdateGeneratorTask : AsyncTask + public class UpdateGeneratorTask : AsyncTask { private delegate void AddDirRecursiveDelegate(GenFolder dir, DirectoryEntry entry); @@ -44,17 +45,14 @@ public class UpdateGeneratorTask : AsyncTask public UpdateGeneratorTask(GenFolder dir, InformationPage info, IList registry) { - if (dir == null) - throw new ArgumentNullException("dir", "The directory cannot be null"); - - Result = new UpdateFile(); - - baseDir = dir; + baseDir = dir ?? throw new ArgumentNullException("dir", "The directory cannot be null"); registryFolders = registry; total = dir.Count + registry.Sum(g => g.Count); infoPage = info; + + base.Result = new UpdateLib.Files.UpdateInfo(); } protected override void DoWork() @@ -73,7 +71,7 @@ protected override void DoWork() Enqueue(new Action(AddRegistryItems), null); - Result.ApplicationName = infoPage.ApplicationName; + // Result.ApplicationName = infoPage.ApplicationName; Result.Version = infoPage.Version; } @@ -128,7 +126,7 @@ private void AddDirRecursive(GenFolder dir, DirectoryEntry entry) List files = dir.Items; foreach (GenFile genFile in files) { - FileInfo fi = genFile.FileInfo; + System.IO.FileInfo fi = genFile.FileInfo; FileEntry newEntry = new FileEntry(fi.Name); newEntry.Hash = HashUtil.GetHash(fi.FullName); diff --git a/UpdateLib/UpdateLib.Generator/TestForm.Designer.cs b/UpdateLib/UpdateLib.Generator/TestForm.Designer.cs deleted file mode 100644 index 09ee13c..0000000 --- a/UpdateLib/UpdateLib.Generator/TestForm.Designer.cs +++ /dev/null @@ -1,264 +0,0 @@ -namespace MatthiWare.UpdateLib.Generator -{ - partial class TestForm - { - /// - /// 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.components = new System.ComponentModel.Container(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(TestForm)); - this.SidebarPanel = new System.Windows.Forms.Panel(); - this.ContentPanel = new System.Windows.Forms.Panel(); - this.btnTabBuild = new MatthiWare.UpdateLib.Generator.UI.FlatButton(); - this.btnTabRegistry = new MatthiWare.UpdateLib.Generator.UI.FlatButton(); - this.btnTabFiles = new MatthiWare.UpdateLib.Generator.UI.FlatButton(); - this.btnTabInformation = new MatthiWare.UpdateLib.Generator.UI.FlatButton(); - this.HeaderPanel = new MatthiWare.UpdateLib.Generator.UI.MoveablePanel(); - this.pbMinimize = new MatthiWare.UpdateLib.Generator.UI.HoverPictureBox(); - this.pbMaximize = new MatthiWare.UpdateLib.Generator.UI.HoverPictureBox(); - this.pbClose = new MatthiWare.UpdateLib.Generator.UI.HoverPictureBox(); - this.pbIcon = new System.Windows.Forms.PictureBox(); - this.lblTitle = new System.Windows.Forms.Label(); - this.elipseComponent1 = new MatthiWare.UpdateLib.Generator.UI.ElipseComponent(this.components); - this.SidebarPanel.SuspendLayout(); - this.HeaderPanel.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pbMinimize)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.pbMaximize)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.pbClose)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.pbIcon)).BeginInit(); - this.SuspendLayout(); - // - // SidebarPanel - // - this.SidebarPanel.BackColor = System.Drawing.Color.DarkGray; - this.SidebarPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.SidebarPanel.Controls.Add(this.btnTabBuild); - this.SidebarPanel.Controls.Add(this.btnTabRegistry); - this.SidebarPanel.Controls.Add(this.btnTabFiles); - this.SidebarPanel.Controls.Add(this.btnTabInformation); - this.SidebarPanel.Dock = System.Windows.Forms.DockStyle.Left; - this.SidebarPanel.Location = new System.Drawing.Point(0, 33); - this.SidebarPanel.Name = "SidebarPanel"; - this.SidebarPanel.Size = new System.Drawing.Size(233, 505); - this.SidebarPanel.TabIndex = 1; - // - // ContentPanel - // - this.ContentPanel.AutoScroll = true; - this.ContentPanel.BackColor = System.Drawing.SystemColors.Control; - this.ContentPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.ContentPanel.Dock = System.Windows.Forms.DockStyle.Fill; - this.ContentPanel.Location = new System.Drawing.Point(233, 33); - this.ContentPanel.Name = "ContentPanel"; - this.ContentPanel.Size = new System.Drawing.Size(806, 505); - this.ContentPanel.TabIndex = 2; - // - // btnTabBuild - // - this.btnTabBuild.ActiveItem = false; - this.btnTabBuild.BackHoverColor = System.Drawing.Color.LightGray; - this.btnTabBuild.BackSelectedColor = System.Drawing.Color.DimGray; - this.btnTabBuild.Dock = System.Windows.Forms.DockStyle.Top; - this.btnTabBuild.Font = new System.Drawing.Font("Century Gothic", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btnTabBuild.InfoImage = ((System.Drawing.Image)(resources.GetObject("btnTabBuild.InfoImage"))); - this.btnTabBuild.Location = new System.Drawing.Point(0, 189); - this.btnTabBuild.Name = "btnTabBuild"; - this.btnTabBuild.Size = new System.Drawing.Size(231, 63); - this.btnTabBuild.TabIndex = 3; - this.btnTabBuild.Text = "Build"; - this.btnTabBuild.Click += new System.EventHandler(this.btnTabBuild_Click); - // - // btnTabRegistry - // - this.btnTabRegistry.ActiveItem = false; - this.btnTabRegistry.BackHoverColor = System.Drawing.Color.LightGray; - this.btnTabRegistry.BackSelectedColor = System.Drawing.Color.DimGray; - this.btnTabRegistry.Dock = System.Windows.Forms.DockStyle.Top; - this.btnTabRegistry.Font = new System.Drawing.Font("Century Gothic", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btnTabRegistry.InfoImage = global::MatthiWare.UpdateLib.Generator.Properties.Resources.Registry_Editor_32px; - this.btnTabRegistry.Location = new System.Drawing.Point(0, 126); - this.btnTabRegistry.Name = "btnTabRegistry"; - this.btnTabRegistry.Size = new System.Drawing.Size(231, 63); - this.btnTabRegistry.TabIndex = 2; - this.btnTabRegistry.Text = "Registry"; - this.btnTabRegistry.Click += new System.EventHandler(this.btnTabRegistry_Click); - // - // btnTabFiles - // - this.btnTabFiles.ActiveItem = false; - this.btnTabFiles.BackHoverColor = System.Drawing.Color.LightGray; - this.btnTabFiles.BackSelectedColor = System.Drawing.Color.DimGray; - this.btnTabFiles.Dock = System.Windows.Forms.DockStyle.Top; - this.btnTabFiles.Font = new System.Drawing.Font("Century Gothic", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btnTabFiles.InfoImage = ((System.Drawing.Image)(resources.GetObject("btnTabFiles.InfoImage"))); - this.btnTabFiles.Location = new System.Drawing.Point(0, 63); - this.btnTabFiles.Name = "btnTabFiles"; - this.btnTabFiles.Size = new System.Drawing.Size(231, 63); - this.btnTabFiles.TabIndex = 1; - this.btnTabFiles.Text = "Files"; - this.btnTabFiles.Click += new System.EventHandler(this.flatButton2_Click); - // - // btnTabInformation - // - this.btnTabInformation.ActiveItem = false; - this.btnTabInformation.BackHoverColor = System.Drawing.Color.LightGray; - this.btnTabInformation.BackSelectedColor = System.Drawing.Color.DimGray; - this.btnTabInformation.Dock = System.Windows.Forms.DockStyle.Top; - this.btnTabInformation.Font = new System.Drawing.Font("Century Gothic", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btnTabInformation.InfoImage = ((System.Drawing.Image)(resources.GetObject("btnTabInformation.InfoImage"))); - this.btnTabInformation.Location = new System.Drawing.Point(0, 0); - this.btnTabInformation.Name = "btnTabInformation"; - this.btnTabInformation.Size = new System.Drawing.Size(231, 63); - this.btnTabInformation.TabIndex = 0; - this.btnTabInformation.Text = "Update Information"; - this.btnTabInformation.Click += new System.EventHandler(this.flatButton1_Click); - // - // HeaderPanel - // - this.HeaderPanel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(78)))), ((int)(((byte)(99)))), ((int)(((byte)(133))))); - this.HeaderPanel.Controls.Add(this.pbMinimize); - this.HeaderPanel.Controls.Add(this.pbMaximize); - this.HeaderPanel.Controls.Add(this.pbClose); - this.HeaderPanel.Controls.Add(this.pbIcon); - this.HeaderPanel.Controls.Add(this.lblTitle); - this.HeaderPanel.Dock = System.Windows.Forms.DockStyle.Top; - this.HeaderPanel.Location = new System.Drawing.Point(0, 0); - this.HeaderPanel.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.HeaderPanel.Name = "HeaderPanel"; - this.HeaderPanel.ParentForm = this; - this.HeaderPanel.Size = new System.Drawing.Size(1039, 33); - this.HeaderPanel.TabIndex = 1; - // - // pbMinimize - // - this.pbMinimize.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.pbMinimize.Image = ((System.Drawing.Image)(resources.GetObject("pbMinimize.Image"))); - this.pbMinimize.Location = new System.Drawing.Point(965, 5); - this.pbMinimize.Name = "pbMinimize"; - this.pbMinimize.Size = new System.Drawing.Size(24, 24); - this.pbMinimize.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; - this.pbMinimize.TabIndex = 4; - this.pbMinimize.TabStop = false; - this.pbMinimize.Click += new System.EventHandler(this.pbMinimize_Click); - // - // pbMaximize - // - this.pbMaximize.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.pbMaximize.BackColor = System.Drawing.Color.Transparent; - this.pbMaximize.Image = ((System.Drawing.Image)(resources.GetObject("pbMaximize.Image"))); - this.pbMaximize.Location = new System.Drawing.Point(988, 5); - this.pbMaximize.Name = "pbMaximize"; - this.pbMaximize.Size = new System.Drawing.Size(24, 24); - this.pbMaximize.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; - this.pbMaximize.TabIndex = 3; - this.pbMaximize.TabStop = false; - this.pbMaximize.Click += new System.EventHandler(this.pbMaximize_Click); - // - // pbClose - // - this.pbClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.pbClose.Image = ((System.Drawing.Image)(resources.GetObject("pbClose.Image"))); - this.pbClose.Location = new System.Drawing.Point(1011, 5); - this.pbClose.Name = "pbClose"; - this.pbClose.Size = new System.Drawing.Size(24, 24); - this.pbClose.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; - this.pbClose.TabIndex = 2; - this.pbClose.TabStop = false; - this.pbClose.Click += new System.EventHandler(this.pbClose_Click); - // - // pbIcon - // - this.pbIcon.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pbIcon.BackgroundImage"))); - this.pbIcon.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.pbIcon.Location = new System.Drawing.Point(5, 5); - this.pbIcon.Name = "pbIcon"; - this.pbIcon.Size = new System.Drawing.Size(24, 24); - this.pbIcon.TabIndex = 1; - this.pbIcon.TabStop = false; - // - // lblTitle - // - this.lblTitle.AutoSize = true; - this.lblTitle.BackColor = System.Drawing.Color.Transparent; - this.lblTitle.Font = new System.Drawing.Font("Century Gothic", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblTitle.ForeColor = System.Drawing.Color.WhiteSmoke; - this.lblTitle.Location = new System.Drawing.Point(31, 6); - this.lblTitle.Name = "lblTitle"; - this.lblTitle.Size = new System.Drawing.Size(157, 21); - this.lblTitle.TabIndex = 0; - this.lblTitle.Text = "Update Generator"; - // - // elipseComponent1 - // - this.elipseComponent1.Control = this; - this.elipseComponent1.Radius = 5; - // - // TestForm - // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.AutoSize = true; - this.BackColor = System.Drawing.SystemColors.ControlLight; - this.ClientSize = new System.Drawing.Size(1039, 538); - this.Controls.Add(this.ContentPanel); - this.Controls.Add(this.SidebarPanel); - this.Controls.Add(this.HeaderPanel); - this.DoubleBuffered = true; - this.Font = new System.Drawing.Font("Century Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; - this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.Name = "TestForm"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "TestForm"; - this.Click += new System.EventHandler(this.TestForm_Click); - this.SidebarPanel.ResumeLayout(false); - this.HeaderPanel.ResumeLayout(false); - this.HeaderPanel.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pbMinimize)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.pbMaximize)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.pbClose)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.pbIcon)).EndInit(); - this.ResumeLayout(false); - - } - - #endregion - - private UI.ElipseComponent elipseComponent1; - private System.Windows.Forms.Label lblTitle; - private System.Windows.Forms.Panel SidebarPanel; - private UI.MoveablePanel HeaderPanel; - private System.Windows.Forms.PictureBox pbIcon; - private UI.HoverPictureBox pbClose; - private UI.HoverPictureBox pbMinimize; - private UI.HoverPictureBox pbMaximize; - private UI.FlatButton btnTabInformation; - private UI.FlatButton btnTabFiles; - private UI.FlatButton btnTabBuild; - internal System.Windows.Forms.Panel ContentPanel; - private UI.FlatButton btnTabRegistry; - } -} \ No newline at end of file diff --git a/UpdateLib/UpdateLib.Generator/TestForm.cs b/UpdateLib/UpdateLib.Generator/TestForm.cs deleted file mode 100644 index 5752676..0000000 --- a/UpdateLib/UpdateLib.Generator/TestForm.cs +++ /dev/null @@ -1,218 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.Collections.Generic; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Windows.Forms; -using MatthiWare.UpdateLib.Generator.UI; -using MatthiWare.UpdateLib.Generator.UI.Pages; -using MatthiWare.UpdateLib.Tasks; -using MatthiWare.UpdateLib.UI; - -namespace MatthiWare.UpdateLib.Generator -{ - public partial class TestForm : Form - { - private Dictionary pageCache; - private AsyncTask loadTask; - private bool shouldShowNewPage = false; - - public TestForm() - { - InitializeComponent(); - - pageCache = new Dictionary(); - - LoadPagesTask().Start(); - } - - public bool TryGetPage(string key, out PageControlBase page) - { - return pageCache.TryGetValue(key, out page); - } - - private AsyncTask LoadPagesTask() - { - if (loadTask == null) - { - LoaderControl.Show(ContentPanel); - - Action loadAction = new Action(() => - { - var pageType = typeof(PageControlBase); - var types = AppDomain.CurrentDomain.GetAssemblies() - .SelectMany(asm => asm.GetTypes()) - .Where(type => pageType.IsAssignableFrom(type) && !type.IsAbstract && type.IsClass && pageType != type); - - foreach (Type type in types) - { - var name = type.Name; - - PageControlBase page = Activator.CreateInstance(type) as PageControlBase; - page.TestForm = this; - - pageCache.Add(name, page); - } - }); - - loadTask = AsyncTaskFactory.From(loadAction, null); - - loadTask.TaskCompleted += (o, e) => - { - LoaderControl.Hide(ContentPanel); - - btnTabInformation.PerformClick(); - }; - } - - return loadTask; - } - - private void TestForm_Click(object sender, EventArgs e) - { - WindowState = (WindowState == FormWindowState.Maximized) ? FormWindowState.Normal : FormWindowState.Maximized; - } - - private void pbMinimize_Click(object sender, EventArgs e) - { - WindowState = FormWindowState.Minimized; - } - - private void pbMaximize_Click(object sender, EventArgs e) - { - MaximumSize = Screen.FromControl(this).WorkingArea.Size; - WindowState = (WindowState == FormWindowState.Normal ? FormWindowState.Maximized : FormWindowState.Normal); - } - - private void pbClose_Click(object sender, EventArgs e) - { - Close(); - } - - private void flatButton1_Click(object sender, EventArgs e) - { - LoadPage(nameof(InformationPage)); - } - - private void flatButton2_Click(object sender, EventArgs e) - { - LoadPage(nameof(FilesPage)); - } - - private bool LoadPage(string pageName) - { - loadTask.AwaitTask(); - - PageControlBase page = null; - bool success = TryGetPage(pageName, out page); - - if (success) - { - shouldShowNewPage = true; - - if (page.IsPageInitialized) - { - AddControlToContentPanel(page); - } - else - { - AddControlToContentPanel(null); - - LoaderControl.Show(ContentPanel); - - page.InitializePage((o, e) => - { - LoaderControl.Hide(ContentPanel); - - if (e.Cancelled) - { - ShowMessageBox( - "Page Load", - "Task cancelled", - "The loading of the page got cancelled.", - SystemIcons.Warning, - MessageBoxButtons.OK); - - return; - } - - if (e.Error != null) - { - ShowMessageBox( - "Page Load", - "Error occured when loading the page", - "Check the log files for more information!", - SystemIcons.Error, - MessageBoxButtons.OK); - - return; - } - - AddControlToContentPanel(page); - }); - } - } - - return success; - } - - private void ShowMessageBox(string title, string header, string desc, Icon icon, MessageBoxButtons buttons = MessageBoxButtons.YesNo) - { - MessageDialog.Show( - this, - title, - header, - desc, - icon, - buttons); - } - - private void AddControlToContentPanel(Control toAdd) - { - if (!shouldShowNewPage) - return; - - ContentPanel.SuspendLayout(); - - ContentPanel.Controls.Clear(); - - if (toAdd != null) - { - toAdd.Dock = DockStyle.Fill; - ContentPanel.Controls.Add(toAdd); - - shouldShowNewPage = false; - } - - ContentPanel.ResumeLayout(); - - } - - private void btnTabBuild_Click(object sender, EventArgs e) - { - LoadPage(nameof(BuilderPage)); - } - - private void btnTabRegistry_Click(object sender, EventArgs e) - { - LoadPage(nameof(RegistryPage)); - } - } -} diff --git a/UpdateLib/UpdateLib.Generator/TestForm.resx b/UpdateLib/UpdateLib.Generator/TestForm.resx deleted file mode 100644 index f6759bb..0000000 --- a/UpdateLib/UpdateLib.Generator/TestForm.resx +++ /dev/null @@ -1,202 +0,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 - - - - - iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAfpJREFUWEft - 1ctLFVEAx/GJjB5UZGkPopAWY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bJFL5/dMbJFL5/dMbJF - L5/dMbJFL5/dMUrxFs9wB5fRo+Q907xg39AE9adUr91tXELRl237I9ZwF8/xDl+xO6zX77j1eaYs4jru - 4QXe4xu2LzR3RriFB3ipgz9G03wB6snjVo1zIMAAAAAASUVORK5CYII= - - - - - iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAL9JREFUWEft - k0sOwjAMRHMPfoLDl88a7sMCyga4AsyEIFlWoiJUuxs/6UmxNzPpJwXBnyzhHp6LPC+gCwx/wpfyAV1K - 7CADj3ANN/BUdh005woZJm+7gtxd8mTMDTJslqcPLMNdnydjtpBhfAUsQXnmzuUV8Lb84Bgo5W4OXeCf - cID3Is9uv+Gk6MeuNacWKjWnFeReQAfq2QwZLgP1bE4UiAKTFfgG6cDWfnRaQa396AwFuBUY0oxaWM0g - +JGU3jM+gGF3vCP8AAAAAElFTkSuQmCC - - - - - iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABGdBTUEAALGPC/xhBQAAAHhJREFUSEtj - GAUkgffv3wt8/vzZgRIMMgNqHCYAKfj69et/SjDIDKhxmABmwbdv3wpgLiIWg/QQbQFeRTgAUXpHLRi1 - AC8YgRZ8//7dDsQmBgPVO5FjgTyQ3UAMBqpVJNkCqBDRgCQLaF7YUYLxWkDzCmcUYAIGBgDTAbB9WZmz - lgAAAABJRU5ErkJggg== - - - - - iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABGdBTUEAALGPC/xhBQAAAN9JREFUSEvt - VTkOwjAQzA/gBRQ8hOs/CERDm5Jn8MK4sBO7g11pLY20TrSO24w08ioz40mR2N2GKjjn9jHGcwuHYdjJ - dhre+9s4jr8WUslJttPIBdM0PWi+1pAyL3PBomkGpiyaUkpHequPheytLqD5wrOF7F1dwKvICujBrMga - aMrhEMKX1r5E0doKLGwq4FVkBfRgVmQNNGFYZAX0YFZkDTRhWGQF9GBWZA005bCFqwqIB/pK3hayt7pA - HplRVUC//52MxeN4jpR5mgtauFjAFw6VFI9jKxcvnA0aXfcH9fiuLoI2qioAAAAASUVORK5CYII= - - - - - iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABGdBTUEAALGPC/xhBQAAATNJREFUSEvt - lc1qwkAUhVO79ocudOOzVPR9SqWbbtNi60YUXLizLvs6voHbQkhCyN8yPXc4EUJimMxs/eDg3Js75zhR - EudOJ8IwHOV5PrNREARD2tWJ43iRpmlhI4Q8065OGZBl2SvW8y7CnjftgNahG2jtbRryfX/AZYWiKB48 - z+uzNAtAPUZ9gVw1QMQcvT10LkOMT4B6JT3c443UMO+hPkoP+lRDwDhAQO9L+kmSbPFZmn/wssIqQED/ - m8Y1c8EqgLflh+bqJLx0xTiA5ieau5A6CUJ2HFEYBcD8EUa/NHxXQwA/+LoMkX+U9IwCYDRF/SeGaoCI - KfoH6BJF0ZP0jAIEfMsJlxUkBPNjluYBunQKwC15wWDj4/iWsGepHWCj1gB54SCk8XGsq9YXzp06jvMP - ywAf8wYrhBkAAAAASUVORK5CYII= - - - - - iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAmxJREFUWEft - ljuLFEEUhUdUWNBATXzjnzEUFMUHJiImq4hipIIogomKGomYmGhiJLK+138giOIDVxE0E9dlHjuzMz06 - e/2qOdXWzmxPVycLwhw4dPetc+6tqa7pupURRiiDVss21jt2rNax5/AjnK61bYbrl2rHJmqJnZ2Zs62S - D4DxM7otB5Juocht2IVWwN/VxO5Ot2yT7CmIX3bjeowHyXZjbCq5Zwe+hi/hJKvwimsCQ03DeV0O7q/4 - eJo0FizrKUzz3gzfsYz7f5qtliSDmY3VEzuI50Og7/HKXgTP8RNg9jtdAhl77v1RZLmGc4FmJRM5j+eP - vAso2XD8mrPNiBsyueJ7NBQNJvHYFw2p4eGg4B1vINE5haPBsl8Li4aUJB/Vtm1D6JdviiVdoaEoUPy6 - L7YYJcsHCU54MZM5pHAhmOgyvDfCYotR8nwgeipxt2q2RuFC/DBbhWd7ESXPB6Ip6CbwRqGlBYVnNYEn - Cv3/4Mf419pQaGlB4beawCeF8sE3YG8hzdZKXoi62ToKp4cYn+lHCudDM81nYqcljQJ/5cOBf1zhfATi - QZYs7s4FfJ/l77p+QkP5yIr1s2RxB379xSDHTYWHIzD8Y9vuazgaeI7g9Ud5rdm0DRoajqzoQs6T8FLM - uYBmDP3VwNtrdGyHhosRGI1v+0OuWUPC83tOxwOuiOQZtNvH4Xevhz12/klJ4pCZ9c657uPZfx09E7Vh - k9C1Za496+8XZ2lqdqVJyyA1920415Syoe4xFtOUOs0t19TIXg4s8QXdDoCNtJ7XcJwCD+A36BpR16B+ - hc/g0ejNNsIIKSqVv+0vKJgA+u+XAAAAAElFTkSuQmCC - - - - 17, 17 - - \ No newline at end of file diff --git a/UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.cs b/UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.cs index f4c7638..8f19624 100644 --- a/UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.cs +++ b/UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.cs @@ -17,14 +17,13 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Drawing; -using System.Windows.Forms; using System.IO; -using MatthiWare.UpdateLib.UI; -using MatthiWare.UpdateLib.Tasks; +using System.Windows.Forms; + using MatthiWare.UpdateLib.Generator.Tasks; -using MatthiWare.UpdateLib.Files; -using System.Diagnostics; +using MatthiWare.UpdateLib.UI; namespace MatthiWare.UpdateLib.Generator.UI.Pages { @@ -88,9 +87,9 @@ private void btnBuild_Click(object sender, EventArgs e) Stopwatch sw = new Stopwatch(); - private AsyncTask Build(Stream s) + private UpdateGeneratorTask Build(Stream s) { - UpdateGeneratorTask task = new UpdateGeneratorTask(filesPage.Root, infoPage, registryPage.Folders); + var task = new UpdateGeneratorTask(filesPage.Root, infoPage, registryPage.Folders); btnBuild.Enabled = false; @@ -107,8 +106,6 @@ private AsyncTask Build(Stream s) Updater.Instance.Logger.Debug(nameof(BuilderPage), nameof(Build), $"File generation completed in {sw.ElapsedMilliseconds} ms."); - - btnBuild.Enabled = true; if (e.Cancelled) diff --git a/UpdateLib/UpdateLib.Generator/UI/Pages/PageControlBase.cs b/UpdateLib/UpdateLib.Generator/UI/Pages/PageControlBase.cs index f39b9f4..2d47e51 100644 --- a/UpdateLib/UpdateLib.Generator/UI/Pages/PageControlBase.cs +++ b/UpdateLib/UpdateLib.Generator/UI/Pages/PageControlBase.cs @@ -24,7 +24,7 @@ namespace MatthiWare.UpdateLib.Generator.UI.Pages { public class PageControlBase : UserControl { - internal TestForm TestForm { get; set; } + internal MainForm TestForm { get; set; } public PageControlBase() { diff --git a/UpdateLib/UpdateLib.Generator/UpdateLib.Generator.csproj b/UpdateLib/UpdateLib.Generator/UpdateLib.Generator.csproj index 6f6d44d..d890be0 100644 --- a/UpdateLib/UpdateLib.Generator/UpdateLib.Generator.csproj +++ b/UpdateLib/UpdateLib.Generator/UpdateLib.Generator.csproj @@ -60,21 +60,15 @@ - - Form - - - MainForm.cs - - + Form - - TestForm.cs + + MainForm.cs Component @@ -130,9 +124,6 @@ UserControl - - MainForm.cs - ResXFileCodeGenerator Resources.Designer.cs @@ -143,8 +134,8 @@ Resources.resx True - - TestForm.cs + + MainForm.cs LoaderControl.cs diff --git a/UpdateLib/UpdateLib.Tests/Common/CatalogEntryTests.cs b/UpdateLib/UpdateLib.Tests/Common/CatalogEntryTests.cs deleted file mode 100644 index 5983dd7..0000000 --- a/UpdateLib/UpdateLib.Tests/Common/CatalogEntryTests.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; - -using MatthiWare.UpdateLib.Common; - -using NUnit.Framework; - -namespace UpdateLib.Tests.Common -{ - [TestFixture] - public class CatalogEntryTests - { - - [Test] - public void ConstructInvalidCatalogEntryThrowsCorrectExceotion() - { - Assert.Catch(() => new CatalogEntry(null, null, null, null)); - Assert.Catch(() => new CatalogEntry("1.0.0", "0.5.0", null, null)); - Assert.Catch(() => new CatalogEntry("1.0.0", "0.5.0", "test", null)); - - Assert.Catch(() => new CatalogEntry("1.0.0", "1.5.0", "test", null)); - } - - [Test] - public void TestIsPatchProperty() - { - CatalogEntry catalogEntry = new CatalogEntry("1.0", null, "test", "test"); - - Assert.IsFalse(catalogEntry.IsPatch); - - catalogEntry = new CatalogEntry("1.0", "0.9", "test", "test"); - - Assert.IsTrue(catalogEntry.IsPatch); - } - } -} diff --git a/UpdateLib/UpdateLib.Tests/Common/UpdateInfoTests.cs b/UpdateLib/UpdateLib.Tests/Common/UpdateInfoTests.cs new file mode 100644 index 0000000..afb8c9b --- /dev/null +++ b/UpdateLib/UpdateLib.Tests/Common/UpdateInfoTests.cs @@ -0,0 +1,35 @@ +using System; + +using MatthiWare.UpdateLib.Common; + +using NUnit.Framework; + +namespace UpdateLib.Tests.Common +{ + [TestFixture] + public class UpdateInfoTests + { + + [Test] + public void ConstructInvalidCatalogEntryThrowsCorrectExceotion() + { + Assert.Catch(() => new UpdateInfo(null, null, null, null)); + Assert.Catch(() => new UpdateInfo("1.0.0", "0.5.0", null, null)); + Assert.Catch(() => new UpdateInfo("1.0.0", "0.5.0", "test", null)); + + Assert.Catch(() => new UpdateInfo("1.0.0", "1.5.0", "test", null)); + } + + [Test] + public void TestIsPatchProperty() + { + var catalogEntry = new UpdateInfo("1.0", null, "test", "test"); + + Assert.IsFalse(catalogEntry.IsPatch); + + catalogEntry = new UpdateInfo("1.0", "0.9", "test", "test"); + + Assert.IsTrue(catalogEntry.IsPatch); + } + } +} diff --git a/UpdateLib/UpdateLib.Tests/Files/UpdateCatalogFileTests.cs b/UpdateLib/UpdateLib.Tests/Files/UpdateCatalogFileTests.cs index 61dfb18..d17a773 100644 --- a/UpdateLib/UpdateLib.Tests/Files/UpdateCatalogFileTests.cs +++ b/UpdateLib/UpdateLib.Tests/Files/UpdateCatalogFileTests.cs @@ -14,9 +14,11 @@ public void TestTryGetLatestVersionGood() { var file = GenerateCatalogFile(); - Assert.IsTrue(file.TryGetLatestUpdateForVersion("0.1", out CatalogEntry entry)); + var latest = file.GetLatestUpdateForVersion("0.1"); - Assert.AreEqual(entry.FileName, "version_1.0-full"); + Assert.IsNotNull(latest); + + Assert.AreEqual(latest.FileName, "version_1.0-full"); } [Test] @@ -24,9 +26,11 @@ public void TestTryGetLatestVersionGood2() { var file = GenerateCatalogFile(); - Assert.IsTrue(file.TryGetLatestUpdateForVersion("0.4", out CatalogEntry entry)); + var latest = file.GetLatestUpdateForVersion("0.4"); + + Assert.IsNotNull(latest); - Assert.AreEqual(entry.FileName, "version_0.4-1.0"); + Assert.AreEqual(latest.FileName, "version_0.4-1.0"); } [Test] @@ -34,7 +38,7 @@ public void TestTryGetLatestVersionEmptryFileReturnsFalse() { var file = GenerateCatalogFile(true); - Assert.IsFalse(file.TryGetLatestUpdateForVersion("0.1", out _)); + Assert.IsNull(file.GetLatestUpdateForVersion("0.1")); } @@ -44,12 +48,12 @@ private UpdateCatalogFile GenerateCatalogFile(bool empty = false) if (!empty) { - file.Catalog.Add(new CatalogEntry("1.0", "0.4", "version_0.4-1.0", "0x0")); - file.Catalog.Add(new CatalogEntry("0.7", "0.1", "version_0.1-0.7", "0x0")); - file.Catalog.Add(new CatalogEntry("0.8", "0.7", "version_0.7-0.8", "0x0")); - file.Catalog.Add(new CatalogEntry("0.9", "0.8", "version_0.8-0.9", "0x0")); - file.Catalog.Add(new CatalogEntry("1.0", null, "version_1.0-full", "0x0")); - file.Catalog.Add(new CatalogEntry("1.0", "0.5", "version_0.5-1.0", "0x0")); + file.Catalog.Add(new UpdateInfo("1.0", "0.4", "version_0.4-1.0", "0x0")); + file.Catalog.Add(new UpdateInfo("0.7", "0.1", "version_0.1-0.7", "0x0")); + file.Catalog.Add(new UpdateInfo("0.8", "0.7", "version_0.7-0.8", "0x0")); + file.Catalog.Add(new UpdateInfo("0.9", "0.8", "version_0.8-0.9", "0x0")); + file.Catalog.Add(new UpdateInfo("1.0", null, "version_1.0-full", "0x0")); + file.Catalog.Add(new UpdateInfo("1.0", "0.5", "version_0.5-1.0", "0x0")); } diff --git a/UpdateLib/UpdateLib.Tests/Files/UpdateFileTest.cs b/UpdateLib/UpdateLib.Tests/Files/UpdateFileTest.cs index c8a160e..addf83a 100644 --- a/UpdateLib/UpdateLib.Tests/Files/UpdateFileTest.cs +++ b/UpdateLib/UpdateLib.Tests/Files/UpdateFileTest.cs @@ -17,10 +17,13 @@ using System; using System.IO; + using MatthiWare.UpdateLib.Common; using MatthiWare.UpdateLib.Common.Abstraction; using MatthiWare.UpdateLib.Files; + using Moq; + using NUnit.Framework; namespace UpdateLib.Tests.Files @@ -38,16 +41,14 @@ public void Before() [Test] public void SaveAndLoadUpdateFileShouldBeTheSame() { - UpdateFile file = MakeUpdateFile(); - UpdateInfo info = file.GetLatestUpdate(); + var file = MakeUpdateFile(); file.Save(temp_file); - UpdateFile updateFile = FileManager.LoadFile(temp_file); - UpdateInfo updateInfo = updateFile.GetLatestUpdate(); + var updateFile = FileManager.LoadFile(temp_file); - Assert.AreEqual(file.ApplicationName, updateFile.ApplicationName); - Assert.AreEqual(info.Version, updateInfo.Version); - Assert.AreEqual(info.FileCount, updateInfo.FileCount); + //Assert.AreEqual(file.ApplicationName, updateFile.ApplicationName); + Assert.AreEqual(file.Version, updateFile.Version); + Assert.AreEqual(file.FileCount, updateFile.FileCount); } [Test] @@ -55,7 +56,7 @@ public void SaveInvalidParamterShouldThrowExceptions() { Stream nullStream = null; - UpdateFile file = new UpdateFile(); + var file = new UpdateMetadataFile(); Assert.Catch(() => { file.Save(nullStream); }); Assert.Catch(() => { file.Save(string.Empty); }); @@ -71,26 +72,24 @@ public void LoadInvalidParameterShouldThrowExceptions() { Stream nullStream = null; - Assert.Catch(() => { FileManager.LoadFile(nullStream); }); - Assert.Catch(() => { FileManager.LoadFile(string.Empty); }); + Assert.Catch(() => { FileManager.LoadFile(nullStream); }); + Assert.Catch(() => { FileManager.LoadFile(string.Empty); }); CleanUp(); - Assert.Catch(() => { FileManager.LoadFile(temp_file); }); + Assert.Catch(() => { FileManager.LoadFile(temp_file); }); Mock unreadableStream = new Mock(); unreadableStream.SetupGet(s => s.CanRead).Returns(false); - Assert.Catch(() => { FileManager.LoadFile(unreadableStream.Object); }); + Assert.Catch(() => { FileManager.LoadFile(unreadableStream.Object); }); } - private UpdateFile MakeUpdateFile() + private UpdateMetadataFile MakeUpdateFile() { - UpdateFile file = new UpdateFile(); - - file.ApplicationName = nameof(UpdateFileTest); + var file = new UpdateMetadataFile(); - UpdateInfo info = new UpdateInfo { Version = new UpdateVersion(9, 9, 9) }; + var info = new UpdateMetadataFile { Version = "9.9.9" }; DirectoryEntry appSubFolder = new DirectoryEntry("AppSubFolder"); DirectoryEntry otherSubFolder = new DirectoryEntry("OtherSubFolder"); diff --git a/UpdateLib/UpdateLib.Tests/Tasks/DownloadManagerTests.cs b/UpdateLib/UpdateLib.Tests/Tasks/DownloadManagerTests.cs index a978ad0..82d0a22 100644 --- a/UpdateLib/UpdateLib.Tests/Tasks/DownloadManagerTests.cs +++ b/UpdateLib/UpdateLib.Tests/Tasks/DownloadManagerTests.cs @@ -15,14 +15,17 @@ * along with this program. If not, see . */ +using System; +using System.IO; +using System.Threading; + using MatthiWare.UpdateLib; using MatthiWare.UpdateLib.Common; +using MatthiWare.UpdateLib.Files; using MatthiWare.UpdateLib.Security; using MatthiWare.UpdateLib.Tasks; + using NUnit.Framework; -using System; -using System.IO; -using System.Threading; namespace UpdateLib.Tests.Tasks { @@ -53,15 +56,14 @@ public void Before() Updater.Instance.Initialize(); } - [Test] + [Test, Parallelizable] public void TestDownloadManager() { - - - UpdateInfo info = new UpdateInfo(); + MatthiWare.UpdateLib.Files.UpdateInfo info = new MatthiWare.UpdateLib.Files.UpdateInfo(); DirectoryEntry dir = new DirectoryEntry("%appdir%"); FileEntry entry_file = new FileEntry("testfile.txt"); + entry_file.Hash = HashUtil.GetHash(m_file); dir.Add(entry_file); @@ -70,9 +72,9 @@ public void TestDownloadManager() ManualResetEvent wait = new ManualResetEvent(false); DownloadManager manager = new DownloadManager(info); manager.Completed += (o, e) => wait.Set(); - manager.Update(); + manager.Download(); - Assert.IsTrue(wait.WaitOne(TimeSpan.FromSeconds(20)), "The async download timed-out after 10 seconds"); + Assert.IsTrue(wait.WaitOne(TimeSpan.FromSeconds(60*5)), "The async download timed-out after 10 seconds"); string localFile = Updater.Instance.Converter.Convert("%appdir%/testfile.txt"); Assert.IsTrue(File.Exists(localFile), "File didn't exist"); diff --git a/UpdateLib/UpdateLib.Tests/UpdateLib.Tests.csproj b/UpdateLib/UpdateLib.Tests/UpdateLib.Tests.csproj index f3514ac..1a6d8ce 100644 --- a/UpdateLib/UpdateLib.Tests/UpdateLib.Tests.csproj +++ b/UpdateLib/UpdateLib.Tests/UpdateLib.Tests.csproj @@ -57,7 +57,7 @@ Properties\SharedAssemblyInfo.cs - + diff --git a/UpdateLib/UpdateLib.Tests/Util/ExtensionMethodsTest.cs b/UpdateLib/UpdateLib.Tests/Util/ExtensionMethodsTest.cs index 292e4a5..c3121e0 100644 --- a/UpdateLib/UpdateLib.Tests/Util/ExtensionMethodsTest.cs +++ b/UpdateLib/UpdateLib.Tests/Util/ExtensionMethodsTest.cs @@ -15,13 +15,17 @@ * along with this program. If not, see . */ -using NUnit.Framework; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; + +using MatthiWare.UpdateLib.Common; +using MatthiWare.UpdateLib.Files; using MatthiWare.UpdateLib.Utils; + using Moq; -using System.Diagnostics; -using MatthiWare.UpdateLib.Common; + +using NUnit.Framework; namespace UpdateLib.Tests.Util { @@ -52,27 +56,27 @@ public void TestNotEmpty() [Test] public void TestMax() { - UpdateInfo v1 = MakeUpdateInfo(new UpdateVersion(1)); - UpdateInfo v2 = MakeUpdateInfo(new UpdateVersion(2)); - UpdateInfo v3 = MakeUpdateInfo(new UpdateVersion(2, 1)); - UpdateInfo v4 = MakeUpdateInfo(new UpdateVersion(2, 1, 1)); - UpdateInfo v5 = MakeUpdateInfo(new UpdateVersion(2, 1, 1, VersionLabel.Beta)); - UpdateInfo v6 = MakeUpdateInfo(new UpdateVersion(2, 1, 1, VersionLabel.RC)); - UpdateInfo v7 = MakeUpdateInfo(new UpdateVersion(2, 1, 2)); - - List versions = new List(new UpdateInfo[] + UpdateMetadataFile v1 = MakeUpdateFile("1"); + UpdateMetadataFile v2 = MakeUpdateFile("2"); + UpdateMetadataFile v3 = MakeUpdateFile("2.1"); + UpdateMetadataFile v4 = MakeUpdateFile("2.1.1"); + UpdateMetadataFile v5 = MakeUpdateFile("2.1.1-beta"); + UpdateMetadataFile v6 = MakeUpdateFile("2.1.1-rc"); + UpdateMetadataFile v7 = MakeUpdateFile("2.1.2"); + + List versions = new List(new UpdateMetadataFile[] { v1,v2,v3,v4,v5,v6,v7 }); - UpdateInfo max = versions.MaxOrDefault(u => u.Version); + var max = versions.MaxOrDefault(u => u.Version); Assert.AreEqual(v7, max); } - private UpdateInfo MakeUpdateInfo(UpdateVersion version) + private UpdateMetadataFile MakeUpdateFile(UpdateVersion version) { - return new UpdateInfo + return new UpdateMetadataFile() { Version = version }; diff --git a/UpdateLib/UpdateLib.Tests/Util/LazyTests.cs b/UpdateLib/UpdateLib.Tests/Util/LazyTests.cs index c3f191c..8c26e0f 100644 --- a/UpdateLib/UpdateLib.Tests/Util/LazyTests.cs +++ b/UpdateLib/UpdateLib.Tests/Util/LazyTests.cs @@ -15,6 +15,8 @@ * along with this program. If not, see . */ +using MatthiWare.UpdateLib.Utils; + using NUnit.Framework; namespace UpdateLib.Tests.Util @@ -26,18 +28,18 @@ public class LazyTests [Test] public void TestLazyInitializesCorreclty() { - MatthiWare.UpdateLib.Utils.Lazy myObject = new MatthiWare.UpdateLib.Utils.Lazy(() => "test"); + var myObject = new Lazy(() => "test"); - Assert.AreEqual("test", myObject.Value); + Assert.AreEqual("test", myObject); } [Test] public void TestLaszySet() { - MatthiWare.UpdateLib.Utils.Lazy myObj = new MatthiWare.UpdateLib.Utils.Lazy(() => "test"); + var myObj = new Lazy(() => "test"); myObj.Value = "new"; - Assert.AreEqual("new", myObj.Value); + Assert.AreEqual("new", myObj); } [Test] @@ -45,17 +47,17 @@ public void TestLazyReset() { SwitchObject switcher = new SwitchObject(); - MatthiWare.UpdateLib.Utils.Lazy myLazy = new MatthiWare.UpdateLib.Utils.Lazy(switcher.Get); + var myLazy = new Lazy(switcher.Get); - Assert.AreEqual(switcher.Get(), myLazy.Value); + Assert.AreEqual(switcher.Get(), myLazy); switcher.Toggle(); - Assert.AreNotEqual(switcher.Get(), myLazy.Value); + Assert.AreNotEqual(switcher.Get(), myLazy); myLazy.Reset(); - Assert.AreEqual(switcher.Get(), myLazy.Value); + Assert.AreEqual(switcher.Get(), myLazy); } private class SwitchObject @@ -68,9 +70,7 @@ public void Toggle() } public string Get() - { - return m_state ? "true" : "false"; - } + => m_state ? "true" : "false"; } } } diff --git a/UpdateLib/UpdateLib/Common/Abstraction/FileBase.cs b/UpdateLib/UpdateLib/Common/Abstraction/FileBase.cs index 9942311..c05a02e 100644 --- a/UpdateLib/UpdateLib/Common/Abstraction/FileBase.cs +++ b/UpdateLib/UpdateLib/Common/Abstraction/FileBase.cs @@ -46,7 +46,7 @@ public virtual void Save(string path) { if (string.IsNullOrEmpty(path)) throw new ArgumentNullException(nameof(path)); - FileInfo fi = new FileInfo(path); + var fi = new FileInfo(path); if (!fi.Directory.Exists) fi.Directory.Create(); @@ -61,6 +61,7 @@ public virtual void Save(string path) /// The stream to save the file to. public virtual void Save(Stream stream) { + if (stream == null) throw new ArgumentNullException(nameof(stream)); if (!stream.CanWrite) throw new ArgumentException("Unwritable stream", nameof(stream)); XmlSerializer serializer = new XmlSerializer(typeof(T)); @@ -82,7 +83,7 @@ public virtual T Load(string path) { if (string.IsNullOrEmpty(path)) throw new ArgumentNullException(nameof(path)); - FileInfo fi = new FileInfo(path); + var fi = new FileInfo(path); if (!fi.Exists) throw new FileNotFoundException("File does not exist", path); @@ -97,6 +98,7 @@ public virtual T Load(string path) /// A loaded instance of the file. public virtual T Load(Stream stream) { + if (stream == null) throw new ArgumentNullException(nameof(stream)); if (!stream.CanRead) throw new ArgumentException("Unreadable stream", nameof(stream)); XmlSerializer serializer = new XmlSerializer(typeof(T)); diff --git a/UpdateLib/UpdateLib/Common/Attributes.cs b/UpdateLib/UpdateLib/Common/Attributes.cs new file mode 100644 index 0000000..509dabe --- /dev/null +++ b/UpdateLib/UpdateLib/Common/Attributes.cs @@ -0,0 +1,19 @@ +using System; + +namespace MatthiWare.UpdateLib.Common +{ + /// + /// The application version that the uses to know what the current version is. + /// This attribute should be incremented with each new release, patch, ... + /// + [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false, Inherited = true)] + public sealed class ApplicationVersionAttribute : Attribute + { + public UpdateVersion Version { get; private set; } + + public ApplicationVersionAttribute(string version) + { + Version = version; + } + } +} diff --git a/UpdateLib/UpdateLib/Common/DirectoryEntry.cs b/UpdateLib/UpdateLib/Common/DirectoryEntry.cs index b022cb3..598698e 100644 --- a/UpdateLib/UpdateLib/Common/DirectoryEntry.cs +++ b/UpdateLib/UpdateLib/Common/DirectoryEntry.cs @@ -17,10 +17,11 @@ using System; using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; using System.Text; using System.Xml.Serialization; -using System.Linq; -using System.Diagnostics; + using MatthiWare.UpdateLib.Common.Abstraction; namespace MatthiWare.UpdateLib.Common @@ -43,13 +44,7 @@ public class DirectoryEntry /// /// Gets how many files there are in this directory and its subdirectories. /// - public int Count - { - get - { - return Items.Count + Directories.Sum(d => d.Count); - } - } + public int Count => Items.Count + Directories.Sum(dir => dir.Count); /// /// Gets the list of subdirectories. @@ -153,9 +148,6 @@ public bool Remove(EntryBase file) /// Gets all the items including the items of childs /// /// A list of items - public IEnumerable GetItems() - { - return Items.Concat(Directories.SelectMany(d => d.GetItems())); - } + public IEnumerable GetItems() => Items.Concat(Directories.SelectMany(d => d.GetItems())); } } diff --git a/UpdateLib/UpdateLib/Common/Exceptions/NoVersionSpecifiedException.cs b/UpdateLib/UpdateLib/Common/Exceptions/InvalidUpdateServerException.cs similarity index 77% rename from UpdateLib/UpdateLib/Common/Exceptions/NoVersionSpecifiedException.cs rename to UpdateLib/UpdateLib/Common/Exceptions/InvalidUpdateServerException.cs index 321fd40..a12fa51 100644 --- a/UpdateLib/UpdateLib/Common/Exceptions/NoVersionSpecifiedException.cs +++ b/UpdateLib/UpdateLib/Common/Exceptions/InvalidUpdateServerException.cs @@ -28,12 +28,12 @@ namespace MatthiWare.UpdateLib.Common.Exceptions { [Serializable] - public class NoVersionSpecifiedException : Exception + public class InvalidUpdateServerException : Exception { - public NoVersionSpecifiedException() { } - public NoVersionSpecifiedException(string message) : base(message) { } - public NoVersionSpecifiedException(string message, Exception inner) : base(message, inner) { } - protected NoVersionSpecifiedException( + public InvalidUpdateServerException() { } + public InvalidUpdateServerException(string message) : base(message) { } + public InvalidUpdateServerException(string message, Exception inner) : base(message, inner) { } + protected InvalidUpdateServerException( System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) { } } diff --git a/UpdateLib/UpdateLib/Common/Exceptions/UnableToDownloadUpdateException.cs b/UpdateLib/UpdateLib/Common/Exceptions/UnableToDownloadUpdateException.cs new file mode 100644 index 0000000..3904c5f --- /dev/null +++ b/UpdateLib/UpdateLib/Common/Exceptions/UnableToDownloadUpdateException.cs @@ -0,0 +1,16 @@ +using System; + +namespace MatthiWare.UpdateLib.Common.Exceptions +{ + + [Serializable] + public class UnableToDownloadUpdateException : Exception + { + public UnableToDownloadUpdateException() { } + public UnableToDownloadUpdateException(string message) : base(message) { } + public UnableToDownloadUpdateException(string message, Exception inner) : base(message, inner) { } + protected UnableToDownloadUpdateException( + System.Runtime.Serialization.SerializationInfo info, + System.Runtime.Serialization.StreamingContext context) : base(info, context) { } + } +} diff --git a/UpdateLib/UpdateLib/Common/HashCacheEntry.cs b/UpdateLib/UpdateLib/Common/HashCacheEntry.cs index 351816c..4c4405c 100644 --- a/UpdateLib/UpdateLib/Common/HashCacheEntry.cs +++ b/UpdateLib/UpdateLib/Common/HashCacheEntry.cs @@ -15,11 +15,12 @@ * along with this program. If not, see . */ -using MatthiWare.UpdateLib.Security; using System; using System.IO; using System.Xml.Serialization; +using MatthiWare.UpdateLib.Security; + namespace MatthiWare.UpdateLib.Common { [Serializable] @@ -55,15 +56,14 @@ public void Recalculate(string hash = "") { try { - long tick = File.GetLastWriteTime(FilePath).Ticks; + var tick = File.GetLastWriteTime(FilePath).Ticks; + + if (Ticks != -1 && tick == Ticks) return; - if (Ticks == -1 || tick != Ticks) - { - Hash = string.IsNullOrEmpty(hash) ? HashUtil.GetHash(FilePath) : hash; - Ticks = tick; + Hash = string.IsNullOrEmpty(hash) ? HashUtil.GetHash(FilePath) : hash; + Ticks = tick; - Updater.Instance.Logger.Debug(nameof(HashCacheEntry), nameof(Recalculate), $"Recalculated Time: {DateTime.FromBinary(Ticks).ToString()} Name: {FilePath} Hash: {Hash}"); - } + Updater.Instance.Logger.Debug(nameof(HashCacheEntry), nameof(Recalculate), $"Recalculated Time: {DateTime.FromBinary(Ticks).ToString()} Name: {FilePath} Hash: {Hash}"); } catch (Exception ex) // file might no longer exist or is in use { diff --git a/UpdateLib/UpdateLib/Common/ParameterDefinition.cs b/UpdateLib/UpdateLib/Common/ParameterDefinition.cs index 8203d19..3b0eefd 100644 --- a/UpdateLib/UpdateLib/Common/ParameterDefinition.cs +++ b/UpdateLib/UpdateLib/Common/ParameterDefinition.cs @@ -9,9 +9,9 @@ public class ParameterDefinition public int Count { get; internal set; } - public bool IsFound { get { return Count > 0; } } + public bool IsFound => Count > 0; - public ParameterDefinition(string paramName, ParamMandatoryType mandatoryType = ParamMandatoryType.Optional, ParamValueType valueType = ParamValueType.None) + internal ParameterDefinition(string paramName, ParamMandatoryType mandatoryType = ParamMandatoryType.Optional, ParamValueType valueType = ParamValueType.None) { ParameterName = paramName; MandatoryType = mandatoryType; diff --git a/UpdateLib/UpdateLib/Common/UpdateInfo.cs b/UpdateLib/UpdateLib/Common/UpdateInfo.cs index 9b58b3e..b159a91 100644 --- a/UpdateLib/UpdateLib/Common/UpdateInfo.cs +++ b/UpdateLib/UpdateLib/Common/UpdateInfo.cs @@ -1,38 +1,116 @@ -using System; -using System.Collections.Generic; -using System.Linq; +/* Copyright + * + * UpdateLib - .Net auto update library + * + * File: UpdateInfo.cs v0.5 + * + * Author: Matthias Beerens + * + * Copyright (C) 2018 - MatthiWare + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using System; using System.Xml.Serialization; namespace MatthiWare.UpdateLib.Common { + /// + /// An entry for the + /// [Serializable] - public class UpdateInfo + public class UpdateInfo : IComparable, IComparable { /// - /// Gets or sets the version of the current update. - /// The versionstring should be parsable by the to be valid. + /// Specifies the version this patch is based on. + /// This field can be null in case it is not a patch. /// - public UpdateVersion Version { get; set; } = new UpdateVersion(1); + public UpdateVersion BasedOnVersion { get; set; } /// - /// Gets the folders of the project + /// The version of the update/patch. /// - [XmlArray("Folders"), XmlArrayItem("Directory")] - public List Folders { get; private set; } = new List(); + public UpdateVersion Version { get; set; } /// - /// Gets the count of all the files in the - /// and their subdirectories. + /// The file name. /// - [XmlIgnore] - public int FileCount => Folders.Sum(dir => dir.Count); + public string FileName { get; set; } - [XmlIgnore] - public int RegistryKeyCount => Registry.Sum(reg => reg.Count); + /// + /// The meta file name. + /// + public string MetaFileName { get; set; } + + /// + /// The calculated hash for the update/patch. + /// + public string Hash { get; set; } + + /// + /// The calculated hash for the meta file. + /// + public string MetaHash { get; set; } - [XmlArray("Registry"), XmlArrayItem("Directory")] - public List Registry { get; private set; } = new List(); + /// + /// Indicates if this update is a patch. + /// + [XmlIgnore] + public bool IsPatch => BasedOnVersion != null; public UpdateInfo() { } + + /// + /// A new catalog entry + /// + /// The update version + /// The version this update is based on, can be null if it's not a patch. + /// The file name for the update. + /// The calculated hash for the update + public UpdateInfo(UpdateVersion version, UpdateVersion basedOnVersion, string fileName, string hash) + { + Version = version ?? throw new ArgumentNullException(nameof(version)); + FileName = fileName ?? throw new ArgumentNullException(nameof(fileName)); + Hash = hash ?? throw new ArgumentNullException(nameof(hash)); + + BasedOnVersion = basedOnVersion; + + if (version <= basedOnVersion) throw new ArgumentOutOfRangeException(nameof(basedOnVersion), "The new version cannot be smaller than the version it was based on."); + } + + public int CompareTo(UpdateInfo other) + { + if (other == null) return -1; + + if (Version > other.Version) return -1; + + if (Version == other.Version) + { + if (IsPatch && other.IsPatch) return BasedOnVersion.CompareTo(other.BasedOnVersion); + + if (IsPatch && !other.IsPatch) return -1; + + if (!IsPatch && other.IsPatch) return 1; + + return 0; + } + + return 1; + } + + public int CompareTo(object obj) + => CompareTo(obj as UpdateInfo); } } diff --git a/UpdateLib/UpdateLib/Common/UpdateVersion.cs b/UpdateLib/UpdateLib/Common/UpdateVersion.cs index 35ca993..6bd3008 100644 --- a/UpdateLib/UpdateLib/Common/UpdateVersion.cs +++ b/UpdateLib/UpdateLib/Common/UpdateVersion.cs @@ -17,18 +17,19 @@ using System; using System.ComponentModel; +using System.Diagnostics; using System.Xml; using System.Xml.Serialization; namespace MatthiWare.UpdateLib.Common { /// - /// Versioning class with small extensions over the original . + /// Versioning class with small extensions over the original as the original is sealed. /// Support for version label's and serializable. /// Partially based on Semantic Versioning /// [Serializable] - + [DebuggerDisplay("[UpdateVersion {Value}]")] public class UpdateVersion : IComparable, IComparable, IEquatable { private int m_major, m_minor, m_patch; @@ -47,28 +48,16 @@ public class UpdateVersion : IComparable, IComparable, IEquatable #region Properties [XmlIgnore] - public int Major - { - get { return m_major; } - } + public int Major => m_major; [XmlIgnore] - public int Minor - { - get { return m_minor; } - } + public int Minor => m_minor; [XmlIgnore] - public int Patch - { - get { return m_patch; } - } + public int Patch => m_patch; [XmlIgnore] - public VersionLabel Label - { - get { return m_label; } - } + public VersionLabel Label => m_label; [XmlText] [XmlElement(typeof(string))] diff --git a/UpdateLib/UpdateLib/Compression/GZip/GZipInputStream.cs b/UpdateLib/UpdateLib/Compression/GZip/GZipInputStream.cs index 8be8b4b..04f0233 100644 --- a/UpdateLib/UpdateLib/Compression/GZip/GZipInputStream.cs +++ b/UpdateLib/UpdateLib/Compression/GZip/GZipInputStream.cs @@ -33,11 +33,12 @@ * DEALINGS IN THE SOFTWARE. */ +using System; +using System.IO; + using MatthiWare.UpdateLib.Compression.Checksum; using MatthiWare.UpdateLib.Compression.Deflaters; using MatthiWare.UpdateLib.Compression.Streams; -using System; -using System.IO; namespace MatthiWare.UpdateLib.Compression.GZip { @@ -97,9 +98,10 @@ public class GZipInputStream : InflaterInputStream /// /// The stream to read compressed data from (baseInputStream GZIP format) /// - public GZipInputStream(Stream baseInputStream) + public GZipInputStream(Stream baseInputStream, bool isOwner = true) : this(baseInputStream, 4096) { + IsStreamOwner = isOwner; } /// diff --git a/UpdateLib/UpdateLib/Compression/GZip/GZipOutputStream.cs b/UpdateLib/UpdateLib/Compression/GZip/GZipOutputStream.cs index 825e70f..0e05719 100644 --- a/UpdateLib/UpdateLib/Compression/GZip/GZipOutputStream.cs +++ b/UpdateLib/UpdateLib/Compression/GZip/GZipOutputStream.cs @@ -33,11 +33,12 @@ * DEALINGS IN THE SOFTWARE. */ +using System; +using System.IO; + using MatthiWare.UpdateLib.Compression.Checksum; using MatthiWare.UpdateLib.Compression.Deflaters; using MatthiWare.UpdateLib.Compression.Streams; -using System; -using System.IO; namespace MatthiWare.UpdateLib.Compression.GZip { @@ -94,9 +95,10 @@ enum OutputState /// /// The stream to read data (to be compressed) from /// - public GZipOutputStream(Stream baseOutputStream) + public GZipOutputStream(Stream baseOutputStream, bool isOwner = true) : this(baseOutputStream, 4096) { + IsStreamOwner = isOwner; } /// diff --git a/UpdateLib/UpdateLib/Compression/Streams/InflaterInputStream.cs b/UpdateLib/UpdateLib/Compression/Streams/InflaterInputStream.cs index 8c81083..c13add9 100644 --- a/UpdateLib/UpdateLib/Compression/Streams/InflaterInputStream.cs +++ b/UpdateLib/UpdateLib/Compression/Streams/InflaterInputStream.cs @@ -33,10 +33,11 @@ * DEALINGS IN THE SOFTWARE. */ -using MatthiWare.UpdateLib.Compression.Deflaters; using System; using System.IO; +using MatthiWare.UpdateLib.Compression.Deflaters; + namespace MatthiWare.UpdateLib.Compression.Streams { /// @@ -282,7 +283,6 @@ public int ReadLeByte() int clearTextLength; byte[] clearText; - byte[] internalClearText; int available; Stream inputStream; diff --git a/UpdateLib/UpdateLib/Compression/Zip/ZipEntry.cs b/UpdateLib/UpdateLib/Compression/Zip/ZipEntry.cs index e13a7b7..9c0831e 100644 --- a/UpdateLib/UpdateLib/Compression/Zip/ZipEntry.cs +++ b/UpdateLib/UpdateLib/Compression/Zip/ZipEntry.cs @@ -1051,9 +1051,6 @@ public static string CleanName(string name) long offset; // used by ZipFile and ZipOutputStream bool forceZip64_; - byte cryptoCheckValue_; - int _aesVer; // Version number (2 = AE-2 ?). Assigned but not used. - int _aesEncryptionStrength; // Encryption strength 1 = 128 2 = 192 3 = 256 #endregion } } diff --git a/UpdateLib/UpdateLib/Compression/Zip/ZipFile.cs b/UpdateLib/UpdateLib/Compression/Zip/ZipFile.cs index 015af3a..44140ef 100644 --- a/UpdateLib/UpdateLib/Compression/Zip/ZipFile.cs +++ b/UpdateLib/UpdateLib/Compression/Zip/ZipFile.cs @@ -33,13 +33,13 @@ * DEALINGS IN THE SOFTWARE. */ -using MatthiWare.UpdateLib.Utils; using System; using System.Collections; -using System.Collections.Generic; using System.IO; using System.Runtime.CompilerServices; +using MatthiWare.UpdateLib.Utils; + namespace MatthiWare.UpdateLib.Compression.Zip { #region ZipFile Class @@ -259,7 +259,7 @@ public ZipEntry GetEntry(string name) } #endregion - + #endregion #region Disposing @@ -393,8 +393,8 @@ void ReadEntries() long offsetOfCentralDir = ReadLEUint(); uint commentSize = ReadLEUshort(); - comment_ = (commentSize > 0) ? - ZipConstants.ConvertToString(baseStream_.CheckedReadBytes((int)commentSize)) : + comment_ = (commentSize > 0) ? + ZipConstants.ConvertToString(baseStream_.CheckedReadBytes((int)commentSize)) : string.Empty; bool isZip64 = false; @@ -517,29 +517,14 @@ void ReadEntries() bool isDisposed_; string name_; string comment_; - string rawPassword_; Stream baseStream_; bool isStreamOwner; long offsetOfFirstEntry; ZipEntry[] entries_; - byte[] key; - bool isNewArchive_; - - // Default is dynamic which is not backwards compatible and can cause problems - // with XP's built in compression which cant read Zip64 archives. - // However it does avoid the situation were a large file is added and cannot be completed correctly. - // Hint: Set always ZipEntry size before they are added to an archive and this setting isnt needed. - UseZip64 useZip64_ = UseZip64.Dynamic; - - #region Zip Update Instance Fields - Dictionary updateIndex_; - bool contentsEdited_; - byte[] copyBuffer_; - #endregion #endregion #region Support Classes - + /// /// An enumerator for Zip entries /// diff --git a/UpdateLib/UpdateLib/Files/CacheFile.cs b/UpdateLib/UpdateLib/Files/CacheFile.cs new file mode 100644 index 0000000..dc0584d --- /dev/null +++ b/UpdateLib/UpdateLib/Files/CacheFile.cs @@ -0,0 +1,22 @@ +using System; + +using MatthiWare.UpdateLib.Common; +using MatthiWare.UpdateLib.Common.Abstraction; +using MatthiWare.UpdateLib.Utils; + +namespace MatthiWare.UpdateLib.Files +{ + [Serializable] + public class CacheFile : FileBase + { + private static Lazy m_filePath = new Lazy(() => $"{IOUtils.AppDataPath}\\Cache.xml"); + + public UpdateVersion CurrentVersion { get; set; } + + public override CacheFile Load() + => Load(m_filePath); + + public override void Save() + => Save(m_filePath); + } +} diff --git a/UpdateLib/UpdateLib/Files/HashCacheFile.cs b/UpdateLib/UpdateLib/Files/HashCacheFile.cs index 198f889..132a3d3 100644 --- a/UpdateLib/UpdateLib/Files/HashCacheFile.cs +++ b/UpdateLib/UpdateLib/Files/HashCacheFile.cs @@ -15,14 +15,14 @@ * along with this program. If not, see . */ -using MatthiWare.UpdateLib.Utils; -using MatthiWare.UpdateLib.Common; using System; using System.Collections.Generic; -using System.IO; -using System.Xml.Serialization; using System.Linq; +using System.Xml.Serialization; + +using MatthiWare.UpdateLib.Common; using MatthiWare.UpdateLib.Common.Abstraction; +using MatthiWare.UpdateLib.Utils; namespace MatthiWare.UpdateLib.Files { @@ -66,8 +66,8 @@ public void AddOrUpdateEntry(string fullPath, string hash = "") } #region Save/Load - private static string GetStoragePath() => $@"{IOUtils.AppDataPath}\{FILE_NAME}"; - + private static string GetStoragePath() => $@"{IOUtils.CachePath}\{FILE_NAME}"; + /// /// Loads the from the default storage location /// diff --git a/UpdateLib/UpdateLib/Files/ServerFile.cs b/UpdateLib/UpdateLib/Files/ServerFile.cs deleted file mode 100644 index 1244829..0000000 --- a/UpdateLib/UpdateLib/Files/ServerFile.cs +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright - * - * UpdateLib - .Net auto update library - * - * File: ServerFile.cs v0.5 - * - * Author: Matthias Beerens - * - * Copyright (C) 2017 - MatthiWare - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using MatthiWare.UpdateLib.Common.Abstraction; -using System; - -namespace MatthiWare.UpdateLib.Files -{ - [Serializable] - public class ServerFile : FileBase - { - public override ServerFile Load() - => Load(""); - - public override void Save() - => Save(""); - } -} diff --git a/UpdateLib/UpdateLib/Files/UpdateCatalogFile.cs b/UpdateLib/UpdateLib/Files/UpdateCatalogFile.cs index fa810df..43827a8 100644 --- a/UpdateLib/UpdateLib/Files/UpdateCatalogFile.cs +++ b/UpdateLib/UpdateLib/Files/UpdateCatalogFile.cs @@ -2,7 +2,7 @@ * * UpdateLib - .Net auto update library * - * File: ServerFile.cs v0.5 + * File: UpdateCatalogFile.cs v0.5 * * Author: Matthias Beerens * @@ -24,18 +24,32 @@ using System; using System.Collections.Generic; +using System.ComponentModel; +using System.IO; using System.Linq; +using System.Xml.Serialization; using MatthiWare.UpdateLib.Common; using MatthiWare.UpdateLib.Common.Abstraction; -using MatthiWare.UpdateLib.Utils; +using MatthiWare.UpdateLib.Compression.GZip; namespace MatthiWare.UpdateLib.Files { - [Serializable] + [Serializable, Description("Update Catalog File")] public class UpdateCatalogFile : FileBase { - public List Catalog { get; private set; } = new List(); + public const string FILE_NAME = "catalogus.gz"; + + /// + /// Gets or sets the name of the application + /// + [XmlAttribute] + public string ApplicationName { get; set; } = "UpdateLib"; + + /// + /// Gets the Catalog + /// + public List Catalog { get; private set; } = new List(); /// /// Download Url's @@ -43,22 +57,25 @@ public class UpdateCatalogFile : FileBase public List DownloadUrls { get; private set; } = new List(); /// - /// Tries to get the best update for the current version. + /// Gets the best update for the current version. /// - /// - /// - /// True if an update available, false if none available. - public bool TryGetLatestUpdateForVersion(UpdateVersion currentVersion, out CatalogEntry entry) + /// The currect application version + /// + public UpdateInfo GetLatestUpdateForVersion(UpdateVersion currentVersion) { if (currentVersion == null) throw new ArgumentNullException(nameof(currentVersion)); - entry = Catalog.OrderBy(c => c).Where(c => currentVersion < c.Version && ((c.IsPatch && c.BasedOnVersion == currentVersion) || !c.IsPatch)).FirstOrDefault(); - - return entry != null; + return Catalog.OrderBy(c => c).Where(c => currentVersion < c.Version && ((c.IsPatch && c.BasedOnVersion == currentVersion) || !c.IsPatch)).FirstOrDefault(); } - public override UpdateCatalogFile Load() => Load($"{IOUtils.AppDataPath}\\catalogus.xml"); + public override UpdateCatalogFile Load() => throw new NotImplementedException(); + + public override UpdateCatalogFile Load(Stream stream) + => base.Load(new GZipInputStream(stream, false)); public override void Save() => throw new NotImplementedException(); + + public override void Save(Stream stream) + => base.Save(new GZipOutputStream(stream, false)); } } diff --git a/UpdateLib/UpdateLib/Files/UpdateFile.cs b/UpdateLib/UpdateLib/Files/UpdateFile.cs deleted file mode 100644 index c1f0b22..0000000 --- a/UpdateLib/UpdateLib/Files/UpdateFile.cs +++ /dev/null @@ -1,60 +0,0 @@ -/* Copyright - * - * UpdateLib - .Net auto update library - * - * File: UpdateFile.cs v0.5 - * - * Author: Matthias Beerens - * - * Copyright (C) 2016 - MatthiWare - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.Collections.Generic; -using System.Xml; -using System.Xml.Serialization; -using MatthiWare.UpdateLib.Utils; -using MatthiWare.UpdateLib.Common; -using MatthiWare.UpdateLib.Common.Abstraction; - -namespace MatthiWare.UpdateLib.Files -{ - /// - /// The UpdateFile - /// - [Serializable] - public class UpdateFile : FileBase - { - /// - /// Gets or sets the name of the application - /// - [XmlAttribute] - public string ApplicationName { get; set; } = "UpdateLib"; - - public List DownloadURIs { get; } = new List(); - - public List Updates { get; } = new List(); - - public UpdateInfo GetLatestUpdate() - => Updates.MaxOrDefault(u => u.Version); - - public override void Save() - => throw new NotImplementedException(); - - public override UpdateFile Load() - => throw new NotImplementedException(); - } -} diff --git a/UpdateLib/UpdateLib/Files/UpdateMetadataFile.cs b/UpdateLib/UpdateLib/Files/UpdateMetadataFile.cs new file mode 100644 index 0000000..6a9a96e --- /dev/null +++ b/UpdateLib/UpdateLib/Files/UpdateMetadataFile.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.IO; +using System.Linq; +using System.Xml.Serialization; + +using MatthiWare.UpdateLib.Common; +using MatthiWare.UpdateLib.Common.Abstraction; +using MatthiWare.UpdateLib.Compression.GZip; + +namespace MatthiWare.UpdateLib.Files +{ + [Serializable, Description("Update Metadata File")] + public class UpdateMetadataFile : FileBase + { + + public const string FILE_NAME = "update-metadata.gz"; + + /// + /// Gets the folders of the project + /// + [XmlArray("Folders"), XmlArrayItem("Directory")] + public List Folders { get; private set; } = new List(); + + /// + /// Gets the count of all the files in the + /// and their subdirectories. + /// + [XmlIgnore] + public int FileCount => Folders.Sum(dir => dir.Count); + + [XmlIgnore] + public int RegistryKeyCount => Registry.Sum(reg => reg.Count); + + [XmlArray("Registry"), XmlArrayItem("Directory")] + public List Registry { get; private set; } = new List(); + + public UpdateMetadataFile() { } + + public override UpdateMetadataFile Load() => throw new NotImplementedException(); + + public override UpdateMetadataFile Load(Stream stream) + => base.Load(new GZipInputStream(stream, false)); + + public override void Save() => throw new NotImplementedException(); + + public override void Save(Stream stream) + => base.Save(new GZipOutputStream(stream, false)); + } +} diff --git a/UpdateLib/UpdateLib/Logging/Writers/FileLogWriter.cs b/UpdateLib/UpdateLib/Logging/Writers/FileLogWriter.cs index caea025..616d75e 100644 --- a/UpdateLib/UpdateLib/Logging/Writers/FileLogWriter.cs +++ b/UpdateLib/UpdateLib/Logging/Writers/FileLogWriter.cs @@ -28,7 +28,7 @@ public class FileLogWriter : ILogWriter { public LoggingLevel LoggingLevel { get { return LoggingLevel.Debug; } } - private Lazy m_logFile = new Lazy(GetLogFile); + private Lazy m_logFile = new Lazy(GetLogFile); private ConcurrentQueue m_logQueue = new ConcurrentQueue(); private AsyncTask m_logTask; @@ -40,7 +40,7 @@ public FileLogWriter() private static FileInfo GetLogFile() { - FileInfo m_logFile = new FileInfo($@"{IOUtils.LogPath}\log_{DateTime.Now.ToString("yyyyMMdd")}.log"); + System.IO.FileInfo m_logFile = new System.IO.FileInfo($@"{IOUtils.LogPath}\log_{DateTime.Now.ToString("yyyyMMdd")}.log"); if (!m_logFile.Directory.Exists) m_logFile.Directory.Create(); diff --git a/UpdateLib/UpdateLib/Properties/AssemblyInfo.cs b/UpdateLib/UpdateLib/Properties/AssemblyInfo.cs index 019f700..a1018ca 100644 --- a/UpdateLib/UpdateLib/Properties/AssemblyInfo.cs +++ b/UpdateLib/UpdateLib/Properties/AssemblyInfo.cs @@ -1,7 +1,17 @@ using System.Reflection; +using System.Runtime.CompilerServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("UpdateLib")] [assembly: AssemblyDescription("Auto Update Library")] + +#if DEBUG +// Make sure the internal methods are available for unit testing +[assembly: InternalsVisibleTo("UpdateLib.Tests")] + +[assembly: AssemblyConfiguration("DEBUG")] +#else +[assembly: AssemblyConfiguration("RELEASE")] +#endif diff --git a/UpdateLib/UpdateLib/Security/HashUtil.cs b/UpdateLib/UpdateLib/Security/HashUtil.cs index 8fd3bd0..7dc277f 100644 --- a/UpdateLib/UpdateLib/Security/HashUtil.cs +++ b/UpdateLib/UpdateLib/Security/HashUtil.cs @@ -16,8 +16,8 @@ */ using System; -using System.Security.Cryptography; using System.IO; +using System.Security.Cryptography; namespace MatthiWare.UpdateLib.Security { @@ -29,10 +29,7 @@ public static class HashUtil /// /// The input file to hash /// The hashed string - public static string GetHash(string file) - { - return GetHash(file); - } + public static string GetHash(string file) => GetHash(file); /// /// Gets the hash from file using the given hashing algorithm. @@ -48,12 +45,12 @@ public static string GetHash(string file) where T : HashAlgorithm if (!File.Exists(file)) throw new FileNotFoundException("File not found", file); - using (Stream stream = File.OpenRead(file)) + using (var stream = File.OpenRead(file)) { - using (HashAlgorithm algo = HashAlgorithm.Create(typeof(T).FullName)) + using (var algo = HashAlgorithm.Create(typeof(T).FullName)) { - byte[] hash = algo.ComputeHash(stream); - return BitConverter.ToString(hash).Replace("-", string.Empty); + var computedHash = algo.ComputeHash(stream); + return BitConverter.ToString(computedHash).Replace("-", string.Empty); } } } diff --git a/UpdateLib/UpdateLib/Security/PermissionUtil.cs b/UpdateLib/UpdateLib/Security/PermissionUtil.cs index bbb8963..5411c3b 100644 --- a/UpdateLib/UpdateLib/Security/PermissionUtil.cs +++ b/UpdateLib/UpdateLib/Security/PermissionUtil.cs @@ -15,9 +15,6 @@ * along with this program. If not, see . */ -using MatthiWare.UpdateLib.Common; -using MatthiWare.UpdateLib.Utils; -using Microsoft.Win32; using System; using System.Diagnostics; using System.IO; @@ -25,11 +22,15 @@ using System.Security.AccessControl; using System.Security.Principal; +using MatthiWare.UpdateLib.Common; +using MatthiWare.UpdateLib.Utils; + +using Microsoft.Win32; + namespace MatthiWare.UpdateLib.Security { public static class PermissionUtil { - private const string uacRegistryKey = "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System"; private const string uacRegistryValue = "EnableLUA"; @@ -44,23 +45,9 @@ public static class PermissionUtil [DllImport("advapi32.dll", SetLastError = true)] private static extern bool GetTokenInformation(IntPtr TokenHandle, TOKEN_INFORMATION_CLASS TokenInformationClass, IntPtr TokenInformation, uint TokenInformationLength, out uint ReturnLength); - - - public static bool IsUacEnabled - { - get - { - return m_lazyIsUacEnabled.Value; - } - } + public static bool IsUacEnabled => m_lazyIsUacEnabled; - public static bool IsProcessElevated - { - get - { - return m_lazyIsElevated.Value; - } - } + public static bool IsProcessElevated => m_lazyIsElevated; private static Lazy m_lazyIsUacEnabled = new Lazy(() => { @@ -87,24 +74,21 @@ public static bool IsProcessElevated IntPtr elevationTypePtr = Marshal.AllocHGlobal(elevationResultSize); bool success = GetTokenInformation(tokenHandle, TOKEN_INFORMATION_CLASS.TokenElevationType, elevationTypePtr, (uint)elevationResultSize, out returnedSize); - if (success) - { - elevationResult = (TOKEN_ELEVATION_TYPE)Marshal.ReadInt32(elevationTypePtr); - bool isProcessAdmin = elevationResult == TOKEN_ELEVATION_TYPE.TokenElevationTypeFull; - return isProcessAdmin; - } - else + if (!success) { Updater.Instance.Logger.Warn(nameof(PermissionUtil), nameof(IsProcessElevated), "Unable to determine the current elevation."); return false; } + + elevationResult = (TOKEN_ELEVATION_TYPE)Marshal.ReadInt32(elevationTypePtr); + bool isProcessAdmin = elevationResult == TOKEN_ELEVATION_TYPE.TokenElevationTypeFull; + return isProcessAdmin; } else { WindowsIdentity identity = WindowsIdentity.GetCurrent(); WindowsPrincipal principal = new WindowsPrincipal(identity); - bool result = principal.IsInRole(WindowsBuiltInRole.Administrator); - return result; + return principal.IsInRole(WindowsBuiltInRole.Administrator); } }); @@ -131,7 +115,7 @@ public static bool DirectoryHasPermission(string dir, FileSystemRights accessRig return false; } - + public static bool CheckRegPermission(RegistryKeyEntry key) { try diff --git a/UpdateLib/UpdateLib/Tasks/AsyncTask.cs b/UpdateLib/UpdateLib/Tasks/AsyncTask.cs index 1bce5de..3b64096 100644 --- a/UpdateLib/UpdateLib/Tasks/AsyncTask.cs +++ b/UpdateLib/UpdateLib/Tasks/AsyncTask.cs @@ -22,14 +22,15 @@ * along with this program. If not, see . */ -using MatthiWare.UpdateLib.Common; -using MatthiWare.UpdateLib.Threading; using System; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Threading; +using MatthiWare.UpdateLib.Common; +using MatthiWare.UpdateLib.Threading; + namespace MatthiWare.UpdateLib.Tasks { /// @@ -331,18 +332,13 @@ protected void AwaitWorkers() /// The amount of work that is done. /// The total amount of work. protected virtual void OnTaskProgressChanged(int done, int total) - { - double percent = ((double)done / total) * 100; - OnTaskProgressChanged((int)percent); - } + => OnTaskProgressChanged((int)((done / (double)total) * 100)); /// /// Raises the event. /// /// The percentage of work that is done. protected virtual void OnTaskProgressChanged(int percent) - { - OnTaskProgressChanged(new ProgressChangedEventArgs(percent, null)); - } + => OnTaskProgressChanged(new ProgressChangedEventArgs(percent, null)); private int m_lastProgressUpdate = -1; @@ -371,9 +367,7 @@ protected virtual void OnTaskProgressChanged(ProgressChangedEventArgs e) /// If an occured pass the object. /// Indicates whether the got cancelled. protected virtual void OnTaskCompleted(Exception e, bool cancelled = false) - { - OnTaskCompleted(new AsyncCompletedEventArgs(e, cancelled, null)); - } + => OnTaskCompleted(new AsyncCompletedEventArgs(e, cancelled, null)); /// /// Raises the event. @@ -444,5 +438,5 @@ public abstract class AsyncTask : AsyncTask wh #endregion } - + } diff --git a/UpdateLib/UpdateLib/Tasks/CheckForUpdatedItemsTask.cs b/UpdateLib/UpdateLib/Tasks/CheckForUpdatedItemsTask.cs index 1521b1a..c70dd02 100644 --- a/UpdateLib/UpdateLib/Tasks/CheckForUpdatedItemsTask.cs +++ b/UpdateLib/UpdateLib/Tasks/CheckForUpdatedItemsTask.cs @@ -33,10 +33,10 @@ namespace MatthiWare.UpdateLib.Tasks { public class CheckForUpdatedItemsTask : AsyncTask { - private UpdateInfo m_updateFile; + private Files.UpdateInfo m_updateFile; private HashCacheFile m_cacheFile; - public CheckForUpdatedItemsTask(UpdateInfo update, HashCacheFile cache) + public CheckForUpdatedItemsTask(Files.UpdateInfo update, HashCacheFile cache) { m_updateFile = update ?? throw new ArgumentNullException(nameof(update)); m_cacheFile = cache ?? throw new ArgumentNullException(nameof(cache)); diff --git a/UpdateLib/UpdateLib/Tasks/CheckForUpdatesTask.cs b/UpdateLib/UpdateLib/Tasks/CheckForUpdatesTask.cs index 1ca040b..a889391 100644 --- a/UpdateLib/UpdateLib/Tasks/CheckForUpdatesTask.cs +++ b/UpdateLib/UpdateLib/Tasks/CheckForUpdatesTask.cs @@ -23,79 +23,112 @@ */ using System; +using System.Collections.Generic; using System.Net; -using MatthiWare.UpdateLib.Files; -using MatthiWare.UpdateLib.Utils; + using MatthiWare.UpdateLib.Common; +using MatthiWare.UpdateLib.Common.Abstraction; using MatthiWare.UpdateLib.Common.Exceptions; +using MatthiWare.UpdateLib.Files; +using MatthiWare.UpdateLib.Utils; + using static MatthiWare.UpdateLib.Tasks.CheckForUpdatesTask; namespace MatthiWare.UpdateLib.Tasks { public class CheckForUpdatesTask : AsyncTask { - public Uri Uri { get; set; } + public IList Urls { get; set; } private WebClient m_wc; + private UpdateVersion m_version; + private Updater m_updater; + + private const string REPLACE_FILE_NAME = "%file%"; - public CheckForUpdatesTask(Uri uri) + public CheckForUpdatesTask(IList urls, UpdateVersion currentVersion) { - Uri = uri; + Urls = urls ?? throw new ArgumentNullException(nameof(urls)); + m_version = currentVersion ?? throw new ArgumentNullException(nameof(currentVersion)); + if (urls.Count == 0) throw new ArgumentException("Empty url list provided", nameof(urls)); + m_wc = new WebClient(); + m_updater = Updater.Instance; } protected override void DoWork() { Result = new CheckForUpdatesResult(); - Updater updater = Updater.Instance; - if (!NetworkUtils.HasConnection()) throw new NoInternetException("No internet available"); - // Getting the file name from the url - string localFile = $@"{IOUtils.AppDataPath}\Update.xml"; - if (IsCancelled) return; - updater.Logger.Debug(nameof(CheckForUpdatesTask), nameof(DoWork), $"Attempting to download update file from {Uri}"); - m_wc.DownloadFile(Uri, localFile); - // load the updatefile from disk - Result.UpdateInfo = FileManager.LoadFile(localFile).GetLatestUpdate() ?? throw new NoVersionSpecifiedException(); + var file = DownloadFile(Urls.Replace(REPLACE_FILE_NAME, UpdateCatalogFile.FILE_NAME), $"{IOUtils.AppDataPath}\\{UpdateCatalogFile.FILE_NAME}"); + + if (IsCancelled) return; - var privilegesCheckTask = CheckPrivileges(Result.UpdateInfo); + if (file.Catalog == null || file.Catalog.Count == 0) throw new InvalidUpdateServerException(); - // lets wait for the Cache update to complete and get the task - var cache = updater.GetCache(); + Result.UpdateInfo = file.GetLatestUpdateForVersion(m_version); + Result.ApplicationName = file.ApplicationName; + Result.DownloadURLs = file.DownloadUrls; - // Wait for the clean up to complete - updater.CleanUpTask.AwaitTask(); + if (!Result.UpdateAvailable || IsCancelled) return; - if (IsCancelled) - return; + if (Result.DownloadURLs == null || Result.DownloadURLs.Count == 0) throw new InvalidUpdateServerException(); - /* - * Start a task to get all the files that need to be updated - * Returns if there is anything to update - */ - var updatedFilesTask = CheckForUpdatedFiles(Result.UpdateInfo, cache); + var meta = DownloadFile(Result.DownloadURLs.Replace(REPLACE_FILE_NAME, Result.UpdateInfo.FileName), $"{IOUtils.TempPath}\\{UpdateMetadataFile.FILE_NAME}"); + if (IsCancelled) return; + + var privilegesCheckTask = new CheckRequiredPrivilegesTask(meta).ConfigureAwait(false).Start(); Result.AdminRightsNeeded = privilegesCheckTask.AwaitTask().Result; - Result.UpdateAvailable = updatedFilesTask.AwaitTask().Result; } - private CheckForUpdatedItemsTask CheckForUpdatedFiles(UpdateInfo updateInfo, HashCacheFile cache) - => new CheckForUpdatedItemsTask(updateInfo, cache).ConfigureAwait(false).Start(); + private T DownloadFile(IEnumerable urlsToUse, string localFile) where T : FileBase, new() + { + var enumerator = urlsToUse.GetEnumerator(); + + m_updater.Logger.Info(nameof(CheckForUpdatesTask), nameof(DownloadFile), $"Getting {typeof(T).GetDescription()}"); + + do + { + if (!enumerator.MoveNext() || string.IsNullOrEmpty(enumerator.Current)) + throw new UnableToDownloadUpdateException(); + } while (!DownloadLocalFile(enumerator.Current, localFile)); + + return FileManager.LoadFile(localFile); + } + + private bool DownloadLocalFile(string url, string localFile) + { + m_updater.Logger.Debug(nameof(CheckForUpdatesTask), nameof(DownloadLocalFile), $"Attempting to download file from {url}"); + + try + { + m_wc.DownloadFile(url, localFile); + + m_updater.Logger.Info(nameof(CheckForUpdatesTask), nameof(DownloadLocalFile), $"Succesfully downloaded file from {url}"); + } + catch (Exception e) + { + m_updater.Logger.Error(nameof(CheckForUpdatesTask), nameof(DoWork), e); + return false; + } - private CheckRequiredPrivilegesTask CheckPrivileges(UpdateInfo updateInfo) - => new CheckRequiredPrivilegesTask(updateInfo).ConfigureAwait(false).Start(); + return true; + } public class CheckForUpdatesResult { public UpdateVersion Version { get { return UpdateInfo.Version; } } - public bool UpdateAvailable { get; set; } = false; + public bool UpdateAvailable => UpdateInfo != null; public UpdateInfo UpdateInfo { get; set; } - public bool AdminRightsNeeded { get; set; } = false; + public string ApplicationName { get; set; } + public IList DownloadURLs { get; set; } + public bool AdminRightsNeeded { get; set; } } } } diff --git a/UpdateLib/UpdateLib/Tasks/CheckRequiredPrivilegesTask.cs b/UpdateLib/UpdateLib/Tasks/CheckRequiredPrivilegesTask.cs index 76cb1a1..9f683ef 100644 --- a/UpdateLib/UpdateLib/Tasks/CheckRequiredPrivilegesTask.cs +++ b/UpdateLib/UpdateLib/Tasks/CheckRequiredPrivilegesTask.cs @@ -22,21 +22,23 @@ * along with this program. If not, see . */ -using MatthiWare.UpdateLib.Security; using System.Linq; -using MatthiWare.UpdateLib.Utils; + using MatthiWare.UpdateLib.Common; +using MatthiWare.UpdateLib.Files; +using MatthiWare.UpdateLib.Security; +using MatthiWare.UpdateLib.Utils; namespace MatthiWare.UpdateLib.Tasks { public class CheckRequiredPrivilegesTask : AsyncTask { - public UpdateInfo UpdateInfo { get; set; } + public UpdateMetadataFile UpdateFile { get; set; } - public CheckRequiredPrivilegesTask(UpdateInfo updateInfo) + public CheckRequiredPrivilegesTask(UpdateMetadataFile updateFile) { - UpdateInfo = updateInfo; + UpdateFile = updateFile; } protected override void DoWork() @@ -46,7 +48,7 @@ protected override void DoWork() if (PermissionUtil.IsProcessElevated) return; - foreach (DirectoryEntry dir in UpdateInfo.Folders) + foreach (DirectoryEntry dir in UpdateFile.Folders) if (!CheckHasSufficientPermissionsForDirectory(dir)) { Result = true; @@ -54,7 +56,7 @@ protected override void DoWork() } - foreach (DirectoryEntry dir in UpdateInfo.Registry) + foreach (DirectoryEntry dir in UpdateFile.Registry) if (!CheckHasSufficientPermissionForRegistry(dir)) { Result = true; diff --git a/UpdateLib/UpdateLib/Tasks/DownloadManager.cs b/UpdateLib/UpdateLib/Tasks/DownloadManager.cs index cbef0ba..9e35f3f 100644 --- a/UpdateLib/UpdateLib/Tasks/DownloadManager.cs +++ b/UpdateLib/UpdateLib/Tasks/DownloadManager.cs @@ -22,120 +22,97 @@ * along with this program. If not, see . */ -using MatthiWare.UpdateLib.Common; -using MatthiWare.UpdateLib.Threading; -using MatthiWare.UpdateLib.Utils; using System; using System.Collections.Generic; -using System.Linq; +using System.ComponentModel; +using System.IO; +using System.Net; + +using MatthiWare.UpdateLib.Common; +using MatthiWare.UpdateLib.Common.Exceptions; +using MatthiWare.UpdateLib.Security; +using MatthiWare.UpdateLib.Utils; namespace MatthiWare.UpdateLib.Tasks { public class DownloadManager { - private AtomicInteger m_amountToDownload = new AtomicInteger(); private UpdateInfo m_updateInfo; - private List m_tasks = new List(); - private bool hasRegUpdate, hasErrors = false; + private IList m_urls; - public event EventHandler Completed; + public event EventHandler ProgressChanged; + public event EventHandler Completed; - public DownloadManager(UpdateInfo updateInfo) - { - m_amountToDownload.Value = updateInfo.FileCount; - m_updateInfo = updateInfo; - } + private int index = 0; - private void Reset() - { - m_tasks.Clear(); - hasRegUpdate = false; - hasErrors = false; - } + private Updater updater; - public void Update() + public DownloadManager(UpdateInfo updateInfo, IList urls) { - Reset(); + m_urls = urls ?? throw new ArgumentNullException(nameof(urls)); + m_updateInfo = updateInfo ?? throw new ArgumentNullException(nameof(updateInfo)); - AddUpdates(); - StartUpdate(); - } - - private void StartUpdate() - { - IEnumerable _tasks = m_tasks.Select(task => task as DownloadTask).NotNull(); + if (m_urls.Count == 0) throw new ArgumentException("No download sources specified ", nameof(urls)); - _tasks.ForEach(task => task.Start()); - - if (hasRegUpdate && _tasks.Count() == 0) - StartRegUpdate(); + updater = Updater.Instance; } - private void StartRegUpdate() + public void Download() { - m_tasks.Select(task => task as UpdateRegistryTask).NotNull().FirstOrDefault()?.Start(); - } + var urlToUse = GetNextUrl(); - private void AddUpdates() - { - foreach (FileEntry file in m_updateInfo.Folders - .SelectMany(dir => dir.GetItems()) - .Select(e => e as FileEntry) - .Distinct() - .NotNull()) - { - DownloadTask task = new DownloadTask(file); - task.TaskCompleted += Task_TaskCompleted; + if (string.IsNullOrEmpty(urlToUse)) + throw new WebException("Unable to download patch from specified download sources"); - m_tasks.Add(task); - } + var local = new FileInfo($"{IOUtils.TempPath}\\{m_updateInfo.FileName}"); - IEnumerable keys = m_updateInfo.Registry - .SelectMany(dir => dir.GetItems()) - .Select(e => e as RegistryKeyEntry) - .Distinct() - .NotNull(); + if (!local.Directory.Exists) local.Directory.Create(); + if (local.Exists) local.Delete(); - if (keys.Count() == 0) - return; + var task = new DownloadTask(urlToUse, local.FullName); - hasRegUpdate = true; - m_amountToDownload.Increment(); + task.TaskProgressChanged += (o, e) => OnProgressChanged(e.ProgressPercentage, 110); - UpdateRegistryTask regTask = new UpdateRegistryTask(keys); - regTask.TaskCompleted += Task_TaskCompleted; + task.TaskCompleted += (o, e) => + { + if (e.Error != null) + { + updater.Logger.Error(nameof(DownloadManager), nameof(Download), e.Error); + updater.Logger.Info(nameof(DownloadManager), nameof(Download), "Attempting to download patch from next url.."); - m_tasks.Add(regTask); - } + task.Url = GetNextUrl(); - private void Task_TaskCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e) - { - if (e.Error != null) - { - hasErrors = true; + if (string.IsNullOrEmpty(task.Url)) + OnCompleted(new WebException("Unable to download patch from specified download sources", e.Error)); + else + task.Start(); - CancelOtherTasks(); - } + return; + } - int left = m_amountToDownload.Decrement(); + var hash = HashUtil.GetHash(local.FullName); - if (hasErrors) - return; + if (m_updateInfo.Hash != hash) + { + OnCompleted(new InvalidHashException($"Hash doesn't match was expecting '{m_updateInfo.Hash}' but got '{hash}'")); + return; + } - if (hasRegUpdate && left == 1) - StartRegUpdate(); - else if (left == 0) - Completed?.Invoke(this, EventArgs.Empty); + OnProgressChanged(100, 100); + OnCompleted(null); + }; + task.Start(); } - private void CancelOtherTasks() - { - foreach (UpdatableTask task in m_tasks) - if (!task.IsCancelled) - task.Cancel(); - } + protected void OnProgressChanged(int done, int total) + => ProgressChanged?.Invoke(this, new ProgressChangedEventArgs((int)((done / (double)total) * 100), null)); + + protected void OnCompleted(Exception e) + => Completed?.Invoke(this, new AsyncCompletedEventArgs(e, false, null)); + private string GetNextUrl() + => (index < m_urls.Count) ? m_urls[index++].Replace("%file%", m_updateInfo.FileName) : string.Empty; } } diff --git a/UpdateLib/UpdateLib/Tasks/DownloadTask.cs b/UpdateLib/UpdateLib/Tasks/DownloadTask.cs index 637890e..999531d 100644 --- a/UpdateLib/UpdateLib/Tasks/DownloadTask.cs +++ b/UpdateLib/UpdateLib/Tasks/DownloadTask.cs @@ -26,10 +26,6 @@ * along with this program. If not, see . */ -using MatthiWare.UpdateLib.Common; -using MatthiWare.UpdateLib.Common.Exceptions; -using MatthiWare.UpdateLib.Security; -using MatthiWare.UpdateLib.Utils; using System; using System.IO; using System.Net; @@ -37,19 +33,28 @@ namespace MatthiWare.UpdateLib.Tasks { - public class DownloadTask : UpdatableTask + public class DownloadTask : AsyncTask { private WebClient webClient; private ManualResetEvent wait; + private Updater m_updater; - public FileEntry Entry { get; private set; } + public string Url { get; set; } + public string Local { get; set; } - public DownloadTask(FileEntry entry) + public DownloadTask(string url, string local) { - Entry = entry; + if (string.IsNullOrEmpty(local)) throw new ArgumentNullException(nameof(local)); + if (string.IsNullOrEmpty(url)) throw new ArgumentNullException(nameof(url)); + + Url = url; + Local = local; + webClient = new WebClient(); - webClient.DownloadProgressChanged += (o, e) => { OnTaskProgressChanged(e.ProgressPercentage, 110); }; + webClient.DownloadProgressChanged += (o, e) => { OnTaskProgressChanged(e.ProgressPercentage); }; webClient.DownloadFileCompleted += (o, e) => { wait.Set(); }; + + m_updater = Updater.Instance; } protected override void DoWork() @@ -59,67 +64,21 @@ protected override void DoWork() wait = new ManualResetEvent(false); - string localFile = Updater.Instance.Converter.Convert(Entry.DestinationLocation); - string remoteFile = string.Concat(Updater.Instance.RemoteBasePath, Entry.SourceLocation); - - Updater.Instance.Logger.Debug(nameof(DownloadTask), nameof(DoWork), $"LocalFile => {localFile}"); - Updater.Instance.Logger.Debug(nameof(DownloadTask), nameof(DoWork), $"RemoteFile => {remoteFile}"); + m_updater.Logger.Debug(nameof(DownloadTask), nameof(DoWork), $"LocalFile => {Local}"); + m_updater.Logger.Debug(nameof(DownloadTask), nameof(DoWork), $"RemoteFile => {Url}"); - FileInfo fi = new FileInfo(localFile); - string cacheFile = $"{IOUtils.CachePath}\\{fi.Name}"; - - if (File.Exists(cacheFile)) - File.Delete(cacheFile); - - if (fi.Exists) - fi.MoveTo(cacheFile); + var fi = new FileInfo(Local); if (!fi.Directory.Exists) fi.Directory.Create(); - var uri = new Uri(remoteFile); - webClient.DownloadFileAsync(uri, localFile); + var uri = new Uri(Url); + webClient.DownloadFileAsync(uri, Local); wait.WaitOne(); wait.Close(); wait = null; - var hash = HashUtil.GetHash(localFile); - - if (hash.Length != Entry.Hash.Length || hash != Entry.Hash) - throw new InvalidHashException($"Calculated hash doesn't match provided hash for file: {localFile}"); - - Updater.Instance.GetCache().AddOrUpdateEntry(localFile, hash); - - OnTaskProgressChanged(100); - } - - public override void Rollback() - { - OnTaskProgressChanged(0); - - webClient.CancelAsync(); - - FileInfo localFile = new FileInfo(Updater.Instance.Converter.Convert(Entry.DestinationLocation)); - FileInfo cacheFile = new FileInfo($"{IOUtils.CachePath}\\{localFile.Name}"); - - if (!cacheFile.Exists) - { - OnTaskProgressChanged(100); - return; - } - - if (localFile.Exists) - localFile.Delete(); - - cacheFile.MoveTo(localFile.FullName); - - OnTaskProgressChanged(50); - - Updater.Instance.GetCache().AddOrUpdateEntry(localFile.FullName); - - Updater.Instance.Logger.Warn(nameof(DownloadTask), nameof(Cancel), $"Rolled back -> {Entry.Name}"); - OnTaskProgressChanged(100); } } diff --git a/UpdateLib/UpdateLib/Tasks/LoadCacheTask.cs b/UpdateLib/UpdateLib/Tasks/LoadCacheTask.cs new file mode 100644 index 0000000..c0b8850 --- /dev/null +++ b/UpdateLib/UpdateLib/Tasks/LoadCacheTask.cs @@ -0,0 +1,38 @@ +using System; +using System.Linq; +using System.Reflection; + +using MatthiWare.UpdateLib.Common; +using MatthiWare.UpdateLib.Files; +using MatthiWare.UpdateLib.Utils; + +namespace MatthiWare.UpdateLib.Tasks +{ + public class LoadCacheTask : AsyncTask + { + private Lazy m_lazyUpdateVersion = new Lazy(() => + { + ApplicationVersionAttribute attr = Assembly.GetEntryAssembly()?.GetCustomAttributes(typeof(ApplicationVersionAttribute), true).FirstOrDefault() as ApplicationVersionAttribute; + + return attr?.Version ?? "0.0.0"; + }); + + + + protected override void DoWork() + { + try + { + Result = FileManager.LoadFile(); + } + catch (Exception e) + { + Updater.Instance.Logger.Error(nameof(LoadCacheTask), nameof(DoWork), e); + + Result = new CacheFile(); + Result.CurrentVersion = m_lazyUpdateVersion; + Result.Save(); + } + } + } +} diff --git a/UpdateLib/UpdateLib/Tasks/UpdateCacheTask.cs b/UpdateLib/UpdateLib/Tasks/UpdateCacheTask.cs index a22e518..ce2c51a 100644 --- a/UpdateLib/UpdateLib/Tasks/UpdateCacheTask.cs +++ b/UpdateLib/UpdateLib/Tasks/UpdateCacheTask.cs @@ -35,7 +35,7 @@ namespace MatthiWare.UpdateLib.Tasks public class UpdateCacheTask : AsyncTask { private Dictionary existingEntries = null; - private IEnumerable files = null; + private IEnumerable files = null; protected override void DoWork() { @@ -75,14 +75,14 @@ protected override void DoWork() private void CheckFiles() { - foreach (FileInfo f in files) + foreach (System.IO.FileInfo f in files) { - HashCacheEntry entry = Result.Items.Find(match => match.FilePath == f.FullName); + HashCacheEntry entry = base.Result.Items.Find(match => match.FilePath == f.FullName); if (entry == null) { try { - Result.Items.Add(new HashCacheEntry(f.FullName)); + base.Result.Items.Add(new HashCacheEntry(f.FullName)); } catch (Exception ex) // file might no longer exist or is in use { @@ -105,7 +105,7 @@ private HashCacheFile CreateNewHashCacheFile() var result = new HashCacheFile(); - foreach (FileInfo f in files) + foreach (System.IO.FileInfo f in files) { try { diff --git a/UpdateLib/UpdateLib/UI/Components/FinishPage.cs b/UpdateLib/UpdateLib/UI/Components/FinishPage.cs index d4fcd98..e2512b5 100644 --- a/UpdateLib/UpdateLib/UI/Components/FinishPage.cs +++ b/UpdateLib/UpdateLib/UI/Components/FinishPage.cs @@ -18,8 +18,6 @@ using System; using System.Windows.Forms; -using MatthiWare.UpdateLib.Common; - namespace MatthiWare.UpdateLib.UI.Components { public partial class FinishPage : UserControl, IWizardPage @@ -34,19 +32,20 @@ public FinishPage(UpdaterForm parent) _updaterForm = parent; txtDescription.Text = txtDescription.Text.Replace("%AppName%", parent.ApplicationName); - txtDescription.Text = txtDescription.Text.Replace("%version%", parent.updateInfo.Version.Value); + txtDescription.Text = txtDescription.Text.Replace("%version%", parent.UpdateInfo.Version); } public void UpdateState() { - UpdateInfo file = _updaterForm.updateInfo; + var version = _updaterForm.UpdateInfo.Version; + string appName = _updaterForm.ApplicationName; - if (_updaterForm.hasHadErrors) + if (_updaterForm.HasHadErrors) { cbRestart.Checked = false; cbRestart.Enabled = false; - txtDescription.Text = $"{file.ApplicationName} was unable to update to version {file.Version}!\n\n" + + txtDescription.Text = $"{appName} was unable to update to version {version}!\n\n" + "Check the log files for more information!\n\n" + "Press Finish to close this wizard."; @@ -57,7 +56,7 @@ public void UpdateState() cbRestart.Checked = false; cbRestart.Enabled = false; - txtDescription.Text = $"{file.ApplicationName} was unable to update to version {file.Version}!\n\n" + + txtDescription.Text = $"{appName} was unable to update to version {version}!\n\n" + "Update process cancelled by the user.\n\n" + "Press Finish to close this wizard."; diff --git a/UpdateLib/UpdateLib/UI/Components/IntroPage.cs b/UpdateLib/UpdateLib/UI/Components/IntroPage.cs index 0033192..ad000c8 100644 --- a/UpdateLib/UpdateLib/UI/Components/IntroPage.cs +++ b/UpdateLib/UpdateLib/UI/Components/IntroPage.cs @@ -28,8 +28,8 @@ public IntroPage(UpdaterForm parent) _updateForm = parent; - txtDesc.Text = txtDesc.Text.Replace("%AppName%", parent.updateInfo.ApplicationName); - txtWelcome.Text = txtWelcome.Text.Replace("%AppName%", parent.updateInfo.ApplicationName); + txtDesc.Text = txtDesc.Text.Replace("%AppName%", parent.ApplicationName); + txtWelcome.Text = txtWelcome.Text.Replace("%AppName%", parent.ApplicationName); } public UserControl Conent diff --git a/UpdateLib/UpdateLib/UI/Components/UpdatePage.cs b/UpdateLib/UpdateLib/UI/Components/UpdatePage.cs index afea599..1834367 100644 --- a/UpdateLib/UpdateLib/UI/Components/UpdatePage.cs +++ b/UpdateLib/UpdateLib/UI/Components/UpdatePage.cs @@ -16,22 +16,24 @@ */ using System; +using System.Collections.Generic; using System.ComponentModel; +using System.Linq; using System.Windows.Forms; + +using MatthiWare.UpdateLib.Common; +using MatthiWare.UpdateLib.Files; using MatthiWare.UpdateLib.Properties; using MatthiWare.UpdateLib.Tasks; using MatthiWare.UpdateLib.Threading; -using System.Collections.Generic; -using System.Linq; using MatthiWare.UpdateLib.Utils; -using MatthiWare.UpdateLib.Common; namespace MatthiWare.UpdateLib.UI.Components { public partial class UpdatePage : UserControl, IWizardPage { - public UpdateInfo UpdateInfo { get; set; } + public UpdateMetadataFile UpdateFile { get; set; } public event EventHandler PageUpdate; @@ -45,7 +47,7 @@ public UpdatePage(UpdaterForm parent) _updaterForm = parent; - UpdateInfo = parent.updateInfo; + UpdateFile = parent.UpdateInfo; ImageList ilItems = MakeImageList(); lvItems.SmallImageList = ilItems; @@ -72,18 +74,18 @@ private ImageList MakeImageList() private void FillListView() { - amountToDownload.Value = UpdateInfo.FileCount; + amountToDownload.Value = UpdateFile.FileCount; lvItems.BeginUpdate(); AddDirectoryToListView( - UpdateInfo.Folders + UpdateFile.Folders .SelectMany(dir => dir.GetItems()) .Select(e => e as FileEntry) .Distinct() .NotNull()); - AddRegistryToListView(UpdateInfo.Registry + AddRegistryToListView(UpdateFile.Registry .SelectMany(dir => dir.GetItems()) .Select(e => e as RegistryKeyEntry) .Distinct() diff --git a/UpdateLib/UpdateLib/UI/UpdaterForm.cs b/UpdateLib/UpdateLib/UI/UpdaterForm.cs index adae182..0f76d9e 100644 --- a/UpdateLib/UpdateLib/UI/UpdaterForm.cs +++ b/UpdateLib/UpdateLib/UI/UpdaterForm.cs @@ -15,29 +15,32 @@ * along with this program. If not, see . */ -using MatthiWare.UpdateLib.Common; -using MatthiWare.UpdateLib.UI.Components; using System; using System.Diagnostics; using System.Drawing; using System.Windows.Forms; +using MatthiWare.UpdateLib.Common; +using MatthiWare.UpdateLib.Files; +using MatthiWare.UpdateLib.UI.Components; namespace MatthiWare.UpdateLib.UI { public partial class UpdaterForm : Form { - internal UpdateInfo updateInfo; - internal bool NeedsRestart = true; - internal bool hasHadErrors = false; - internal bool UserCancelled = false; + public UpdateInfo UpdateInfo { get; internal set; } + public string ApplicationName { get; internal set; } + public bool NeedsRestart { get; internal set; } = true; + public bool HasHadErrors { get; internal set; } = false; + public bool UserCancelled { get; internal set; } = false; private WizardPageCollection pages; - public UpdaterForm(UpdateInfo updateInfo) + public UpdaterForm(UpdateInfo updateInfo, string appName) { InitializeComponent(); - this.updateInfo = updateInfo; + UpdateInfo = updateInfo ?? throw new ArgumentException(nameof(UpdateInfo)); + ApplicationName = string.IsNullOrEmpty(appName) ? throw new ArgumentException(nameof(appName)) : appName; pages = new WizardPageCollection(); AddPage(new IntroPage(this)); @@ -93,18 +96,16 @@ private void OnPageUpdate(IWizardPage page) if (page.HasErrors && page.NeedsRollBack) { - hasHadErrors = true; + HasHadErrors = true; btnNext.Enabled = true; btnPrevious.Enabled = false; btnCancel.Enabled = false; btnNext.Text = "Rollback"; } - if (!pages.CurrentPage.HasErrors && pages.CurrentPage.NeedsRollBack && hasHadErrors) - { + if (!pages.CurrentPage.HasErrors && pages.CurrentPage.NeedsRollBack && HasHadErrors) foreach (IWizardPage wp in pages) wp.UpdateState(); - } if (pages.AllDone()) btnCancel.Enabled = false; @@ -183,7 +184,7 @@ private void btnNext_Click(object sender, EventArgs e) private void ExitUpdater() { - Updater.Instance.GetCache().Save(); + Updater.Instance.GetCache2().Save(); if (NeedsRestart) { diff --git a/UpdateLib/UpdateLib/UpdateLib.csproj b/UpdateLib/UpdateLib/UpdateLib.csproj index 9521100..f04610e 100644 --- a/UpdateLib/UpdateLib/UpdateLib.csproj +++ b/UpdateLib/UpdateLib/UpdateLib.csproj @@ -54,14 +54,18 @@ Properties\SharedAssemblyInfo.cs + - + + + + @@ -113,8 +117,7 @@ - - + @@ -127,6 +130,7 @@ + diff --git a/UpdateLib/UpdateLib/Updater.cs b/UpdateLib/UpdateLib/Updater.cs index 429dcfc..da5cf9d 100644 --- a/UpdateLib/UpdateLib/Updater.cs +++ b/UpdateLib/UpdateLib/Updater.cs @@ -28,7 +28,6 @@ using System.Diagnostics; using System.Drawing; using System.Linq; -using System.Net; using System.Reflection; using System.Security; using System.Windows.Forms; @@ -78,6 +77,8 @@ public static Updater Instance private Lazy m_lazyLogger = new Lazy(() => new Logger()); private InstallationMode m_installationMode = InstallationMode.Shared; + private LoadCacheTask m_loadCacheTask; + private static Lazy m_lazyProductName = new Lazy(() => { AssemblyProductAttribute attr = Assembly.GetEntryAssembly()?.GetCustomAttributes(typeof(AssemblyProductAttribute), true).FirstOrDefault() as AssemblyProductAttribute; @@ -107,9 +108,9 @@ public static Updater Instance #region Properties - internal static string ProductName { get { return m_lazyProductName.Value; } } + internal static string ProductName => m_lazyProductName; - internal static string UpdaterName { get { return m_lazyUpdaterName.Value; } } + internal static string UpdaterName => m_lazyUpdaterName; /// /// Gets the command line parser. Use this to add additional command line arguments that need to be parsed. @@ -117,15 +118,15 @@ public static Updater Instance public CmdLineParser CommandLine { get; } = new CmdLineParser(); /// - /// Gets the collection of Uri's to update from + /// Gets the collection of Url's to update from /// /// If you want to specify an unsafe connection you should enable - public IList UpdateURIs { get; } = new List(); + public IList UpdateURLs { get; } = new List(); /// /// Gets the logger for the application. /// - public ILogger Logger { get { return m_lazyLogger.Value; } } + public ILogger Logger => m_lazyLogger.Value; /// /// Gets or sets the Updater Installation mode @@ -189,6 +190,8 @@ public PathVariableConverter Converter /// public UpdateCacheTask UpdateCacheTask { get; private set; } + + /// /// Is the updater already initialized? /// @@ -201,11 +204,6 @@ public PathVariableConverter Converter /// Hot-swapping might cause issues if the files are still in use. public bool NeedsRestartBeforeUpdate { get; set; } = true; - /// - /// The remote base path to use for downloading etc.. - /// - internal string RemoteBasePath { get; set; } - #endregion #region Fluent API @@ -303,9 +301,9 @@ public Updater ConfigureInstallationMode(InstallationMode mode) /// To use HTTP you should enable /// Uri to update from /// - public Updater ConfigureAddUpdateUri(Uri uri) + public Updater ConfigureAddUpdateUri(string uri) { - UpdateURIs.Add(uri); + UpdateURLs.Add(uri); return this; } @@ -353,6 +351,7 @@ private void StartInitializationTasks() { CleanUpTask = new CleanUpTask("%appdir%").ConfigureAwait(false).Start(); UpdateCacheTask = new UpdateCacheTask().ConfigureAwait(false).Start(); + m_loadCacheTask = new LoadCacheTask().ConfigureAwait(false).Start(); } /// @@ -397,16 +396,16 @@ public CheckForUpdatesTask CheckForUpdatesAsync() public CheckForUpdatesTask CheckForUpdatesAsync(IWin32Window owner) { if (!IsInitialized) throw new InvalidOperationException("The updater needs to be initialized first"); - if (UpdateURIs.Count == 0) throw new ArgumentException("No uri's specified", nameof(UpdateURIs)); + if (UpdateURLs.Count == 0) throw new ArgumentException("No uri's specified", nameof(UpdateURLs)); - IEnumerable uris = UpdateURIs.Where(u => AllowUnsafeConnection && u.Scheme == Uri.UriSchemeHttps); + var urls = UpdateURLs.Where(u => !AllowUnsafeConnection || (AllowUnsafeConnection && u.StartsWith(Uri.UriSchemeHttps))); - if (AllowUnsafeConnection && uris.Count() == 0) + if (AllowUnsafeConnection && urls.Count() == 0) throw new SecurityException("Using unsafe connections to update from is not allowed"); - int skip = 1; + var version = GetCache().CurrentVersion; - CheckForUpdatesTask task = new CheckForUpdatesTask(uris.FirstOrDefault()); + CheckForUpdatesTask task = new CheckForUpdatesTask(urls.ToList(), version); task.TaskCompleted += (o, e) => { bool error = e.Error != null; @@ -419,21 +418,7 @@ public CheckForUpdatesTask CheckForUpdatesAsync(IWin32Window owner) if (!update || cancelled || error) { if (error) - { - var uri = uris.Skip(skip++).FirstOrDefault(); - - if (e.Error is WebException && uri != null) - { - Logger.Debug(nameof(Updater), nameof(CheckForUpdatesAsync), "Unable to download server file trying again using next specified uri.."); - - task.Uri = uri; - task.Start(); - - return; - } - HandleException(owner, e.Error); - } else if (cancelled) HandleUserCancelled(owner); else if (!update) @@ -456,14 +441,14 @@ public CheckForUpdatesTask CheckForUpdatesAsync(IWin32Window owner) return; if (((!StartUpdating && NeedsRestartBeforeUpdate) || (adminReq && !PermissionUtil.IsProcessElevated)) - && !RestartApp(true, UpdateSilently, true, adminReq)) + && !RestartApp(owner, true, UpdateSilently, true, adminReq)) return; if (UpdateSilently) - UpdateWithoutGUI(task.Result.UpdateInfo); + UpdateWithoutGUI(task.Result.UpdateInfo, task.Result.DownloadURLs); else { - UpdaterForm updateForm = new UpdaterForm(task.Result.UpdateInfo); + UpdaterForm updateForm = new UpdaterForm(task.Result.UpdateInfo, task.Result.ApplicationName); updateForm.ShowDialog(owner); } }; @@ -484,12 +469,12 @@ private void HandleException(IWin32Window owner, Exception e) "Unable to connect to the update server\nPlease check your internet connection and try again!", SystemIcons.Error, MessageBoxButtons.OK); - else if (e is NoVersionSpecifiedException) + else if (e is InvalidUpdateServerException) MessageDialog.Show( owner, $"{ProductName} Updater", "Error while updating", - "No available versions specified on the download server\nPlease contact the software vendor!", + "No valid update server available\nPlease contact the software vendor!", SystemIcons.Error, MessageBoxButtons.OK); else if (e is Win32Exception) @@ -532,8 +517,8 @@ private void HandleUserCancelled(IWin32Window owner) MessageDialog.Show( owner, $"{ProductName} Updater", - "Cancelled", - "Update got cancelled", + "Cancelled", + "Update got cancelled", SystemIcons.Warning, MessageBoxButtons.OK); } @@ -542,29 +527,34 @@ private void HandleUserCancelled(IWin32Window owner) /// Gets the cached index of the current application /// /// The of the current application - public HashCacheFile GetCache() - => UpdateCacheTask.AwaitTask().Result; + public HashCacheFile GetCache2() => UpdateCacheTask.AwaitTask().Result; + + /// + /// Gets the cache of the updater + /// + /// The loaded of the current application + public CacheFile GetCache() => m_loadCacheTask.AwaitTask().Result; /// /// Updates without user interaction /// /// The update specifications file - private void UpdateWithoutGUI(UpdateInfo updateInfo) + private void UpdateWithoutGUI(UpdateInfo updateInfo, IList urls) { - DownloadManager downloader = new DownloadManager(updateInfo); + var downloadManager = new DownloadManager(updateInfo, urls); - downloader.Completed += (o, e) => + downloadManager.Completed += (o, e) => { - GetCache().Save(); + GetCache2().Save(); RestartApp(); }; - downloader.Update(); + downloadManager.Download(); } - internal bool RestartApp(bool update = false, bool silent = false, bool waitForPid = true, bool asAdmin = false) + internal bool RestartApp(IWin32Window owner = null, bool update = false, bool silent = false, bool waitForPid = true, bool asAdmin = false) { - Logger.Debug(nameof(Updater), nameof(RestartApp), $"Restarting app: update={update} silent={silent} waitForPid={waitForPid} asAdmin={asAdmin}"); + Logger.Debug(nameof(Updater), nameof(RestartApp), $"Restarting app: [update={update}; silent={silent}; waitForPid={waitForPid}; asAdmin={asAdmin}]"); List args = new List(Environment.GetCommandLineArgs()); @@ -613,7 +603,7 @@ internal bool RestartApp(bool update = false, bool silent = false, bool waitForP { Logger.Error(nameof(Updater), nameof(RestartApp), e); - HandleException(null, e); + HandleException(owner, e); return false; } diff --git a/UpdateLib/UpdateLib/Utils/ExtensionMethods.cs b/UpdateLib/UpdateLib/Utils/ExtensionMethods.cs index bfa7d66..eb5f5a5 100644 --- a/UpdateLib/UpdateLib/Utils/ExtensionMethods.cs +++ b/UpdateLib/UpdateLib/Utils/ExtensionMethods.cs @@ -17,8 +17,10 @@ using System; using System.Collections.Generic; -using System.Text; +using System.ComponentModel; using System.Diagnostics; +using System.Linq; +using System.Text; namespace MatthiWare.UpdateLib.Utils { @@ -42,17 +44,30 @@ public static string AppendAll(this IEnumerable collection, string seperat } + public static IEnumerable Replace(this IEnumerable collection, string oldStr, string newStr) + { + using (var enumerator = collection.GetEnumerator()) + while (enumerator.MoveNext()) + yield return enumerator.Current.Replace(oldStr, newStr); + } + [DebuggerStepThrough] public static T MaxOrDefault(this IEnumerable collection, Func resolve) where K : IComparable { using (var enumerator = collection.GetEnumerator()) { T max = default(T); - + while (enumerator.MoveNext()) { T other = enumerator.Current; + if (max == null) + { + max = other; + continue; + } + if (resolve(other).CompareTo(resolve(max)) > 0) max = other; } @@ -61,6 +76,10 @@ public static T MaxOrDefault(this IEnumerable collection, Func re } } + public static string GetDescription(this Type type) + => type.GetCustomAttributes(typeof(DescriptionAttribute), false).Cast().FirstOrDefault().Description ?? "invalid description"; + + [DebuggerStepThrough] public static void ForEach(this IEnumerable collection, Action action) { diff --git a/UpdateLib/UpdateLib/Utils/IOUtils.cs b/UpdateLib/UpdateLib/Utils/IOUtils.cs index bc22bd5..1298990 100644 --- a/UpdateLib/UpdateLib/Utils/IOUtils.cs +++ b/UpdateLib/UpdateLib/Utils/IOUtils.cs @@ -15,11 +15,12 @@ * along with this program. If not, see . */ -using MatthiWare.UpdateLib.Common; using System; using System.IO; using System.Text; +using MatthiWare.UpdateLib.Common; + namespace MatthiWare.UpdateLib.Utils { public static class IOUtils @@ -27,17 +28,16 @@ public static class IOUtils private static Lazy m_getAppDataPath = new Lazy(GetAppDataPath); private static Lazy m_getCachePath = new Lazy(() => $"{AppDataPath}\\Cache"); private static Lazy m_getLogPath = new Lazy(() => $"{AppDataPath}\\Log"); + private static Lazy m_getTempPath = new Lazy(() => $"{AppDataPath}\\Temp"); - internal static void ReinitializeAppData() - { - m_getAppDataPath.Reset(); - } + internal static void ReinitializeAppData() => m_getAppDataPath.Reset(); - public static string AppDataPath { get { return m_getAppDataPath.Value; } } - public static string CachePath { get { return m_getCachePath.Value; } } - public static string LogPath { get { return m_getLogPath.Value; } } + public static string AppDataPath => m_getAppDataPath; + public static string CachePath => m_getCachePath; + public static string LogPath => m_getLogPath; + public static string TempPath => m_getTempPath; - public static string GetRemoteBasePath(string url) + internal static string GetRemoteBasePath(string url) { if (string.IsNullOrEmpty(url)) throw new ArgumentNullException(nameof(url)); @@ -50,12 +50,9 @@ public static string GetRemoteBasePath(string url) { builder.Append(s); builder.Append(slash); - } return builder.ToString(); - - //return .AppendAll(splitter.ToString()); } private static string GetAppDataPath() diff --git a/UpdateLib/UpdateLib/Utils/Lazy.cs b/UpdateLib/UpdateLib/Utils/Lazy.cs index 7ec9821..9caa64c 100644 --- a/UpdateLib/UpdateLib/Utils/Lazy.cs +++ b/UpdateLib/UpdateLib/Utils/Lazy.cs @@ -77,6 +77,8 @@ public Lazy(Func initFunction) m_initFunction = initFunction; } + public static implicit operator T(Lazy self) + => self.Value; } } From f7bbf359d4658e758c03a17c2b2833f196e5f1f8 Mon Sep 17 00:00:00 2001 From: Matthias Beerens Date: Tue, 27 Mar 2018 20:50:41 +0200 Subject: [PATCH 30/40] Thread-safety improvements --- UpdateLib/UpdateLib/Tasks/AsyncTask.cs | 170 ++++++++++++------------- 1 file changed, 82 insertions(+), 88 deletions(-) diff --git a/UpdateLib/UpdateLib/Tasks/AsyncTask.cs b/UpdateLib/UpdateLib/Tasks/AsyncTask.cs index 3b64096..9fae9f0 100644 --- a/UpdateLib/UpdateLib/Tasks/AsyncTask.cs +++ b/UpdateLib/UpdateLib/Tasks/AsyncTask.cs @@ -29,7 +29,6 @@ using System.Threading; using MatthiWare.UpdateLib.Common; -using MatthiWare.UpdateLib.Threading; namespace MatthiWare.UpdateLib.Tasks { @@ -41,7 +40,7 @@ public abstract class AsyncTask #region private fields - private Exception m_lastException = null; + protected Exception m_lastException = null; private bool m_useSyncContext = true; private SynchronizationContext m_syncContext; @@ -52,7 +51,7 @@ public abstract class AsyncTask public Stopwatch m_sw = new Stopwatch(); #endif - private readonly ConcurrentQueue m_childTasks = new ConcurrentQueue(); + private readonly Queue m_childTasks = new Queue(); private ManualResetEvent m_waitHandle = new ManualResetEvent(true); private readonly object sync = new object(); @@ -84,11 +83,6 @@ public Exception LastException lock (sync) return m_lastException; } - protected set - { - lock (sync) - m_lastException = value; - } } /// @@ -110,11 +104,6 @@ public bool IsCompleted lock (sync) return m_completed; } - set - { - lock (sync) - m_completed = value; - } } /// @@ -127,14 +116,13 @@ public bool IsCancelled lock (sync) return m_cancelled; } - private set - { - lock (sync) - m_cancelled = value; - } } + + /// + /// Gets if the current is Running. + /// public bool IsRunning { get @@ -142,11 +130,6 @@ public bool IsRunning lock (sync) return m_running; } - private set - { - lock (sync) - m_running = value; - } } #endregion @@ -185,53 +168,57 @@ public AsyncTask ConfigureAwait(bool useSyncContext) /// Returns the current Task. public AsyncTask Start() { - if (IsRunning) - return this; + lock (sync) + { + if (m_running) + return this; - Reset(); + Reset(); - m_syncContext = SynchronizationContext.Current; + m_syncContext = SynchronizationContext.Current; - Action worker = new Action(() => - { - try - { - IsRunning = true; - DoWork(); - } - catch (Exception ex) + Action worker = new Action(() => { - LastException = ex; - - Updater.Instance.Logger.Error(GetType().Name, null, ex); - } - finally - { - AwaitWorkers(); - IsRunning = false; - IsCompleted = true; - } - }); + try + { + m_running = true; + DoWork(); + } + catch (Exception ex) + { + m_lastException = ex; + + Updater.Instance.Logger.Error(GetType().Name, null, ex); + } + finally + { + AwaitWorkers(); + + m_running = false; + m_completed = true; + } + }); #if DEBUG - m_sw.Start(); + m_sw.Start(); #endif - worker.BeginInvoke(new AsyncCallback((IAsyncResult r) => - { + worker.BeginInvoke(new AsyncCallback((IAsyncResult r) => + { #if DEBUG - m_sw.Stop(); - Updater.Instance.Logger.Debug(GetType().Name, nameof(Start), $"Completed in {m_sw.ElapsedMilliseconds}ms"); + m_sw.Stop(); + Updater.Instance.Logger.Debug(GetType().Name, nameof(Start), $"Completed in {m_sw.ElapsedMilliseconds}ms"); #endif - worker.EndInvoke(r); + worker.EndInvoke(r); - OnTaskCompleted(m_lastException, IsCancelled); + OnTaskCompleted(m_lastException, IsCancelled); - m_waitHandle.Set(); + m_waitHandle.Set(); - }), null); ; + }), null); ; - return this; + return this; + } } /// @@ -240,17 +227,20 @@ public AsyncTask Start() /// public AsyncTask AwaitTask() { - if (IsChildTask && !IsCompleted && !IsRunning) - Reset(); - - if (m_waitHandle != null) + lock (sync) { - m_waitHandle.WaitOne(); - m_waitHandle.Close(); - m_waitHandle = null; - } + if (IsChildTask && !m_completed && !m_running) + Reset(); - return this; + if (m_waitHandle != null) + { + m_waitHandle.WaitOne(); + m_waitHandle.Close(); + m_waitHandle = null; + } + + return this; + } } #endregion @@ -260,10 +250,10 @@ public AsyncTask AwaitTask() /// private void Reset() { - IsCancelled = false; - IsRunning = false; - LastException = null; - IsCompleted = false; + m_cancelled = false; + m_running = false; + m_lastException = null; + m_completed = false; m_waitHandle.Reset(); m_childTasks.Clear(); @@ -284,7 +274,8 @@ private void Reset() /// public virtual void Cancel() { - IsCancelled = true; + lock (sync) + m_cancelled = true; } /// @@ -294,25 +285,29 @@ public virtual void Cancel() /// Optional arguments for the action protected void Enqueue(Delegate action, params object[] args) { - // Don't allow to start another task when the parent task has been cancelled or contains errors. - if (HasErrors || IsCancelled) - return; - - var task = AsyncTaskFactory.From(action, args); - task.IsChildTask = true; - task.TaskCompleted += (o, e) => + lock (sync) { - if (e.Error != null) + // Don't allow to start another child task when the parent task has been cancelled or contains errors. + if (m_lastException != null || m_cancelled) + return; + + var task = AsyncTaskFactory.From(action, args); + + task.IsChildTask = true; + task.TaskCompleted += (o, e) => { - LastException = e.Error?.InnerException ?? e.Error; + if (e.Error != null) + { + m_lastException = e.Error?.InnerException ?? e.Error; - Updater.Instance.Logger.Error(GetType().Name, null, LastException); - } - }; + Updater.Instance.Logger.Error(GetType().Name, null, LastException); + } + }; - m_childTasks.Enqueue(task); + m_childTasks.Enqueue(task); - WorkerScheduler.Instance.Schedule(task); + WorkerScheduler.Instance.Schedule(task); + } } /// @@ -320,10 +315,9 @@ protected void Enqueue(Delegate action, params object[] args) /// protected void AwaitWorkers() { - AsyncTask task = null; - - while (m_childTasks.TryDequeue(out task)) - task.AwaitTask(); + lock (sync) + while (m_childTasks.Count != 0) + m_childTasks.Dequeue().AwaitTask(); } /// From 0a5136f793da4dc7421b1f499826ab9e2c6b7977 Mon Sep 17 00:00:00 2001 From: Matthias Beerens Date: Tue, 27 Mar 2018 20:51:15 +0200 Subject: [PATCH 31/40] Small coding improvements --- .../Logging/Writers/FileLogWriter.cs | 12 ++-- UpdateLib/UpdateLib/Utils/CmdLineParser.cs | 16 ++--- UpdateLib/UpdateLib/Utils/ExtensionMethods.cs | 70 ++++++++----------- 3 files changed, 42 insertions(+), 56 deletions(-) diff --git a/UpdateLib/UpdateLib/Logging/Writers/FileLogWriter.cs b/UpdateLib/UpdateLib/Logging/Writers/FileLogWriter.cs index 616d75e..c7db11e 100644 --- a/UpdateLib/UpdateLib/Logging/Writers/FileLogWriter.cs +++ b/UpdateLib/UpdateLib/Logging/Writers/FileLogWriter.cs @@ -15,12 +15,13 @@ * along with this program. If not, see . */ +using System; +using System.IO; + using MatthiWare.UpdateLib.Common; using MatthiWare.UpdateLib.Tasks; using MatthiWare.UpdateLib.Threading; using MatthiWare.UpdateLib.Utils; -using System; -using System.IO; namespace MatthiWare.UpdateLib.Logging.Writers { @@ -28,7 +29,7 @@ public class FileLogWriter : ILogWriter { public LoggingLevel LoggingLevel { get { return LoggingLevel.Debug; } } - private Lazy m_logFile = new Lazy(GetLogFile); + private Lazy m_logFile = new Lazy(GetLogFile); private ConcurrentQueue m_logQueue = new ConcurrentQueue(); private AsyncTask m_logTask; @@ -40,7 +41,7 @@ public FileLogWriter() private static FileInfo GetLogFile() { - System.IO.FileInfo m_logFile = new System.IO.FileInfo($@"{IOUtils.LogPath}\log_{DateTime.Now.ToString("yyyyMMdd")}.log"); + FileInfo m_logFile = new FileInfo($@"{IOUtils.LogPath}\log_{DateTime.Now.ToString("yyyyMMdd")}.log"); if (!m_logFile.Directory.Exists) m_logFile.Directory.Create(); @@ -58,9 +59,8 @@ public void Log(string text) private void Log() { - string text; using (StreamWriter writer = new StreamWriter(m_logFile.Value.Open(FileMode.OpenOrCreate, FileAccess.Write))) - while (m_logQueue.TryDequeue(out text)) + while (m_logQueue.TryDequeue(out string text)) { writer.BaseStream.Seek(0, SeekOrigin.End); writer.WriteLine(text); diff --git a/UpdateLib/UpdateLib/Utils/CmdLineParser.cs b/UpdateLib/UpdateLib/Utils/CmdLineParser.cs index 007d16e..83546d0 100644 --- a/UpdateLib/UpdateLib/Utils/CmdLineParser.cs +++ b/UpdateLib/UpdateLib/Utils/CmdLineParser.cs @@ -14,11 +14,12 @@ * along with this program. If not, see . */ -using MatthiWare.UpdateLib.Common; using System; using System.Collections.Generic; using System.Linq; +using MatthiWare.UpdateLib.Common; + namespace MatthiWare.UpdateLib.Utils { public class CmdLineParser @@ -32,7 +33,7 @@ public void AddParameter(string paramName, ParamMandatoryType mandatoryType = Pa if (string.IsNullOrEmpty(paramName)) throw new ArgumentNullException(nameof(paramName)); if (paramName.Contains(' ')) throw new ArgumentException("Parameter cannot contain spaces", nameof(paramName)); if (m_params.ContainsKey(paramName)) throw new ArgumentException("Key already exists", nameof(paramName)); - + var param = new ParameterDefinition(paramName, mandatoryType, valueType); m_params.Add(paramName, param); } @@ -81,16 +82,14 @@ private void FindParameterValue(ParameterDefinition param, string[] args, ref in if (param.ValueType == ParamValueType.Int || param.ValueType == ParamValueType.OptionalInt) { - int value; - succes = int.TryParse(data, out value); + succes = int.TryParse(data, out int value); if (succes) param.Value = value; } else if (param.ValueType == ParamValueType.Bool || param.ValueType == ParamValueType.OptionalBool) { - bool value; - succes = bool.TryParse(data, out value); + succes = bool.TryParse(data, out bool value); if (succes) param.Value = value; @@ -104,10 +103,9 @@ private void FindParameterValue(ParameterDefinition param, string[] args, ref in } else if (param.ValueType == ParamValueType.MultipleInts) { - List values = new List(); - int outValue; + var values = new List(); - while (index < args.Length && int.TryParse(args[index], out outValue)) + while (index < args.Length && int.TryParse(args[index], out int outValue)) { values.Add(outValue); index++; diff --git a/UpdateLib/UpdateLib/Utils/ExtensionMethods.cs b/UpdateLib/UpdateLib/Utils/ExtensionMethods.cs index eb5f5a5..c29d625 100644 --- a/UpdateLib/UpdateLib/Utils/ExtensionMethods.cs +++ b/UpdateLib/UpdateLib/Utils/ExtensionMethods.cs @@ -41,70 +41,60 @@ public static string AppendAll(this IEnumerable collection, string seperat return builder.ToString(); } - } public static IEnumerable Replace(this IEnumerable collection, string oldStr, string newStr) { - using (var enumerator = collection.GetEnumerator()) - while (enumerator.MoveNext()) - yield return enumerator.Current.Replace(oldStr, newStr); + foreach (var str in collection) + yield return str.Replace(oldStr, newStr); } [DebuggerStepThrough] public static T MaxOrDefault(this IEnumerable collection, Func resolve) where K : IComparable { - using (var enumerator = collection.GetEnumerator()) - { - T max = default(T); + T max = default(T); - while (enumerator.MoveNext()) + foreach (T other in collection) + { + if (max == null) { - T other = enumerator.Current; - - if (max == null) - { - max = other; - continue; - } - - if (resolve(other).CompareTo(resolve(max)) > 0) - max = other; + max = other; + continue; } - return max; + if (resolve(other).CompareTo(resolve(max)) > 0) + max = other; } + + return max; } public static string GetDescription(this Type type) - => type.GetCustomAttributes(typeof(DescriptionAttribute), false).Cast().FirstOrDefault().Description ?? "invalid description"; + => type.GetCustomAttributes(typeof(DescriptionAttribute), false).Cast().FirstOrDefault().Description ?? "No description available"; [DebuggerStepThrough] public static void ForEach(this IEnumerable collection, Action action) { - using (var enumerator = collection.GetEnumerator()) - while (enumerator.MoveNext()) - action(enumerator.Current); + foreach (T item in collection) + action(item); } [DebuggerStepThrough] public static IEnumerable NotNull(this IEnumerable collection) { - using (var enumerator = collection.GetEnumerator()) - while (enumerator.MoveNext()) - if (enumerator.Current != null) - yield return enumerator.Current; + foreach (T item in collection) + if (item != null) + yield return item; } [DebuggerStepThrough] public static IEnumerable NotEmpty(this IEnumerable collection) { - using (var enumerator = collection.GetEnumerator()) - while (enumerator.MoveNext()) - if (!string.IsNullOrEmpty(enumerator.Current)) - yield return enumerator.Current; + foreach (var item in collection) + if (!string.IsNullOrEmpty(item)) + yield return item; } /// @@ -128,20 +118,18 @@ public static IEnumerable SkipLast(this IEnumerable source, int count) int i = 0; var buffer = new Queue(count + 1); - using (var enumerator = source.GetEnumerator()) + foreach (T item in source) { - while (enumerator.MoveNext()) + if (i == count) { - if (i == count) - { - yield return buffer.Dequeue(); - i--; - } - - buffer.Enqueue(enumerator.Current); - i++; + yield return buffer.Dequeue(); + i--; } + + buffer.Enqueue(item); + i++; } + } } } From d003df58a4f00cb8c5d4b7b47723cd661990e0f6 Mon Sep 17 00:00:00 2001 From: Matthias Beerens Date: Wed, 15 Aug 2018 21:58:23 +0200 Subject: [PATCH 32/40] Update to .NET Standard 2.0 --- UpdateLib/TestApp/TestApp.csproj | 92 +- .../Data/FilesPage/GenFile.cs | 68 -- .../Data/FilesPage/GenFolder.cs | 83 -- .../Data/FilesPage/GenReg.cs | 115 -- .../Data/FilesPage/IGenItem.cs | 34 - .../Data/ListViewFolder.cs | 39 - .../Data/ListViewGenItem.cs | 45 - .../Data/TreeViewFolderNode.cs | 38 - .../UpdateLib.Generator/Files/ProjectFile.cs | 36 - .../UpdateLib.Generator/Generator_logo.ico | Bin 167188 -> 0 bytes .../UpdateLib.Generator/MainForm.Designer.cs | 264 ----- UpdateLib/UpdateLib.Generator/MainForm.cs | 206 ---- UpdateLib/UpdateLib.Generator/MainForm.resx | 202 ---- UpdateLib/UpdateLib.Generator/Program.cs | 6 - .../Properties/Resources.Designer.cs | 163 --- .../Properties/Resources.resx | 151 --- .../Properties/Settings.Designer.cs | 26 - .../Properties/Settings.settings | 7 - .../Resources/Registry Editor_16px.png | Bin 342 -> 0 bytes .../Resources/Registry Editor_32px.png | Bin 569 -> 0 bytes .../UpdateLib.Generator/Resources/cross.png | Bin 912 -> 0 bytes .../Resources/folder_transparent_16px.png | Bin 436 -> 0 bytes .../UpdateLib.Generator/Resources/gears.png | Bin 446 -> 0 bytes .../Resources/image_transparent_16px.png | Bin 484 -> 0 bytes .../UpdateLib.Generator/Resources/loading.gif | Bin 98823 -> 0 bytes .../Resources/loading_gear.gif | Bin 73023 -> 0 bytes .../Resources/project_16px.png | Bin 244 -> 0 bytes .../Resources/reg_bin_16px.png | Bin 345 -> 0 bytes .../Resources/reg_string_16px.png | Bin 343 -> 0 bytes .../Tasks/LoadDirectoryTask.cs | 104 -- .../Tasks/UpdateGeneratorTask.cs | 158 --- .../UpdateLib.Generator/UI/ElipseComponent.cs | 135 --- .../UpdateLib.Generator/UI/FlatButton.cs | 205 ---- .../UpdateLib.Generator/UI/GradientPanel.cs | 134 --- .../UpdateLib.Generator/UI/HoverPictureBox.cs | 104 -- .../UI/InputDialog.Designer.cs | 138 --- .../UpdateLib.Generator/UI/InputDialog.cs | 108 -- .../UpdateLib.Generator/UI/InputDialog.resx | 306 ----- .../UI/LoaderControl.Designer.cs | 64 - .../UpdateLib.Generator/UI/LoaderControl.cs | 144 --- .../UpdateLib.Generator/UI/LoaderControl.resx | 126 -- .../UpdateLib.Generator/UI/MoveablePanel.cs | 71 -- .../UI/Pages/BuilderPage.Designer.cs | 133 --- .../UI/Pages/BuilderPage.cs | 155 --- .../UI/Pages/BuilderPage.resx | 123 -- .../UI/Pages/FilesPage.Designer.cs | 232 ---- .../UpdateLib.Generator/UI/Pages/FilesPage.cs | 310 ----- .../UI/Pages/FilesPage.resx | 132 --- .../UI/Pages/InformationPage.Designer.cs | 113 -- .../UI/Pages/InformationPage.cs | 59 - .../UI/Pages/InformationPage.resx | 120 -- .../UI/Pages/PageControlBase.cs | 79 -- .../UI/Pages/PageControlBase.resx | 120 -- .../UI/Pages/RegistryPage.Designer.cs | 255 ---- .../UI/Pages/RegistryPage.cs | 256 ---- .../UI/Pages/RegistryPage.resx | 177 --- .../UpdateLib.Generator.csproj | 193 +-- .../UpdateLib.Tests/UpdateLib.Tests.csproj | 115 +- UpdateLib/UpdateLib.Tests/packages.config | 15 - UpdateLib/UpdateLib.sln | 10 +- UpdateLib/UpdateLib/Common/DirectoryEntry.cs | 10 - UpdateLib/UpdateLib/Common/HashCacheEntry.cs | 4 +- .../UpdateLib/Common/RegistryKeyEntry.cs | 52 - UpdateLib/UpdateLib/Common/UpdateVersion.cs | 32 +- UpdateLib/UpdateLib/Common/WorkerScheduler.cs | 122 -- .../UpdateLib/Compression/Checksum/Adler32.cs | 209 ---- .../UpdateLib/Compression/Checksum/Crc32.cs | 217 ---- .../Compression/Checksum/IChecksum.cs | 91 -- .../Compression/Deflaters/Deflater.cs | 464 -------- .../Deflaters/DeflaterConstants.cs | 181 --- .../Compression/Deflaters/DeflaterEngine.cs | 850 ------------- .../Compression/Deflaters/DeflaterHuffman.cs | 894 -------------- .../Compression/Deflaters/DeflaterPending.cs | 53 - .../Compression/Deflaters/Inflater.cs | 857 ------------- .../Deflaters/InflaterDynHeader.cs | 207 ---- .../Deflaters/InflaterHuffmanTree.cs | 257 ---- .../Compression/Deflaters/PendingBuffer.cs | 258 ---- UpdateLib/UpdateLib/Compression/GZip/GZip.cs | 62 - .../Compression/GZip/GZipConstants.cs | 86 -- .../Compression/GZip/GZipException.cs | 51 - .../Compression/GZip/GZipInputStream.cs | 382 ------ .../Compression/GZip/GZipOutputStream.cs | 258 ---- .../UpdateLib/Compression/PatchBuilder.cs | 23 - UpdateLib/UpdateLib/Compression/Patcher.cs | 37 - .../Streams/DeflaterOutputStream.cs | 388 ------ .../Streams/InflaterInputStream.cs | 642 ---------- .../Compression/Streams/OutputWindow.cs | 233 ---- .../Compression/Streams/StreamManipulator.cs | 282 ----- .../Compression/VCDiff/AddressCache.cs | 81 -- .../UpdateLib/Compression/VCDiff/CodeTable.cs | 111 -- .../Compression/VCDiff/Instruction.cs | 36 - .../Compression/VCDiff/VCDiffDecoder.cs | 198 ---- .../VCDiff/VCDiffFormatException.cs | 35 - UpdateLib/UpdateLib/Compression/Zip/Zip.cs | 22 - .../UpdateLib/Compression/Zip/ZipConstants.cs | 470 -------- .../UpdateLib/Compression/Zip/ZipEntry.cs | 1056 ----------------- .../UpdateLib/Compression/Zip/ZipException.cs | 51 - .../UpdateLib/Compression/Zip/ZipExtraData.cs | 970 --------------- .../UpdateLib/Compression/Zip/ZipFile.cs | 566 --------- .../Compression/Zip/ZipHelperStream.cs | 618 ---------- .../Compression/Zip/ZipInputStream.cs | 608 ---------- .../Compression/Zip/ZipOutputStream.cs | 735 ------------ .../Controls/UpdaterControl.Designer.cs | 49 - .../UpdateLib/Controls/UpdaterControl.cs | 288 ----- .../UpdateLib/Controls/UpdaterControl.resx | 120 -- UpdateLib/UpdateLib/Files/CacheFile.cs | 6 +- UpdateLib/UpdateLib/Files/HashCacheFile.cs | 4 +- .../UpdateLib/Files/UpdateCatalogFile.cs | 5 +- .../UpdateLib/Files/UpdateMetadataFile.cs | 5 +- UpdateLib/UpdateLib/Logging/ILogWriter.cs | 28 - UpdateLib/UpdateLib/Logging/ILogger.cs | 35 - UpdateLib/UpdateLib/Logging/Logger.cs | 68 -- .../Logging/Writers/ConsoleLogWriter.cs | 32 - .../Logging/Writers/FileLogWriter.cs | 72 -- .../Properties/Resources.Designer.cs | 133 --- UpdateLib/UpdateLib/Properties/Resources.resx | 142 --- .../UpdateLib/Resources/project_16px.png | Bin 244 -> 0 bytes UpdateLib/UpdateLib/Resources/status_done.png | Bin 454 -> 0 bytes .../UpdateLib/Resources/status_download.png | Bin 493 -> 0 bytes .../UpdateLib/Resources/status_error.png | Bin 912 -> 0 bytes UpdateLib/UpdateLib/Resources/status_info.png | Bin 617 -> 0 bytes .../UpdateLib/Resources/status_update.png | Bin 3169 -> 0 bytes .../UpdateLib/Resources/status_warning.png | Bin 502 -> 0 bytes .../UpdateLib/Resources/status_working.png | Bin 1600 -> 0 bytes .../UpdateLib/Security/PermissionUtil.cs | 133 --- UpdateLib/UpdateLib/Tasks/AsyncTask.cs | 436 ------- UpdateLib/UpdateLib/Tasks/AsyncTaskFactory.cs | 105 -- .../Tasks/CheckForUpdatedItemsTask.cs | 107 -- .../CheckForUpdatesCompletedEventArgs.cs | 49 - .../UpdateLib/Tasks/CheckForUpdatesTask.cs | 134 --- .../Tasks/CheckRequiredPrivilegesTask.cs | 92 -- UpdateLib/UpdateLib/Tasks/CleanUpTask.cs | 60 - UpdateLib/UpdateLib/Tasks/DownloadManager.cs | 118 -- UpdateLib/UpdateLib/Tasks/DownloadTask.cs | 85 -- UpdateLib/UpdateLib/Tasks/LoadCacheTask.cs | 38 - UpdateLib/UpdateLib/Tasks/UpdatableTask.cs | 49 - UpdateLib/UpdateLib/Tasks/UpdateCacheTask.cs | 125 -- .../UpdateLib/Tasks/UpdateRegistryTask.cs | 138 --- .../UI/Components/ChangelogPage.Designer.cs | 83 -- .../UpdateLib/UI/Components/ChangelogPage.cs | 127 -- .../UI/Components/ChangelogPage.resx | 235 ---- .../UI/Components/FinishPage.Designer.cs | 97 -- .../UpdateLib/UI/Components/FinishPage.cs | 170 --- .../UpdateLib/UI/Components/FinishPage.resx | 131 -- .../UI/Components/IntroPage.Designer.cs | 77 -- .../UpdateLib/UI/Components/IntroPage.cs | 138 --- .../UpdateLib/UI/Components/IntroPage.resx | 129 -- .../UI/Components/RollbackPage.Designer.cs | 142 --- .../UpdateLib/UI/Components/RollbackPage.cs | 12 - .../UpdateLib/UI/Components/RollbackPage.resx | 123 -- .../UI/Components/UpdatePage.Designer.cs | 142 --- .../UpdateLib/UI/Components/UpdatePage.cs | 374 ------ .../UpdateLib/UI/Components/UpdatePage.resx | 123 -- UpdateLib/UpdateLib/UI/IWizardPage.cs | 41 - .../UpdateLib/UI/MessageDialog.Designer.cs | 152 --- UpdateLib/UpdateLib/UI/MessageDialog.cs | 119 -- UpdateLib/UpdateLib/UI/MessageDialog.resx | 306 ----- UpdateLib/UpdateLib/UI/UIExtensions.cs | 43 - .../UpdateLib/UI/UpdaterForm.Designer.cs | 167 --- UpdateLib/UpdateLib/UI/UpdaterForm.cs | 258 ---- UpdateLib/UpdateLib/UI/UpdaterForm.resx | 306 ----- .../UpdateLib/UI/WizardPageCollection.cs | 178 --- UpdateLib/UpdateLib/UpdateLib.csproj | 254 +--- UpdateLib/UpdateLib/Updater.cs | 288 +---- UpdateLib/UpdateLib/UpdaterControl.bmp | Bin 822 -> 0 bytes UpdateLib/UpdateLib/Utils/IOUtils.cs | 161 --- UpdateLib/UpdateLib/Utils/Lazy.cs | 84 -- UpdateLib/UpdateLib/Utils/NetworkUtils.cs | 31 - UpdateLib/UpdateLib/Utils/RegistryHelper.cs | 160 --- UpdateLib/UpdateLib/Win32/NativeMethods.cs | 28 - UpdateLib/UpdateLib/updater.ico | Bin 10806 -> 0 bytes 171 files changed, 114 insertions(+), 25949 deletions(-) delete mode 100644 UpdateLib/UpdateLib.Generator/Data/FilesPage/GenFile.cs delete mode 100644 UpdateLib/UpdateLib.Generator/Data/FilesPage/GenFolder.cs delete mode 100644 UpdateLib/UpdateLib.Generator/Data/FilesPage/GenReg.cs delete mode 100644 UpdateLib/UpdateLib.Generator/Data/FilesPage/IGenItem.cs delete mode 100644 UpdateLib/UpdateLib.Generator/Data/ListViewFolder.cs delete mode 100644 UpdateLib/UpdateLib.Generator/Data/ListViewGenItem.cs delete mode 100644 UpdateLib/UpdateLib.Generator/Data/TreeViewFolderNode.cs delete mode 100644 UpdateLib/UpdateLib.Generator/Files/ProjectFile.cs delete mode 100644 UpdateLib/UpdateLib.Generator/Generator_logo.ico delete mode 100644 UpdateLib/UpdateLib.Generator/MainForm.Designer.cs delete mode 100644 UpdateLib/UpdateLib.Generator/MainForm.cs delete mode 100644 UpdateLib/UpdateLib.Generator/MainForm.resx delete mode 100644 UpdateLib/UpdateLib.Generator/Properties/Resources.Designer.cs delete mode 100644 UpdateLib/UpdateLib.Generator/Properties/Resources.resx delete mode 100644 UpdateLib/UpdateLib.Generator/Properties/Settings.Designer.cs delete mode 100644 UpdateLib/UpdateLib.Generator/Properties/Settings.settings delete mode 100644 UpdateLib/UpdateLib.Generator/Resources/Registry Editor_16px.png delete mode 100644 UpdateLib/UpdateLib.Generator/Resources/Registry Editor_32px.png delete mode 100644 UpdateLib/UpdateLib.Generator/Resources/cross.png delete mode 100644 UpdateLib/UpdateLib.Generator/Resources/folder_transparent_16px.png delete mode 100644 UpdateLib/UpdateLib.Generator/Resources/gears.png delete mode 100644 UpdateLib/UpdateLib.Generator/Resources/image_transparent_16px.png delete mode 100644 UpdateLib/UpdateLib.Generator/Resources/loading.gif delete mode 100644 UpdateLib/UpdateLib.Generator/Resources/loading_gear.gif delete mode 100644 UpdateLib/UpdateLib.Generator/Resources/project_16px.png delete mode 100644 UpdateLib/UpdateLib.Generator/Resources/reg_bin_16px.png delete mode 100644 UpdateLib/UpdateLib.Generator/Resources/reg_string_16px.png delete mode 100644 UpdateLib/UpdateLib.Generator/Tasks/LoadDirectoryTask.cs delete mode 100644 UpdateLib/UpdateLib.Generator/Tasks/UpdateGeneratorTask.cs delete mode 100644 UpdateLib/UpdateLib.Generator/UI/ElipseComponent.cs delete mode 100644 UpdateLib/UpdateLib.Generator/UI/FlatButton.cs delete mode 100644 UpdateLib/UpdateLib.Generator/UI/GradientPanel.cs delete mode 100644 UpdateLib/UpdateLib.Generator/UI/HoverPictureBox.cs delete mode 100644 UpdateLib/UpdateLib.Generator/UI/InputDialog.Designer.cs delete mode 100644 UpdateLib/UpdateLib.Generator/UI/InputDialog.cs delete mode 100644 UpdateLib/UpdateLib.Generator/UI/InputDialog.resx delete mode 100644 UpdateLib/UpdateLib.Generator/UI/LoaderControl.Designer.cs delete mode 100644 UpdateLib/UpdateLib.Generator/UI/LoaderControl.cs delete mode 100644 UpdateLib/UpdateLib.Generator/UI/LoaderControl.resx delete mode 100644 UpdateLib/UpdateLib.Generator/UI/MoveablePanel.cs delete mode 100644 UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.Designer.cs delete mode 100644 UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.cs delete mode 100644 UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.resx delete mode 100644 UpdateLib/UpdateLib.Generator/UI/Pages/FilesPage.Designer.cs delete mode 100644 UpdateLib/UpdateLib.Generator/UI/Pages/FilesPage.cs delete mode 100644 UpdateLib/UpdateLib.Generator/UI/Pages/FilesPage.resx delete mode 100644 UpdateLib/UpdateLib.Generator/UI/Pages/InformationPage.Designer.cs delete mode 100644 UpdateLib/UpdateLib.Generator/UI/Pages/InformationPage.cs delete mode 100644 UpdateLib/UpdateLib.Generator/UI/Pages/InformationPage.resx delete mode 100644 UpdateLib/UpdateLib.Generator/UI/Pages/PageControlBase.cs delete mode 100644 UpdateLib/UpdateLib.Generator/UI/Pages/PageControlBase.resx delete mode 100644 UpdateLib/UpdateLib.Generator/UI/Pages/RegistryPage.Designer.cs delete mode 100644 UpdateLib/UpdateLib.Generator/UI/Pages/RegistryPage.cs delete mode 100644 UpdateLib/UpdateLib.Generator/UI/Pages/RegistryPage.resx delete mode 100644 UpdateLib/UpdateLib.Tests/packages.config delete mode 100644 UpdateLib/UpdateLib/Common/RegistryKeyEntry.cs delete mode 100644 UpdateLib/UpdateLib/Common/WorkerScheduler.cs delete mode 100644 UpdateLib/UpdateLib/Compression/Checksum/Adler32.cs delete mode 100644 UpdateLib/UpdateLib/Compression/Checksum/Crc32.cs delete mode 100644 UpdateLib/UpdateLib/Compression/Checksum/IChecksum.cs delete mode 100644 UpdateLib/UpdateLib/Compression/Deflaters/Deflater.cs delete mode 100644 UpdateLib/UpdateLib/Compression/Deflaters/DeflaterConstants.cs delete mode 100644 UpdateLib/UpdateLib/Compression/Deflaters/DeflaterEngine.cs delete mode 100644 UpdateLib/UpdateLib/Compression/Deflaters/DeflaterHuffman.cs delete mode 100644 UpdateLib/UpdateLib/Compression/Deflaters/DeflaterPending.cs delete mode 100644 UpdateLib/UpdateLib/Compression/Deflaters/Inflater.cs delete mode 100644 UpdateLib/UpdateLib/Compression/Deflaters/InflaterDynHeader.cs delete mode 100644 UpdateLib/UpdateLib/Compression/Deflaters/InflaterHuffmanTree.cs delete mode 100644 UpdateLib/UpdateLib/Compression/Deflaters/PendingBuffer.cs delete mode 100644 UpdateLib/UpdateLib/Compression/GZip/GZip.cs delete mode 100644 UpdateLib/UpdateLib/Compression/GZip/GZipConstants.cs delete mode 100644 UpdateLib/UpdateLib/Compression/GZip/GZipException.cs delete mode 100644 UpdateLib/UpdateLib/Compression/GZip/GZipInputStream.cs delete mode 100644 UpdateLib/UpdateLib/Compression/GZip/GZipOutputStream.cs delete mode 100644 UpdateLib/UpdateLib/Compression/PatchBuilder.cs delete mode 100644 UpdateLib/UpdateLib/Compression/Patcher.cs delete mode 100644 UpdateLib/UpdateLib/Compression/Streams/DeflaterOutputStream.cs delete mode 100644 UpdateLib/UpdateLib/Compression/Streams/InflaterInputStream.cs delete mode 100644 UpdateLib/UpdateLib/Compression/Streams/OutputWindow.cs delete mode 100644 UpdateLib/UpdateLib/Compression/Streams/StreamManipulator.cs delete mode 100644 UpdateLib/UpdateLib/Compression/VCDiff/AddressCache.cs delete mode 100644 UpdateLib/UpdateLib/Compression/VCDiff/CodeTable.cs delete mode 100644 UpdateLib/UpdateLib/Compression/VCDiff/Instruction.cs delete mode 100644 UpdateLib/UpdateLib/Compression/VCDiff/VCDiffDecoder.cs delete mode 100644 UpdateLib/UpdateLib/Compression/VCDiff/VCDiffFormatException.cs delete mode 100644 UpdateLib/UpdateLib/Compression/Zip/Zip.cs delete mode 100644 UpdateLib/UpdateLib/Compression/Zip/ZipConstants.cs delete mode 100644 UpdateLib/UpdateLib/Compression/Zip/ZipEntry.cs delete mode 100644 UpdateLib/UpdateLib/Compression/Zip/ZipException.cs delete mode 100644 UpdateLib/UpdateLib/Compression/Zip/ZipExtraData.cs delete mode 100644 UpdateLib/UpdateLib/Compression/Zip/ZipFile.cs delete mode 100644 UpdateLib/UpdateLib/Compression/Zip/ZipHelperStream.cs delete mode 100644 UpdateLib/UpdateLib/Compression/Zip/ZipInputStream.cs delete mode 100644 UpdateLib/UpdateLib/Compression/Zip/ZipOutputStream.cs delete mode 100644 UpdateLib/UpdateLib/Controls/UpdaterControl.Designer.cs delete mode 100644 UpdateLib/UpdateLib/Controls/UpdaterControl.cs delete mode 100644 UpdateLib/UpdateLib/Controls/UpdaterControl.resx delete mode 100644 UpdateLib/UpdateLib/Logging/ILogWriter.cs delete mode 100644 UpdateLib/UpdateLib/Logging/ILogger.cs delete mode 100644 UpdateLib/UpdateLib/Logging/Logger.cs delete mode 100644 UpdateLib/UpdateLib/Logging/Writers/ConsoleLogWriter.cs delete mode 100644 UpdateLib/UpdateLib/Logging/Writers/FileLogWriter.cs delete mode 100644 UpdateLib/UpdateLib/Properties/Resources.Designer.cs delete mode 100644 UpdateLib/UpdateLib/Properties/Resources.resx delete mode 100644 UpdateLib/UpdateLib/Resources/project_16px.png delete mode 100644 UpdateLib/UpdateLib/Resources/status_done.png delete mode 100644 UpdateLib/UpdateLib/Resources/status_download.png delete mode 100644 UpdateLib/UpdateLib/Resources/status_error.png delete mode 100644 UpdateLib/UpdateLib/Resources/status_info.png delete mode 100644 UpdateLib/UpdateLib/Resources/status_update.png delete mode 100644 UpdateLib/UpdateLib/Resources/status_warning.png delete mode 100644 UpdateLib/UpdateLib/Resources/status_working.png delete mode 100644 UpdateLib/UpdateLib/Security/PermissionUtil.cs delete mode 100644 UpdateLib/UpdateLib/Tasks/AsyncTask.cs delete mode 100644 UpdateLib/UpdateLib/Tasks/AsyncTaskFactory.cs delete mode 100644 UpdateLib/UpdateLib/Tasks/CheckForUpdatedItemsTask.cs delete mode 100644 UpdateLib/UpdateLib/Tasks/CheckForUpdatesCompletedEventArgs.cs delete mode 100644 UpdateLib/UpdateLib/Tasks/CheckForUpdatesTask.cs delete mode 100644 UpdateLib/UpdateLib/Tasks/CheckRequiredPrivilegesTask.cs delete mode 100644 UpdateLib/UpdateLib/Tasks/CleanUpTask.cs delete mode 100644 UpdateLib/UpdateLib/Tasks/DownloadManager.cs delete mode 100644 UpdateLib/UpdateLib/Tasks/DownloadTask.cs delete mode 100644 UpdateLib/UpdateLib/Tasks/LoadCacheTask.cs delete mode 100644 UpdateLib/UpdateLib/Tasks/UpdatableTask.cs delete mode 100644 UpdateLib/UpdateLib/Tasks/UpdateCacheTask.cs delete mode 100644 UpdateLib/UpdateLib/Tasks/UpdateRegistryTask.cs delete mode 100644 UpdateLib/UpdateLib/UI/Components/ChangelogPage.Designer.cs delete mode 100644 UpdateLib/UpdateLib/UI/Components/ChangelogPage.cs delete mode 100644 UpdateLib/UpdateLib/UI/Components/ChangelogPage.resx delete mode 100644 UpdateLib/UpdateLib/UI/Components/FinishPage.Designer.cs delete mode 100644 UpdateLib/UpdateLib/UI/Components/FinishPage.cs delete mode 100644 UpdateLib/UpdateLib/UI/Components/FinishPage.resx delete mode 100644 UpdateLib/UpdateLib/UI/Components/IntroPage.Designer.cs delete mode 100644 UpdateLib/UpdateLib/UI/Components/IntroPage.cs delete mode 100644 UpdateLib/UpdateLib/UI/Components/IntroPage.resx delete mode 100644 UpdateLib/UpdateLib/UI/Components/RollbackPage.Designer.cs delete mode 100644 UpdateLib/UpdateLib/UI/Components/RollbackPage.cs delete mode 100644 UpdateLib/UpdateLib/UI/Components/RollbackPage.resx delete mode 100644 UpdateLib/UpdateLib/UI/Components/UpdatePage.Designer.cs delete mode 100644 UpdateLib/UpdateLib/UI/Components/UpdatePage.cs delete mode 100644 UpdateLib/UpdateLib/UI/Components/UpdatePage.resx delete mode 100644 UpdateLib/UpdateLib/UI/IWizardPage.cs delete mode 100644 UpdateLib/UpdateLib/UI/MessageDialog.Designer.cs delete mode 100644 UpdateLib/UpdateLib/UI/MessageDialog.cs delete mode 100644 UpdateLib/UpdateLib/UI/MessageDialog.resx delete mode 100644 UpdateLib/UpdateLib/UI/UIExtensions.cs delete mode 100644 UpdateLib/UpdateLib/UI/UpdaterForm.Designer.cs delete mode 100644 UpdateLib/UpdateLib/UI/UpdaterForm.cs delete mode 100644 UpdateLib/UpdateLib/UI/UpdaterForm.resx delete mode 100644 UpdateLib/UpdateLib/UI/WizardPageCollection.cs delete mode 100644 UpdateLib/UpdateLib/UpdaterControl.bmp delete mode 100644 UpdateLib/UpdateLib/Utils/IOUtils.cs delete mode 100644 UpdateLib/UpdateLib/Utils/Lazy.cs delete mode 100644 UpdateLib/UpdateLib/Utils/NetworkUtils.cs delete mode 100644 UpdateLib/UpdateLib/Utils/RegistryHelper.cs delete mode 100644 UpdateLib/UpdateLib/Win32/NativeMethods.cs delete mode 100644 UpdateLib/UpdateLib/updater.ico diff --git a/UpdateLib/TestApp/TestApp.csproj b/UpdateLib/TestApp/TestApp.csproj index 7ebd714..914012b 100644 --- a/UpdateLib/TestApp/TestApp.csproj +++ b/UpdateLib/TestApp/TestApp.csproj @@ -1,82 +1,49 @@ - - - + - Debug - AnyCPU - {7C3C0345-6D01-40A6-9F01-60D8D6451FB1} + net472 WinExe - Properties - TestApp - TestApp - v3.5 - 512 + false - AnyCPU - true full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 + bin\$(Configuration)\ Auto - - + - AnyCPU pdbonly - true - bin\Release\ - TRACE - prompt - 4 + bin\$(Configuration)\ - + {7C3C0345-6D01-40A6-9F01-60D8D6451FB1} TestApp.Program - - app.manifest - - - + + + - - - - - Properties\SharedAssemblyInfo.cs - - + + Form - + Form1.cs - - - - - Form1.cs - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - + True Resources.resx + + True + Settings.settings + True + Designer @@ -84,19 +51,6 @@ SettingsSingleFileGenerator Settings.Designer.cs - - True - Settings.settings - True - - - - - {4394be57-95e2-45b1-a968-1404b0590b35} - UpdateLib - - - Always @@ -107,12 +61,4 @@ Always - - \ No newline at end of file diff --git a/UpdateLib/UpdateLib.Generator/Data/FilesPage/GenFile.cs b/UpdateLib/UpdateLib.Generator/Data/FilesPage/GenFile.cs deleted file mode 100644 index 14edd17..0000000 --- a/UpdateLib/UpdateLib.Generator/Data/FilesPage/GenFile.cs +++ /dev/null @@ -1,68 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.IO; - -namespace MatthiWare.UpdateLib.Generator.Data.FilesPage -{ - public class GenFile : IGenItem - { - public event EventHandler Changed; - - private FileInfo m_fileInfo; - public FileInfo FileInfo - { - get { return m_fileInfo; } - set { m_fileInfo = value; Changed?.Invoke(this, EventArgs.Empty); } - } - - public string Name { get { return FileInfo?.Name ?? string.Empty; } set { Changed?.Invoke(this, EventArgs.Empty); } } - public string RealPath { get { return FileInfo?.FullName ?? string.Empty; } } - public string Extension { get { return FileInfo?.Extension ?? string.Empty; } } - public string Size { get { return ConvertBytesToSizeString(FileInfo?.Length ?? 0); } } - - public GenFolder Parent { get; set; } - - public ListViewGenItem View { get; set; } - - public GenFile(FileInfo file) - { - FileInfo = file; - - View = new ListViewGenItem(this); - } - - private static string ConvertBytesToSizeString(long size) - { - size = Math.Max(0, size); - - double kb = Math.Ceiling(size / 1024.0); - - return $"{kb.ToString("N0")} kB"; - } - - public string[] GetListViewItems() - { - return new string[] { Name, "File", FileInfo.LastWriteTime.ToString(), Size }; - } - public string GetListViewImageKey() - { - return Extension; - } - } -} diff --git a/UpdateLib/UpdateLib.Generator/Data/FilesPage/GenFolder.cs b/UpdateLib/UpdateLib.Generator/Data/FilesPage/GenFolder.cs deleted file mode 100644 index 63ebf75..0000000 --- a/UpdateLib/UpdateLib.Generator/Data/FilesPage/GenFolder.cs +++ /dev/null @@ -1,83 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System.Collections.Generic; -using System.Linq; -using System.Windows.Forms; - -namespace MatthiWare.UpdateLib.Generator.Data.FilesPage -{ - public class GenFolder - { - public string Name { get; set; } - public string PathVariable { get; set; } - public List Items { get; private set; } = new List(); - public List Directories { get; private set; } = new List(); - public GenFolder ParentFolder { get; set; } - public bool IsRoot { get { return ParentFolder == null; } } - public bool ProtectedFolder { get; set; } = false; - - public ListViewFolder FolderListView { get; set; } - public TreeViewFolderNode FolderTreeView { get; set; } - - public int Count - { - get - { - return Items.Count + Directories.Sum(d => d.Count); - } - } - - public GenFolder(string name, ContextMenuStrip menu) - { - Name = name; - - FolderListView = new ListViewFolder(name, this); - FolderTreeView = new TreeViewFolderNode(name, this); - - FolderTreeView.ContextMenuStrip = menu; - - } - - public void Add(IGenItem item) - { - item.Parent = this; - Items.Add(item); - } - - public void Add(GenFolder folder) - { - folder.ParentFolder = this; - Directories.Add(folder); - FolderTreeView.Nodes.Add(folder.FolderTreeView); - } - - public void Remove(IGenItem item) - { - Items.Remove(item); - item.View.Remove(); - } - - public void Remove(GenFolder folder) - { - Directories.Remove(folder); - FolderTreeView.Nodes.Remove(folder.FolderTreeView); - folder.FolderListView.Remove(); - } - - } -} diff --git a/UpdateLib/UpdateLib.Generator/Data/FilesPage/GenReg.cs b/UpdateLib/UpdateLib.Generator/Data/FilesPage/GenReg.cs deleted file mode 100644 index a41064d..0000000 --- a/UpdateLib/UpdateLib.Generator/Data/FilesPage/GenReg.cs +++ /dev/null @@ -1,115 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using Microsoft.Win32; -using System; - -namespace MatthiWare.UpdateLib.Generator.Data.FilesPage -{ - public class GenReg : IGenItem - { - public event EventHandler Changed; - - private RegistryValueKind m_type; - public RegistryValueKind Type - { - get { return m_type; } - set - { - m_type = value; - Changed?.Invoke(this, EventArgs.Empty); - } - } - - private string m_name; - public string Name - { - get { return m_name; } - set - { - m_name = value; - Changed?.Invoke(this, EventArgs.Empty); - } - } - - private object m_value; - public object Value - { - get { return m_value; } - set - { - m_value = value; - Changed?.Invoke(this, EventArgs.Empty); - } - } - - public GenFolder Parent { get; set; } - public ListViewGenItem View { get; set; } - - public GenReg(string name, RegistryValueKind kind = RegistryValueKind.String) - { - Name = name; - Type = kind; - - View = new ListViewGenItem(this); - } - - public string[] GetListViewItems() - { - return new string[] { Name, GetTypeName(), Value?.ToString() ?? string.Empty }; - } - - private string GetTypeName() - { - switch (Type) - { - case RegistryValueKind.ExpandString: - return "REG_EXPANDED_SZ"; - case RegistryValueKind.MultiString: - return "REG_MULTI_SZ"; - case RegistryValueKind.Binary: - return "REG_BINARY"; - case RegistryValueKind.DWord: - return "REG_DWORD"; - case RegistryValueKind.QWord: - return "REG_QWORD"; - case RegistryValueKind.String: - case RegistryValueKind.Unknown: - default: - return "REG_SZ"; - } - } - - public string GetListViewImageKey() - { - switch (Type) - { - case RegistryValueKind.String: - case RegistryValueKind.ExpandString: - case RegistryValueKind.MultiString: - return "REG_SZ"; - case RegistryValueKind.Binary: - case RegistryValueKind.DWord: - case RegistryValueKind.QWord: - case RegistryValueKind.Unknown: - default: - return "REG_BIN"; - } - } - - } -} diff --git a/UpdateLib/UpdateLib.Generator/Data/FilesPage/IGenItem.cs b/UpdateLib/UpdateLib.Generator/Data/FilesPage/IGenItem.cs deleted file mode 100644 index 5ad1db5..0000000 --- a/UpdateLib/UpdateLib.Generator/Data/FilesPage/IGenItem.cs +++ /dev/null @@ -1,34 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; - -namespace MatthiWare.UpdateLib.Generator.Data.FilesPage -{ - public interface IGenItem - { - event EventHandler Changed; - - string Name { get; set; } - GenFolder Parent { get; set; } - ListViewGenItem View { get; set; } - - string[] GetListViewItems(); - string GetListViewImageKey(); - - } -} diff --git a/UpdateLib/UpdateLib.Generator/Data/ListViewFolder.cs b/UpdateLib/UpdateLib.Generator/Data/ListViewFolder.cs deleted file mode 100644 index 8acfcd9..0000000 --- a/UpdateLib/UpdateLib.Generator/Data/ListViewFolder.cs +++ /dev/null @@ -1,39 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using MatthiWare.UpdateLib.Generator.Data.FilesPage; -using System.Windows.Forms; - -namespace MatthiWare.UpdateLib.Generator.Data -{ - public class ListViewFolder : ListViewItem - { - internal const string FOLDER_KEY = "folderimagekey"; - - public GenFolder Folder { get; set; } - - private ListViewFolder(string[] items, string imageKey) - : base(items, imageKey) - { } - - public ListViewFolder(string folderName, GenFolder folder) - : this(new string[] { folderName, "Folder", string.Empty, string.Empty }, FOLDER_KEY) - { - Folder = folder; - } - } -} diff --git a/UpdateLib/UpdateLib.Generator/Data/ListViewGenItem.cs b/UpdateLib/UpdateLib.Generator/Data/ListViewGenItem.cs deleted file mode 100644 index dc4d66f..0000000 --- a/UpdateLib/UpdateLib.Generator/Data/ListViewGenItem.cs +++ /dev/null @@ -1,45 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using MatthiWare.UpdateLib.Generator.Data.FilesPage; -using System; -using System.Windows.Forms; - -namespace MatthiWare.UpdateLib.Generator.Data -{ - public class ListViewGenItem : ListViewItem - { - public IGenItem Item { get; set; } - - public ListViewGenItem(IGenItem item) - : base(item.GetListViewItems(), item.GetListViewImageKey()) - { - Item = item; - Item.Changed += Item_Changed; - } - - private void Item_Changed(object sender, EventArgs e) - { - string[] items = Item.GetListViewItems(); - - for (int i = 0; i < items.Length; i++) - SubItems[i].Text = items[i]; - - ImageKey = Item.GetListViewImageKey(); - } - } -} diff --git a/UpdateLib/UpdateLib.Generator/Data/TreeViewFolderNode.cs b/UpdateLib/UpdateLib.Generator/Data/TreeViewFolderNode.cs deleted file mode 100644 index fbfdfa6..0000000 --- a/UpdateLib/UpdateLib.Generator/Data/TreeViewFolderNode.cs +++ /dev/null @@ -1,38 +0,0 @@ -using MatthiWare.UpdateLib.Generator.Data.FilesPage; -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System.Windows.Forms; - -namespace MatthiWare.UpdateLib.Generator.Data -{ - public class TreeViewFolderNode : TreeNode - { - internal const string FOLDER_KEY = "folderimagekey"; - - public GenFolder Folder { get; set; } - - public TreeViewFolderNode(string folderName, GenFolder folder, string imageKey = FOLDER_KEY) - { - Text = folderName; - ImageKey = imageKey; - SelectedImageKey = imageKey; - Folder = folder; - } - - } -} diff --git a/UpdateLib/UpdateLib.Generator/Files/ProjectFile.cs b/UpdateLib/UpdateLib.Generator/Files/ProjectFile.cs deleted file mode 100644 index 5ef1c4c..0000000 --- a/UpdateLib/UpdateLib.Generator/Files/ProjectFile.cs +++ /dev/null @@ -1,36 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; - -namespace MatthiWare.UpdateLib.Generator.Files -{ - [Serializable] - public class ProjectFile - { - - #region General Info - #endregion - - #region Files - #endregion - - #region Registry - #endregion - - } -} diff --git a/UpdateLib/UpdateLib.Generator/Generator_logo.ico b/UpdateLib/UpdateLib.Generator/Generator_logo.ico deleted file mode 100644 index e51a99254ab13f7ed8d310bb5b58ffa05f5dff2b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 167188 zcmcG$byyVd_dh(l)Y1q@r%Fjncc~~UqKJ|L79i58)Gn=vprW9(AgI&=(zSpRlF~{o z(jhD%EdAU|==<~i{rz|y=9<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|#U=y1jiD60)LM87)>i`V3f`$lyS6QKf+=p`7#%ftkg$(7m#mj{dhd<636cC zR}27ozN=|`Kw}Vo{6Xz8&5@7WGKG!R$gecD-?iOz@ZRKi;CgCcP6@oJZfL5?`jXjxA+ldD;B@m`7e2&Cmvs&X}Y#FHO)l zq^L_xGuiz7Sb!hX@Z)i!hsT5F6J+!8->H+xmqGn->W>S{;Q7iwFPl<+J`gR6%8<>+ zf9Lb^DdED82ZTJ~pO;Pfe8QBcM<^TFeEfG|KH+C!8Io}cpQTVL%p?1m?;8vrJeazO za)WFh;dknX;JLDfax+SPL|HvUJ{5`dJMJ^kEH1CA_uwtQ+;EOM8=L;@?=WIx&pzX; zDO+BwhQBw&h^;)WG!Zij+8Id$Q%Np1Y+Y5Y585H44Kl5j(iy&5XdlehNb#&*?eMms zgMD2(E0@m1Z9N~?Ef@BJHp@60TD#eJ#x0&t+im#>=(%nT^je4Ok;wrte02~|Uv})e ziQv5r&!F8I2>~f+%Zh7`;rr%7%$5Y0x&zl0_b0%jRP1wRZh-A)_QKxGL(=uXV<(QY zwZ3zAFTusjm)M!C)Q=SQAMZUZSkGhrZvOg%wGC7^zxEa7_K~Qq`WnCTfOLQhKmT9N z+CqEGI`wK*t;W_DjZKUU^z|D3TBBLzAE{$(*`{?X^OkirTIl{>A6q7ol{NjKqt#eb zy*jp5qPFd=+qQ0Hrq - /// 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.components = new System.ComponentModel.Container(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); - this.SidebarPanel = new System.Windows.Forms.Panel(); - this.ContentPanel = new System.Windows.Forms.Panel(); - this.btnTabBuild = new MatthiWare.UpdateLib.Generator.UI.FlatButton(); - this.btnTabRegistry = new MatthiWare.UpdateLib.Generator.UI.FlatButton(); - this.btnTabFiles = new MatthiWare.UpdateLib.Generator.UI.FlatButton(); - this.btnTabInformation = new MatthiWare.UpdateLib.Generator.UI.FlatButton(); - this.HeaderPanel = new MatthiWare.UpdateLib.Generator.UI.MoveablePanel(); - this.pbMinimize = new MatthiWare.UpdateLib.Generator.UI.HoverPictureBox(); - this.pbMaximize = new MatthiWare.UpdateLib.Generator.UI.HoverPictureBox(); - this.pbClose = new MatthiWare.UpdateLib.Generator.UI.HoverPictureBox(); - this.pbIcon = new System.Windows.Forms.PictureBox(); - this.lblTitle = new System.Windows.Forms.Label(); - this.elipseComponent1 = new MatthiWare.UpdateLib.Generator.UI.ElipseComponent(this.components); - this.SidebarPanel.SuspendLayout(); - this.HeaderPanel.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pbMinimize)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.pbMaximize)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.pbClose)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.pbIcon)).BeginInit(); - this.SuspendLayout(); - // - // SidebarPanel - // - this.SidebarPanel.BackColor = System.Drawing.Color.DarkGray; - this.SidebarPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.SidebarPanel.Controls.Add(this.btnTabBuild); - this.SidebarPanel.Controls.Add(this.btnTabRegistry); - this.SidebarPanel.Controls.Add(this.btnTabFiles); - this.SidebarPanel.Controls.Add(this.btnTabInformation); - this.SidebarPanel.Dock = System.Windows.Forms.DockStyle.Left; - this.SidebarPanel.Location = new System.Drawing.Point(0, 33); - this.SidebarPanel.Name = "SidebarPanel"; - this.SidebarPanel.Size = new System.Drawing.Size(233, 505); - this.SidebarPanel.TabIndex = 1; - // - // ContentPanel - // - this.ContentPanel.AutoScroll = true; - this.ContentPanel.BackColor = System.Drawing.SystemColors.Control; - this.ContentPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.ContentPanel.Dock = System.Windows.Forms.DockStyle.Fill; - this.ContentPanel.Location = new System.Drawing.Point(233, 33); - this.ContentPanel.Name = "ContentPanel"; - this.ContentPanel.Size = new System.Drawing.Size(806, 505); - this.ContentPanel.TabIndex = 2; - // - // btnTabBuild - // - this.btnTabBuild.ActiveItem = false; - this.btnTabBuild.BackHoverColor = System.Drawing.Color.LightGray; - this.btnTabBuild.BackSelectedColor = System.Drawing.Color.DimGray; - this.btnTabBuild.Dock = System.Windows.Forms.DockStyle.Top; - this.btnTabBuild.Font = new System.Drawing.Font("Century Gothic", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btnTabBuild.InfoImage = ((System.Drawing.Image)(resources.GetObject("btnTabBuild.InfoImage"))); - this.btnTabBuild.Location = new System.Drawing.Point(0, 189); - this.btnTabBuild.Name = "btnTabBuild"; - this.btnTabBuild.Size = new System.Drawing.Size(231, 63); - this.btnTabBuild.TabIndex = 3; - this.btnTabBuild.Text = "Build"; - this.btnTabBuild.Click += new System.EventHandler(this.btnTabBuild_Click); - // - // btnTabRegistry - // - this.btnTabRegistry.ActiveItem = false; - this.btnTabRegistry.BackHoverColor = System.Drawing.Color.LightGray; - this.btnTabRegistry.BackSelectedColor = System.Drawing.Color.DimGray; - this.btnTabRegistry.Dock = System.Windows.Forms.DockStyle.Top; - this.btnTabRegistry.Font = new System.Drawing.Font("Century Gothic", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btnTabRegistry.InfoImage = global::MatthiWare.UpdateLib.Generator.Properties.Resources.Registry_Editor_32px; - this.btnTabRegistry.Location = new System.Drawing.Point(0, 126); - this.btnTabRegistry.Name = "btnTabRegistry"; - this.btnTabRegistry.Size = new System.Drawing.Size(231, 63); - this.btnTabRegistry.TabIndex = 2; - this.btnTabRegistry.Text = "Registry"; - this.btnTabRegistry.Click += new System.EventHandler(this.btnTabRegistry_Click); - // - // btnTabFiles - // - this.btnTabFiles.ActiveItem = false; - this.btnTabFiles.BackHoverColor = System.Drawing.Color.LightGray; - this.btnTabFiles.BackSelectedColor = System.Drawing.Color.DimGray; - this.btnTabFiles.Dock = System.Windows.Forms.DockStyle.Top; - this.btnTabFiles.Font = new System.Drawing.Font("Century Gothic", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btnTabFiles.InfoImage = ((System.Drawing.Image)(resources.GetObject("btnTabFiles.InfoImage"))); - this.btnTabFiles.Location = new System.Drawing.Point(0, 63); - this.btnTabFiles.Name = "btnTabFiles"; - this.btnTabFiles.Size = new System.Drawing.Size(231, 63); - this.btnTabFiles.TabIndex = 1; - this.btnTabFiles.Text = "Files"; - this.btnTabFiles.Click += new System.EventHandler(this.flatButton2_Click); - // - // btnTabInformation - // - this.btnTabInformation.ActiveItem = false; - this.btnTabInformation.BackHoverColor = System.Drawing.Color.LightGray; - this.btnTabInformation.BackSelectedColor = System.Drawing.Color.DimGray; - this.btnTabInformation.Dock = System.Windows.Forms.DockStyle.Top; - this.btnTabInformation.Font = new System.Drawing.Font("Century Gothic", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btnTabInformation.InfoImage = ((System.Drawing.Image)(resources.GetObject("btnTabInformation.InfoImage"))); - this.btnTabInformation.Location = new System.Drawing.Point(0, 0); - this.btnTabInformation.Name = "btnTabInformation"; - this.btnTabInformation.Size = new System.Drawing.Size(231, 63); - this.btnTabInformation.TabIndex = 0; - this.btnTabInformation.Text = "Update Information"; - this.btnTabInformation.Click += new System.EventHandler(this.flatButton1_Click); - // - // HeaderPanel - // - this.HeaderPanel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(78)))), ((int)(((byte)(99)))), ((int)(((byte)(133))))); - this.HeaderPanel.Controls.Add(this.pbMinimize); - this.HeaderPanel.Controls.Add(this.pbMaximize); - this.HeaderPanel.Controls.Add(this.pbClose); - this.HeaderPanel.Controls.Add(this.pbIcon); - this.HeaderPanel.Controls.Add(this.lblTitle); - this.HeaderPanel.Dock = System.Windows.Forms.DockStyle.Top; - this.HeaderPanel.Location = new System.Drawing.Point(0, 0); - this.HeaderPanel.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.HeaderPanel.Name = "HeaderPanel"; - this.HeaderPanel.ParentForm = this; - this.HeaderPanel.Size = new System.Drawing.Size(1039, 33); - this.HeaderPanel.TabIndex = 1; - // - // pbMinimize - // - this.pbMinimize.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.pbMinimize.Image = ((System.Drawing.Image)(resources.GetObject("pbMinimize.Image"))); - this.pbMinimize.Location = new System.Drawing.Point(965, 5); - this.pbMinimize.Name = "pbMinimize"; - this.pbMinimize.Size = new System.Drawing.Size(24, 24); - this.pbMinimize.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; - this.pbMinimize.TabIndex = 4; - this.pbMinimize.TabStop = false; - this.pbMinimize.Click += new System.EventHandler(this.pbMinimize_Click); - // - // pbMaximize - // - this.pbMaximize.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.pbMaximize.BackColor = System.Drawing.Color.Transparent; - this.pbMaximize.Image = ((System.Drawing.Image)(resources.GetObject("pbMaximize.Image"))); - this.pbMaximize.Location = new System.Drawing.Point(988, 5); - this.pbMaximize.Name = "pbMaximize"; - this.pbMaximize.Size = new System.Drawing.Size(24, 24); - this.pbMaximize.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; - this.pbMaximize.TabIndex = 3; - this.pbMaximize.TabStop = false; - this.pbMaximize.Click += new System.EventHandler(this.pbMaximize_Click); - // - // pbClose - // - this.pbClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.pbClose.Image = ((System.Drawing.Image)(resources.GetObject("pbClose.Image"))); - this.pbClose.Location = new System.Drawing.Point(1011, 5); - this.pbClose.Name = "pbClose"; - this.pbClose.Size = new System.Drawing.Size(24, 24); - this.pbClose.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; - this.pbClose.TabIndex = 2; - this.pbClose.TabStop = false; - this.pbClose.Click += new System.EventHandler(this.pbClose_Click); - // - // pbIcon - // - this.pbIcon.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pbIcon.BackgroundImage"))); - this.pbIcon.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.pbIcon.Location = new System.Drawing.Point(5, 5); - this.pbIcon.Name = "pbIcon"; - this.pbIcon.Size = new System.Drawing.Size(24, 24); - this.pbIcon.TabIndex = 1; - this.pbIcon.TabStop = false; - // - // lblTitle - // - this.lblTitle.AutoSize = true; - this.lblTitle.BackColor = System.Drawing.Color.Transparent; - this.lblTitle.Font = new System.Drawing.Font("Century Gothic", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblTitle.ForeColor = System.Drawing.Color.WhiteSmoke; - this.lblTitle.Location = new System.Drawing.Point(31, 6); - this.lblTitle.Name = "lblTitle"; - this.lblTitle.Size = new System.Drawing.Size(157, 21); - this.lblTitle.TabIndex = 0; - this.lblTitle.Text = "Update Generator"; - // - // elipseComponent1 - // - this.elipseComponent1.Control = this; - this.elipseComponent1.Radius = 5; - // - // TestForm - // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.AutoSize = true; - this.BackColor = System.Drawing.SystemColors.ControlLight; - this.ClientSize = new System.Drawing.Size(1039, 538); - this.Controls.Add(this.ContentPanel); - this.Controls.Add(this.SidebarPanel); - this.Controls.Add(this.HeaderPanel); - this.DoubleBuffered = true; - this.Font = new System.Drawing.Font("Century Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; - this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.Name = "TestForm"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "TestForm"; - this.Click += new System.EventHandler(this.TestForm_Click); - this.SidebarPanel.ResumeLayout(false); - this.HeaderPanel.ResumeLayout(false); - this.HeaderPanel.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pbMinimize)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.pbMaximize)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.pbClose)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.pbIcon)).EndInit(); - this.ResumeLayout(false); - - } - - #endregion - - private UI.ElipseComponent elipseComponent1; - private System.Windows.Forms.Label lblTitle; - private System.Windows.Forms.Panel SidebarPanel; - private UI.MoveablePanel HeaderPanel; - private System.Windows.Forms.PictureBox pbIcon; - private UI.HoverPictureBox pbClose; - private UI.HoverPictureBox pbMinimize; - private UI.HoverPictureBox pbMaximize; - private UI.FlatButton btnTabInformation; - private UI.FlatButton btnTabFiles; - private UI.FlatButton btnTabBuild; - internal System.Windows.Forms.Panel ContentPanel; - private UI.FlatButton btnTabRegistry; - } -} \ No newline at end of file diff --git a/UpdateLib/UpdateLib.Generator/MainForm.cs b/UpdateLib/UpdateLib.Generator/MainForm.cs deleted file mode 100644 index 5e39ca6..0000000 --- a/UpdateLib/UpdateLib.Generator/MainForm.cs +++ /dev/null @@ -1,206 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.Collections.Generic; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Windows.Forms; - -using MatthiWare.UpdateLib.Generator.UI; -using MatthiWare.UpdateLib.Generator.UI.Pages; -using MatthiWare.UpdateLib.Tasks; -using MatthiWare.UpdateLib.UI; - -namespace MatthiWare.UpdateLib.Generator -{ - public partial class MainForm : Form - { - private Dictionary pageCache; - private AsyncTask loadTask; - private bool shouldShowNewPage = false; - - public MainForm() - { - InitializeComponent(); - - pageCache = new Dictionary(); - - LoadPagesTask().Start(); - } - - public bool TryGetPage(string key, out PageControlBase page) => pageCache.TryGetValue(key, out page); - - private AsyncTask LoadPagesTask() - { - if (loadTask == null) - { - LoaderControl.Show(ContentPanel); - - Action loadAction = new Action(() => - { - var pageType = typeof(PageControlBase); - var types = AppDomain.CurrentDomain.GetAssemblies() - .SelectMany(asm => asm.GetTypes()) - .Where(type => pageType.IsAssignableFrom(type) && !type.IsAbstract && type.IsClass && pageType != type); - - foreach (Type type in types) - { - var name = type.Name; - - PageControlBase page = Activator.CreateInstance(type) as PageControlBase; - page.TestForm = this; - - pageCache.Add(name, page); - } - }); - - loadTask = AsyncTaskFactory.From(loadAction, null); - - loadTask.TaskCompleted += (o, e) => - { - LoaderControl.Hide(ContentPanel); - - btnTabInformation.PerformClick(); - }; - } - - return loadTask; - } - - private void TestForm_Click(object sender, EventArgs e) - { - WindowState = (WindowState == FormWindowState.Maximized) ? FormWindowState.Normal : FormWindowState.Maximized; - } - - private void pbMinimize_Click(object sender, EventArgs e) - { - WindowState = FormWindowState.Minimized; - } - - private void pbMaximize_Click(object sender, EventArgs e) - { - MaximumSize = Screen.FromControl(this).WorkingArea.Size; - WindowState = (WindowState == FormWindowState.Normal ? FormWindowState.Maximized : FormWindowState.Normal); - } - - private void pbClose_Click(object sender, EventArgs e) => Close(); - - private void flatButton1_Click(object sender, EventArgs e) => LoadPage(nameof(InformationPage)); - - private void flatButton2_Click(object sender, EventArgs e) => LoadPage(nameof(FilesPage)); - - private bool LoadPage(string pageName) - { - loadTask.AwaitTask(); - - bool success = TryGetPage(pageName, out PageControlBase page); - - if (success) - { - shouldShowNewPage = true; - - if (page.IsPageInitialized) - { - AddControlToContentPanel(page); - } - else - { - AddControlToContentPanel(null); - - LoaderControl.Show(ContentPanel); - - page.InitializePage((o, e) => - { - LoaderControl.Hide(ContentPanel); - - if (e.Cancelled) - { - ShowMessageBox( - "Page Load", - "Task cancelled", - "The loading of the page got cancelled.", - SystemIcons.Warning, - MessageBoxButtons.OK); - - return; - } - - if (e.Error != null) - { - ShowMessageBox( - "Page Load", - "Error occured when loading the page", - "Check the log files for more information!", - SystemIcons.Error, - MessageBoxButtons.OK); - - return; - } - - AddControlToContentPanel(page); - }); - } - } - - return success; - } - - private void ShowMessageBox(string title, string header, string desc, Icon icon, MessageBoxButtons buttons = MessageBoxButtons.YesNo) - { - MessageDialog.Show( - this, - title, - header, - desc, - icon, - buttons); - } - - private void AddControlToContentPanel(Control toAdd) - { - if (!shouldShowNewPage) - return; - - ContentPanel.SuspendLayout(); - - ContentPanel.Controls.Clear(); - - if (toAdd != null) - { - toAdd.Dock = DockStyle.Fill; - ContentPanel.Controls.Add(toAdd); - - shouldShowNewPage = false; - } - - ContentPanel.ResumeLayout(); - - } - - private void btnTabBuild_Click(object sender, EventArgs e) - { - LoadPage(nameof(BuilderPage)); - } - - private void btnTabRegistry_Click(object sender, EventArgs e) - { - LoadPage(nameof(RegistryPage)); - } - } -} diff --git a/UpdateLib/UpdateLib.Generator/MainForm.resx b/UpdateLib/UpdateLib.Generator/MainForm.resx deleted file mode 100644 index f6759bb..0000000 --- a/UpdateLib/UpdateLib.Generator/MainForm.resx +++ /dev/null @@ -1,202 +0,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 - - - - - iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAfpJREFUWEft - 1ctLFVEAx/GJjB5UZGkPopAWYYG1cO+/oP4BbiMkLagEV27qP+gPyb3to8iKSlFX4kIUNTUz6KXf7zgH - LsPcuo8zBHF/8GFmzpw758ycx01a+d9yAt0Hp2mu4vDBafm5hc/4lF4lySHMYAnXLSg7bVjFd2xmfmEZ - pX6F27CBCdjgXo5lIziCHkRNJ77BN/+dnT/ARVzGY/zED6xjA8cRLb2YhY37tsPI5ym8ZyecEzcQNY69 - b6mjFuTSBTvgXCglf+vAFdiBlfQqcm5iDs58GxlCPk/gPYdpEs6bhuODFOKEcmLJ8m04D47hFMbg2LsS - 7OQial6SPiDf23wHTB/O4hnC/bxxXIJ1a8o5TGMe1/AI7xDG+i0ewglmnTdwt/Mtd+Fy9Oj1GpwndcU3 - /wB7/yU7FtnJjnbO8bfh5wj5CLdnt+m6cwFbsAEn2gA6MoNYgPescx7GofCrhPjH5B9UQ7kHG3CjOWNB - Lu2wY9a5b0HsvIIP70+viuOXsM7L9CpSfKCcbB5dDdVyGtYJW7GaTnhQ6MBJVEspHQj5Z0MQUs8kHLUg - dlxObiY2EJah88HPXrkMXfuVSy9KXOvvYQNhsynyNTta199Ei5vHC7yGm8zd7NzJJs/vwB3T8yk0vOFU - S61/Rtb501KNmqIOtNJKE0mSfboRqJMj/kopAAAAAElFTkSuQmCC - - - - - iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAUhJREFUWEft - lj1KA1EUhUdJb6VuwEpBXIOlK7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GgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABGdBTUEAALGPC/xhBQAAAN9JREFUSEvt - VTkOwjAQzA/gBRQ8hOs/CERDm5Jn8MK4sBO7g11pLY20TrSO24w08ioz40mR2N2GKjjn9jHGcwuHYdjJ - dhre+9s4jr8WUslJttPIBdM0PWi+1pAyL3PBomkGpiyaUkpHequPheytLqD5wrOF7F1dwKvICujBrMga - aMrhEMKX1r5E0doKLGwq4FVkBfRgVmQNNGFYZAX0YFZkDTRhWGQF9GBWZA005bCFqwqIB/pK3hayt7pA - HplRVUC//52MxeN4jpR5mgtauFjAFw6VFI9jKxcvnA0aXfcH9fiuLoI2qioAAAAASUVORK5CYII= - - - - - iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABGdBTUEAALGPC/xhBQAAATNJREFUSEvt - lc1qwkAUhVO79ocudOOzVPR9SqWbbtNi60YUXLizLvs6voHbQkhCyN8yPXc4EUJimMxs/eDg3Js75zhR - EudOJ8IwHOV5PrNREARD2tWJ43iRpmlhI4Q8065OGZBl2SvW8y7CnjftgNahG2jtbRryfX/AZYWiKB48 - z+uzNAtAPUZ9gVw1QMQcvT10LkOMT4B6JT3c443UMO+hPkoP+lRDwDhAQO9L+kmSbPFZmn/wssIqQED/ - m8Y1c8EqgLflh+bqJLx0xTiA5ieau5A6CUJ2HFEYBcD8EUa/NHxXQwA/+LoMkX+U9IwCYDRF/SeGaoCI - KfoH6BJF0ZP0jAIEfMsJlxUkBPNjluYBunQKwC15wWDj4/iWsGepHWCj1gB54SCk8XGsq9YXzp06jvMP - ywAf8wYrhBkAAAAASUVORK5CYII= - - - - - iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAmxJREFUWEft - ljuLFEEUhUdUWNBATXzjnzEUFMUHJiImq4hipIIogomKGomYmGhiJLK+138giOIDVxE0E9dlHjuzMz06 - e/2qOdXWzmxPVycLwhw4dPetc+6tqa7pupURRiiDVss21jt2rNax5/AjnK61bYbrl2rHJmqJnZ2Zs62S - D4DxM7otB5Juocht2IVWwN/VxO5Ot2yT7CmIX3bjeowHyXZjbCq5Zwe+hi/hJKvwimsCQ03DeV0O7q/4 - eJo0FizrKUzz3gzfsYz7f5qtliSDmY3VEzuI50Og7/HKXgTP8RNg9jtdAhl77v1RZLmGc4FmJRM5j+eP - vAso2XD8mrPNiBsyueJ7NBQNJvHYFw2p4eGg4B1vINE5haPBsl8Li4aUJB/Vtm1D6JdviiVdoaEoUPy6 - L7YYJcsHCU54MZM5pHAhmOgyvDfCYotR8nwgeipxt2q2RuFC/DBbhWd7ESXPB6Ip6CbwRqGlBYVnNYEn - Cv3/4Mf419pQaGlB4beawCeF8sE3YG8hzdZKXoi62ToKp4cYn+lHCudDM81nYqcljQJ/5cOBf1zhfATi - QZYs7s4FfJ/l77p+QkP5yIr1s2RxB379xSDHTYWHIzD8Y9vuazgaeI7g9Ud5rdm0DRoajqzoQs6T8FLM - uYBmDP3VwNtrdGyHhosRGI1v+0OuWUPC83tOxwOuiOQZtNvH4Xevhz12/klJ4pCZ9c657uPZfx09E7Vh - k9C1Za496+8XZ2lqdqVJyyA1920415Syoe4xFtOUOs0t19TIXg4s8QXdDoCNtJ7XcJwCD+A36BpR16B+ - hc/g0ejNNsIIKSqVv+0vKJgA+u+XAAAAAElFTkSuQmCC - - - - 17, 17 - - \ No newline at end of file diff --git a/UpdateLib/UpdateLib.Generator/Program.cs b/UpdateLib/UpdateLib.Generator/Program.cs index 5b2e883..90aba91 100644 --- a/UpdateLib/UpdateLib.Generator/Program.cs +++ b/UpdateLib/UpdateLib.Generator/Program.cs @@ -15,9 +15,7 @@ * along with this program. If not, see . */ -using MatthiWare.UpdateLib.Logging.Writers; using System; -using System.Windows.Forms; namespace MatthiWare.UpdateLib.Generator { @@ -29,11 +27,7 @@ static class Program [STAThread] static void Main() { - Updater.Instance.ConfigureLogger((logger) => logger.Writers.Add(new ConsoleLogWriter())); - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new MainForm()); } } } diff --git a/UpdateLib/UpdateLib.Generator/Properties/Resources.Designer.cs b/UpdateLib/UpdateLib.Generator/Properties/Resources.Designer.cs deleted file mode 100644 index 017ea70..0000000 --- a/UpdateLib/UpdateLib.Generator/Properties/Resources.Designer.cs +++ /dev/null @@ -1,163 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace MatthiWare.UpdateLib.Generator.Properties { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // 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")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MatthiWare.UpdateLib.Generator.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap cross { - get { - object obj = ResourceManager.GetObject("cross", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap folder_transparent_16px { - get { - object obj = ResourceManager.GetObject("folder_transparent_16px", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap gears { - get { - object obj = ResourceManager.GetObject("gears", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap image_transparent_16px { - get { - object obj = ResourceManager.GetObject("image_transparent_16px", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap loading { - get { - object obj = ResourceManager.GetObject("loading", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap loading_gear { - get { - object obj = ResourceManager.GetObject("loading_gear", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap project_16px { - get { - object obj = ResourceManager.GetObject("project_16px", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap reg_bin_16px { - get { - object obj = ResourceManager.GetObject("reg_bin_16px", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap reg_string_16px { - get { - object obj = ResourceManager.GetObject("reg_string_16px", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Registry_Editor_32px { - get { - object obj = ResourceManager.GetObject("Registry_Editor_32px", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - } -} diff --git a/UpdateLib/UpdateLib.Generator/Properties/Resources.resx b/UpdateLib/UpdateLib.Generator/Properties/Resources.resx deleted file mode 100644 index d5f13cd..0000000 --- a/UpdateLib/UpdateLib.Generator/Properties/Resources.resx +++ /dev/null @@ -1,151 +0,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 - - - - ..\Resources\loading.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\gears.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\folder_transparent_16px.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\loading_gear.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\image_transparent_16px.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\cross.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\project_16px.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\reg_bin_16px.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\reg_string_16px.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\Registry Editor_32px.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - \ No newline at end of file diff --git a/UpdateLib/UpdateLib.Generator/Properties/Settings.Designer.cs b/UpdateLib/UpdateLib.Generator/Properties/Settings.Designer.cs deleted file mode 100644 index 58bfc72..0000000 --- a/UpdateLib/UpdateLib.Generator/Properties/Settings.Designer.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace MatthiWare.UpdateLib.Generator.Properties { - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default { - get { - return defaultInstance; - } - } - } -} diff --git a/UpdateLib/UpdateLib.Generator/Properties/Settings.settings b/UpdateLib/UpdateLib.Generator/Properties/Settings.settings deleted file mode 100644 index 3964565..0000000 --- a/UpdateLib/UpdateLib.Generator/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/UpdateLib/UpdateLib.Generator/Resources/Registry Editor_16px.png b/UpdateLib/UpdateLib.Generator/Resources/Registry Editor_16px.png deleted file mode 100644 index c98ba682f74a8e9c8487807d821aef264c2c6b28..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 342 zcmV-c0jd6pP)PyvU_Y<%c87Lrim6W#2nvX>?$Dh;E70U8Kj{E_-zb1@$9=JXjNf o7WG={9qT3VE+sk7%#nYmFYQ)1@8QzLGynhq07*qoM6N<$f(Yu9{Qv*} diff --git a/UpdateLib/UpdateLib.Generator/Resources/Registry Editor_32px.png b/UpdateLib/UpdateLib.Generator/Resources/Registry Editor_32px.png deleted file mode 100644 index edcd6f81df4b24e5a6ed481944d57df3a520f616..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 569 zcmV-90>=G`P)+l@zRsA7^Z*T#1ScWL;JYrAf_=w3lI0X;+ON{w2xzf+W^~yY9@)x+d z-`pD*p#B&_(Ay%`z+6Z(SxaVAO_msRBO~dRx_KUg{&*vrlV-A(%&3|?WAF^lVGvX= zj}7pEAB|{En#o!+@+JU%h(+8S{dPQdyfaRJQpV7Zv`HqiICaKtv|krnC}prUtE zbiEL9IBib74=h-JCyu~%y~h}X2T)0Mri75mS~MQ=n1C8w*JBL-Jnj8S{uy3DDLE|Z zkhP@VP5E0)`~Ekgx$IF-K_NL%hIG>n3TG#YuVEg3gWf8!kZdkP+_XQ0;6JH9#2$#+ zCUL(v#6q%J(q?OE<;}2Y&nD5|2_d}Xp?6G-9%*YiAZeGiwDNXYv`0MfEA=8+e<2o@ z1CkC{ODpdwi|=3u>`fUBB|hn3)x3}MrePlrpaz9i_0V)K9@a%N0HqW+N{8;^rTaAH zzFm`X-$mPBpqBHEz3!Z)!gk)?O&hfR2AbZcQ*>^i9XD_ZM=9n!IB_Zn00000NkvXX Hu0mjf-ev*> diff --git a/UpdateLib/UpdateLib.Generator/Resources/cross.png b/UpdateLib/UpdateLib.Generator/Resources/cross.png deleted file mode 100644 index ecbd604965bfe5179caa0a005a97cfa6b9b50ec3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 912 zcmV;B18@9^P)F7{`yK0V=d$TiSY2XvE5`aId!oK9m-MmRoAuWLY}N5MwluX_%m)ya;H~7!;I9 zG#XvV68B;6$+FCC*{98z=%#Lx857Y)5ap#HZE3wNwKaWw(wJy``6d6HJkNQ4Ip^F< z9yB(t`p;q+xx0Duy>krXVI-1V@*c*G#+>Pzn!ZJ=)%z{O41KOtD$2#;738+nI{cuk zOPCoRhR1Gq_yo%yZ_dw`yeS7wCh0?)ttZgi8;*^Pz*1XVdE25 z@WkT*|KK3_+S``~H*Gp8OH0ck$e3QAD>xjUr(IpogrOmb_V+`wvlITWs+u#2L`~!i zh8dXJy?c57;6a${?S=5MV=&#?8g$e2(a&;nD12H6ba#iAupjH|gQVLHV@_vuTVCGf zOhRm=AUk{2QJwD8?9QFh;DH0M(9r>rLx*6psmXuK;kZ86(lQf6dAX+tVE=x&ZMR2k zGTBcAWsH;%L@5%aoiug!b%725>NnCoQ+NL8!SIgoXx)yIje!+S-UyrTQ5a z9+OGlLeZ(w9Pw`5Iv;X6!EZ7_u%rZ*C<+9X3a%6t1?uGT?{KablTO~pKvh-24VJwT zl*?g3B!YQDAczTPXTz5?Jx;0B+sKE&54GC2efz*8it_oeT*L%kt@C0r+@AFHAxNmc{?bBW zA^2X&36v-F`gjw|{=%(aziXtj^5QJVMQ^32!>_o171w)ZW$~}A*3lBBavc$P-oKcZ zmb!Kf~7%YUK#JLUb-F~iUVn3qRN6?|&E~v6?Dnr_ zc|Po^sQ4RY7dm3{7L{6U!H+!ujkm5Y-pR86=1QfXVq2El?60m~SC7|GWMzGlYJLD) mQIXC?)7>hGWEYllg1iLx?{j!Py0k6;0000Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D02y>eSaefwW^{L9 za%BK;VQFr3E^cLXAT%y8E-^DS16z6k00AUPL_t(IPmPjEPQySDMRPgE7{QV&u;m5_ zF$n|$Ay5zq1SbiEc}k9e@o0yj*wJwhO>@_~uANUkS_1-fG& z_%~dmRU0L6z(ku;s(D%CELnZgN^*fV%mvfju&4jLE#Z>UH%*g`(=1 eou)P?7^Oev)Ia1+K1=NY00009<7rA diff --git a/UpdateLib/UpdateLib.Generator/Resources/gears.png b/UpdateLib/UpdateLib.Generator/Resources/gears.png deleted file mode 100644 index f0fc2163923b7f72feecd3763e3299697cb1d607..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 446 zcmV;v0YUzWP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D02y>eSaefwW^{L9 za%BK;VQFr3E^cLXAT%y8E-^DS16z6k00AyZL_t(IPnFZlD@0KM$MK88U?rhurHE`u zv6F>{HU9v4`~@~j7Iyvs{t*9(4N53QA@5g_*Y|txoN3Cv)16;^ntRSY=bq<8b!M#m zJBr5SF@M_dh6DVdAGuS)CC;&qecWIfxzdVzEXAcLn#3=PaVaGem`WbwOye7S=)(^D zz$z-~h8t7B1zypG2Dsi?e87%cKqun#;0nihL}>JmLp);$+Ze|dI#5XyP7yjf`cqZ; z4(-T{Q?ZkcchLerx>>IKL@!b^2am*tFR*in>pz3PWB+}1Wd&==W35EdAKB+m%5=Nk#{d8T07*qoM6N<$f}{hu^8f$< diff --git a/UpdateLib/UpdateLib.Generator/Resources/image_transparent_16px.png b/UpdateLib/UpdateLib.Generator/Resources/image_transparent_16px.png deleted file mode 100644 index 3e26c140daf90a9e7a06563ad80f28f2b47ab3ab..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 484 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1qucLCF%=h?3y^w370~qEv>0#LT=By}Z;C1rt33 zJwsy?=IAP*sUe;&jv*HQy^~KCH93g5{{5`tS9l=7p&^d*Z|5&ya=4MV{l~2w0T#w41|ulGz@!e6#qw(q#|wAG=GlQ=V;A3P$V(&;!yrQlE#{unI)He z{7zQ+mIRxb2O=C5uU*N`clr;EeR%a-C*s#&sK}^*t-SAD+Y3W%$;1naKW{V ztb+*_B94(+a$Kvv?h-4oeQN)M{ruHgK-SL07@>1B7bk7MX>jdKw(-pN`Ejet8MW;H XtaX0-T$L#t7zqrXu6{1-oD!M<*f7VI diff --git a/UpdateLib/UpdateLib.Generator/Resources/loading.gif b/UpdateLib/UpdateLib.Generator/Resources/loading.gif deleted file mode 100644 index 62d8e4e54726c2634af80e1396191c15e645941c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 98823 zcmafaby!=^vv&eX2<{LdKnN~{;9A_>-L25#ZlwwC?of(rTbyF0!L2RQLZQW7S_-rj zsO9B*-}}4rKKFU={&RNs%}e{mu;xc)8N^>19&BJRx*j=uu8 za*E4-i(5Ox-EG88?&GBEaeA$|uh+P`W!!CH!x8JNnVP658LEj0qVRzL0N}REQqK^f z>J;R3dzDiN^K)`};1+~%cDv{4a~Juw{}mG9>3SDwA+Cqg^HXv2@YIY5a5IU}H+6}4 z;3DmcRFFr=g~^0@`+2(sIU&Nly?g>?!tNrSTz#G0WNz#KbPFL7|3(t@;4V_>pBspO zWUBZExFN&^QFmNW62b@xF+pK5l(d+%073*Mj1m$S5kg7c5k|>~OUj^x5&vG0x6%S! z-DQkb)&E`AZR;-5BPhsEMo1_$G*mEDRM0ozo{+G#w6qXPL`X#B&Mn2Az;K@+r?5Ld zf$aYpLDenLCBV}!$kW#c@z01(&c4AxcagW6{$CTk{q*$yV_=^^!GAMI(8bqVD9p)E zNLUahZh^kR0WNO0qpMcJm3+QoW13?GbeKbd?d85K}@)i3m%pN~sD9tBFb}OQV$3#g$OvYU0w$Qj-7T z)$$1pa`JI;`xme0fAXUKzq~Rk0d7t~z5%AbzFz-YJwp%QAm2a_Uq6J3iMXIJ!ot(X z)i*Top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hv4^3wa z>|vV?aKk3WJXfbkMf*IrU=UucVQb3;vhT!mDsAkYtsR#N^!u%CZ}O@7;H7be+|4#! zuAH43GBrf-zZEisGugN~YhSCvIA)s!4;$LbqEQ|h$9|jJ7T9M7e-4yQad6S_C1deO hQ7LIj8Z*0sTks~3^G#ggFoQMY8783ce{zh%{{bQyG4%id diff --git a/UpdateLib/UpdateLib.Generator/Resources/loading_gear.gif b/UpdateLib/UpdateLib.Generator/Resources/loading_gear.gif deleted file mode 100644 index fef4ec0a9d9b1cda3d973b603e57ef3ecfeb78d9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 73023 zcmd?xbx<2>yEgg?PzX|jyIb+nqNRcacXtTxR@^-ySa5fD_X4H36}J|5cc-wvtkwOl zz0Y^{dC&f2pZ(38d!7k1A<2K4$#1Ufe#9lk`1ry7Px_x+KlyW>K7IP^*|X=*pCch5 zAtNKBprE{X@d6bU6%7py005w)qhnxTU}9ooVPU;|`4Sr&8wdpA;Nalm;^N`q;p5{I z5D*X&5)u&+5fc-WkdTm)l9G{;k&}~CP*6}(Qc_V-QBzaX(9qD*($dkFDU_{*RB|f7l+&zTUc0FSy?$cI=Z^LdU<*I`S}G0 z2SXqb7z`E>5fL37osf`_oSdARnwpW3k)54gP*6}@TwGRGR#8z=UR|Bn+LF-K88kFt zIX$lYb4KZ(pM_bae|nS`W>pqu)fQ&e7iKjU<}?@Pv=-;I7w2>q=kylm4VQixE&VWE z{%NuN(`seGW@W*4Wx;M`(SCK&adq+Y>XP%?lIz;C``WVC`ik%RO33C~*w%XF)_U~z zM(oaJ{LW_5?pDg~R@&}X`rdZN-geIZPQm_e>A_yb;a=6ze(ljg{qaH5@nPHXVdv37 z_rdmR6mHD;RpBwATTU%>;d+WzXYiFn1XJ?1!=O>7BadCEe zd3}9-cX#*e*RRKa%){g3{o~{9!^6$P!_}`}m;X2yzkdBbh$pWf9uTiVyz;-BKmKmDy$nydsAYY2J}47`ZeDt9Us* zHwyY4C{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4QR2&6xpj8$p*6KbYRZE5lG-)POUK>>KMvlDhKrWxL=SNlE~{US zE-}dMz%#U#jk4{VN@}AYo!nci=a99r!L)61dJ1rrY=Sy5T>1+!`4N%Q-mLLW*7-SY z2TV)Tp+#O$W%>ItdGey62M)E*!X8Fyvd@PVR4359)KKB~kx2{zp z!U6Qtf_7K*BZOciD}Ib!yP{!9fx*E772U2ZJAp?-;;7`&tW87A&$*;uLa=VyIVaq( zRSA}(_(}(`{cG8;-g6Gg@DmN?Lb=fxf?2#f2e3D8|CdlQ=x299Jkp<+D+&j~l2Ydp z!XdU4`MJ%Meg)?%b=_MF!Oa{dXL8OPexHjEgs60p6eYl+2<|X!`E&qmrLgj_O|N!*x-%KP09c-+flkn zqQ8DgjyShy8cC3cmS_@7;w3E)+&lFi{#1BSQU}3$to8XZ_P4bZyy0ymYqR{-+4G0b zSJw-FFB&}L zr}r4FD&94URnc?zP*z+?AL-OjHnTiG^F=fil>gqjjcS@!glXGK92wS_@@@G>p|p1G zOYj*TQX)M-GUTnqu|d)u+h#y5ncoWy|1(V;fpbf+mgf~4;R;LvNUTj$eDUFgF{$cr zn*0hd-|#KGyjgIhEhUsl(Q(xYA`sPMAq(y)^zxAn#JBcYOR*)EBOE{T%Z~GZP!x>c z67(0;npGF{V2n>;d`N0X*_n?Qo!Oc)?QW&V`0lX}YNFN^5$WAsepodI}G;xVk-j4*I`}?Nh zORs_~URv~vhd~sz?xrM=jay<> z&oIm&-*;XyvS8>|DCkTV>-3g*+{>G+Hu4Qx^pzK=Ecbmz8fa$GvvM((h3{2vrzScj ne6YkBBmG^ObBJOoVX}!XuvvRWLHOYLga7;bzu&-r^$q+t0||%G diff --git a/UpdateLib/UpdateLib.Generator/Resources/project_16px.png b/UpdateLib/UpdateLib.Generator/Resources/project_16px.png deleted file mode 100644 index 25fe53638760c704f3418e4eba29e18e92140f68..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 244 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt^DJzX3_ zECi1R9uz!ez!SXSuz`?|aJkI32EiFCPGtH%*&WB%=Uy77a@+GCY;=hC=^8;`1(tCCNR6^{wxE0GE#x_SCe{z$LSF+fzdfRu-U6Hl+s_Qzw p3#OlR-?k~z0#LT=By}Z;C1rt33 zJwr2>%=KS^icWgEIEGmGFP(In_mBaPgR$UggUG(f#haH{Zg2_YpYo@Z*Kclvg6On) zPvYlScU*{iuI!;%%<0IH%wy7)6novqH&|KlvyHQ%jDm)uM^n=jp(3kzt=j$~0Re@T zO?4lm<&w`_PyOl75W;Ah(Ww7%)+d1(4&sg+{{&R(IZI^Uh~JuXz2UoDCD*CPAMPps zJ`@qhdd{+?ZLy_rM2h@2%k`D~tX?a98qP#n^Kd<|6jIsrE$$)vubZ0#LT=By}Z;C1rt33 zJwr2>%=KS^ijI4_IEGmG&zpLrt8GgcaP0X$U4W^aQ!Hbxu)@sZcLq8q@)t2oEY5FJ(w~ri#LeNsamHJxjVJXy i?!GDdhj|j~Tsy{xvCsOg)Ej|bV(@hJb6Mw<&;$VMH+)0@ diff --git a/UpdateLib/UpdateLib.Generator/Tasks/LoadDirectoryTask.cs b/UpdateLib/UpdateLib.Generator/Tasks/LoadDirectoryTask.cs deleted file mode 100644 index 2177efb..0000000 --- a/UpdateLib/UpdateLib.Generator/Tasks/LoadDirectoryTask.cs +++ /dev/null @@ -1,104 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.Drawing; -using System.IO; -using System.Windows.Forms; - -using MatthiWare.UpdateLib.Tasks; -using MatthiWare.UpdateLib.UI; - -namespace MatthiWare.UpdateLib.Generator.Tasks -{ - public class LoadDirectoryTask : AsyncTask - { - public ListView ItemsListView { get; set; } - public ImageList IconList { get; set; } - public DirectoryInfo DirectoryPath { get; set; } - - public LoadDirectoryTask(ListView lv, ImageList iconCache, DirectoryInfo dirPath) - { - ItemsListView = lv ?? throw new ArgumentNullException(nameof(lv)); - IconList = iconCache ?? throw new ArgumentNullException(nameof(iconCache)); - DirectoryPath = dirPath ?? throw new ArgumentNullException(nameof(dirPath)); - - if (!DirectoryPath.Exists) throw new DirectoryNotFoundException($"The directory '{dirPath.FullName}' was not found."); - } - - protected override void DoWork() - { - BeginUpdate(); - - Clear(); - - foreach (DirectoryInfo subDir in DirectoryPath.GetDirectories()) - { - ListViewItem item = new ListViewItem(new string[] { subDir.Name, subDir.LastWriteTimeUtc.ToString(), subDir.FullName }); - item.Tag = subDir; - item.ImageKey = "folder"; - - AddItem(item); - } - - foreach (FileInfo file in DirectoryPath.GetFiles()) - { - ListViewItem item = new ListViewItem(new string[] { file.Name, file.LastWriteTimeUtc.ToString(), file.FullName }); - item.Tag = file; - - if (!IconList.Images.ContainsKey(file.Extension)) - IconList.Images.Add(file.Extension, Icon.ExtractAssociatedIcon(file.FullName)); - - item.ImageKey = file.Extension; - - AddItem(item); - } - - SetColumnAutoSize(0); - SetColumnAutoSize(1); - SetColumnAutoSize(2); - - EndUpdate(); - - } - - private void SetColumnAutoSize(int clmn) - { - ItemsListView.InvokeOnUI(() => ItemsListView.Columns[clmn].Width = -1); - } - - private void EndUpdate() - { - ItemsListView.InvokeOnUI(() => ItemsListView.EndUpdate()); - } - - private void BeginUpdate() - { - ItemsListView.InvokeOnUI(() => ItemsListView.BeginUpdate()); - } - - private void Clear() - { - ItemsListView.InvokeOnUI(() => ItemsListView.Items.Clear()); - } - - private void AddItem(ListViewItem item) - { - ItemsListView.InvokeOnUI(() => ItemsListView.Items.Add(item)); - } - } -} diff --git a/UpdateLib/UpdateLib.Generator/Tasks/UpdateGeneratorTask.cs b/UpdateLib/UpdateLib.Generator/Tasks/UpdateGeneratorTask.cs deleted file mode 100644 index 5b1e3b7..0000000 --- a/UpdateLib/UpdateLib.Generator/Tasks/UpdateGeneratorTask.cs +++ /dev/null @@ -1,158 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading; - -using MatthiWare.UpdateLib.Common; -using MatthiWare.UpdateLib.Files; -using MatthiWare.UpdateLib.Generator.Data.FilesPage; -using MatthiWare.UpdateLib.Generator.UI.Pages; -using MatthiWare.UpdateLib.Security; -using MatthiWare.UpdateLib.Tasks; - -namespace MatthiWare.UpdateLib.Generator.Tasks -{ - public class UpdateGeneratorTask : AsyncTask - { - private delegate void AddDirRecursiveDelegate(GenFolder dir, DirectoryEntry entry); - - private GenFolder baseDir; - - private int total; - private int done = 0; - - private InformationPage infoPage; - - private IList registryFolders; - - public UpdateGeneratorTask(GenFolder dir, InformationPage info, IList registry) - { - baseDir = dir ?? throw new ArgumentNullException("dir", "The directory cannot be null"); - registryFolders = registry; - - total = dir.Count + registry.Sum(g => g.Count); - - infoPage = info; - - base.Result = new UpdateLib.Files.UpdateInfo(); - } - - protected override void DoWork() - { - foreach (GenFolder subfolder in baseDir.Directories) - { - if (subfolder.Count == 0) - return; - - DirectoryEntry entry = new DirectoryEntry(string.IsNullOrEmpty(subfolder.PathVariable) ? subfolder.Name : subfolder.PathVariable); - - Result.Folders.Add(entry); - - AddDirRecursive(subfolder, entry); - } - - Enqueue(new Action(AddRegistryItems), null); - - // Result.ApplicationName = infoPage.ApplicationName; - Result.Version = infoPage.Version; - } - - private void AddRegistryItems() - { - foreach (GenFolder registry in registryFolders) - { - if (registry.Count == 0) - continue; - - DirectoryEntry dir = new DirectoryEntry(registry.Name); - - Result.Registry.Add(dir); - - AddRegistryRecursive(registry, dir); - } - } - - private void AddRegistryRecursive(GenFolder dir, DirectoryEntry entry) - { - List keys = dir.Items; - foreach (GenReg key in keys) - { - entry.Add(new RegistryKeyEntry(key.Name, key.Type, key.Value)); - - Interlocked.Increment(ref done); - } - - if (keys.Count > 0) - OnTaskProgressChanged(done, total); - - IEnumerable dirsLeft = dir.Directories.Where(g => g.Count > 0); - int left = dirsLeft.Count(); - - foreach (GenFolder subDir in dirsLeft) - { - DirectoryEntry dirEntry = new DirectoryEntry(subDir.Name); - entry.Add(dirEntry); - - left--; - - if (left == 0) - AddRegistryRecursive(subDir, dirEntry); - else - Enqueue(new Action(AddRegistryRecursive), subDir, dirEntry); - } - - } - - private void AddDirRecursive(GenFolder dir, DirectoryEntry entry) - { - List files = dir.Items; - foreach (GenFile genFile in files) - { - System.IO.FileInfo fi = genFile.FileInfo; - FileEntry newEntry = new FileEntry(fi.Name); - newEntry.Hash = HashUtil.GetHash(fi.FullName); - - entry.Add(newEntry); - - Interlocked.Increment(ref done); - } - - if (files.Count > 0) - OnTaskProgressChanged(done, total); - - IEnumerable dirsLeft = dir.Directories.Where(g => g.Count > 0); - int left = dirsLeft.Count(); - - foreach (GenFolder subDir in dirsLeft) - { - DirectoryEntry dirEntry = new DirectoryEntry(string.IsNullOrEmpty(subDir.PathVariable) ? subDir.Name : subDir.PathVariable); - entry.Add(dirEntry); - - left--; - - if (left == 0) - AddDirRecursive(subDir, dirEntry); - else - Enqueue(new Action(AddDirRecursive), subDir, dirEntry); - } - } - } -} diff --git a/UpdateLib/UpdateLib.Generator/UI/ElipseComponent.cs b/UpdateLib/UpdateLib.Generator/UI/ElipseComponent.cs deleted file mode 100644 index 938db33..0000000 --- a/UpdateLib/UpdateLib.Generator/UI/ElipseComponent.cs +++ /dev/null @@ -1,135 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.ComponentModel; -using System.ComponentModel.Design; -using System.Drawing; -using System.Runtime.InteropServices; -using System.Windows.Forms; - -namespace MatthiWare.UpdateLib.Generator.UI -{ - public class ElipseComponent : Component - { - #region PInvoke CreateRoundRectRgn - - [DllImport("gdi32.dll", EntryPoint = "CreateRoundRectRgn")] - private static extern IntPtr CreateRoundRectRgn(int x, int y, int width, int height, int curveX, int curveY); - - private static void MakeRound(Form form, int elipse) - { - if (form == null) - return; - - form.FormBorderStyle = FormBorderStyle.None; - Region region = Region.FromHrgn(CreateRoundRectRgn(0, 0, form.Width, form.Height, elipse, elipse)); - form.Region = region; - } - - #endregion - - private int m_radius; - - public int Radius - { - get { return m_radius; } - set - { - m_radius = value; - ApplyRadius(); - } - } - - private ContainerControl m_control; - - public ContainerControl Control - { - get { return m_control; } - set - { - if (m_control != null && m_control is Form) - { - m_control.Resize -= M_control_Resize; - } - - m_control = value; - - m_control.Resize += M_control_Resize; - - ApplyRadius(); - } - } - - private void M_control_Resize(object sender, EventArgs e) - { - ApplyRadius(); - } - - public ElipseComponent() - { - m_radius = 5; - } - - public ElipseComponent(IContainer container) - : this() - { - container.Add(this); - } - - public void ApplyRadius() - { - if (Control == null) - return; - - if (!(Control is Form)) - return; - - MakeRound(Control as Form, Radius); - } - - public override ISite Site - { - get - { - return base.Site; - } - - set - { - base.Site = value; - - if (value == null) - return; - - IComponent rootComponent; - Type serviceType = typeof(IDesignerHost); - IDesignerHost service = Site.GetService(serviceType) as IDesignerHost; - - if (service == null) - return; - - rootComponent = service.RootComponent; - - if (!(rootComponent is ContainerControl)) - return; - - Control = rootComponent as ContainerControl; - } - } - } -} diff --git a/UpdateLib/UpdateLib.Generator/UI/FlatButton.cs b/UpdateLib/UpdateLib.Generator/UI/FlatButton.cs deleted file mode 100644 index 5f10eba..0000000 --- a/UpdateLib/UpdateLib.Generator/UI/FlatButton.cs +++ /dev/null @@ -1,205 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.ComponentModel; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Drawing.Text; -using System.Windows.Forms; - -namespace MatthiWare.UpdateLib.Generator.UI -{ - [DefaultEvent(nameof(Click))] - public class FlatButton : Control - { - private const float PADDING_WIDTH = 0.0625f; - private const float PADDING_HEIGHT = 0.25f; - private const float IMG_SIZE_WIDTH = 0.125f; - private const float IMG_SIZE_HEIGHT = 0.5f; - private const float TEXT_SIZE_WIDTH = 1f - (PADDING_WIDTH * 3) - IMG_SIZE_WIDTH; - private const float TEXT_SIZE_HEIGHT = 1f - (PADDING_HEIGHT * 2); - - private bool mouseInside = false; - - private Bitmap buffer; - - private bool m_activeItem; - - private Color m_backColor; - - public bool ActiveItem - { - get { return m_activeItem; } - set { m_activeItem = value; UpdateBackgroundColor(); } - } - - private Color m_hoveColor; - - public Color BackHoverColor - { - get { return m_hoveColor; } - set { m_hoveColor = value; } - } - - private Color m_selectedColor; - - public Color BackSelectedColor - { - get { return m_selectedColor; } - set { m_selectedColor = value; } - } - - private Image m_infoImage; - - public Image InfoImage - { - get { return m_infoImage; } - set - { - m_infoImage = value; - - Rectangle rect = new Rectangle( - (int)(Width * PADDING_WIDTH), - (int)(Height * PADDING_HEIGHT), - (int)(Width * IMG_SIZE_WIDTH), - (int)(Height * IMG_SIZE_HEIGHT)); - - Invalidate(rect); - } - } - - - public FlatButton() - : base() - { - SetStyle(ControlStyles.AllPaintingInWmPaint - | ControlStyles.UserPaint - | ControlStyles.ResizeRedraw - | ControlStyles.OptimizedDoubleBuffer - | ControlStyles.SupportsTransparentBackColor, true); - - DoubleBuffered = true; - } - - public void PerformClick() - { - OnClick(EventArgs.Empty); - } - - protected override void OnClick(EventArgs e) - { - ActiveItem = true; - - foreach (Control c in Parent.Controls) - { - FlatButton button = c as FlatButton; - - if (button == null || button == this) - continue; - - button.ActiveItem = false; - } - - base.OnClick(e); - } - - protected override void OnMouseEnter(EventArgs e) - { - base.OnMouseEnter(e); - - if (!mouseInside) - { - mouseInside = true; - UpdateBackgroundColor(); - } - } - - protected override void OnMouseLeave(EventArgs e) - { - base.OnMouseLeave(e); - - if (mouseInside) - { - mouseInside = false; - UpdateBackgroundColor(); - } - } - - private void UpdateBackgroundColor() - { - m_backColor = (m_activeItem ? m_selectedColor : BackColor); - m_backColor = (mouseInside ? m_hoveColor : m_backColor); - - - Invalidate(); - } - - protected override void OnResize(EventArgs e) - { - base.OnResize(e); - - buffer = new Bitmap(Width, Height); - } - - protected override void OnPaint(PaintEventArgs e) - { - Rectangle rect = new Rectangle(0, 0, Width, Height); - - buffer = buffer ?? new Bitmap(Width, Height); - - using (Graphics g = Graphics.FromImage(buffer)) - { - g.SmoothingMode = SmoothingMode.HighQuality; - g.PixelOffsetMode = PixelOffsetMode.HighQuality; - g.TextRenderingHint = TextRenderingHint.ClearTypeGridFit; - - g.Clear(Color.White); - - g.FillRectangle(new SolidBrush(m_backColor), rect); - - float imgSize = Math.Min(Width * IMG_SIZE_WIDTH, Height * IMG_SIZE_HEIGHT); - - RectangleF imgRect = new RectangleF( - Width * PADDING_WIDTH, - Height * PADDING_HEIGHT, - imgSize, - imgSize); - - if (InfoImage != null) - g.DrawImage(InfoImage, imgRect); - - SizeF textSize = g.MeasureString(Text, Font, (int)(Width * TEXT_SIZE_WIDTH)); - - float offsetX = ((Width * PADDING_WIDTH) * 2) + imgRect.Width; - float offsetY = imgRect.Y; - - float availableTextWidth = Width - offsetX - (Width * PADDING_WIDTH); - float availableTextHeight = Height - (offsetY * 2); - - float x = offsetX + (availableTextWidth / 2) - (textSize.Width / 2); - float y = offsetY + (availableTextHeight / 2) - (textSize.Height / 2); - - g.DrawString(Text, Font, new SolidBrush(ForeColor), x, y); - - base.OnPaint(e); - e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic; - e.Graphics.DrawImageUnscaled(buffer, 0, 0); - } - } - } -} diff --git a/UpdateLib/UpdateLib.Generator/UI/GradientPanel.cs b/UpdateLib/UpdateLib.Generator/UI/GradientPanel.cs deleted file mode 100644 index c74349a..0000000 --- a/UpdateLib/UpdateLib.Generator/UI/GradientPanel.cs +++ /dev/null @@ -1,134 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.Drawing; -using System.Windows.Forms; - -namespace MatthiWare.UpdateLib.Generator.UI -{ - public class GradientPanel : Panel - { - - public GradientPanel() - : base() - { - - } - - private int m_quality = 100; - - public int Quality - { - get { return m_quality; } - set { m_quality = value; SetGradient(); } - } - - - private Color m_gradientTopRight = SystemColors.Control; - - public Color GradientTopRight - { - get { return m_gradientTopRight; } - set { m_gradientTopRight = value; SetGradient(); } - } - - private Color m_gradientTopLeft = SystemColors.Control; - - public Color GradientTopLeft - { - get { return m_gradientTopLeft; } - set { m_gradientTopLeft = value; SetGradient(); } - } - - private Color m_gradientBottomLeft = SystemColors.Control; - - public Color GradientBottomLeft - { - get { return m_gradientBottomLeft; } - set { m_gradientBottomLeft = value; SetGradient(); } - } - - private Color m_gradientBottomRight = SystemColors.Control; - - public Color GradientBottomRight - { - get { return m_gradientBottomRight; } - set { m_gradientBottomRight = value; SetGradient(); } - } - - protected override void OnResize(EventArgs eventargs) - { - base.OnResize(eventargs); - - SetGradient(); - } - - private void SetGradient() - { - Bitmap buffer = new Bitmap(Quality, Quality); - for (int x = 0; x < Quality; x++) - { - int percentX = (int)(((double)x / Width) * 100); - - Color c1 = GetColorScale(percentX, GradientTopLeft, GradientTopRight); - - for (int y = 0; y < Quality; y++) - { - int percentY = (int)(((double)y / Height) * 100); - - Color c2 = GetColorScale(percentY, GradientTopLeft, GradientTopRight); - - buffer.SetPixel(x, y, DiffuseColors(c1, c2)); - } - } - - if (BackgroundImageLayout != ImageLayout.Stretch) - BackgroundImageLayout = ImageLayout.Stretch; - - SuspendLayout(); - - BackgroundImage = buffer; - - ResumeLayout(true); - } - - private Color GetColorScale(int percentage, Color start, Color end) - { - byte red = GetByte(percentage, start.R, end.R); - byte green = GetByte(percentage, start.G, end.G); - byte blue = GetByte(percentage, start.B, end.B); - - return Color.FromArgb(red, green, blue); - } - - private byte GetByte(int percentage, byte begin, byte end) - { - return (byte)(Math.Round((begin + ((end - begin) * percentage) * 0.01), 0)); - } - - private Color DiffuseColors(Color a, Color b) - { - int red = (a.R + b.R) / 2; - int green = (a.G + b.G) / 2; - int blue = (a.B + b.B) / 2; - return Color.FromArgb(red, green, blue); - } - - - } -} diff --git a/UpdateLib/UpdateLib.Generator/UI/HoverPictureBox.cs b/UpdateLib/UpdateLib.Generator/UI/HoverPictureBox.cs deleted file mode 100644 index 08cfd31..0000000 --- a/UpdateLib/UpdateLib.Generator/UI/HoverPictureBox.cs +++ /dev/null @@ -1,104 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.Drawing; -using System.Windows.Forms; - -namespace MatthiWare.UpdateLib.Generator.UI -{ - public class HoverPictureBox : PictureBox - { - private int alpha = 255; - private bool mouseInBox = false; - private bool mouseDown = false; - - protected override void OnMouseEnter(EventArgs e) - { - base.OnMouseEnter(e); - - if (!mouseInBox) - { - mouseInBox = true; - SwitchBackgroundColor(); - } - } - - private void SwitchBackgroundColor() - { - alpha = (mouseInBox ? 100 : 0); - alpha = (mouseDown ? 150 : alpha); - BackColor = Color.FromArgb(alpha, Color.WhiteSmoke); - } - - protected override void OnMouseHover(EventArgs e) - { - base.OnMouseHover(e); - - if (!mouseInBox) - { - mouseInBox = true; - SwitchBackgroundColor(); - } - } - - protected override void OnMouseLeave(EventArgs e) - { - base.OnMouseLeave(e); - - if (mouseInBox) - { - mouseInBox = false; - SwitchBackgroundColor(); - } - } - - protected override void OnMouseMove(MouseEventArgs e) - { - base.OnMouseMove(e); - - if (!mouseInBox) - { - mouseInBox = true; - SwitchBackgroundColor(); - } - } - - protected override void OnMouseDown(MouseEventArgs e) - { - base.OnMouseDown(e); - - if (!mouseDown) - { - mouseDown = true; - SwitchBackgroundColor(); - } - } - - protected override void OnMouseUp(MouseEventArgs e) - { - base.OnMouseUp(e); - - if (mouseDown) - { - mouseDown = false; - SwitchBackgroundColor(); - } - } - - } -} diff --git a/UpdateLib/UpdateLib.Generator/UI/InputDialog.Designer.cs b/UpdateLib/UpdateLib.Generator/UI/InputDialog.Designer.cs deleted file mode 100644 index 709c5a0..0000000 --- a/UpdateLib/UpdateLib.Generator/UI/InputDialog.Designer.cs +++ /dev/null @@ -1,138 +0,0 @@ -namespace MatthiWare.UpdateLib.Generator.UI -{ - partial class InputDialog - { - /// - /// 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() - { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(InputDialog)); - this.panel1 = new System.Windows.Forms.Panel(); - this.btn2 = new System.Windows.Forms.Button(); - this.btn1 = new System.Windows.Forms.Button(); - this.btn3 = new System.Windows.Forms.Button(); - this.lblHeader = new System.Windows.Forms.Label(); - this.txtInput = new System.Windows.Forms.TextBox(); - this.panel1.SuspendLayout(); - this.SuspendLayout(); - // - // panel1 - // - this.panel1.BackColor = System.Drawing.SystemColors.Control; - this.panel1.Controls.Add(this.btn2); - this.panel1.Controls.Add(this.btn1); - this.panel1.Controls.Add(this.btn3); - this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom; - this.panel1.Location = new System.Drawing.Point(0, 100); - this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(401, 46); - this.panel1.TabIndex = 0; - // - // btn2 - // - this.btn2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btn2.Location = new System.Drawing.Point(227, 11); - this.btn2.Name = "btn2"; - this.btn2.Size = new System.Drawing.Size(75, 23); - this.btn2.TabIndex = 2; - this.btn2.UseVisualStyleBackColor = true; - this.btn2.Visible = false; - // - // btn1 - // - this.btn1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btn1.Location = new System.Drawing.Point(146, 11); - this.btn1.Name = "btn1"; - this.btn1.Size = new System.Drawing.Size(75, 23); - this.btn1.TabIndex = 1; - this.btn1.UseVisualStyleBackColor = true; - this.btn1.Visible = false; - // - // btn3 - // - this.btn3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btn3.Location = new System.Drawing.Point(308, 11); - this.btn3.Name = "btn3"; - this.btn3.Size = new System.Drawing.Size(75, 23); - this.btn3.TabIndex = 3; - this.btn3.UseVisualStyleBackColor = true; - this.btn3.Visible = false; - // - // lblHeader - // - this.lblHeader.AutoSize = true; - this.lblHeader.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblHeader.ForeColor = System.Drawing.Color.MidnightBlue; - this.lblHeader.Location = new System.Drawing.Point(12, 9); - this.lblHeader.Name = "lblHeader"; - this.lblHeader.Size = new System.Drawing.Size(212, 25); - this.lblHeader.TabIndex = 2; - this.lblHeader.Text = "Version 1.0.0.0 available"; - // - // txtInput - // - this.txtInput.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.txtInput.Location = new System.Drawing.Point(17, 52); - this.txtInput.Name = "txtInput"; - this.txtInput.Size = new System.Drawing.Size(366, 22); - this.txtInput.TabIndex = 0; - this.txtInput.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtInput_KeyDown); - // - // InputDialog - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.AutoSize = true; - this.BackColor = System.Drawing.SystemColors.Window; - this.ClientSize = new System.Drawing.Size(401, 146); - this.Controls.Add(this.txtInput); - this.Controls.Add(this.lblHeader); - this.Controls.Add(this.panel1); - 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.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "InputDialog"; - this.ShowIcon = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Message Dialog"; - this.panel1.ResumeLayout(false); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.Panel panel1; - private System.Windows.Forms.Button btn3; - private System.Windows.Forms.Label lblHeader; - private System.Windows.Forms.Button btn1; - private System.Windows.Forms.Button btn2; - private System.Windows.Forms.TextBox txtInput; - } -} \ No newline at end of file diff --git a/UpdateLib/UpdateLib.Generator/UI/InputDialog.cs b/UpdateLib/UpdateLib.Generator/UI/InputDialog.cs deleted file mode 100644 index 9610f66..0000000 --- a/UpdateLib/UpdateLib.Generator/UI/InputDialog.cs +++ /dev/null @@ -1,108 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System.Windows.Forms; - -namespace MatthiWare.UpdateLib.Generator.UI -{ - public partial class InputDialog : Form - { - public string Header - { - get { return this.lblHeader.Text; } - set { this.lblHeader.Text = value; } - } - - public string Input - { - get { return this.txtInput.Text; } - set { this.txtInput.Text = value; } - } - - public InputDialog() - { - InitializeComponent(); - } - - public InputDialog(string title, string header, MessageBoxButtons buttons = MessageBoxButtons.YesNo) - : this() - { - Header = header; - Text = title; - - SetUpButtons(buttons); - - txtInput.Focus(); - } - - private void SetUpButtons(MessageBoxButtons buttons) - { - switch (buttons) - { - case MessageBoxButtons.OK: - default: - SetUpButton(btn3, "OK", DialogResult.OK, true); - break; - case MessageBoxButtons.OKCancel: - SetUpButton(btn2, "OK", DialogResult.OK, true); - SetUpButton(btn3, "Cancel", DialogResult.Cancel); - break; - case MessageBoxButtons.AbortRetryIgnore: - SetUpButton(btn3, "Ignore", DialogResult.Ignore); - SetUpButton(btn2, "Retry", DialogResult.Retry); - SetUpButton(btn1, "Abort", DialogResult.Abort, true); - break; - case MessageBoxButtons.YesNoCancel: - SetUpButton(btn3, "Cancel", DialogResult.Cancel); - SetUpButton(btn2, "No", DialogResult.No); - SetUpButton(btn1, "Yes", DialogResult.Yes, true); - break; - case MessageBoxButtons.YesNo: - SetUpButton(btn3, "No", DialogResult.No); - SetUpButton(btn2, "Yes", DialogResult.Yes, true); - break; - case MessageBoxButtons.RetryCancel: - SetUpButton(btn3, "Cancel", DialogResult.Cancel); - SetUpButton(btn2, "Retry", DialogResult.Retry, true); - break; - } - } - - private void SetUpButton(Button button, string text, DialogResult result, bool defaultButton = false) - { - button.Text = text; - button.DialogResult = result; - button.Visible = true; - - if (defaultButton) - button.TabIndex = 0; - } - - private void txtInput_KeyDown(object sender, KeyEventArgs e) - { - if (e.KeyCode == Keys.Enter) - { - if (btn1.Visible) - btn1.PerformClick(); - else if (btn2.Visible) - btn2.PerformClick(); - else if (btn3.Visible) - btn3.PerformClick(); - } - } - } -} diff --git a/UpdateLib/UpdateLib.Generator/UI/InputDialog.resx b/UpdateLib/UpdateLib.Generator/UI/InputDialog.resx deleted file mode 100644 index 9fe1da0..0000000 --- a/UpdateLib/UpdateLib.Generator/UI/InputDialog.resx +++ /dev/null @@ -1,306 +0,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 - - - - - AAABAAIAMDAAAAEAIACoJQAAJgAAABAQAAABACAAaAQAAM4lAAAoAAAAMAAAAGAAAAABACAAAAAAAAAk - AAASCwAAEgsAAAAAAAAAAAAA////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8ANJtQDDOYTkgxlEx2MZJLojCQSs0wkEr0MJBK4zCR - SsswkUuyMZJLmTGTTIAylk1fNJtQDP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AACEIy0UgTKaIIM89iuDQv8pgkD/JoI//yWF - QP8liUD/JYdA/yWHQP8mhED/JoI//yiBP/8qg0H/IIM89hSDM5kAhCMs////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wAAfB9RE30xxxt7Nv8kfjz/IYU8/yWP - Q/88oFb/VKxs/2e2ff9yvIf/abZ+/2K0ev9asXL/VK1t/02pZv82mFH/JYZA/yZ/Pf8bezb/En0wxwqD - K1sAgyMG////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8AAIUjFBN/Ma4ZdzT/In06/x6G - Ov9MqGP/iMaZ/6XUsv+cz6r/lMuk/43Hnf+JxJn/hMKU/4DAkv99vo3/ebyL/3a7if90u4f/abd//0+p - Zf8zkE3/JX49/yd8Pv8ggzrTDYsvIf///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8AMZRMiwCEIw7///8A////AP///wD///8A////AP///wD///8A////AP///wAJgClUHX037iF3 - OP8jiT//YrZ6/57Qq/+l07L/mc2n/5DIoP+KxZr/hsOX/4LBk/9+v4//er2M/3a7iP9yuYX/breC/2q1 - fv9ms3v/ZLJ5/2KyeP9hs3f/WrBy/zqYU/8nez7/HXw38wiCKUv///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8ALYZF/x58OO4WhzVpAIUkAv///wD///8A////AP///wD///8AAIQjAxN/ - MaEXci//Hno2/z6eWP+i06//p9Sz/5vNqf+TyaL/jsee/4vFmv+IxJn/hsOW/4PBlf+AwJP/fL6O/3a7 - iv9xuIT/a7Z//2aze/9isXf/Xq90/1qtcP9Wq23/VKps/1Ora/9Colv/J30+/xp1M/0VgjGDAIQjAf// - /wD///8A////AP///wD///8A////AP///wD///8ALIRE/yd3PP8mdjv/HX031AmBKkH///8A////AP// - /wANiy8EH4M7ryFyNv8fgzr/b7uD/6/au/+i0bD/mM2m/5TLo/+QyKD/kcig/5LJof+FwpX/c7mG/2Ox - eP9Tqmr/Uqlo/1uucv9jsnn/aLV+/2q1ff9isXj/XK5x/1arbf9SqWr/Tqdm/0ulZP9Jp2L/QaJd/y2G - Rv8ndTv/III6ug2MLxD///8A////AP///wD///8A////AP///wD///8ALIND/iyJRv87l1b/GG0u/xVt - LP8QeS2zDo4wIBuVPAUfgTqzHm80/yqHQv+e0qv/rNa4/5/PrP+YzKX/l8yl/5jNpv+UyqP/Z7R8/zme - Vf8llEP/KZZG/yuXSP8tmEr/LZhK/y2YSv8sl0n/K5dI/yuWSf9Co13/WK1u/1arbf9PqGf/SqVj/0ak - X/9Colz/P6JZ/z2jWP8ujUn/JnM7/x5/OccAhSQE////AP///wD///8A////AP///wD///8AK4FC/TKI - Sf/y/vT/f8OR/xt9Nv8Zai//JXU8+yuCQ9MdazL/J4dD/6TWsv+q1rb/nM2q/5nNpv+azqj/mM2n/1es - b/8nlET/KpZH/zCZTP8zm0//NJtQ/zSbUP80m1D/NJtQ/zSbUP80m1D/NJtQ/zObT/8xmk3/LphL/z6f - WP9JpWP/R6Vg/0KiXP8+oFj/Op5V/zadUv81n1L/L49K/yVuOf8SfS+W////AP///wD///8A////AP// - /wD///8AKn9B/SyDRf/f8+T/y+fS/8Hjyv9XrG7/FXQw/xNiKP8phkL/p9az/6rWtv+dz6r/nM6p/57Q - q/9+wJH/MplP/yuXSP8xmk7/NJtQ/zScUP81nVH/NZ5R/zagU/82olP/NqNU/zajVP82olP/NqBS/zWe - Uf80nFD/M5tP/zKaTv8zm1D/QKFb/z+hWf86nlX/NZxS/zObT/80nFD/NqBT/yyERP8XaC7/CH0mXf// - /wD///8A////AP///wD///8AKn1A/C6DRf/V7t3/udzD/7vexf/B4sr/oNOu/0OhXP+k1rL/qta2/53P - qv+czqr/otGv/1etb/8mlET/L5lM/zObT/80nFD/NZ1R/zagU/80nVH/MJFK/yuAQ/8lbzn/I2k2/yVu - OP8mdDv/Kn5B/zGVTf82olT/NZ9S/zScUP8zm0//MppO/zufVv83nFL/M5tP/zSbUP80m1D/NZ1R/zWg - Uv8mdT3/GW0w+QmEKy7///8A////AP///wD///8AKXxA+zGCSP/Q7Nj/tNq//7DYu/+v17r/sdi6/67W - uf+m1LP/nc+q/53Oqv+f0K3/Tahm/ymWRv8xmk7/NJtQ/zScUP81n1L/NZ5R/yp8QP8hZDP/Imc1/xlw - MfkOcSq/Am4gmgFrHrEObijIGW0w+iBlNP8lcDr/L49K/zahU/81nVH/NJtQ/zObUP8zm1D/NJtQ/zSb - UP80m1D/NJtQ/zWeUf80nVH/JGw3/xtzM+MOjjAP////AP///wD///8AKXo/+zGBSf/L6tX/sNi7/63W - uP+p1LT/pdKx/6HQrv+dzqr/ns6r/57Oq/9GpF//KpZH/zKaTv80nFD/NZ1R/zahU/8xlEz/Imo2/xdk - LP0Sei2dDYsvQACHJQb///8A////AP///wD///8AAIglEhN/MHYZbzDfIWEz/yuBQv81oVL/NZ5R/zSc - UP80m1D/NJtQ/zSbUP80m1D/NJxQ/zWdUf83pFX/MJFK/yJkNP8ceDW8AIMjAf///wD///8AKHg++jWC - Sf/I6NH/rda4/6nUtP+l0rH/odCu/53Oqv+bzan/otCu/0+nZ/8qlkf/MptP/zSbUP81nlH/NZ9S/yp/ - Qf8gYDL/GnEy5gqELD////8A////AP///wD///8A////AP///wD///8A////AP///wAAiCUHEHQsqBRc - J/8mcjr/NJ1R/zWeUf80m1D/NJtQ/zSbUP80nFH/Np9S/zWhU/8shET/IGMy/xdmLPoReC2BAHwXBP// - /wD///8AJ3c9+jaBSv/D587/qdW1/6XTsv+h0K7/nc6q/5rMqP+ezqv/cLmE/yeVRf8ymk7/NJtQ/zSb - UP81nlH/J3Q7/x9cL/8ndTz9KZtHTv///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AAZ2I3MUYCj9JG45/zWiU/81nVH/NJxQ/zWeUv83olT/MJJL/yNnNf8SWSb/DXApvgCB - ISL///8A////AP///wD///8AJ3U8+jd/S/++5Mj/pdOy/6HRrv+dz6v/mc6n/5zNqP+KxZr/KJVF/zCZ - Tf80m1D/NJtQ/zSbUP81nVH/NqJU/y2JRv8gYDL/E1om/w9wKbUBiiYg////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wAEdSRvEVYj/yt+Qf83o1T/NqJT/zSeUf8mdDv/HVgt/xlq - LusHfSdW////AP///wD///8A////AP///wD///8AJnM7+Th+TP+54sX/odGu/53Pq/+Zzaf/mc2o/5vM - qP80m1D/LphL/zSbUP80m1D/NJtQ/zSbUP80m1D/NZ1R/zagUv82olP/KX1A/x1ZLv8VYCn7EHcsjgCG - JAv///8A////AP///wD///8A////AP///wD///8A////AP///wD///8ADm8osBxVLf8xkkv/LYZF/x9a - Lv8TWyf9EXUslACJJQv///8A////AP///wD///8A////AP///wD///8AJnI7+Dl+S/+04MD/nc+r/5nN - p/+Xzab/nc+r/0ynZP8rl0j/M5tP/zSbUP80m1D/NJtQ/zSbUP80m1D/NJtQ/zScUP82oVP/OalY/y+P - Sf8eWC3/D1Ag/wRzIqgAdAoB////AP///wD///8A////AP///wD///8A////AP///wD///8AAYkmDBdo - LeIdVCv/HFYt/xltMM0Khywu////AP///wD///8A////AP///wD///8A////AABiEiErgkOkJXA6+Dp8 - Sv+x3r3/ms2o/5bMpf+azqj/a7Z//yiVRv8ymk7/NJtQ/zSbUP80m1D/NJtQ/zSbUP80nFD/NZ5R/zei - VP80m0//JGs2/xpQKP8YZy7lB30oUv///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AAiAKC4JYSDnFH4waACIJQH///8A////AP///wD///8A////AP///wAAaBUID3MphBx3 - Nfgqf0HyJW859zp7S/+s3Ln/lsul/5fLpf+Mx5v/JpVF/zCaTf80m1D/NJtQ/zSbUP80m1D/NJtQ/zWd - Uf82oVP/NaFT/yd3Pv8ZTCf/E1km+BF4LYABiSYG////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wAAfhgC////AP///wD///8A////AP///wD///8A////AABp - GlUUdC7kL4BG/yV5O/8pfEDzJG049jp5TP+n2rb/k8qi/5nNqP9JpmL/LZhK/zSbUP80m1D/NJtQ/zSb - UP80nFH/NqBS/zimVv8rhET/G1Eq/w9NIP4NaiasAYsnGP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wAAYxEpB24jvglsJP9fk2//grSQ/yN6PP8oeT70JGs39jl3Sv+j2LH/k8qj/4PCk/8mlET/MppO/zSb - UP80m1D/NJxQ/zWfUv83pVX/MJFL/x5aLf8YSSb/FmYs0guGLDf///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8AAGIQDQxxJpAPcSn8LHtB/5a1nv/a69//OaVX/yR3Ov8ndj30I2o29Tp2S/+f1q//lsuk/0Cg - Wv8umEv/NJtQ/zScUP81nlH/N6NU/zSdUf8jZjX/FUIh/xJaJu8TfjBkAYkmAf///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wAAahxiE3Mt6xdyMf9jmHL/v9fH/9Hs1/+Lx5v/JppG/yZ0PP8mczv2I2k28jt2 - TP+g2K//eL2K/yiVRf8zm0//NZ1R/zahU/83o1P/J3c9/xZFI/8PUCH8DnIpkQGLJwv///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8AAGcTNAlvJcgKbCX/N4FL/6jFr//J6NH/vuLH/8Piy/8xmk7/MJ9O/yZz - O/8lcDn3I2o28j12Tf+i2bL/OJxU/y+aTP82oFL/OKZV/y2GRf8ZTij/C0Ub/wplJLwAhSMi////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AABhERMNciidEHAr/RxzM/94p4X/y+XQ/8Diyf+z277/ttvA/36/ - j/8llEP/NqJT/yVvOf8kbTj3I2o28UF3Uf96xI//KplI/zakVP8xlk3/Hlwv/xZEI/8VYireCH8pR/// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wAAhyQCD3MqbhZ0L/EWci//SYta/7jVwf/I59H/t93C/63Y - uv+t1rf/r9e5/yyYSP8vmUz/N6NU/yRtOP8jajb4I2o38El9Vf9Cr1//MZ1P/yRrN/8WQiH/Elck9RF5 - LXUBiiYD////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AAFrHj8YdTHSG3Qz/yN2Of+Qu5z/zerU/7zf - xf+v2Lr/qtW2/6XTs/+s1bj/ZLJ5/ymWRv8zm1D/N6RU/yNrN/8iZzX5I2o27zBzQf8ngED/F0ck/w5L - Hv0NbCaiAYwnEv///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wAAYhIbDXEpqRJwLP4Vby7/XJtt/8fj - z//B48z/tNu//6vVtv+m07L/odGu/6LRr/+bzqn/JpRD/zCaTf80m1D/N6RV/yNnNv8hYzP5I2o37xdI - JP8LRBv/CWEhygCDIi7///8A////AP///wD///8A////AP///wD///8AAHoVAv///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8AAFcMBRB1K3sYdDD2GnMy/y5/ - Rf+pzrP/yOfQ/7jdwv+u17n/qNS0/6PRsP+ez6v/ms6o/6HQrf9LpmX/LJdJ/zSbUP80m1D/N6VV/yJl - M/8gYDH5JGs37xRfKOkHeiVZ////AP///wD///8A////AP///wD///8A////AP///wALhy1NGY453QqD - Kkv///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wACbR9LHHk23iF5 - Of8aczL/da+F/8zp1P+94Mf/r9m7/6nUtP+l0rH/oNCt/5vNqf+Wy6X/l8yl/3/Akf8mlET/MppO/zSb - UP80m1D/OKVV/yBiMv8fXTD6MI9KbgCIJQj///8A////AP///wD///8A////AP///wD///8AAIEhHhiO - OLAhkj//L5ZK/yGNPvAJgSkg////AP///wD///8A////AP///wD///8A////AP///wD///8A////AABj - EYobdzT/KXw//zOCSP/L6dT/zuzW/7bcwf+q1bb/pdOy/6HQrv+czqn/mMym/5PKov+QyKD/lsqk/zac - Uv8vmUv/NJtQ/zSbUP80m1D/OKZV/x9fMf8eWi77////AP///wD///8A////AP///wD///8A////AACB - IQQZjjl1IZI/9x+NPP8wlEz/Xaxy/yCKPf8giD3MAIMjBv///wD///8A////AP///wD///8A////AP// - /wD///8A////AABDAAQNbyh2GXEx8h1wNP80fUj/mcWl/7jgw/+o1rX/ntCs/5nMp/+UyqP/j8ie/4zG - nP+Nxp3/YrJ4/yqWR/8zm0//NJtQ/zSbUP80m1D/OKZW/x9dMP8dVy37////AP///wD///8A////AP// - /wD///8AC4gtOySUQtMlkkP/E4c0/4fCl////////////y2RSP8jhj7/E30wmP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8AAFsNFQlmI6IQZCf9E2Uq/0uGWv+cy6j/ndOt/5LJ - of+Mxpz/h8SY/4XClf+EwpT/K5dJ/zGaTf80m1D/NJtQ/zSbUP80m1D/OKdW/x5aLv8dVy38////AP// - /wD///8A////AACBIRMZjjmcI5JC/h+NPv9RpGb/8vn1///////8/v3//////9fs3f8UfS//GHwz/xB3 - LJAAhiQC////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wAacTM7IWw19BNg - KP8RViT/f7KO/4rFmv+EwpX/gMGS/4HBlP9LpmT/LZhK/zSbUP80m1D/NJtQ/zSbUP80m1D/OKdW/x5a - L/8dViz8////AP///wD///8AAIEhYyWUQ+4zmE7/MJVM/0aiYP////////////L49P/r9e7/6vTs//X6 - 9v+t1bn/GX00/yF9Ov8deja/AGgcE////wD///8A////AP///wD///8A////AP///wD///8A////AABf - GTEUZSvXGmMt/yNoNf93s4n/jsyf/4LDk/98vo7/e76O/222gf8qlkf/MptP/zSbUP80m1D/NJtQ/zSb - UP80m1D/OKZW/x5cL/8dViz8////AP///wD///8ACoMqjTKXTv8ylk3/M5xQ/x+RPv+UyqP//////+z2 - 7v/j8ef/3+/j/97u4v/m9Or/v+HI/yGBO/8ddjX/GHQx6g1vKIgAYRAe////AP///wD///8A////AAA7 - AAMAXxdBCWEhlRBdJfsUXCn/RoNW/5TOpP+LyJv/f8CR/3m9i/93u4n/crqH/zKaTv8wmk3/NJtQ/zSb - UP80m1D/NJtQ/zSbUP80m1D/OKZW/x5cL/8dViz9////AP///wD///8AAIIiBSOMQMkxkUv/MpZN/y6a - S/8ckDz/u97E//P69P/f7+P/1+vc/9Lp2P/P59b/1ezc/8no0f9RmmT/Emss/xtvMv8Vayv9C2Qi0ABb - F7gAXBWkCWMhuxRkKfUdZTH/Fl4p/x5hMP9xq4D/kc+i/4LDlf96vYz/dbuI/3O6hf9zuYb/PZ9Y/y+Z - TP80m1D/NZ1R/zWeUf81nlH/NJxQ/zSbUP80m1D/OKZW/x5cL/8dViz9////AP///wD///8A////AAZ6 - JyEihz7yLoxI/zKZT/8smUr/G446/6PRsP/o8+r/1OrZ/8rl0f/F4s3/weDK/8TjzP/L6NL/stq+/0+b - ZP8fcDT/Dl8l/xFgJ/8TXyf/EFwl/xdiLP89gU7/bqh9/47Hn/+HyJr/fcCP/3a7if9yuYX/b7iC/262 - gv9Lp2X/LphL/zObT/81nlL/NqNT/yl8P/81oVL/NqJU/zWeUf80nFD/OKZW/x5cLv8dViz9////AP// - /wD///8A////AP///wAFdSNVIIE6/y2JRf80nFH/LppL/x2QPP+EwpX/2+3g/8vm0f+/38f/uNzC/7Ta - vv+y2b3/stm8/7XdwP+44cP/sNu8/5TKov+CvJH/lMej/57Wrv+Tz6T/iciZ/3/BkP95vYz/c7qG/264 - gv9stn//a7Z//0akX/8umEv/M5tP/zWeUv82pFT/JGo2/xdIJf8aTyn/K39B/zekVf82oVP/OKhX/x5c - MP8dViz+////AP///wD///8A////AP///wD///8AEXgtmSuDRP8shkX/NJ1R/zCbTf8jk0L/QqFc/7fc - wf/E4cv/tdu//63XuP+n07P/o9Gw/57Pq/+Zzaf/l8ul/5TLov+Pyp//iMWa/4PClP9+v4//eb2L/3S6 - h/9vuIP/bLaB/2m2ff9ntH3/P6Ba/y6ZS/8zm0//NZ9S/zalVP8kajf/GUwn/x1XLOkbUyr5GEwn/x1X - Lf8vjEj/O7Bb/x9gMv8cViz+////AP///wD///8A////AP///wD///8AAF0OBh17NrEqfED/K4BB/zOb - UP8znVD/KpdI/yKSQv9rt4D/r9i6/7HZu/+k0bD/m86p/5bLpf+RyaD/jcac/4jEmP+DwpT/fr+Q/3q9 - jP92u4j/cbmE/222gP9ptX7/Z7V8/1etb/81m1H/MJlM/zObT/82n1L/N6RV/yJqNf8ZTCf/Dk0g3Qdb - HRkAUBEgAksVtwxEG/4YSyb/I2o2/yBdMP8cViz+////AP///wD///8A////AP///wD///8A////AACH - JAEMbCibGnEy/yl4Pf8ymU7/NZ9S/zCaTf8plkb/I5JB/1mucf+Xy6X/odGu/5fMpv+PyJ//iMWZ/4HA - kv97vo3/druJ/3O5iP9xuIX/breB/2u1f/9brnH/Op1U/y6YSv8xmk7/NJ1R/zaiU/80nVH/IWQz/xlM - J/8QTyDYAFERFP///wD///8A////AABDAkQBRRLXC0cc/xtTKv8cViz/////AP///wD///8A////AP// - /wD///8A////AP///wD///8AAGQaghdrL/4lcjr/L4pI/zWhUv81n1L/MZtO/yuXSf8klEP/MZlO/1Gp - aP9rtn//er6L/3q+jP97vo3/eL6L/2u1f/9YrG//R6Rg/zmeU/8tmEr/MZpN/zScUP81n1L/OKVV/yyG - Rf8aUCn/CkQa/wFGFM0ARAEQ////AP///wD///8A////AP///wD///8AAEkNbg9OH+4cViz/////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AABfF2kWZy36I2o3/yVxOv8wkkv/N6NU/zWf - Uv80nFD/MZpO/y6YS/8qlkj/KJVG/yiVRv8olUb/KZZG/yuXSP8tmEr/MJlM/zKaTv80nFD/NqBS/zel - Vf81n1D/ImY0/xhLJv8MRxz6AEMKhf///wD///8A////AP///wD///8A////AP///wD///8A////AAA/ - AAwhYzOZ////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wAAVAkjCV0ftRRd - J/4gYTL/J3U9/zGVTP82pVT/N6NU/zagUv81nVH/NJxQ/zSbUP80m1D/NJtQ/zScUP81nlH/NqBS/zej - VP84qFb/L49J/yJmNP8ZSSX/GVAp/xBRIdYATA0v////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AABWE0YTWyfWHlsw/x5aLv8fWy//JnE7/y2KSP82oVP/OalX/zioV/84qFb/OKhX/zeo - Vv8zmk//LolG/yh3Pf8dVSz/GEom/wpEGv8AQhHjAEoMgAAYAAL///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wACjSgBAE8PYwRSGrcQUSH1G1Qr/xpQKf8YSyb/GEkm/xpN - J/8bUyr/HVgt/xhKJv8XSSX/GEom/xhNJ/8MRhz9AUoWwABCAVL///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wAndDwEI2o2TyFi - MqUfXTDRHlsv3R5aLucdWC3xHVgt+B5bL+EgXzG+IWMzlCJmNGQjaTYc////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A///AAf// - AAD//wAAf/8AAP/8AAAP/wAA//AAAAf/AAA/4AAAA/8AAA+AAAAA/wAABwAAAAB/AAAAAAAAAD8AAAAA - AAAAPwAAAAAAAAAfAAAAAAAAAA8AAAAAAAAABwAAAAAB4AADAAAAAA/4AAMAAAAAH/4ADwAAAAAH/wA/ - AAAAAAH/gH8AAAAAAP+B/AAAAAAD/8PwAAAAAAf/7+AAAAAAH///gAAAAAB///4AAAAAAP///AAAAAAD - ///wAAAAAA///8AAAAAAP///AAAAAAB///4AAAAAAf//+AAAAAAH9//gAAAAAB/j/8AAAAAAP4H/gAAA - AAD+AP+AAAAAAPwA/+AAAAAA8AA/+AAAAADgAB/wAAAAAOAAB4AAAAAA4AAAAAAAAADwAAAAAAAAAPgA - AAAAAAAA/AAAAAAAAAD8AAAAAAAAAP4AAAAA4AAA/4AAAAH4AAD/wAAAB/wAAP/gAAAP/wAA//gAAB// - AAD//AAA//8AAP//gAP//wAAKAAAABAAAAAgAAAAAQAgAAAAAAAABAAAEgsAABILAAAAAAAAAAAAAP// - /wD///8A////AP///wA0m1AIMpJMbDOTTt0/mlj4Qpta+TuYVPUyk0zDMJFLIv///wD///8A////AP// - /wAvjEhW////AP///wAAbhkgJIU99Hu4jP+q17b/sdq8/6DRrv+PyZ//cbmF/zOPTf4FeCSi////AP// - /wD///8AQpFY/BB3K+4AbRp8LodG/MHgyf+j1LH/abZ+/0KkW/9BpFz/Wa9w/2W0ev9fsXX/NJVP/wZ0 - I83///8A////AGamd/3h9ef/cbCC/8rn0v9+wpD/I5ZD/yaNQf8mgT77J4FA+yeJQv8smUr/R6dh/0Kk - XP8giDz/AG0alP///wBionP91O3b/77fx/9otn7/JZVD/yV7PP4vhUahKZxJChuVPAQLaSU/G3Qz+DOf - Uf81oVL/IIU8/wJoHd7///8AX51w/cbn0P+ZzKf/I5JB/zKdT/8yl03/KHU8+Q1qJkz///8A////AABi - GiYccjP6Kn1B+R54N3j///8ALIVFFlqZa/3B5cr/O59W/y6bS/81n1H/G3Uz/RBtKb4AZwwK////AP// - /wD///8AAGEYJCCIPAsMXCIEKotEpTKDR/hVlGb9fseR/ymcSP8bdjT/DGIi5ABbDSH///8A////AP// - /wD///8A////AP///wARfS5ZU5Zk96zTtv8sg0T8SY5c/SyOSP8hbDb1GmwwVP///wD///8A////AP// - /wD///8A////AABfCSEQdCvjfrCL/9Lr2f9Wsm//Kn5B/SVuOfYabDGZJptFASOXQwgIiCsg////AP// - /wD///8AAF8HCA14KbdUmWf+weDL/7new/+MyJz/JppF/yl4Pv00m1AM////ABqTO2BLpGP4OplV+wB0 - GS7///8A////AA1uJ0A2hUv4nsiq/6vZt/+WzKX/NpxS/zGgT/8nczv9////AAqHLM9IoWD///////3/ - /v8efzb6AGYaTAFeGgkRaykKGHIwmjR3Rv6Mx5z/V65u/yyYSf83pVT/JnI7/f///wAAeR5jDn8s/ozJ - nf/t+PD/zufV/3ywi/9Bh1T9Sodb/XCqf/+Myp7/XrV1/yudSv8pfj//N6ZW/yZyO/3///8A////AAJy - IIgPeyv/QKRb/5jQqP+y3L3/otWx/5DNoP9zvof/TKtk/yycS/8SXCb9B1QbjghYHfAgYjL9////AP// - /wD///8ABGwfoBRwLfshij7/KZxJ/zmkVf85pFf/K5tJ/ymFQf8TWyX4AEgNNP///wD///8AImU0Zv// - /wD///8A////AP///wAlcDoLKXY+mSdyO/Umcjv7JnE7+ydwO+cmbzqHI2k2EP///wD///8A////AP// - /wDwDwAAYAcAAAADAAAAAQAAAAEAAADCAAAA4AAAA/AAAA/AAAAHAAAAQwAAAIAAAACAAAAAwAAAAOAG - AADwDwAA - - - \ No newline at end of file diff --git a/UpdateLib/UpdateLib.Generator/UI/LoaderControl.Designer.cs b/UpdateLib/UpdateLib.Generator/UI/LoaderControl.Designer.cs deleted file mode 100644 index 6b90a43..0000000 --- a/UpdateLib/UpdateLib.Generator/UI/LoaderControl.Designer.cs +++ /dev/null @@ -1,64 +0,0 @@ -namespace MatthiWare.UpdateLib.Generator.UI -{ - partial class LoaderControl - { - /// - /// 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 Component Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.pbLoader = new System.Windows.Forms.PictureBox(); - ((System.ComponentModel.ISupportInitialize)(this.pbLoader)).BeginInit(); - this.SuspendLayout(); - // - // pbLoader - // - this.pbLoader.Anchor = System.Windows.Forms.AnchorStyles.None; - this.pbLoader.BackColor = System.Drawing.Color.Transparent; - this.pbLoader.Image = global::MatthiWare.UpdateLib.Generator.Properties.Resources.loading_gear; - this.pbLoader.Location = new System.Drawing.Point(0, 0); - this.pbLoader.Name = "pbLoader"; - this.pbLoader.Size = new System.Drawing.Size(150, 150); - this.pbLoader.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; - this.pbLoader.TabIndex = 0; - this.pbLoader.TabStop = false; - // - // LoaderControl - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(249)))), ((int)(((byte)(249)))), ((int)(((byte)(249))))); - this.Controls.Add(this.pbLoader); - this.MinimumSize = new System.Drawing.Size(150, 150); - this.Name = "LoaderControl"; - ((System.ComponentModel.ISupportInitialize)(this.pbLoader)).EndInit(); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.PictureBox pbLoader; - } -} diff --git a/UpdateLib/UpdateLib.Generator/UI/LoaderControl.cs b/UpdateLib/UpdateLib.Generator/UI/LoaderControl.cs deleted file mode 100644 index 8cbf791..0000000 --- a/UpdateLib/UpdateLib.Generator/UI/LoaderControl.cs +++ /dev/null @@ -1,144 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Windows.Forms; -using MatthiWare.UpdateLib.UI; - -namespace MatthiWare.UpdateLib.Generator.UI -{ - public partial class LoaderControl : UserControl - { - private static Dictionary loaders = new Dictionary(); - - private const int WS_EX_TRANSPARENT = 0x20; - - private int m_opacity = 100; - - public int Opacity - { - get - { - return m_opacity; - } - set - { - m_opacity = value; - - if (m_opacity > 100) - m_opacity = 100; - - if (m_opacity < 0) - m_opacity = 1; - - var alpha = (m_opacity * 255) / 100; - BackColor = Color.FromArgb(alpha, BackColor); - Invalidate(); - } - } - - - public LoaderControl() - { - InitializeComponent(); - - SetStyle(ControlStyles.SupportsTransparentBackColor, true); - //SetStyle(ControlStyles.Opaque, true); - DoubleBuffered = true; - } - - protected override CreateParams CreateParams - { - get - { - CreateParams cp = base.CreateParams; - cp.ExStyle |= WS_EX_TRANSPARENT; - return cp; - } - } - - public static void Show(Control parent) - { - if (parent == null) - return; - - if (!loaders.ContainsKey(parent)) - loaders.Add(parent, new LoaderControl()); - - loaders[parent].ShowLoader(parent); - } - - public void ShowLoader(Control parent) - { - Parent.InvokeOnUI(() => - { - parent.SuspendLayout(); - - Opacity = 100; - - Size = parent.Size; - //parent.Size = Size; - Location = new Point(0, 0); - - parent.Resize += ParentResize; - - parent.Controls.Add(this); - - BringToFront(); - - parent.ResumeLayout(); - }); - } - - private void ParentResize(object sender, EventArgs e) - { - Control parent = sender as Control; - - if (parent == null) - return; - - Size = parent.Size; - } - - public static void Hide(Control parent) - { - if (parent == null) - return; - - if (!loaders.ContainsKey(parent)) - return; - - loaders[parent].HideLoader(parent); - } - - public void HideLoader(Control parent) - { - Parent.InvokeOnUI(() => - { - parent.SuspendLayout(); - - parent.Resize -= ParentResize; - - parent.Controls.Remove(this); - - parent.ResumeLayout(); - }); - } - } -} diff --git a/UpdateLib/UpdateLib.Generator/UI/LoaderControl.resx b/UpdateLib/UpdateLib.Generator/UI/LoaderControl.resx deleted file mode 100644 index 750e8d2..0000000 --- a/UpdateLib/UpdateLib.Generator/UI/LoaderControl.resx +++ /dev/null @@ -1,126 +0,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 - - - True - - - True - - \ No newline at end of file diff --git a/UpdateLib/UpdateLib.Generator/UI/MoveablePanel.cs b/UpdateLib/UpdateLib.Generator/UI/MoveablePanel.cs deleted file mode 100644 index 5e57ec8..0000000 --- a/UpdateLib/UpdateLib.Generator/UI/MoveablePanel.cs +++ /dev/null @@ -1,71 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.Runtime.InteropServices; -using System.Windows.Forms; - -namespace MatthiWare.UpdateLib.Generator.UI -{ - public class MoveablePanel : Panel - { - public Form ParentForm { get; set; } - - private const int WM_NCLBUTTONDOWN = 0xA1; - private const int HT_CAPTION = 0x2; - - [DllImport("user32.dll")] - private static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam); - - [DllImport("user32.dll")] - private static extern bool ReleaseCapture(); - - protected override void OnMouseMove(MouseEventArgs e) - { - base.OnMouseMove(e); - - MoveParentForm(this, e); - } - - private void MoveParentForm(object sender, MouseEventArgs e) - { - if (ParentForm != null) - { - ReleaseCapture(); - SendMessage(this.ParentForm.Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0); - } - } - - protected override void OnControlAdded(ControlEventArgs e) - { - base.OnControlAdded(e); - - if (typeof(HoverPictureBox) == e.Control.GetType()) - return; - - e.Control.MouseMove += MoveParentForm; - } - - protected override void OnControlRemoved(ControlEventArgs e) - { - base.OnControlRemoved(e); - - e.Control.MouseMove -= MoveParentForm; - } - - } -} diff --git a/UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.Designer.cs b/UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.Designer.cs deleted file mode 100644 index 1a33f59..0000000 --- a/UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.Designer.cs +++ /dev/null @@ -1,133 +0,0 @@ -namespace MatthiWare.UpdateLib.Generator.UI.Pages -{ - partial class BuilderPage - { - /// - /// 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 Component Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.label1 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.btnBuild = new System.Windows.Forms.Button(); - this.lblProgress = new System.Windows.Forms.Label(); - this.pbProgress = new System.Windows.Forms.ProgressBar(); - this.lblStatus = new System.Windows.Forms.Label(); - this.saveFileDialog = new System.Windows.Forms.SaveFileDialog(); - this.SuspendLayout(); - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Font = new System.Drawing.Font("Century Gothic", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label1.Location = new System.Drawing.Point(14, 16); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(143, 20); - this.label1.TabIndex = 1; - this.label1.Text = "Update generator"; - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(15, 59); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(121, 17); - this.label2.TabIndex = 2; - this.label2.Text = "Make new version: "; - // - // btnBuild - // - this.btnBuild.Location = new System.Drawing.Point(142, 56); - this.btnBuild.Name = "btnBuild"; - this.btnBuild.Size = new System.Drawing.Size(75, 23); - this.btnBuild.TabIndex = 3; - this.btnBuild.Text = "Build"; - this.btnBuild.UseVisualStyleBackColor = true; - this.btnBuild.Click += new System.EventHandler(this.btnBuild_Click); - // - // lblProgress - // - this.lblProgress.AutoSize = true; - this.lblProgress.Location = new System.Drawing.Point(139, 100); - this.lblProgress.Name = "lblProgress"; - this.lblProgress.Size = new System.Drawing.Size(79, 17); - this.lblProgress.TabIndex = 4; - this.lblProgress.Text = "Progress: 0%"; - // - // pbProgress - // - this.pbProgress.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.pbProgress.Location = new System.Drawing.Point(17, 139); - this.pbProgress.Name = "pbProgress"; - this.pbProgress.Size = new System.Drawing.Size(593, 23); - this.pbProgress.TabIndex = 5; - // - // lblStatus - // - this.lblStatus.AutoSize = true; - this.lblStatus.Location = new System.Drawing.Point(14, 100); - this.lblStatus.Name = "lblStatus"; - this.lblStatus.Size = new System.Drawing.Size(104, 17); - this.lblStatus.TabIndex = 6; - this.lblStatus.Text = "Status: Waiting.."; - // - // saveFileDialog - // - this.saveFileDialog.FileName = "updatefile"; - this.saveFileDialog.Filter = "Update files (.xml)|*.xml"; - this.saveFileDialog.Title = "Save location"; - // - // BuilderPage - // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.lblStatus); - this.Controls.Add(this.pbProgress); - this.Controls.Add(this.lblProgress); - this.Controls.Add(this.btnBuild); - this.Controls.Add(this.label2); - this.Controls.Add(this.label1); - this.DoubleBuffered = true; - this.Font = new System.Drawing.Font("Century Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.MinimumSize = new System.Drawing.Size(239, 104); - this.Name = "BuilderPage"; - this.Size = new System.Drawing.Size(629, 182); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.Button btnBuild; - private System.Windows.Forms.Label lblProgress; - private System.Windows.Forms.ProgressBar pbProgress; - private System.Windows.Forms.Label lblStatus; - private System.Windows.Forms.SaveFileDialog saveFileDialog; - } -} diff --git a/UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.cs b/UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.cs deleted file mode 100644 index 8f19624..0000000 --- a/UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.cs +++ /dev/null @@ -1,155 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Drawing; -using System.IO; -using System.Windows.Forms; - -using MatthiWare.UpdateLib.Generator.Tasks; -using MatthiWare.UpdateLib.UI; - -namespace MatthiWare.UpdateLib.Generator.UI.Pages -{ - public partial class BuilderPage : PageControlBase - { - private FilesPage filesPage; - private InformationPage infoPage; - private RegistryPage registryPage; - - public BuilderPage() - { - InitializeComponent(); - } - - protected override void OnPageInitialize() - { - saveFileDialog.InitialDirectory = new DirectoryInfo("./Output").FullName; - - PageControlBase page; - if (!TestForm.TryGetPage(nameof(FilesPage), out page)) - { - throw new KeyNotFoundException($"Unable to get {nameof(FilesPage)}"); - } - - filesPage = page as FilesPage; - - if (!TestForm.TryGetPage(nameof(InformationPage), out page)) - { - throw new KeyNotFoundException($"Unable to get {nameof(InformationPage)}"); - } - - infoPage = page as InformationPage; - - if (!TestForm.TryGetPage(nameof(RegistryPage), out page)) - { - throw new KeyNotFoundException($"Unable to get {nameof(RegistryPage)}"); - } - - registryPage = page as RegistryPage; - - if (!filesPage.IsPageInitialized) - filesPage.InitializePage(null); - - if (!infoPage.IsPageInitialized) - infoPage.InitializePage(null); - - if (!registryPage.IsPageInitialized) - registryPage.InitializePage(null); - } - - private void btnBuild_Click(object sender, EventArgs e) - { - if (saveFileDialog.ShowDialog(ParentForm) != DialogResult.OK) - return; - - pbProgress.Value = 0; - lblProgress.Text = "Progress: 0%"; - - Build(saveFileDialog.OpenFile()); - } - - Stopwatch sw = new Stopwatch(); - - private UpdateGeneratorTask Build(Stream s) - { - var task = new UpdateGeneratorTask(filesPage.Root, infoPage, registryPage.Folders); - - btnBuild.Enabled = false; - - task.TaskProgressChanged += (o, e) => - { - lblProgress.Text = $"Progress: {e.ProgressPercentage}%"; - pbProgress.Value = e.ProgressPercentage; - - }; - - task.TaskCompleted += (o, e) => - { - sw.Stop(); - - Updater.Instance.Logger.Debug(nameof(BuilderPage), nameof(Build), $"File generation completed in {sw.ElapsedMilliseconds} ms."); - - btnBuild.Enabled = true; - - if (e.Cancelled) - { - lblStatus.Text = $"Status: Cancelled"; - return; - } - - if (e.Error != null) - { - lblStatus.Text = $"Status: Error"; - - MessageDialog.Show( - ParentForm, - "Builder", - "Build error", - "Check the logs for more information", - SystemIcons.Error, - MessageBoxButtons.OK); - - return; - } - - using (s) - task.Result.Save(s); - - lblStatus.Text = $"Status: Completed"; - - MessageDialog.Show( - ParentForm, - "Builder", - "Build completed", - "The update file has been succesfully generated!\n" + - $"File generation completed in {sw.ElapsedMilliseconds} ms.", - SystemIcons.Information, - MessageBoxButtons.OK); - }; - - lblStatus.Text = "Status: Building.."; - - sw.Reset(); - sw.Start(); - - return task.Start(); - } - } -} diff --git a/UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.resx b/UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.resx deleted file mode 100644 index ff68a6a..0000000 --- a/UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.resx +++ /dev/null @@ -1,123 +0,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 - - - 17, 17 - - \ No newline at end of file diff --git a/UpdateLib/UpdateLib.Generator/UI/Pages/FilesPage.Designer.cs b/UpdateLib/UpdateLib.Generator/UI/Pages/FilesPage.Designer.cs deleted file mode 100644 index b5cbc01..0000000 --- a/UpdateLib/UpdateLib.Generator/UI/Pages/FilesPage.Designer.cs +++ /dev/null @@ -1,232 +0,0 @@ -namespace MatthiWare.UpdateLib.Generator.UI.Pages -{ - partial class FilesPage - { - /// - /// 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 Component Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - this.label1 = new System.Windows.Forms.Label(); - this.tvFolders = new System.Windows.Forms.TreeView(); - this.ilIcons = new System.Windows.Forms.ImageList(this.components); - this.contextMenuRightClick = new System.Windows.Forms.ContextMenuStrip(this.components); - this.menuAddFiles = new System.Windows.Forms.ToolStripMenuItem(); - this.menuAddFolder = new System.Windows.Forms.ToolStripMenuItem(); - this.newFolderToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.existingFolderToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); - this.deleteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.lvFiles = new System.Windows.Forms.ListView(); - this.clmnName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.clmnDate = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.clmnType = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.clmnSize = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.folderBrowserDialog = new System.Windows.Forms.FolderBrowserDialog(); - this.openFileDialog = new System.Windows.Forms.OpenFileDialog(); - this.contextMenuRightClick.SuspendLayout(); - this.SuspendLayout(); - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Font = new System.Drawing.Font("Century Gothic", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label1.Location = new System.Drawing.Point(14, 16); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(128, 20); - this.label1.TabIndex = 1; - this.label1.Text = " Files and folders"; - // - // tvFolders - // - this.tvFolders.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left))); - this.tvFolders.ImageIndex = 0; - this.tvFolders.ImageList = this.ilIcons; - this.tvFolders.Location = new System.Drawing.Point(18, 53); - this.tvFolders.Name = "tvFolders"; - this.tvFolders.SelectedImageIndex = 0; - this.tvFolders.Size = new System.Drawing.Size(191, 332); - this.tvFolders.TabIndex = 2; - this.tvFolders.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.tvFolders_NodeMouseClick); - // - // ilIcons - // - this.ilIcons.ColorDepth = System.Windows.Forms.ColorDepth.Depth32Bit; - this.ilIcons.ImageSize = new System.Drawing.Size(16, 16); - this.ilIcons.TransparentColor = System.Drawing.Color.Transparent; - // - // contextMenuRightClick - // - this.contextMenuRightClick.Font = new System.Drawing.Font("Century Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.contextMenuRightClick.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.menuAddFiles, - this.menuAddFolder, - this.toolStripSeparator1, - this.deleteToolStripMenuItem}); - this.contextMenuRightClick.Name = "menuTV"; - this.contextMenuRightClick.Size = new System.Drawing.Size(142, 76); - // - // menuAddFiles - // - this.menuAddFiles.Image = global::MatthiWare.UpdateLib.Generator.Properties.Resources.image_transparent_16px; - this.menuAddFiles.Name = "menuAddFiles"; - this.menuAddFiles.Size = new System.Drawing.Size(141, 22); - this.menuAddFiles.Text = "Add File(s)"; - this.menuAddFiles.Click += new System.EventHandler(this.menuAddFiles_Click); - // - // menuAddFolder - // - this.menuAddFolder.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.newFolderToolStripMenuItem, - this.existingFolderToolStripMenuItem}); - this.menuAddFolder.Image = global::MatthiWare.UpdateLib.Generator.Properties.Resources.folder_transparent_16px; - this.menuAddFolder.Name = "menuAddFolder"; - this.menuAddFolder.Size = new System.Drawing.Size(141, 22); - this.menuAddFolder.Text = "Add Folder"; - // - // newFolderToolStripMenuItem - // - this.newFolderToolStripMenuItem.Name = "newFolderToolStripMenuItem"; - this.newFolderToolStripMenuItem.Size = new System.Drawing.Size(159, 22); - this.newFolderToolStripMenuItem.Text = "New Folder"; - this.newFolderToolStripMenuItem.Click += new System.EventHandler(this.newFolderToolStripMenuItem_Click); - // - // existingFolderToolStripMenuItem - // - this.existingFolderToolStripMenuItem.Name = "existingFolderToolStripMenuItem"; - this.existingFolderToolStripMenuItem.Size = new System.Drawing.Size(159, 22); - this.existingFolderToolStripMenuItem.Text = "Existing Folder"; - this.existingFolderToolStripMenuItem.Click += new System.EventHandler(this.existingFolderToolStripMenuItem_Click); - // - // toolStripSeparator1 - // - this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(138, 6); - // - // deleteToolStripMenuItem - // - this.deleteToolStripMenuItem.Enabled = false; - this.deleteToolStripMenuItem.Image = global::MatthiWare.UpdateLib.Generator.Properties.Resources.cross; - this.deleteToolStripMenuItem.Name = "deleteToolStripMenuItem"; - this.deleteToolStripMenuItem.Size = new System.Drawing.Size(141, 22); - this.deleteToolStripMenuItem.Text = "Delete"; - this.deleteToolStripMenuItem.Click += new System.EventHandler(this.deleteToolStripMenuItem_Click); - // - // lvFiles - // - this.lvFiles.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.lvFiles.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.clmnName, - this.clmnType, - this.clmnDate, - this.clmnSize}); - this.lvFiles.ContextMenuStrip = this.contextMenuRightClick; - this.lvFiles.FullRowSelect = true; - this.lvFiles.Location = new System.Drawing.Point(215, 53); - this.lvFiles.MultiSelect = false; - this.lvFiles.Name = "lvFiles"; - this.lvFiles.Size = new System.Drawing.Size(577, 332); - this.lvFiles.SmallImageList = this.ilIcons; - this.lvFiles.TabIndex = 3; - this.lvFiles.UseCompatibleStateImageBehavior = false; - this.lvFiles.View = System.Windows.Forms.View.Details; - this.lvFiles.SelectedIndexChanged += new System.EventHandler(this.lvFiles_SelectedIndexChanged); - this.lvFiles.DoubleClick += new System.EventHandler(this.lvFiles_DoubleClick); - // - // clmnName - // - this.clmnName.Text = "Name"; - this.clmnName.Width = 109; - // - // clmnDate - // - this.clmnDate.DisplayIndex = 1; - this.clmnDate.Text = "Last Modified"; - this.clmnDate.Width = 147; - // - // clmnType - // - this.clmnType.DisplayIndex = 2; - this.clmnType.Text = "Type"; - this.clmnType.Width = 93; - // - // clmnSize - // - this.clmnSize.Text = "Size"; - this.clmnSize.Width = 71; - // - // folderBrowserDialog - // - this.folderBrowserDialog.ShowNewFolderButton = false; - // - // openFileDialog - // - this.openFileDialog.Multiselect = true; - this.openFileDialog.ReadOnlyChecked = true; - this.openFileDialog.Title = "Add files to be included in the updater"; - // - // FilesPage - // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.lvFiles); - this.Controls.Add(this.tvFolders); - this.Controls.Add(this.label1); - this.DoubleBuffered = true; - this.Font = new System.Drawing.Font("Century Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.MinimumSize = new System.Drawing.Size(589, 233); - this.Name = "FilesPage"; - this.Size = new System.Drawing.Size(810, 403); - this.contextMenuRightClick.ResumeLayout(false); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.Label label1; - private System.Windows.Forms.TreeView tvFolders; - private System.Windows.Forms.ListView lvFiles; - private System.Windows.Forms.ColumnHeader clmnName; - private System.Windows.Forms.ColumnHeader clmnDate; - private System.Windows.Forms.ColumnHeader clmnType; - private System.Windows.Forms.ColumnHeader clmnSize; - private System.Windows.Forms.ImageList ilIcons; - private System.Windows.Forms.ContextMenuStrip contextMenuRightClick; - private System.Windows.Forms.ToolStripMenuItem menuAddFiles; - private System.Windows.Forms.ToolStripMenuItem menuAddFolder; - private System.Windows.Forms.ToolStripMenuItem newFolderToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem existingFolderToolStripMenuItem; - private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog; - private System.Windows.Forms.OpenFileDialog openFileDialog; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; - private System.Windows.Forms.ToolStripMenuItem deleteToolStripMenuItem; - } -} diff --git a/UpdateLib/UpdateLib.Generator/UI/Pages/FilesPage.cs b/UpdateLib/UpdateLib.Generator/UI/Pages/FilesPage.cs deleted file mode 100644 index 526cbba..0000000 --- a/UpdateLib/UpdateLib.Generator/UI/Pages/FilesPage.cs +++ /dev/null @@ -1,310 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Data; -using System.Linq; -using System.Windows.Forms; -using MatthiWare.UpdateLib.Tasks; -using MatthiWare.UpdateLib.Generator.Data; -using System.IO; -using MatthiWare.UpdateLib.UI; -using MatthiWare.UpdateLib.Generator.Data.FilesPage; - -namespace MatthiWare.UpdateLib.Generator.UI.Pages -{ - public partial class FilesPage : PageControlBase - { - private const string PROJECT_IMAGE_KEY = "project_key"; - - public GenFolder Root { get; set; } - - private GenFile _selectedFile; - private GenFile SelectedFile - { - get { return _selectedFile; } - set - { - _selectedFile = value; - if (value != null && !deleteToolStripMenuItem.Enabled) - deleteToolStripMenuItem.Enabled = true; - } - } - private GenFolder _selectedFolder; - private GenFolder SelectedFolder - { - get { return _selectedFolder; } - set - { - _selectedFolder = value; - if (value != null && !deleteToolStripMenuItem.Enabled) - deleteToolStripMenuItem.Enabled = true; - } - } - - public FilesPage() - { - InitializeComponent(); - } - - protected override void OnPageInitialize() - { - SuspendLayout(); - - ilIcons.Images.Add(TreeViewFolderNode.FOLDER_KEY, Properties.Resources.folder_transparent_16px); - ilIcons.Images.Add(PROJECT_IMAGE_KEY, Properties.Resources.project_16px); - - Root = new GenFolder("Update Project", contextMenuRightClick); - Root.ProtectedFolder = true; - Root.FolderTreeView.SelectedImageKey = PROJECT_IMAGE_KEY; - Root.FolderTreeView.ImageKey = PROJECT_IMAGE_KEY; - - GenFolder appFolder = new GenFolder("Application Folder", contextMenuRightClick); - appFolder.ProtectedFolder = true; - appFolder.PathVariable = "%appdir%"; - - Root.Add(appFolder); - - tvFolders.Nodes.Add(Root.FolderTreeView); - - folderBrowserDialog.Description = "Please select the folder to import"; - - UpdateSelectedFolder(Root); - - ResumeLayout(); - } - - private void menuAddFiles_Click(object sender, EventArgs e) - { - if (openFileDialog.ShowDialog(ParentForm) != DialogResult.OK) - return; - - if (SelectedFolder == Root) - return; - - AddExistingFileAsync(openFileDialog.FileNames.Select(file => new FileInfo(file))); - } - - private void existingFolderToolStripMenuItem_Click(object sender, EventArgs e) - { - if (folderBrowserDialog.ShowDialog(ParentForm) != DialogResult.OK) - return; - - if (SelectedFolder == Root) - return; - - AddExistingFolderAsync(new DirectoryInfo(folderBrowserDialog.SelectedPath)); - } - - private AsyncTask AddExistingFolderAsync(DirectoryInfo dir) - { - ShowLoader(); - - AsyncTask task = AsyncTaskFactory.From(new Action(() => - { - this.InvokeOnUI(() => SuspendLayout()); - - AddExistingFolder(dir, SelectedFolder, true); - - this.InvokeOnUI(() => - { - Root.FolderTreeView.Expand(); - ResumeLayout(); - }); - }), null); - - task.TaskCompleted += (o, e) => { HideLoader(); }; - - return task.Start(); - } - - private void AddExistingFolder(DirectoryInfo dir, GenFolder parentFolder, bool addToUI = false) - { - GenFolder folder = new GenFolder(dir.Name, contextMenuRightClick); - - if (addToUI) - this.InvokeOnUI(() => lvFiles.Items.Add(folder.FolderListView)); - - foreach (DirectoryInfo subDir in dir.GetDirectories()) - AddExistingFolder(subDir, folder); - - foreach (FileInfo f in dir.GetFiles()) - AddExistingFile(f, folder); - - this.InvokeOnUI(() => parentFolder.Add(folder)); - } - - private AsyncTask AddExistingFileAsync(IEnumerable files) - { - return AsyncTaskFactory.StartNew(new Action(() => - { - GenFolder s = SelectedFolder; - - foreach (FileInfo file in files) - AddExistingFile(file, s, true); - - }), null); - } - - private void AddExistingFile(FileInfo f, GenFolder folder, bool addToUI = false) - { - GenFile file = new GenFile(f); - - EnsureExtensionIconExists(f); - - folder.Add(file); - - if (addToUI) - this.InvokeOnUI(() => lvFiles.Items.Add(file.View)); - - } - - private void EnsureExtensionIconExists(FileInfo file) - { - if (ilIcons.Images.ContainsKey(file.Extension)) - return; - - Icon extensionIcon = Icon.ExtractAssociatedIcon(file.FullName); - - this.InvokeOnUI(() => ilIcons.Images.Add(file.Extension, extensionIcon)); - } - - private void UpdateSelectedFolder(GenFolder folder) - { - if (folder == null || folder == SelectedFolder) - return; - - SelectedFolder = folder; - SelectedFile = null; - - if (SelectedFolder == Root) - { - deleteToolStripMenuItem.Enabled = false; - menuAddFiles.Enabled = false; - menuAddFolder.Enabled = false; - } - else - { - menuAddFiles.Enabled = true; - menuAddFolder.Enabled = true; - } - - lvFiles.SuspendLayout(); - - lvFiles.Items.Clear(); - - foreach (GenFolder subFolder in folder.Directories) - lvFiles.Items.Add(subFolder.FolderListView); - - foreach (GenFile subFile in folder.Items) - lvFiles.Items.Add(subFile.View); - - lvFiles.ResumeLayout(); - - tvFolders.SelectedNode = folder.FolderTreeView; - folder.FolderTreeView.Expand(); - } - - private void lvFiles_DoubleClick(object sender, EventArgs e) - { - if (lvFiles.SelectedItems.Count == 0) - return; - - ListViewFolder item = lvFiles.SelectedItems[0] as ListViewFolder; - if (item == null) - return; - - UpdateSelectedFolder(item?.Folder); - - } - - private void newFolderToolStripMenuItem_Click(object sender, EventArgs e) - { - if (SelectedFolder == null || SelectedFolder == Root) - return; - - InputDialog inputDlg = new InputDialog("New folder", "Please enter the folder name: ", MessageBoxButtons.OKCancel); - - if (inputDlg.ShowDialog(ParentForm) != DialogResult.OK && SelectedFolder != null) - return; - - var name = inputDlg.Input; - - GenFolder folder = new GenFolder(name, contextMenuRightClick); - - this.InvokeOnUI(() => - { - SelectedFolder.Add(folder); - lvFiles.Items.Add(folder.FolderListView); - }); - } - - private void lvFiles_SelectedIndexChanged(object sender, EventArgs e) - { - if (lvFiles.SelectedItems.Count == 0) - return; - - ListViewItem item = lvFiles.SelectedItems[0]; - - if (item == null) - return; - - if (item is ListViewGenItem) - SelectedFile = (item as ListViewGenItem).Item as GenFile; - else if (item is ListViewFolder) - SelectedFolder = (item as ListViewFolder).Folder; - } - - private void deleteToolStripMenuItem_Click(object sender, EventArgs e) - { - SuspendLayout(); - - deleteToolStripMenuItem.Enabled = false; - - if (SelectedFile != null) - { - SelectedFile.Parent.Remove(SelectedFile); - SelectedFile = null; - } - else if (SelectedFolder != null && SelectedFolder != Root && !SelectedFolder.ProtectedFolder) - { - SelectedFolder.ParentFolder.Remove(SelectedFolder); - - lvFiles.Items.Clear(); - - GenFolder temp = SelectedFolder; - - UpdateSelectedFolder(SelectedFolder.ParentFolder); - - temp = null; - } - ResumeLayout(); - } - - private void tvFolders_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) - { - TreeViewFolderNode node = e.Node as TreeViewFolderNode; - - if (node == null) - return; - - UpdateSelectedFolder(node?.Folder); - } - } -} diff --git a/UpdateLib/UpdateLib.Generator/UI/Pages/FilesPage.resx b/UpdateLib/UpdateLib.Generator/UI/Pages/FilesPage.resx deleted file mode 100644 index 11876ac..0000000 --- a/UpdateLib/UpdateLib.Generator/UI/Pages/FilesPage.resx +++ /dev/null @@ -1,132 +0,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 - - - 17, 17 - - - 103, 17 - - - 281, 17 - - - 444, 17 - - \ No newline at end of file diff --git a/UpdateLib/UpdateLib.Generator/UI/Pages/InformationPage.Designer.cs b/UpdateLib/UpdateLib.Generator/UI/Pages/InformationPage.Designer.cs deleted file mode 100644 index 4b10891..0000000 --- a/UpdateLib/UpdateLib.Generator/UI/Pages/InformationPage.Designer.cs +++ /dev/null @@ -1,113 +0,0 @@ -namespace MatthiWare.UpdateLib.Generator.UI.Pages -{ - partial class InformationPage - { - /// - /// 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 Component Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.label1 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.txtAppName = new System.Windows.Forms.TextBox(); - this.label3 = new System.Windows.Forms.Label(); - this.txtAppVersion = new System.Windows.Forms.TextBox(); - this.SuspendLayout(); - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Font = new System.Drawing.Font("Century Gothic", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label1.Location = new System.Drawing.Point(14, 16); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(153, 20); - this.label1.TabIndex = 0; - this.label1.Text = "Update Information"; - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(15, 59); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(121, 17); - this.label2.TabIndex = 1; - this.label2.Text = "Application name: "; - // - // txtAppName - // - this.txtAppName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.txtAppName.Location = new System.Drawing.Point(160, 56); - this.txtAppName.Name = "txtAppName"; - this.txtAppName.Size = new System.Drawing.Size(212, 22); - this.txtAppName.TabIndex = 3; - // - // label3 - // - this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(15, 97); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(130, 17); - this.label3.TabIndex = 4; - this.label3.Text = "Application version: "; - // - // txtAppVersion - // - this.txtAppVersion.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.txtAppVersion.Location = new System.Drawing.Point(160, 94); - this.txtAppVersion.Name = "txtAppVersion"; - this.txtAppVersion.Size = new System.Drawing.Size(212, 22); - this.txtAppVersion.TabIndex = 5; - // - // InformationPage - // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.SystemColors.Control; - this.Controls.Add(this.txtAppVersion); - this.Controls.Add(this.label3); - this.Controls.Add(this.txtAppName); - this.Controls.Add(this.label2); - this.Controls.Add(this.label1); - this.DoubleBuffered = true; - this.Font = new System.Drawing.Font("Century Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.MinimumSize = new System.Drawing.Size(396, 144); - this.Name = "InformationPage"; - this.Size = new System.Drawing.Size(396, 144); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.TextBox txtAppName; - private System.Windows.Forms.Label label3; - private System.Windows.Forms.TextBox txtAppVersion; - } -} diff --git a/UpdateLib/UpdateLib.Generator/UI/Pages/InformationPage.cs b/UpdateLib/UpdateLib.Generator/UI/Pages/InformationPage.cs deleted file mode 100644 index c501c01..0000000 --- a/UpdateLib/UpdateLib.Generator/UI/Pages/InformationPage.cs +++ /dev/null @@ -1,59 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using MatthiWare.UpdateLib.Common; - -namespace MatthiWare.UpdateLib.Generator.UI.Pages -{ - public partial class InformationPage : PageControlBase - { - - public string ApplicationName - { - get - { - return txtAppName.Text; - } - set - { - txtAppName.Text = value; - } - } - - public UpdateVersion Version - { - get - { - return new UpdateVersion(txtAppVersion.Text); - } - set - { - txtAppVersion.Text = value.ToString(); - } - } - - public InformationPage() - { - InitializeComponent(); - } - - protected override void OnPageInitialize() - { - - } - } -} diff --git a/UpdateLib/UpdateLib.Generator/UI/Pages/InformationPage.resx b/UpdateLib/UpdateLib.Generator/UI/Pages/InformationPage.resx deleted file mode 100644 index 7080a7d..0000000 --- a/UpdateLib/UpdateLib.Generator/UI/Pages/InformationPage.resx +++ /dev/null @@ -1,120 +0,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/UpdateLib/UpdateLib.Generator/UI/Pages/PageControlBase.cs b/UpdateLib/UpdateLib.Generator/UI/Pages/PageControlBase.cs deleted file mode 100644 index 2d47e51..0000000 --- a/UpdateLib/UpdateLib.Generator/UI/Pages/PageControlBase.cs +++ /dev/null @@ -1,79 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using MatthiWare.UpdateLib.Tasks; -using System; -using System.ComponentModel; -using System.Windows.Forms; - -namespace MatthiWare.UpdateLib.Generator.UI.Pages -{ - public class PageControlBase : UserControl - { - internal MainForm TestForm { get; set; } - - public PageControlBase() - { - - } - - public void ShowLoader() - { - LoaderControl.Show(TestForm?.ContentPanel); - } - - public void HideLoader() - { - LoaderControl.Hide(TestForm?.ContentPanel); - } - - public bool IsPageInitialized { get; private set; } = false; - - private AsyncTask taskInitialize; - - public AsyncTask InitializePage(EventHandler callBack) - { - if (IsPageInitialized || (taskInitialize != null && taskInitialize.IsRunning)) - return taskInitialize; - - taskInitialize = AsyncTaskFactory.From(new Action(OnPageInitialize), null); - - taskInitialize.TaskCompleted += (o, e) => - { - IsPageInitialized = !e.Cancelled && e.Error == null; - - callBack?.Invoke(this, e); - }; - - return taskInitialize.Start(); - } - - protected virtual void OnPageInitialize() { } - - private void InitializeComponent() - { - this.SuspendLayout(); - // - // PageControlBase - // - this.DoubleBuffered = true; - this.Name = "PageControlBase"; - this.ResumeLayout(false); - - } - } -} diff --git a/UpdateLib/UpdateLib.Generator/UI/Pages/PageControlBase.resx b/UpdateLib/UpdateLib.Generator/UI/Pages/PageControlBase.resx deleted file mode 100644 index 7080a7d..0000000 --- a/UpdateLib/UpdateLib.Generator/UI/Pages/PageControlBase.resx +++ /dev/null @@ -1,120 +0,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/UpdateLib/UpdateLib.Generator/UI/Pages/RegistryPage.Designer.cs b/UpdateLib/UpdateLib.Generator/UI/Pages/RegistryPage.Designer.cs deleted file mode 100644 index 33f3ba0..0000000 --- a/UpdateLib/UpdateLib.Generator/UI/Pages/RegistryPage.Designer.cs +++ /dev/null @@ -1,255 +0,0 @@ -namespace MatthiWare.UpdateLib.Generator.UI.Pages -{ - partial class RegistryPage - { - /// - /// 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 Component Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RegistryPage)); - this.label1 = new System.Windows.Forms.Label(); - this.tvFolders = new System.Windows.Forms.TreeView(); - this.ilIcons = new System.Windows.Forms.ImageList(this.components); - this.contextMenuRightClick = new System.Windows.Forms.ContextMenuStrip(this.components); - this.menuAddFiles = new System.Windows.Forms.ToolStripMenuItem(); - this.menuAddFolder = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); - this.deleteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.lvRegistry = new System.Windows.Forms.ListView(); - this.clmnName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.clmnType = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.clmnValue = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.stringValueToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.binaryValueToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.dWORDValueToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.qWORDValueToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.multiStringValueToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.expandableStringValueToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.contextMenuRightClick.SuspendLayout(); - this.SuspendLayout(); - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Font = new System.Drawing.Font("Century Gothic", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label1.Location = new System.Drawing.Point(14, 16); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(65, 20); - this.label1.TabIndex = 1; - this.label1.Text = "Registry"; - // - // tvFolders - // - this.tvFolders.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left))); - this.tvFolders.ImageIndex = 0; - this.tvFolders.ImageList = this.ilIcons; - this.tvFolders.Location = new System.Drawing.Point(18, 53); - this.tvFolders.Name = "tvFolders"; - this.tvFolders.SelectedImageIndex = 0; - this.tvFolders.Size = new System.Drawing.Size(191, 332); - this.tvFolders.TabIndex = 2; - this.tvFolders.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.tvFolders_NodeMouseClick); - // - // ilIcons - // - this.ilIcons.ColorDepth = System.Windows.Forms.ColorDepth.Depth32Bit; - this.ilIcons.ImageSize = new System.Drawing.Size(16, 16); - this.ilIcons.TransparentColor = System.Drawing.Color.Transparent; - // - // contextMenuRightClick - // - this.contextMenuRightClick.Font = new System.Drawing.Font("Century Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.contextMenuRightClick.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.menuAddFiles, - this.menuAddFolder, - this.toolStripSeparator1, - this.deleteToolStripMenuItem}); - this.contextMenuRightClick.Name = "menuTV"; - this.contextMenuRightClick.Size = new System.Drawing.Size(153, 98); - // - // menuAddFiles - // - this.menuAddFiles.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.stringValueToolStripMenuItem, - this.binaryValueToolStripMenuItem, - this.dWORDValueToolStripMenuItem, - this.qWORDValueToolStripMenuItem, - this.multiStringValueToolStripMenuItem, - this.expandableStringValueToolStripMenuItem}); - this.menuAddFiles.Image = global::MatthiWare.UpdateLib.Generator.Properties.Resources.image_transparent_16px; - this.menuAddFiles.Name = "menuAddFiles"; - this.menuAddFiles.Size = new System.Drawing.Size(152, 22); - this.menuAddFiles.Text = "Add Value"; - // - // menuAddFolder - // - this.menuAddFolder.Image = global::MatthiWare.UpdateLib.Generator.Properties.Resources.folder_transparent_16px; - this.menuAddFolder.Name = "menuAddFolder"; - this.menuAddFolder.Size = new System.Drawing.Size(152, 22); - this.menuAddFolder.Text = "Add Key"; - this.menuAddFolder.Click += new System.EventHandler(this.menuAddFolder_Click); - // - // toolStripSeparator1 - // - this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(149, 6); - // - // deleteToolStripMenuItem - // - this.deleteToolStripMenuItem.Enabled = false; - this.deleteToolStripMenuItem.Image = global::MatthiWare.UpdateLib.Generator.Properties.Resources.cross; - this.deleteToolStripMenuItem.Name = "deleteToolStripMenuItem"; - this.deleteToolStripMenuItem.Size = new System.Drawing.Size(152, 22); - this.deleteToolStripMenuItem.Text = "Delete"; - this.deleteToolStripMenuItem.Click += new System.EventHandler(this.deleteToolStripMenuItem_Click); - // - // lvRegistry - // - this.lvRegistry.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.lvRegistry.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.clmnName, - this.clmnType, - this.clmnValue}); - this.lvRegistry.ContextMenuStrip = this.contextMenuRightClick; - this.lvRegistry.FullRowSelect = true; - this.lvRegistry.Location = new System.Drawing.Point(215, 53); - this.lvRegistry.MultiSelect = false; - this.lvRegistry.Name = "lvRegistry"; - this.lvRegistry.Size = new System.Drawing.Size(577, 332); - this.lvRegistry.SmallImageList = this.ilIcons; - this.lvRegistry.TabIndex = 3; - this.lvRegistry.UseCompatibleStateImageBehavior = false; - this.lvRegistry.View = System.Windows.Forms.View.Details; - this.lvRegistry.SelectedIndexChanged += new System.EventHandler(this.lvFiles_SelectedIndexChanged); - this.lvRegistry.DoubleClick += new System.EventHandler(this.lvFiles_DoubleClick); - // - // clmnName - // - this.clmnName.Text = "Name"; - this.clmnName.Width = 150; - // - // clmnType - // - this.clmnType.Text = "Type"; - this.clmnType.Width = 93; - // - // clmnValue - // - this.clmnValue.Text = "Value"; - this.clmnValue.Width = 250; - // - // stringValueToolStripMenuItem - // - this.stringValueToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("stringValueToolStripMenuItem.Image"))); - this.stringValueToolStripMenuItem.Name = "stringValueToolStripMenuItem"; - this.stringValueToolStripMenuItem.Size = new System.Drawing.Size(221, 22); - this.stringValueToolStripMenuItem.Text = "String Value"; - this.stringValueToolStripMenuItem.Click += new System.EventHandler(this.stringValueToolStripMenuItem_Click); - // - // binaryValueToolStripMenuItem - // - this.binaryValueToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("binaryValueToolStripMenuItem.Image"))); - this.binaryValueToolStripMenuItem.Name = "binaryValueToolStripMenuItem"; - this.binaryValueToolStripMenuItem.Size = new System.Drawing.Size(221, 22); - this.binaryValueToolStripMenuItem.Text = "Binary Value"; - this.binaryValueToolStripMenuItem.Click += new System.EventHandler(this.binaryValueToolStripMenuItem_Click); - // - // dWORDValueToolStripMenuItem - // - this.dWORDValueToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("dWORDValueToolStripMenuItem.Image"))); - this.dWORDValueToolStripMenuItem.Name = "dWORDValueToolStripMenuItem"; - this.dWORDValueToolStripMenuItem.Size = new System.Drawing.Size(221, 22); - this.dWORDValueToolStripMenuItem.Text = "DWORD (32-bit) Value"; - this.dWORDValueToolStripMenuItem.Click += new System.EventHandler(this.dWORDValueToolStripMenuItem_Click); - // - // qWORDValueToolStripMenuItem - // - this.qWORDValueToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("qWORDValueToolStripMenuItem.Image"))); - this.qWORDValueToolStripMenuItem.Name = "qWORDValueToolStripMenuItem"; - this.qWORDValueToolStripMenuItem.Size = new System.Drawing.Size(221, 22); - this.qWORDValueToolStripMenuItem.Text = "QWORD (64-bit) Value"; - this.qWORDValueToolStripMenuItem.Click += new System.EventHandler(this.qWORDValueToolStripMenuItem_Click); - // - // multiStringValueToolStripMenuItem - // - this.multiStringValueToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("multiStringValueToolStripMenuItem.Image"))); - this.multiStringValueToolStripMenuItem.Name = "multiStringValueToolStripMenuItem"; - this.multiStringValueToolStripMenuItem.Size = new System.Drawing.Size(221, 22); - this.multiStringValueToolStripMenuItem.Text = "Multi String Value"; - this.multiStringValueToolStripMenuItem.Click += new System.EventHandler(this.multiStringValueToolStripMenuItem_Click); - // - // expandableStringValueToolStripMenuItem - // - this.expandableStringValueToolStripMenuItem.Image = global::MatthiWare.UpdateLib.Generator.Properties.Resources.reg_string_16px; - this.expandableStringValueToolStripMenuItem.Name = "expandableStringValueToolStripMenuItem"; - this.expandableStringValueToolStripMenuItem.Size = new System.Drawing.Size(221, 22); - this.expandableStringValueToolStripMenuItem.Text = "Expandable String Value"; - this.expandableStringValueToolStripMenuItem.Click += new System.EventHandler(this.expandableStringValueToolStripMenuItem_Click); - // - // RegistryPage - // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.lvRegistry); - this.Controls.Add(this.tvFolders); - this.Controls.Add(this.label1); - this.DoubleBuffered = true; - this.Font = new System.Drawing.Font("Century Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.MinimumSize = new System.Drawing.Size(589, 233); - this.Name = "RegistryPage"; - this.Size = new System.Drawing.Size(810, 403); - this.contextMenuRightClick.ResumeLayout(false); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.Label label1; - private System.Windows.Forms.TreeView tvFolders; - private System.Windows.Forms.ListView lvRegistry; - private System.Windows.Forms.ColumnHeader clmnName; - private System.Windows.Forms.ColumnHeader clmnType; - private System.Windows.Forms.ColumnHeader clmnValue; - private System.Windows.Forms.ImageList ilIcons; - private System.Windows.Forms.ContextMenuStrip contextMenuRightClick; - private System.Windows.Forms.ToolStripMenuItem menuAddFiles; - private System.Windows.Forms.ToolStripMenuItem menuAddFolder; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; - private System.Windows.Forms.ToolStripMenuItem deleteToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem stringValueToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem binaryValueToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem dWORDValueToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem qWORDValueToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem multiStringValueToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem expandableStringValueToolStripMenuItem; - } -} diff --git a/UpdateLib/UpdateLib.Generator/UI/Pages/RegistryPage.cs b/UpdateLib/UpdateLib.Generator/UI/Pages/RegistryPage.cs deleted file mode 100644 index 8aae329..0000000 --- a/UpdateLib/UpdateLib.Generator/UI/Pages/RegistryPage.cs +++ /dev/null @@ -1,256 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.Collections.Generic; -using System.Windows.Forms; -using MatthiWare.UpdateLib.Generator.Data; -using MatthiWare.UpdateLib.UI; -using MatthiWare.UpdateLib.Generator.Data.FilesPage; -using Microsoft.Win32; - -namespace MatthiWare.UpdateLib.Generator.UI.Pages -{ - public partial class RegistryPage : PageControlBase - { - private const string PROJECT_IMAGE_KEY = "project_key"; - - private GenReg m_selectedRegEntry; - private GenReg SelectedRegEntry - { - get { return m_selectedRegEntry; } - set - { - m_selectedRegEntry = value; - if (value != null && !deleteToolStripMenuItem.Enabled) - deleteToolStripMenuItem.Enabled = true; - } - } - private GenFolder _selectedFolder; - private GenFolder SelectedFolder - { - get { return _selectedFolder; } - set - { - _selectedFolder = value; - if (value != null && !deleteToolStripMenuItem.Enabled) - deleteToolStripMenuItem.Enabled = true; - } - } - - public IList Folders { get; set; } - - public RegistryPage() - { - InitializeComponent(); - } - - protected override void OnPageInitialize() - { - SuspendLayout(); - - Folders = new List(); - - ilIcons.Images.Add("REG_BIN", Properties.Resources.reg_bin_16px); - ilIcons.Images.Add("REG_SZ", Properties.Resources.reg_string_16px); - ilIcons.Images.Add(TreeViewFolderNode.FOLDER_KEY, Properties.Resources.folder_transparent_16px); - - GenFolder hkey_classes_root = new GenFolder("HKEY_CLASSES_ROOT", contextMenuRightClick); - GenFolder hkey_current_user = new GenFolder("HKEY_CURRENT_USER", contextMenuRightClick); - GenFolder hkey_local_machine = new GenFolder("HKEY_LOCAL_MACHINE", contextMenuRightClick); - GenFolder hkey_users = new GenFolder("HKEY_USERS", contextMenuRightClick); - GenFolder hkey_current_config = new GenFolder("HKEY_CURRENT_CONFIG", contextMenuRightClick); - - tvFolders.Nodes.Add(hkey_classes_root.FolderTreeView); - tvFolders.Nodes.Add(hkey_current_user.FolderTreeView); - tvFolders.Nodes.Add(hkey_local_machine.FolderTreeView); - tvFolders.Nodes.Add(hkey_users.FolderTreeView); - tvFolders.Nodes.Add(hkey_current_config.FolderTreeView); - - Folders.Add(hkey_classes_root); - Folders.Add(hkey_current_user); - Folders.Add(hkey_local_machine); - Folders.Add(hkey_users); - Folders.Add(hkey_current_config); - - UpdateSelectedFolder(hkey_classes_root); - - ResumeLayout(); - } - - private void UpdateSelectedFolder(GenFolder folder) - { - if (folder == null || folder == SelectedFolder) - return; - - SelectedFolder = folder; - SelectedRegEntry = null; - - if (SelectedFolder.IsRoot) - deleteToolStripMenuItem.Enabled = false; - - lvRegistry.SuspendLayout(); - - lvRegistry.Items.Clear(); - - foreach (GenFolder subFolder in folder.Directories) - lvRegistry.Items.Add(subFolder.FolderListView); - - foreach (IGenItem subFile in folder.Items) - lvRegistry.Items.Add(subFile.View); - - lvRegistry.ResumeLayout(); - - tvFolders.SelectedNode = folder.FolderTreeView; - folder.FolderTreeView.Expand(); - } - - private void lvFiles_DoubleClick(object sender, EventArgs e) - { - if (lvRegistry.SelectedItems.Count == 0) - return; - - ListViewFolder item = lvRegistry.SelectedItems[0] as ListViewFolder; - if (item == null) - return; - - UpdateSelectedFolder(item?.Folder); - - } - - private void lvFiles_SelectedIndexChanged(object sender, EventArgs e) - { - if (lvRegistry.SelectedItems.Count == 0) - return; - - ListViewItem item = lvRegistry.SelectedItems[0]; - - if (item == null) - return; - - if (item is ListViewGenItem) - SelectedRegEntry = (item as ListViewGenItem).Item as GenReg; - else if (item is ListViewFolder) - SelectedFolder = (item as ListViewFolder).Folder; - } - - private void deleteToolStripMenuItem_Click(object sender, EventArgs e) - { - SuspendLayout(); - - deleteToolStripMenuItem.Enabled = false; - - if (SelectedRegEntry != null) - { - SelectedRegEntry.Parent.Remove(SelectedRegEntry); - lvRegistry.Items.Remove(SelectedRegEntry.View); - SelectedRegEntry = null; - } - else if (SelectedFolder != null && !SelectedFolder.IsRoot) - { - SelectedFolder.ParentFolder.Remove(SelectedFolder); - - lvRegistry.Items.Clear(); - - GenFolder temp = SelectedFolder; - - UpdateSelectedFolder(SelectedFolder.ParentFolder); - - temp = null; - } - - ResumeLayout(); - } - - private void tvFolders_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) - { - TreeViewFolderNode node = e.Node as TreeViewFolderNode; - - if (node == null) - return; - - UpdateSelectedFolder(node?.Folder); - } - - private void menuAddFolder_Click(object sender, EventArgs e) - { - if (SelectedFolder == null) - return; - - InputDialog inputDlg = new InputDialog("New folder", "Please enter the folder name: ", MessageBoxButtons.OKCancel); - - if (inputDlg.ShowDialog(ParentForm) != DialogResult.OK && SelectedFolder != null) - return; - - var name = inputDlg.Input; - - GenFolder folder = new GenFolder(name, contextMenuRightClick); - - this.InvokeOnUI(() => - { - SelectedFolder.Add(folder); - SelectedFolder.FolderTreeView.Expand(); - lvRegistry.Items.Add(folder.FolderListView); - }); - } - - private void stringValueToolStripMenuItem_Click(object sender, EventArgs e) - { - MakeNewEntry(RegistryValueKind.String); - } - - private void binaryValueToolStripMenuItem_Click(object sender, EventArgs e) - { - MakeNewEntry(RegistryValueKind.Binary); - } - - private void dWORDValueToolStripMenuItem_Click(object sender, EventArgs e) - { - MakeNewEntry(RegistryValueKind.DWord); - } - - private void qWORDValueToolStripMenuItem_Click(object sender, EventArgs e) - { - MakeNewEntry(RegistryValueKind.QWord); - } - - private void multiStringValueToolStripMenuItem_Click(object sender, EventArgs e) - { - MakeNewEntry(RegistryValueKind.MultiString); - } - - private void expandableStringValueToolStripMenuItem_Click(object sender, EventArgs e) - { - MakeNewEntry(RegistryValueKind.ExpandString); - } - - private void MakeNewEntry(RegistryValueKind type) - { - if (SelectedFolder == null) - return; - - GenReg item = new GenReg("New Item", type); - item.Value = "Test"; - - this.InvokeOnUI(() => - { - SelectedFolder.Add(item); - lvRegistry.Items.Add(item.View); - }); - } - } -} diff --git a/UpdateLib/UpdateLib.Generator/UI/Pages/RegistryPage.resx b/UpdateLib/UpdateLib.Generator/UI/Pages/RegistryPage.resx deleted file mode 100644 index a8e58e9..0000000 --- a/UpdateLib/UpdateLib.Generator/UI/Pages/RegistryPage.resx +++ /dev/null @@ -1,177 +0,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 - - - 17, 17 - - - 103, 17 - - - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - wwAADsMBx2+oZAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xNkRpr/UAAADHSURBVDhPnZNN - DoMgEIU5US/Tk7nkGp4FXPQSNi5q+VHKjH04jZKqL/kSeEw+NqCMMekMTdOkHAVU13VUHMowDKlt2x+J - stbS5nBIkKMgYcE8z1Ue9xuDkACQ5LQAefb9VoBhYq9DP00TUwQoAIZr6xiFwGRBjIHBwDq4dnKNi74C - Ux2srUMIzCLIjyMEXw4lez11oAi895cQAncJFmitEyCZc+4wLMhvogCRc2+GIi+QZ8RGQODHAdrLM5KM - 44vZFfwDkgWdPgHhXeaPOieBAAAAAElFTkSuQmCC - - - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - ww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ghSIKClBJyOl8qfY9yEBAgqYJ+8VseY8zXZflPAFQBNWiBL/Ga8hCYQBdBCP4QJH8JdB3sF9qc - 14D3HnkKyuPw3iH7wlheBc45hIajORNYZB+2Oa95DwVKqUyAzFo7DArgORIksvZe4Qf62ZsAgL/gH0Dd - z7bthnwU/KI9oPIDaOlC7DAsnWYAAAAASUVORK5CYII= - - - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - wwAADsMBx2+oZAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xNkRpr/UAAADHSURBVDhPnZNN - DoMgEIU5US/Tk7nkGp4FXPQSNi5q+VHKjH04jZKqL/kSeEw+NqCMMekMTdOkHAVU13VUHMowDKlt2x+J - stbS5nBIkKMgYcE8z1Ue9xuDkACQ5LQAefb9VoBhYq9DP00TUwQoAIZr6xiFwGRBjIHBwDq4dnKNi74C - Ux2srUMIzCLIjyMEXw4lez11oAi895cQAncJFmitEyCZc+4wLMhvogCRc2+GIi+QZ8RGQODHAdrLM5KM - 44vZFfwDkgWdPgHhXeaPOieBAAAAAElFTkSuQmCC - - - \ No newline at end of file diff --git a/UpdateLib/UpdateLib.Generator/UpdateLib.Generator.csproj b/UpdateLib/UpdateLib.Generator/UpdateLib.Generator.csproj index d890be0..697f5f2 100644 --- a/UpdateLib/UpdateLib.Generator/UpdateLib.Generator.csproj +++ b/UpdateLib/UpdateLib.Generator/UpdateLib.Generator.csproj @@ -1,200 +1,27 @@ - - - + - Debug - AnyCPU - {5194FF71-49F6-4ADB-9B0E-4BEB418DC6F3} - WinExe - Properties + netcoreapp2.1 MatthiWare.UpdateLib.Generator - UpdateLib.Generator - v3.5 - 512 + Exe + false - AnyCPU - true full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 + bin\$(Configuration)\ - AnyCPU pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - Generator_logo.ico + bin\$(Configuration)\ + {5194FF71-49F6-4ADB-9B0E-4BEB418DC6F3} + MatthiWare.UpdateLib.Generator MatthiWare.UpdateLib.Generator.Program - - - - - - - - - - - - - Properties\SharedAssemblyInfo.cs - - - - - - - - - - - - - - - Form - - - MainForm.cs - - - Component - - - Component - - - Component - - - Component - - - UserControl - - - LoaderControl.cs - - - Form - - - InputDialog.cs - - - Component - - - UserControl - - - BuilderPage.cs - - - UserControl - - - RegistryPage.cs - - - UserControl - - - FilesPage.cs - - - UserControl - - - InformationPage.cs - - - UserControl - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - True - Resources.resx - True - - - MainForm.cs - - - LoaderControl.cs - - - InputDialog.cs - - - BuilderPage.cs - - - RegistryPage.cs - - - FilesPage.cs - - - InformationPage.cs - - - PageControlBase.cs - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - Settings.settings - True - - - - - {4394be57-95e2-45b1-a968-1404b0590b35} - UpdateLib - + - - - - - - - - - - - - + - - - \ No newline at end of file diff --git a/UpdateLib/UpdateLib.Tests/UpdateLib.Tests.csproj b/UpdateLib/UpdateLib.Tests/UpdateLib.Tests.csproj index 1a6d8ce..6ee2945 100644 --- a/UpdateLib/UpdateLib.Tests/UpdateLib.Tests.csproj +++ b/UpdateLib/UpdateLib.Tests/UpdateLib.Tests.csproj @@ -1,107 +1,40 @@ - - - + - Debug - AnyCPU - {C47B8CC3-ABAB-4F56-8CA2-1323F902D1C3} - Library - Properties - UpdateLib.Tests - UpdateLib.Tests - v4.5 - 512 - + netcoreapp2.1 + false - true full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false + bin\$(Configuration)\ pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false + bin\$(Configuration)\ + + + {C47B8CC3-ABAB-4F56-8CA2-1323F902D1C3} - - ..\packages\Castle.Core.4.0.0\lib\net45\Castle.Core.dll - True - - - ..\packages\Moq.4.7.1\lib\net45\Moq.dll - True - - - ..\packages\NUnit.3.6.1\lib\net45\nunit.framework.dll - True - - - - - - - - + - - Properties\SharedAssemblyInfo.cs - - - - - - - - - - - - - - - - - - - - - - - - - - + + + all + + + + + + + + + + + + - - - - - {4394be57-95e2-45b1-a968-1404b0590b35} - UpdateLib - - - - - - \ No newline at end of file diff --git a/UpdateLib/UpdateLib.Tests/packages.config b/UpdateLib/UpdateLib.Tests/packages.config deleted file mode 100644 index 9f7b212..0000000 --- a/UpdateLib/UpdateLib.Tests/packages.config +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/UpdateLib/UpdateLib.sln b/UpdateLib/UpdateLib.sln index 2957dee..4ffaddb 100644 --- a/UpdateLib/UpdateLib.sln +++ b/UpdateLib/UpdateLib.sln @@ -3,21 +3,21 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.27130.2010 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UpdateLib", "UpdateLib\UpdateLib.csproj", "{4394BE57-95E2-45B1-A968-1404B0590B35}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UpdateLib", "UpdateLib\UpdateLib.csproj", "{4394BE57-95E2-45B1-A968-1404B0590B35}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestApp", "TestApp\TestApp.csproj", "{7C3C0345-6D01-40A6-9F01-60D8D6451FB1}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestApp", "TestApp\TestApp.csproj", "{7C3C0345-6D01-40A6-9F01-60D8D6451FB1}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{4FDF7C41-4B30-4153-A06A-6DE8989B4EFF}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UpdateLib.Tests", "UpdateLib.Tests\UpdateLib.Tests.csproj", "{C47B8CC3-ABAB-4F56-8CA2-1323F902D1C3}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UpdateLib.Generator", "UpdateLib.Generator\UpdateLib.Generator.csproj", "{5194FF71-49F6-4ADB-9B0E-4BEB418DC6F3}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UpdateLib.Tests", "UpdateLib.Tests\UpdateLib.Tests.csproj", "{C47B8CC3-ABAB-4F56-8CA2-1323F902D1C3}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{CDD5CD43-2D33-4654-8680-2352806AE394}" ProjectSection(SolutionItems) = preProject .shared\SharedAssemblyInfo.cs = .shared\SharedAssemblyInfo.cs EndProjectSection EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UpdateLib.Generator", "UpdateLib.Generator\UpdateLib.Generator.csproj", "{5194FF71-49F6-4ADB-9B0E-4BEB418DC6F3}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU diff --git a/UpdateLib/UpdateLib/Common/DirectoryEntry.cs b/UpdateLib/UpdateLib/Common/DirectoryEntry.cs index 598698e..4fd8787 100644 --- a/UpdateLib/UpdateLib/Common/DirectoryEntry.cs +++ b/UpdateLib/UpdateLib/Common/DirectoryEntry.cs @@ -17,10 +17,8 @@ using System; using System.Collections.Generic; -using System.Diagnostics; using System.Linq; using System.Text; -using System.Xml.Serialization; using MatthiWare.UpdateLib.Common.Abstraction; @@ -37,8 +35,6 @@ public class DirectoryEntry /// /// Gets or sets the name of the directory. /// - [XmlAttribute] - [DebuggerDisplay("{DestinationLocation}")] public string Name { get; set; } /// @@ -49,23 +45,18 @@ public class DirectoryEntry /// /// Gets the list of subdirectories. /// - [XmlArray("Directories"), XmlArrayItem("Directory")] public List Directories { get; set; } = new List(); /// /// Gets the list of files in this directory. /// - [XmlElement(typeof(FileEntry))] - [XmlElement(typeof(RegistryKeyEntry))] public List Items { get; set; } = new List(); /// /// Gets or Sets the Parent of this Directory /// - [XmlIgnore] public DirectoryEntry Parent { get; set; } - [XmlIgnore] public string SourceLocation { get @@ -83,7 +74,6 @@ public string SourceLocation } } - [XmlIgnore] public string DestinationLocation { get diff --git a/UpdateLib/UpdateLib/Common/HashCacheEntry.cs b/UpdateLib/UpdateLib/Common/HashCacheEntry.cs index 4c4405c..0de28ff 100644 --- a/UpdateLib/UpdateLib/Common/HashCacheEntry.cs +++ b/UpdateLib/UpdateLib/Common/HashCacheEntry.cs @@ -63,14 +63,14 @@ public void Recalculate(string hash = "") Hash = string.IsNullOrEmpty(hash) ? HashUtil.GetHash(FilePath) : hash; Ticks = tick; - Updater.Instance.Logger.Debug(nameof(HashCacheEntry), nameof(Recalculate), $"Recalculated Time: {DateTime.FromBinary(Ticks).ToString()} Name: {FilePath} Hash: {Hash}"); + //Updater.Instance.Logger.Debug(nameof(HashCacheEntry), nameof(Recalculate), $"Recalculated Time: {DateTime.FromBinary(Ticks).ToString()} Name: {FilePath} Hash: {Hash}"); } catch (Exception ex) // file might no longer exist or is in use { Hash = string.Empty; Ticks = -1; - Updater.Instance.Logger.Error(nameof(HashCacheEntry), nameof(Recalculate), ex); + //Updater.Instance.Logger.Error(nameof(HashCacheEntry), nameof(Recalculate), ex); } } diff --git a/UpdateLib/UpdateLib/Common/RegistryKeyEntry.cs b/UpdateLib/UpdateLib/Common/RegistryKeyEntry.cs deleted file mode 100644 index 69994a0..0000000 --- a/UpdateLib/UpdateLib/Common/RegistryKeyEntry.cs +++ /dev/null @@ -1,52 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using MatthiWare.UpdateLib.Common.Abstraction; -using Microsoft.Win32; -using System; -using System.Diagnostics; -using System.Xml.Serialization; - -namespace MatthiWare.UpdateLib.Common -{ - [Serializable] - [DebuggerDisplay("RegistryKeyEntry: {DestinationLocation}")] - public class RegistryKeyEntry : EntryBase - { - /// - /// The type of registry key - /// - [XmlAttribute] - public RegistryValueKind Type { get; set; } - - /// - /// The value of the key - /// - public object Value { get; set; } = "Test"; - - public RegistryKeyEntry() - : this(string.Empty, RegistryValueKind.String, null) - { } - - public RegistryKeyEntry(string name, RegistryValueKind type, object value) - { - Name = name; - Type = type; - Value = value; - } - } -} diff --git a/UpdateLib/UpdateLib/Common/UpdateVersion.cs b/UpdateLib/UpdateLib/Common/UpdateVersion.cs index 6bd3008..922b356 100644 --- a/UpdateLib/UpdateLib/Common/UpdateVersion.cs +++ b/UpdateLib/UpdateLib/Common/UpdateVersion.cs @@ -28,7 +28,6 @@ namespace MatthiWare.UpdateLib.Common /// Support for version label's and serializable. /// Partially based on Semantic Versioning /// - [Serializable] [DebuggerDisplay("[UpdateVersion {Value}]")] public class UpdateVersion : IComparable, IComparable, IEquatable { @@ -47,38 +46,14 @@ public class UpdateVersion : IComparable, IComparable, IEquatable #region Properties - [XmlIgnore] public int Major => m_major; - [XmlIgnore] public int Minor => m_minor; - [XmlIgnore] public int Patch => m_patch; - [XmlIgnore] public VersionLabel Label => m_label; - [XmlText] - [XmlElement(typeof(string))] - [EditorBrowsable(EditorBrowsableState.Never), Browsable(false)] - public string Value - { - get { return ToString(); } - set - { - UpdateVersion version; - - if (!TryParse(value, out version)) - throw new ArgumentException(nameof(value), "Unable to parse input string"); - - m_major = version.m_major; - m_minor = version.m_minor; - m_patch = version.m_patch; - m_label = version.m_label; - } - } - #endregion #region Constructor @@ -113,9 +88,7 @@ public UpdateVersion(int major, int minor, int patch, VersionLabel label) public UpdateVersion(string input) { - UpdateVersion version; - - if (!TryParse(input, out version)) + if (!TryParse(input, out UpdateVersion version)) throw new ArgumentException(nameof(input), "Unable to parse input string"); m_major = version.m_major; @@ -198,7 +171,6 @@ private string LabelToString() return BETA_STRING; case VersionLabel.RC: return RC_STRING; - case VersionLabel.None: default: return string.Empty; } @@ -288,6 +260,6 @@ public static implicit operator UpdateVersion(string value) => new UpdateVersion(value); public static implicit operator string(UpdateVersion version) - => version.Value; + => version.ToString(); } } diff --git a/UpdateLib/UpdateLib/Common/WorkerScheduler.cs b/UpdateLib/UpdateLib/Common/WorkerScheduler.cs deleted file mode 100644 index 62ff183..0000000 --- a/UpdateLib/UpdateLib/Common/WorkerScheduler.cs +++ /dev/null @@ -1,122 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using MatthiWare.UpdateLib.Tasks; -using MatthiWare.UpdateLib.Threading; -using System; -using System.Threading; - -namespace MatthiWare.UpdateLib.Common -{ - internal class WorkerScheduler - { - - #region Singleton - private static volatile WorkerScheduler instance = null; - private static readonly object synclock = new object(); - - /// - /// Gets a thread safe instance of - /// - public static WorkerScheduler Instance - { - get - { - if (instance == null) - lock (synclock) - if (instance == null) - instance = new WorkerScheduler(); - - return instance; - } - } - #endregion - - #region Fields - - private readonly long MAX_WORKERS; - private readonly ConcurrentQueue m_taskQueue; - private readonly AtomicInteger m_currentWorkerCount; - private readonly AsyncTask m_dispatcherTask; - private readonly ManualResetEvent m_waitForAvailableWorker; - private readonly object sync = new object(); - - public const long MIN_WORKERS = 8; - - #endregion - - private WorkerScheduler() - { - MAX_WORKERS = Math.Max(Environment.ProcessorCount, MIN_WORKERS); - m_taskQueue = new ConcurrentQueue(); - m_dispatcherTask = AsyncTaskFactory.From(new Action(Dispatcher), null); - m_waitForAvailableWorker = new ManualResetEvent(true); - m_currentWorkerCount = new AtomicInteger(); - } - - public void Schedule(AsyncTask task) - { - Enqueue(task); - - lock (synclock) - if (!m_dispatcherTask.IsRunning) - m_dispatcherTask.Start(); - } - - private void Dispatcher() - { - AsyncTask task = null; - while (m_taskQueue.TryDequeue(out task)) - { - lock (sync) - { - if (task.IsCompleted || task.IsCancelled || task.HasErrors) - continue; - - SetupTask(task); - - if (m_currentWorkerCount.Value >= MAX_WORKERS) - m_waitForAvailableWorker.Reset(); - - m_waitForAvailableWorker.WaitOne(); - - Updater.Instance.Logger.Debug(nameof(WorkerScheduler), nameof(Dispatcher), $"Current worker count: {m_currentWorkerCount.Increment()} | Current queue count: {m_taskQueue.Count}"); - - task.ConfigureAwait(false).Start(); - } - } - } - - private void SetupTask(AsyncTask task) - { - task.TaskCompleted += (o, e) => - { - - if (m_currentWorkerCount.Decrement() < MAX_WORKERS) - m_waitForAvailableWorker.Set(); - - Updater.Instance.Logger.Debug(nameof(WorkerScheduler), nameof(Dispatcher), $"Current worker count: {m_currentWorkerCount}"); - }; - } - - private void Enqueue(AsyncTask task) - { - m_taskQueue.Enqueue(task); - } - - } -} diff --git a/UpdateLib/UpdateLib/Compression/Checksum/Adler32.cs b/UpdateLib/UpdateLib/Compression/Checksum/Adler32.cs deleted file mode 100644 index 4fa0d86..0000000 --- a/UpdateLib/UpdateLib/Compression/Checksum/Adler32.cs +++ /dev/null @@ -1,209 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -using System; - -namespace MatthiWare.UpdateLib.Compression.Checksum -{ - /// - /// Computes Adler32 checksum for a stream of data. An Adler32 - /// checksum is not as reliable as a CRC32 checksum, but a lot faster to - /// compute. - /// - /// The specification for Adler32 may be found in RFC 1950. - /// ZLIB Compressed Data Format Specification version 3.3) - /// - /// - /// From that document: - /// - /// "ADLER32 (Adler-32 checksum) - /// This contains a checksum value of the uncompressed data - /// (excluding any dictionary data) computed according to Adler-32 - /// algorithm. This algorithm is a 32-bit extension and improvement - /// of the Fletcher algorithm, used in the ITU-T X.224 / ISO 8073 - /// standard. - /// - /// Adler-32 is composed of two sums accumulated per byte: s1 is - /// the sum of all bytes, s2 is the sum of all s1 values. Both sums - /// are done modulo 65521. s1 is initialized to 1, s2 to zero. The - /// Adler-32 checksum is stored as s2*65536 + s1 in most- - /// significant-byte first (network) order." - /// - /// "8.2. The Adler-32 algorithm - /// - /// The Adler-32 algorithm is much faster than the CRC32 algorithm yet - /// still provides an extremely low probability of undetected errors. - /// - /// The modulo on unsigned long accumulators can be delayed for 5552 - /// bytes, so the modulo operation time is negligible. If the bytes - /// are a, b, c, the second sum is 3a + 2b + c + 3, and so is position - /// and order sensitive, unlike the first sum, which is just a - /// checksum. That 65521 is prime is important to avoid a possible - /// large class of two-byte errors that leave the check unchanged. - /// (The Fletcher checksum uses 255, which is not prime and which also - /// makes the Fletcher check insensitive to single byte changes 0 - - /// 255.) - /// - /// The sum s1 is initialized to 1 instead of zero to make the length - /// of the sequence part of s2, so that the length does not have to be - /// checked separately. (Any sequence of zeroes has a Fletcher - /// checksum of zero.)" - /// - public sealed class Adler32 : IChecksum - { - #region Instance Fields - /// - /// largest prime smaller than 65536 - /// - readonly static uint BASE = 65521; - - /// - /// The CRC data checksum so far. - /// - uint checkValue; - #endregion - - /// - /// Initialise a default instance of - /// - public Adler32() - { - Reset(); - } - - /// - /// Resets the Adler32 data checksum as if no update was ever called. - /// - public void Reset() - { - checkValue = 1; - } - - /// - /// Returns the Adler32 data checksum computed so far. - /// - public long Value - { - get - { - return checkValue; - } - } - - /// - /// Updates the checksum with the byte b. - /// - /// - /// The data value to add. The high byte of the int is ignored. - /// - public void Update(int bval) - { - // We could make a length 1 byte array and call update again, but I - // would rather not have that overhead - uint s1 = checkValue & 0xFFFF; - uint s2 = checkValue >> 16; - - s1 = (s1 + ((uint)bval & 0xFF)) % BASE; - s2 = (s1 + s2) % BASE; - - checkValue = (s2 << 16) + s1; - } - - /// - /// Updates the Adler32 data checksum with the bytes taken from - /// a block of data. - /// - /// Contains the data to update the checksum with. - public void Update(byte[] buffer) - { - if (buffer == null) - throw new ArgumentNullException(nameof(buffer)); - - Update(buffer, 0, buffer.Length); - } - - /// - /// Update Adler32 data checksum based on a portion of a block of data - /// - /// Contains the data to update the CRC with. - /// The offset into the buffer where the data starts - /// The number of data bytes to update the CRC with. - public void Update(byte[] buffer, int offset, int count) - { - if (buffer == null) - throw new ArgumentNullException(nameof(buffer)); - - if (offset < 0) - throw new ArgumentOutOfRangeException(nameof(offset), "cannot be less than zero"); - - if (offset >= buffer.Length) - throw new ArgumentOutOfRangeException(nameof(offset), "not a valid index into buffer"); - - if (count < 0) - throw new ArgumentOutOfRangeException(nameof(count), "cannot be less than zero"); - - if (offset + count > buffer.Length) - throw new ArgumentOutOfRangeException(nameof(count), "exceeds buffer size"); - - //(By Per Bothner) - uint s1 = checkValue & 0xFFFF; - uint s2 = checkValue >> 16; - - while (count > 0) - { - // We can defer the modulo operation: - // s1 maximally grows from 65521 to 65521 + 255 * 3800 - // s2 maximally grows by 3800 * median(s1) = 2090079800 < 2^31 - int n = 3800; - - if (n > count) - n = count; - - count -= n; - - while (--n >= 0) - { - s1 = s1 + (uint)(buffer[offset++] & 0xff); - s2 = s2 + s1; - } - - s1 %= BASE; - s2 %= BASE; - } - - checkValue = (s2 << 16) | s1; - } - } -} diff --git a/UpdateLib/UpdateLib/Compression/Checksum/Crc32.cs b/UpdateLib/UpdateLib/Compression/Checksum/Crc32.cs deleted file mode 100644 index f3d70b8..0000000 --- a/UpdateLib/UpdateLib/Compression/Checksum/Crc32.cs +++ /dev/null @@ -1,217 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -using System; - -namespace MatthiWare.UpdateLib.Compression.Checksum -{ - /// - /// CRC-32 with reversed data and unreversed output - /// - /// - /// Generate a table for a byte-wise 32-bit CRC calculation on the polynomial: - /// x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x^1+x^0. - /// - /// Polynomials over GF(2) are represented in binary, one bit per coefficient, - /// with the lowest powers in the most significant bit. Then adding polynomials - /// is just exclusive-or, and multiplying a polynomial by x is a right shift by - /// one. If we call the above polynomial p, and represent a byte as the - /// polynomial q, also with the lowest power in the most significant bit (so the - /// byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p, - /// where a mod b means the remainder after dividing a by b. - /// - /// This calculation is done using the shift-register method of multiplying and - /// taking the remainder. The register is initialized to zero, and for each - /// incoming bit, x^32 is added mod p to the register if the bit is a one (where - /// x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by - /// x (which is shifting right by one and adding x^32 mod p if the bit shifted - /// out is a one). We start with the highest power (least significant bit) of - /// q and repeat for all eight bits of q. - /// - /// The table is simply the CRC of all possible eight bit values. This is all - /// the information needed to generate CRC's on data a byte at a time for all - /// combinations of CRC register values and incoming bytes. - /// - public sealed class Crc32 : IChecksum - { - #region Instance Fields - readonly static uint crcInit = 0xFFFFFFFF; - readonly static uint crcXor = 0xFFFFFFFF; - - readonly static uint[] crcTable = { - 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, - 0x706AF48F, 0xE963A535, 0x9E6495A3, 0x0EDB8832, 0x79DCB8A4, - 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, - 0x90BF1D91, 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, - 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, 0x136C9856, - 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9, - 0xFA0F3D63, 0x8D080DF5, 0x3B6E20C8, 0x4C69105E, 0xD56041E4, - 0xA2677172, 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, - 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, - 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, 0x26D930AC, 0x51DE003A, - 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, - 0xB8BDA50F, 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, - 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, 0x76DC4190, - 0x01DB7106, 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F, - 0x9FBFE4A5, 0xE8B8D433, 0x7807C9A2, 0x0F00F934, 0x9609A88E, - 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01, - 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, 0x6C0695ED, - 0x1B01A57B, 0x8208F4C1, 0xF50FC457, 0x65B0D9C6, 0x12B7E950, - 0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, - 0xFBD44C65, 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, - 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, 0x4369E96A, - 0x346ED9FC, 0xAD678846, 0xDA60B8D0, 0x44042D73, 0x33031DE5, - 0xAA0A4C5F, 0xDD0D7CC9, 0x5005713C, 0x270241AA, 0xBE0B1010, - 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F, - 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, - 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD, 0xEDB88320, 0x9ABFB3B6, - 0x03B6E20C, 0x74B1D29A, 0xEAD54739, 0x9DD277AF, 0x04DB2615, - 0x73DC1683, 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, - 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, 0xF00F9344, - 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB, - 0x196C3671, 0x6E6B06E7, 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, - 0x67DD4ACC, 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, - 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, - 0xA6BC5767, 0x3FB506DD, 0x48B2364B, 0xD80D2BDA, 0xAF0A1B4C, - 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, - 0x4669BE79, 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, - 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, 0xC5BA3BBE, - 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31, - 0x2CD99E8B, 0x5BDEAE1D, 0x9B64C2B0, 0xEC63F226, 0x756AA39C, - 0x026D930A, 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713, - 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, 0x92D28E9B, - 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, 0x86D3D2D4, 0xF1D4E242, - 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, - 0x18B74777, 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, - 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, 0xA00AE278, - 0xD70DD2EE, 0x4E048354, 0x3903B3C2, 0xA7672661, 0xD06016F7, - 0x4969474D, 0x3E6E77DB, 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, - 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, - 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, - 0xCDD70693, 0x54DE5729, 0x23D967BF, 0xB3667A2E, 0xC4614AB8, - 0x5D681B02, 0x2A6F2B94, 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, - 0x2D02EF8D - }; - - /// - /// The CRC data checksum so far. - /// - uint checkValue; - #endregion - - internal static uint ComputeCrc32(uint oldCrc, byte bval) => crcTable[(oldCrc ^ bval) & 0xFF] ^ (oldCrc >> 8); - - - /// - /// Initialise a default instance of - /// - public Crc32() - { - Reset(); - } - - /// - /// Resets the CRC data checksum as if no update was ever called. - /// - public void Reset() - { - checkValue = crcInit; - } - - /// - /// Returns the CRC data checksum computed so far. - /// - /// Reversed Out = false - public long Value - { - get - { - return checkValue ^ crcXor; - } - } - - /// - /// Updates the checksum with the int bval. - /// - /// - /// the byte is taken as the lower 8 bits of bval - /// - /// Reversed Data = true - public void Update(int bval) - { - checkValue = unchecked(crcTable[(checkValue ^ bval) & 0xFF] ^ (checkValue >> 8)); - } - - /// - /// Updates the CRC data checksum with the bytes taken from - /// a block of data. - /// - /// Contains the data to update the CRC with. - public void Update(byte[] buffer) - { - if (buffer == null) - throw new ArgumentNullException(nameof(buffer)); - - Update(buffer, 0, buffer.Length); - } - - /// - /// Update CRC data checksum based on a portion of a block of data - /// - /// Contains the data to update the CRC with. - /// The offset into the buffer where the data starts - /// The number of data bytes to update the CRC with. - public void Update(byte[] buffer, int offset, int count) - { - if (buffer == null) - throw new ArgumentNullException(nameof(buffer)); - - if (offset < 0) - throw new ArgumentOutOfRangeException(nameof(offset), "cannot be less than zero"); - - if (offset >= buffer.Length) - throw new ArgumentOutOfRangeException(nameof(offset), "not a valid index into buffer"); - - if (count < 0) - throw new ArgumentOutOfRangeException(nameof(count), "cannot be less than zero"); - - if (offset + count > buffer.Length) - throw new ArgumentOutOfRangeException(nameof(count), "exceeds buffer size"); - - for (int i = 0; i < count; ++i) - Update(buffer[offset++]); - } - } -} diff --git a/UpdateLib/UpdateLib/Compression/Checksum/IChecksum.cs b/UpdateLib/UpdateLib/Compression/Checksum/IChecksum.cs deleted file mode 100644 index 087ef98..0000000 --- a/UpdateLib/UpdateLib/Compression/Checksum/IChecksum.cs +++ /dev/null @@ -1,91 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - - -namespace MatthiWare.UpdateLib.Compression.Checksum -{ - /// - /// Interface to compute a data checksum used by checked input/output streams. - /// A data checksum can be updated by one byte or with a byte array. After each - /// update the value of the current checksum can be returned by calling - /// getValue. The complete checksum object can also be reset - /// so it can be used again with new data. - /// - public interface IChecksum - { - /// - /// Resets the data checksum as if no update was ever called. - /// - void Reset(); - - /// - /// Returns the data checksum computed so far. - /// - long Value - { - get; - } - - /// - /// Adds one byte to the data checksum. - /// - /// - /// the data value to add. The high byte of the int is ignored. - /// - void Update(int bval); - - /// - /// Updates the data checksum with the bytes taken from the array. - /// - /// - /// buffer an array of bytes - /// - void Update(byte[] buffer); - - /// - /// Adds the byte array to the data checksum. - /// - /// - /// The buffer which contains the data - /// - /// - /// The offset in the buffer where the data starts - /// - /// - /// the number of data bytes to add. - /// - void Update(byte[] buffer, int offset, int count); - } -} diff --git a/UpdateLib/UpdateLib/Compression/Deflaters/Deflater.cs b/UpdateLib/UpdateLib/Compression/Deflaters/Deflater.cs deleted file mode 100644 index 17feee8..0000000 --- a/UpdateLib/UpdateLib/Compression/Deflaters/Deflater.cs +++ /dev/null @@ -1,464 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -using System; - -namespace MatthiWare.UpdateLib.Compression.Deflaters -{ - /// - /// This is the Deflater class. The deflater class compresses input - /// with the deflate algorithm described in RFC 1951. It has several - /// compression levels and three different strategies described below. - /// - /// This class is not thread safe. This is inherent in the API, due - /// to the split of deflate and setInput. - /// - /// author of the original java version : Jochen Hoenicke - /// - public class Deflater - { - #region Public Constants - /// - /// The best and slowest compression level. This tries to find very - /// long and distant string repetitions. - /// - public const int BEST_COMPRESSION = 9; - - /// - /// The worst but fastest compression level. - /// - public const int BEST_SPEED = 1; - - /// - /// The default compression level. - /// - public const int DEFAULT_COMPRESSION = -1; - - /// - /// This level won't compress at all but output uncompressed blocks. - /// - public const int NO_COMPRESSION = 0; - - /// - /// The compression method. This is the only method supported so far. - /// There is no need to use this constant at all. - /// - public const int DEFLATED = 8; - #endregion - #region Local Constants - private const int IS_SETDICT = 0x01; - private const int IS_FLUSHING = 0x04; - private const int IS_FINISHING = 0x08; - - private const int INIT_STATE = 0x00; - private const int SETDICT_STATE = 0x01; - // private static int INIT_FINISHING_STATE = 0x08; - // private static int SETDICT_FINISHING_STATE = 0x09; - private const int BUSY_STATE = 0x10; - private const int FLUSHING_STATE = 0x14; - private const int FINISHING_STATE = 0x1c; - private const int FINISHED_STATE = 0x1e; - private const int CLOSED_STATE = 0x7f; - #endregion - #region Constructors - /// - /// Creates a new deflater with default compression level. - /// - public Deflater() : this(DEFAULT_COMPRESSION, false) - { - - } - - /// - /// Creates a new deflater with given compression level. - /// - /// - /// the compression level, a value between NO_COMPRESSION - /// and BEST_COMPRESSION. - /// - /// - /// true, if we should suppress the Zlib/RFC1950 header at the - /// beginning and the adler checksum at the end of the output. This is - /// useful for the GZIP/PKZIP formats. - /// - /// if lvl is out of range. - public Deflater(int level, bool noZlibHeaderOrFooter_) - { - if (level == DEFAULT_COMPRESSION) - level = 6; - else if (level < NO_COMPRESSION || level > BEST_COMPRESSION) - throw new ArgumentOutOfRangeException(nameof(level)); - - pending = new DeflaterPending(); - engine = new DeflaterEngine(pending); - noZlibHeaderOrFooter = noZlibHeaderOrFooter_; - SetStrategy(DeflateStrategy.Default); - SetLevel(level); - Reset(); - } - #endregion - - /// - /// Resets the deflater. The deflater acts afterwards as if it was - /// just created with the same compression level and strategy as it - /// had before. - /// - public void Reset() - { - state = (noZlibHeaderOrFooter ? BUSY_STATE : INIT_STATE); - totalOut = 0; - pending.Reset(); - engine.Reset(); - } - - /// - /// Gets the number of input bytes processed so far. - /// - public long TotalIn - { - get - { - return engine.TotalIn; - } - } - - /// - /// Gets the number of output bytes so far. - /// - public long TotalOut - { - get - { - return totalOut; - } - } - - /// - /// Flushes the current input block. Further calls to deflate() will - /// produce enough output to inflate everything in the current input - /// block. This is not part of Sun's JDK so I have made it package - /// private. It is used by DeflaterOutputStream to implement - /// flush(). - /// - public void Flush() - { - state |= IS_FLUSHING; - } - - /// - /// Finishes the deflater with the current input block. It is an error - /// to give more input after this method was called. This method must - /// be called to force all bytes to be flushed. - /// - public void Finish() - { - state |= (IS_FLUSHING | IS_FINISHING); - } - - /// - /// Returns true if the stream was finished and no more output bytes - /// are available. - /// - public bool IsFinished - { - get - { - return (state == FINISHED_STATE) && pending.IsFlushed; - } - } - - /// - /// Returns true, if the input buffer is empty. - /// You should then call setInput(). - /// NOTE: This method can also return true when the stream - /// was finished. - /// - public bool IsNeedingInput - { - get - { - return engine.NeedsInput(); - } - } - - /// - /// Sets the data which should be compressed next. This should be - /// only called when needsInput indicates that more input is needed. - /// The given byte array should not be changed, before needsInput() returns - /// true again. - /// - /// - /// the buffer containing the input data. - /// - /// - /// the start of the data. - /// - /// - /// the number of data bytes of input. - /// - /// - /// if the buffer was Finish()ed or if previous input is still pending. - /// - public void SetInput(byte[] input, int offset, int count) - { - if ((state & IS_FINISHING) != 0) - { - throw new InvalidOperationException("Finish() already called"); - } - engine.SetInput(input, offset, count); - } - - /// - /// Sets the compression level. There is no guarantee of the exact - /// position of the change, but if you call this when needsInput is - /// true the change of compression level will occur somewhere near - /// before the end of the so far given input. - /// - /// - /// the new compression level. - /// - public void SetLevel(int level) - { - if (level == DEFAULT_COMPRESSION) - level = 6; - else if (level < NO_COMPRESSION || level > BEST_COMPRESSION) - throw new ArgumentOutOfRangeException(nameof(level)); - - if (this.level != level) - { - this.level = level; - engine.SetLevel(level); - } - } - - /// - /// Get current compression level - /// - /// Returns the current compression level - public int GetLevel() => level; - - /// - /// Sets the compression strategy. Strategy is one of - /// DEFAULT_STRATEGY, HUFFMAN_ONLY and FILTERED. For the exact - /// position where the strategy is changed, the same as for - /// SetLevel() applies. - /// - /// - /// The new compression strategy. - /// - public void SetStrategy(DeflateStrategy strategy) - { - engine.Strategy = strategy; - } - - /// - /// Deflates the current input block to the given array. - /// - /// - /// Buffer to store the compressed data. - /// - /// - /// Offset into the output array. - /// - /// - /// The maximum number of bytes that may be stored. - /// - /// - /// The number of compressed bytes added to the output, or 0 if either - /// needsInput() or finished() returns true or length is zero. - /// - /// - /// If Finish() was previously called. - /// - /// - /// If offset or length don't match the array length. - /// - public int Deflate(byte[] output, int offset, int length) - { - int origLength = length; - - if (state == CLOSED_STATE) - throw new InvalidOperationException("Deflater closed"); - - if (state < BUSY_STATE) - { - // output header - int header = (DEFLATED + - ((DeflaterConstants.MAX_WBITS - 8) << 4)) << 8; - - int level_flags = (level - 1) >> 1; - - if (level_flags < 0 || level_flags > 3) - level_flags = 3; - - header |= level_flags << 6; - - if ((state & IS_SETDICT) != 0) - header |= DeflaterConstants.PRESET_DICT; // Dictionary was set - - header += 31 - (header % 31); - - pending.WriteShortMSB(header); - - if ((state & IS_SETDICT) != 0) - { - int chksum = engine.Adler; - engine.ResetAdler(); - pending.WriteShortMSB(chksum >> 16); - pending.WriteShortMSB(chksum & 0xffff); - } - - state = BUSY_STATE | (state & (IS_FLUSHING | IS_FINISHING)); - } - - for (;;) - { - int count = pending.Flush(output, offset, length); - offset += count; - totalOut += count; - length -= count; - - if (length == 0 || state == FINISHED_STATE) - break; - - if (!engine.Deflate((state & IS_FLUSHING) != 0, (state & IS_FINISHING) != 0)) - { - switch (state) - { - case BUSY_STATE: - // We need more input now - return origLength - length; - - case FLUSHING_STATE: - if (level != NO_COMPRESSION) - { - /* We have to supply some lookahead. 8 bit lookahead - * is needed by the zlib inflater, and we must fill - * the next byte, so that all bits are flushed. - */ - int neededbits = 8 + ((-pending.BitCount) & 7); - while (neededbits > 0) - { - /* write a static tree block consisting solely of - * an EOF: - */ - pending.WriteBits(2, 10); - neededbits -= 10; - } - } - - state = BUSY_STATE; - break; - case FINISHING_STATE: - pending.AlignToByte(); - - // Compressed data is complete. Write footer information if required. - if (!noZlibHeaderOrFooter) - { - int adler = engine.Adler; - pending.WriteShortMSB(adler >> 16); - pending.WriteShortMSB(adler & 0xffff); - } - - state = FINISHED_STATE; - break; - } - } - } - return origLength - length; - } - - /// - /// Sets the dictionary which should be used in the deflate process. - /// The dictionary is a byte array containing strings that are - /// likely to occur in the data which should be compressed. The - /// dictionary is not stored in the compressed output, only a - /// checksum. To decompress the output you need to supply the same - /// dictionary again. - /// - /// - /// The dictionary data - /// - /// - /// The index where dictionary information commences. - /// - /// - /// The number of bytes in the dictionary. - /// - /// - /// If SetInput () or Deflate() were already called or another dictionary was already set. - /// - public void SetDictionary(byte[] dictionary, int index, int count) - { - if (state != INIT_STATE) - throw new InvalidOperationException(); - - state = SETDICT_STATE; - engine.SetDictionary(dictionary, index, count); - } - - #region Instance Fields - /// - /// Compression level. - /// - int level; - - /// - /// If true no Zlib/RFC1950 headers or footers are generated - /// - bool noZlibHeaderOrFooter; - - /// - /// The current state. - /// - int state; - - /// - /// The total bytes of output written. - /// - long totalOut; - - /// - /// The pending output. - /// - DeflaterPending pending; - - /// - /// The deflater engine. - /// - DeflaterEngine engine; - #endregion - } -} diff --git a/UpdateLib/UpdateLib/Compression/Deflaters/DeflaterConstants.cs b/UpdateLib/UpdateLib/Compression/Deflaters/DeflaterConstants.cs deleted file mode 100644 index 965c189..0000000 --- a/UpdateLib/UpdateLib/Compression/Deflaters/DeflaterConstants.cs +++ /dev/null @@ -1,181 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -using System; - -namespace MatthiWare.UpdateLib.Compression.Deflaters -{ - /// - /// This class contains constants used for deflation. - /// - public static class DeflaterConstants - { - /// - /// Set to true to enable debugging - /// - public const bool DEBUGGING = false; - - /// - /// Written to Zip file to identify a stored block - /// - public const int STORED_BLOCK = 0; - - /// - /// Identifies static tree in Zip file - /// - public const int STATIC_TREES = 1; - - /// - /// Identifies dynamic tree in Zip file - /// - public const int DYN_TREES = 2; - - /// - /// Header flag indicating a preset dictionary for deflation - /// - public const int PRESET_DICT = 0x20; - - /// - /// Sets internal buffer sizes for Huffman encoding - /// - public const int DEFAULT_MEM_LEVEL = 8; - - /// - /// Internal compression engine constant - /// - public const int MAX_MATCH = 258; - - /// - /// Internal compression engine constant - /// - public const int MIN_MATCH = 3; - - /// - /// Internal compression engine constant - /// - public const int MAX_WBITS = 15; - - /// - /// Internal compression engine constant - /// - public const int WSIZE = 1 << MAX_WBITS; - - /// - /// Internal compression engine constant - /// - public const int WMASK = WSIZE - 1; - - /// - /// Internal compression engine constant - /// - public const int HASH_BITS = DEFAULT_MEM_LEVEL + 7; - - /// - /// Internal compression engine constant - /// - public const int HASH_SIZE = 1 << HASH_BITS; - - /// - /// Internal compression engine constant - /// - public const int HASH_MASK = HASH_SIZE - 1; - - /// - /// Internal compression engine constant - /// - public const int HASH_SHIFT = (HASH_BITS + MIN_MATCH - 1) / MIN_MATCH; - - /// - /// Internal compression engine constant - /// - public const int MIN_LOOKAHEAD = MAX_MATCH + MIN_MATCH + 1; - - /// - /// Internal compression engine constant - /// - public const int MAX_DIST = WSIZE - MIN_LOOKAHEAD; - - /// - /// Internal compression engine constant - /// - public const int PENDING_BUF_SIZE = 1 << (DEFAULT_MEM_LEVEL + 8); - - /// - /// Internal compression engine constant - /// - public static int MAX_BLOCK_SIZE = Math.Min(65535, PENDING_BUF_SIZE - 5); - - /// - /// Internal compression engine constant - /// - public const int DEFLATE_STORED = 0; - - /// - /// Internal compression engine constant - /// - public const int DEFLATE_FAST = 1; - - /// - /// Internal compression engine constant - /// - public const int DEFLATE_SLOW = 2; - - /// - /// Internal compression engine constant - /// - public static int[] GOOD_LENGTH = { 0, 4, 4, 4, 4, 8, 8, 8, 32, 32 }; - - /// - /// Internal compression engine constant - /// - public static int[] MAX_LAZY = { 0, 4, 5, 6, 4, 16, 16, 32, 128, 258 }; - - /// - /// Internal compression engine constant - /// - public static int[] NICE_LENGTH = { 0, 8, 16, 32, 16, 32, 128, 128, 258, 258 }; - - /// - /// Internal compression engine constant - /// - public static int[] MAX_CHAIN = { 0, 4, 8, 32, 16, 32, 128, 256, 1024, 4096 }; - - /// - /// Internal compression engine constant - /// - public static int[] COMPR_FUNC = { 0, 1, 1, 1, 1, 2, 2, 2, 2, 2 }; - - } -} diff --git a/UpdateLib/UpdateLib/Compression/Deflaters/DeflaterEngine.cs b/UpdateLib/UpdateLib/Compression/Deflaters/DeflaterEngine.cs deleted file mode 100644 index 63f5010..0000000 --- a/UpdateLib/UpdateLib/Compression/Deflaters/DeflaterEngine.cs +++ /dev/null @@ -1,850 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -using MatthiWare.UpdateLib.Compression.Checksum; -using System; - -namespace MatthiWare.UpdateLib.Compression.Deflaters -{ - /// - /// Strategies for deflater - /// - public enum DeflateStrategy - { - /// - /// The default strategy - /// - Default = 0, - - /// - /// This strategy will only allow longer string repetitions. It is - /// useful for random data with a small character set. - /// - Filtered = 1, - - - /// - /// This strategy will not look for string repetitions at all. It - /// only encodes with Huffman trees (which means, that more common - /// characters get a smaller encoding. - /// - HuffmanOnly = 2 - } - - // DEFLATE ALGORITHM: - // - // The uncompressed stream is inserted into the window array. When - // the window array is full the first half is thrown away and the - // second half is copied to the beginning. - // - // The head array is a hash table. Three characters build a hash value - // and they the value points to the corresponding index in window of - // the last string with this hash. The prev array implements a - // linked list of matches with the same hash: prev[index & WMASK] points - // to the previous index with the same hash. - // - - - /// - /// Low level compression engine for deflate algorithm which uses a 32K sliding window - /// with secondary compression from Huffman/Shannon-Fano codes. - /// - public class DeflaterEngine - { - #region Constants - const int TooFar = 4096; - #endregion - - #region Constructors - /// - /// Construct instance with pending buffer - /// - /// - /// Pending buffer to use - /// > - public DeflaterEngine(DeflaterPending pending) - { - this.pending = pending; - huffman = new DeflaterHuffman(pending); - checksum = new Adler32(); - - window = new byte[2 * DeflaterConstants.WSIZE]; - head = new short[DeflaterConstants.HASH_SIZE]; - prev = new short[DeflaterConstants.WSIZE]; - - // We start at index 1, to avoid an implementation deficiency, that - // we cannot build a repeat pattern at index 0. - blockStart = strstart = 1; - } - - #endregion - - /// - /// Deflate drives actual compression of data - /// - /// True to flush input buffers - /// Finish deflation with the current input. - /// Returns true if progress has been made. - public bool Deflate(bool flush, bool finish) - { - bool progress; - do - { - FillWindow(); - bool canFlush = flush && (inputOff == inputEnd); - - switch (compressionFunction) - { - case DeflaterConstants.DEFLATE_STORED: - progress = DeflateStored(canFlush, finish); - break; - case DeflaterConstants.DEFLATE_FAST: - progress = DeflateFast(canFlush, finish); - break; - case DeflaterConstants.DEFLATE_SLOW: - progress = DeflateSlow(canFlush, finish); - break; - default: - throw new InvalidOperationException("unknown compressionFunction"); - } - } while (pending.IsFlushed && progress); // repeat while we have no pending output and progress was made - return progress; - } - - /// - /// Sets input data to be deflated. Should only be called when NeedsInput() - /// returns true - /// - /// The buffer containing input data. - /// The offset of the first byte of data. - /// The number of bytes of data to use as input. - public void SetInput(byte[] buffer, int offset, int count) - { - if (buffer == null) - throw new ArgumentNullException(nameof(buffer)); - - if (offset < 0) - throw new ArgumentOutOfRangeException(nameof(offset)); - - if (count < 0) - throw new ArgumentOutOfRangeException(nameof(count)); - - if (inputOff < inputEnd) - throw new InvalidOperationException("Old input was not completely processed"); - - int end = offset + count; - - /* We want to throw an ArrayIndexOutOfBoundsException early. The - * check is very tricky: it also handles integer wrap around. - */ - if ((offset > end) || (end > buffer.Length)) - throw new ArgumentOutOfRangeException(nameof(count)); - - inputBuf = buffer; - inputOff = offset; - inputEnd = end; - } - - /// - /// Determines if more input is needed. - /// - /// Return true if input is needed via SetInput - public bool NeedsInput() => (inputEnd == inputOff); - - /// - /// Set compression dictionary - /// - /// The buffer containing the dictionary data - /// The offset in the buffer for the first byte of data - /// The length of the dictionary data. - public void SetDictionary(byte[] buffer, int offset, int length) - { - checksum.Update(buffer, offset, length); - if (length < DeflaterConstants.MIN_MATCH) - return; - - if (length > DeflaterConstants.MAX_DIST) - { - offset += length - DeflaterConstants.MAX_DIST; - length = DeflaterConstants.MAX_DIST; - } - - Array.Copy(buffer, offset, window, strstart, length); - - UpdateHash(); - --length; - - while (--length > 0) - { - InsertString(); - strstart++; - } - - strstart += 2; - blockStart = strstart; - } - - /// - /// Reset internal state - /// - public void Reset() - { - huffman.Reset(); - checksum.Reset(); - blockStart = strstart = 1; - lookahead = 0; - totalIn = 0; - prevAvailable = false; - matchLen = DeflaterConstants.MIN_MATCH - 1; - - for (int i = 0; i < DeflaterConstants.HASH_SIZE; i++) - head[i] = 0; - - for (int i = 0; i < DeflaterConstants.WSIZE; i++) - prev[i] = 0; - } - - /// - /// Reset Adler checksum - /// - public void ResetAdler() => checksum.Reset(); - - /// - /// Get current value of Adler checksum - /// - public int Adler - { - get - { - return unchecked((int)checksum.Value); - } - } - - /// - /// Total data processed - /// - public long TotalIn - { - get - { - return totalIn; - } - } - - /// - /// Get/set the deflate strategy - /// - public DeflateStrategy Strategy - { - get - { - return strategy; - } - set - { - strategy = value; - } - } - - /// - /// Set the deflate level (0-9) - /// - /// The value to set the level to. - public void SetLevel(int level) - { - if ((level < 0) || (level > 9)) - throw new ArgumentOutOfRangeException(nameof(level)); - - goodLength = DeflaterConstants.GOOD_LENGTH[level]; - max_lazy = DeflaterConstants.MAX_LAZY[level]; - niceLength = DeflaterConstants.NICE_LENGTH[level]; - max_chain = DeflaterConstants.MAX_CHAIN[level]; - - if (DeflaterConstants.COMPR_FUNC[level] != compressionFunction) - { - switch (compressionFunction) - { - case DeflaterConstants.DEFLATE_STORED: - if (strstart > blockStart) - { - huffman.FlushStoredBlock(window, blockStart, - strstart - blockStart, false); - blockStart = strstart; - } - - UpdateHash(); - break; - - case DeflaterConstants.DEFLATE_FAST: - if (strstart > blockStart) - { - huffman.FlushBlock(window, blockStart, strstart - blockStart, - false); - blockStart = strstart; - } - break; - - case DeflaterConstants.DEFLATE_SLOW: - if (prevAvailable) - huffman.TallyLit(window[strstart - 1] & 0xff); - - if (strstart > blockStart) - { - huffman.FlushBlock(window, blockStart, strstart - blockStart, false); - blockStart = strstart; - } - - prevAvailable = false; - matchLen = DeflaterConstants.MIN_MATCH - 1; - break; - } - - compressionFunction = DeflaterConstants.COMPR_FUNC[level]; - } - } - - /// - /// Fill the window - /// - public void FillWindow() - { - /* If the window is almost full and there is insufficient lookahead, - * move the upper half to the lower one to make room in the upper half. - */ - if (strstart >= DeflaterConstants.WSIZE + DeflaterConstants.MAX_DIST) - SlideWindow(); - - /* If there is not enough lookahead, but still some input left, - * read in the input - */ - if (lookahead < DeflaterConstants.MIN_LOOKAHEAD && inputOff < inputEnd) - { - int more = 2 * DeflaterConstants.WSIZE - lookahead - strstart; - - if (more > inputEnd - inputOff) - more = inputEnd - inputOff; - - Array.Copy(inputBuf, inputOff, window, strstart + lookahead, more); - checksum.Update(inputBuf, inputOff, more); - - inputOff += more; - totalIn += more; - lookahead += more; - } - - if (lookahead >= DeflaterConstants.MIN_MATCH) - UpdateHash(); - } - - void UpdateHash() - { - /* - if (DEBUGGING) { - Console.WriteLine("updateHash: "+strstart); - } - */ - ins_h = (window[strstart] << DeflaterConstants.HASH_SHIFT) ^ window[strstart + 1]; - } - - /// - /// Inserts the current string in the head hash and returns the previous - /// value for this hash. - /// - /// The previous hash value - int InsertString() - { - short match; - int hash = ((ins_h << DeflaterConstants.HASH_SHIFT) ^ window[strstart + (DeflaterConstants.MIN_MATCH - 1)]) & DeflaterConstants.HASH_MASK; - - prev[strstart & DeflaterConstants.WMASK] = match = head[hash]; - head[hash] = unchecked((short)strstart); - ins_h = hash; - - return match & 0xffff; - } - - void SlideWindow() - { - Array.Copy(window, DeflaterConstants.WSIZE, window, 0, DeflaterConstants.WSIZE); - matchStart -= DeflaterConstants.WSIZE; - strstart -= DeflaterConstants.WSIZE; - blockStart -= DeflaterConstants.WSIZE; - - // Slide the hash table (could be avoided with 32 bit values - // at the expense of memory usage). - for (int i = 0; i < DeflaterConstants.HASH_SIZE; ++i) - { - int m = head[i] & 0xffff; - head[i] = (short)(m >= DeflaterConstants.WSIZE ? (m - DeflaterConstants.WSIZE) : 0); - } - - // Slide the prev table. - for (int i = 0; i < DeflaterConstants.WSIZE; i++) - { - int m = prev[i] & 0xffff; - prev[i] = (short)(m >= DeflaterConstants.WSIZE ? (m - DeflaterConstants.WSIZE) : 0); - } - } - - /// - /// Find the best (longest) string in the window matching the - /// string starting at strstart. - /// - /// Preconditions: - /// - /// strstart + DeflaterConstants.MAX_MATCH <= window.length. - /// - /// - /// True if a match greater than the minimum length is found - bool FindLongestMatch(int curMatch) - { - int match; - int scan = strstart; - // scanMax is the highest position that we can look at - int scanMax = scan + Math.Min(DeflaterConstants.MAX_MATCH, lookahead) - 1; - int limit = Math.Max(scan - DeflaterConstants.MAX_DIST, 0); - - byte[] window = this.window; - short[] prev = this.prev; - int chainLength = this.max_chain; - int niceLength = Math.Min(this.niceLength, lookahead); - - matchLen = Math.Max(matchLen, DeflaterConstants.MIN_MATCH - 1); - - if (scan + matchLen > scanMax) return false; - - byte scan_end1 = window[scan + matchLen - 1]; - byte scan_end = window[scan + matchLen]; - - // Do not waste too much time if we already have a good match: - if (matchLen >= this.goodLength) chainLength >>= 2; - - do - { - match = curMatch; - scan = strstart; - - if (window[match + matchLen] != scan_end - || window[match + matchLen - 1] != scan_end1 - || window[match] != window[scan] - || window[++match] != window[++scan]) - continue; - - // scan is set to strstart+1 and the comparison passed, so - // scanMax - scan is the maximum number of bytes we can compare. - // below we compare 8 bytes at a time, so first we compare - // (scanMax - scan) % 8 bytes, so the remainder is a multiple of 8 - - switch ((scanMax - scan) % 8) - { - case 1: - if (window[++scan] == window[++match]) break; - break; - case 2: - if (window[++scan] == window[++match] - && window[++scan] == window[++match]) break; - break; - case 3: - if (window[++scan] == window[++match] - && window[++scan] == window[++match] - && window[++scan] == window[++match]) break; - break; - case 4: - if (window[++scan] == window[++match] - && window[++scan] == window[++match] - && window[++scan] == window[++match] - && window[++scan] == window[++match]) break; - break; - case 5: - if (window[++scan] == window[++match] - && window[++scan] == window[++match] - && window[++scan] == window[++match] - && window[++scan] == window[++match] - && window[++scan] == window[++match]) break; - break; - case 6: - if (window[++scan] == window[++match] - && window[++scan] == window[++match] - && window[++scan] == window[++match] - && window[++scan] == window[++match] - && window[++scan] == window[++match] - && window[++scan] == window[++match]) break; - break; - case 7: - if (window[++scan] == window[++match] - && window[++scan] == window[++match] - && window[++scan] == window[++match] - && window[++scan] == window[++match] - && window[++scan] == window[++match] - && window[++scan] == window[++match] - && window[++scan] == window[++match]) break; - break; - } - - if (window[scan] == window[match]) - { - /* We check for insufficient lookahead only every 8th comparison; - * the 256th check will be made at strstart + 258 unless lookahead is - * exhausted first. - */ - do - { - if (scan == scanMax) - { - ++scan; // advance to first position not matched - ++match; - - break; - } - } - while (window[++scan] == window[++match] - && window[++scan] == window[++match] - && window[++scan] == window[++match] - && window[++scan] == window[++match] - && window[++scan] == window[++match] - && window[++scan] == window[++match] - && window[++scan] == window[++match] - && window[++scan] == window[++match]); - } - - if (scan - strstart > matchLen) - { - matchStart = curMatch; - matchLen = scan - strstart; - - if (matchLen >= niceLength) - break; - - scan_end1 = window[scan - 1]; - scan_end = window[scan]; - } - } while ((curMatch = (prev[curMatch & DeflaterConstants.WMASK] & 0xffff)) > limit && 0 != --chainLength); - - return matchLen >= DeflaterConstants.MIN_MATCH; - } - - bool DeflateStored(bool flush, bool finish) - { - if (!flush && (lookahead == 0)) - return false; - - strstart += lookahead; - lookahead = 0; - - int storedLength = strstart - blockStart; - - if ((storedLength >= DeflaterConstants.MAX_BLOCK_SIZE) || // Block is full - (blockStart < DeflaterConstants.WSIZE && storedLength >= DeflaterConstants.MAX_DIST) || // Block may move out of window - flush) - { - bool lastBlock = finish; - if (storedLength > DeflaterConstants.MAX_BLOCK_SIZE) - { - storedLength = DeflaterConstants.MAX_BLOCK_SIZE; - lastBlock = false; - } - - huffman.FlushStoredBlock(window, blockStart, storedLength, lastBlock); - blockStart += storedLength; - return !lastBlock; - } - - return true; - } - - bool DeflateFast(bool flush, bool finish) - { - if (lookahead < DeflaterConstants.MIN_LOOKAHEAD && !flush) - return false; - - while (lookahead >= DeflaterConstants.MIN_LOOKAHEAD || flush) - { - if (lookahead == 0) - { - // We are flushing everything - huffman.FlushBlock(window, blockStart, strstart - blockStart, finish); - blockStart = strstart; - return false; - } - - if (strstart > 2 * DeflaterConstants.WSIZE - DeflaterConstants.MIN_LOOKAHEAD) - { - /* slide window, as FindLongestMatch needs this. - * This should only happen when flushing and the window - * is almost full. - */ - SlideWindow(); - } - - int hashHead; - if (lookahead >= DeflaterConstants.MIN_MATCH && - (hashHead = InsertString()) != 0 && - strategy != DeflateStrategy.HuffmanOnly && - strstart - hashHead <= DeflaterConstants.MAX_DIST && - FindLongestMatch(hashHead)) - { - // longestMatch sets matchStart and matchLen - - bool full = huffman.TallyDist(strstart - matchStart, matchLen); - - lookahead -= matchLen; - if (matchLen <= max_lazy && lookahead >= DeflaterConstants.MIN_MATCH) - { - while (--matchLen > 0) - { - ++strstart; - InsertString(); - } - - ++strstart; - } - else - { - strstart += matchLen; - - if (lookahead >= DeflaterConstants.MIN_MATCH - 1) - UpdateHash(); - } - matchLen = DeflaterConstants.MIN_MATCH - 1; - - if (!full) - continue; - } - else - { - // No match found - huffman.TallyLit(window[strstart] & 0xff); - - ++strstart; - --lookahead; - } - - if (huffman.IsFull()) - { - bool lastBlock = finish && (lookahead == 0); - - huffman.FlushBlock(window, blockStart, strstart - blockStart, lastBlock); - blockStart = strstart; - - return !lastBlock; - } - } - return true; - } - - bool DeflateSlow(bool flush, bool finish) - { - if (lookahead < DeflaterConstants.MIN_LOOKAHEAD && !flush) - return false; - - while (lookahead >= DeflaterConstants.MIN_LOOKAHEAD || flush) - { - if (lookahead == 0) - { - if (prevAvailable) - huffman.TallyLit(window[strstart - 1] & 0xff); - - prevAvailable = false; - - // We are flushing everything - - huffman.FlushBlock(window, blockStart, strstart - blockStart, - finish); - blockStart = strstart; - return false; - } - - if (strstart >= 2 * DeflaterConstants.WSIZE - DeflaterConstants.MIN_LOOKAHEAD) - { - /* slide window, as FindLongestMatch needs this. - * This should only happen when flushing and the window - * is almost full. - */ - SlideWindow(); - } - - int prevMatch = matchStart; - int prevLen = matchLen; - if (lookahead >= DeflaterConstants.MIN_MATCH) - { - - int hashHead = InsertString(); - - if (strategy != DeflateStrategy.HuffmanOnly && - hashHead != 0 && - strstart - hashHead <= DeflaterConstants.MAX_DIST && - FindLongestMatch(hashHead)) - { - - // longestMatch sets matchStart and matchLen - - // Discard match if too small and too far away - if (matchLen <= 5 && (strategy == DeflateStrategy.Filtered || (matchLen == DeflaterConstants.MIN_MATCH && strstart - matchStart > TooFar))) - matchLen = DeflaterConstants.MIN_MATCH - 1; - } - } - - // previous match was better - if ((prevLen >= DeflaterConstants.MIN_MATCH) && (matchLen <= prevLen)) - { - - huffman.TallyDist(strstart - 1 - prevMatch, prevLen); - prevLen -= 2; - do - { - strstart++; - lookahead--; - if (lookahead >= DeflaterConstants.MIN_MATCH) - InsertString(); - - } while (--prevLen > 0); - - strstart++; - lookahead--; - prevAvailable = false; - matchLen = DeflaterConstants.MIN_MATCH - 1; - } - else - { - if (prevAvailable) - huffman.TallyLit(window[strstart - 1] & 0xff); - - prevAvailable = true; - strstart++; - lookahead--; - } - - if (huffman.IsFull()) - { - int len = strstart - blockStart; - - if (prevAvailable) - len--; - - bool lastBlock = (finish && (lookahead == 0) && !prevAvailable); - huffman.FlushBlock(window, blockStart, len, lastBlock); - blockStart += len; - return !lastBlock; - } - } - return true; - } - - #region Instance Fields - - // Hash index of string to be inserted - int ins_h; - - /// - /// Hashtable, hashing three characters to an index for window, so - /// that window[index]..window[index+2] have this hash code. - /// Note that the array should really be unsigned short, so you need - /// to and the values with 0xffff. - /// - short[] head; - - /// - /// prev[index & WMASK] points to the previous index that has the - /// same hash code as the string starting at index. This way - /// entries with the same hash code are in a linked list. - /// Note that the array should really be unsigned short, so you need - /// to and the values with 0xffff. - /// - short[] prev; - - int matchStart; - // Length of best match - int matchLen; - // Set if previous match exists - bool prevAvailable; - int blockStart; - - /// - /// Points to the current character in the window. - /// - int strstart; - - /// - /// lookahead is the number of characters starting at strstart in - /// window that are valid. - /// So window[strstart] until window[strstart+lookahead-1] are valid - /// characters. - /// - int lookahead; - - /// - /// This array contains the part of the uncompressed stream that - /// is of relevance. The current character is indexed by strstart. - /// - byte[] window; - - DeflateStrategy strategy; - int max_chain, max_lazy, niceLength, goodLength; - - /// - /// The current compression function. - /// - int compressionFunction; - - /// - /// The input data for compression. - /// - byte[] inputBuf; - - /// - /// The total bytes of input read. - /// - long totalIn; - - /// - /// The offset into inputBuf, where input data starts. - /// - int inputOff; - - /// - /// The end offset of the input data. - /// - int inputEnd; - - DeflaterPending pending; - DeflaterHuffman huffman; - - /// - /// The adler checksum - /// - IChecksum checksum; - #endregion - } -} diff --git a/UpdateLib/UpdateLib/Compression/Deflaters/DeflaterHuffman.cs b/UpdateLib/UpdateLib/Compression/Deflaters/DeflaterHuffman.cs deleted file mode 100644 index 41d8c2a..0000000 --- a/UpdateLib/UpdateLib/Compression/Deflaters/DeflaterHuffman.cs +++ /dev/null @@ -1,894 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -using System; - -namespace MatthiWare.UpdateLib.Compression.Deflaters -{ - /// - /// This is the DeflaterHuffman class. - /// - /// This class is not thread safe. This is inherent in the API, due - /// to the split of Deflate and SetInput. - /// - /// author of the original java version : Jochen Hoenicke - /// - public class DeflaterHuffman - { - const int BUFSIZE = 1 << (DeflaterConstants.DEFAULT_MEM_LEVEL + 6); - const int LITERAL_NUM = 286; - - // Number of distance codes - const int DIST_NUM = 30; - // Number of codes used to transfer bit lengths - const int BITLEN_NUM = 19; - - // repeat previous bit length 3-6 times (2 bits of repeat count) - const int REP_3_6 = 16; - // repeat a zero length 3-10 times (3 bits of repeat count) - const int REP_3_10 = 17; - // repeat a zero length 11-138 times (7 bits of repeat count) - const int REP_11_138 = 18; - - const int EOF_SYMBOL = 256; - - // The lengths of the bit length codes are sent in order of decreasing - // probability, to avoid transmitting the lengths for unused bit length codes. - static readonly int[] BL_ORDER = { 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 }; - - static readonly byte[] bit4Reverse = { - 0, - 8, - 4, - 12, - 2, - 10, - 6, - 14, - 1, - 9, - 5, - 13, - 3, - 11, - 7, - 15 - }; - - static short[] staticLCodes; - static byte[] staticLLength; - static short[] staticDCodes; - static byte[] staticDLength; - - class Tree - { - #region Instance Fields - public short[] freqs; - - public byte[] length; - - public int minNumCodes; - - public int numCodes; - - short[] codes; - readonly int[] bl_counts; - readonly int maxLength; - DeflaterHuffman dh; - #endregion - - #region Constructors - public Tree(DeflaterHuffman dh, int elems, int minCodes, int maxLength) - { - this.dh = dh; - this.minNumCodes = minCodes; - this.maxLength = maxLength; - freqs = new short[elems]; - bl_counts = new int[maxLength]; - } - - #endregion - - /// - /// Resets the internal state of the tree - /// - public void Reset() - { - for (int i = 0; i < freqs.Length; i++) - freqs[i] = 0; - - codes = null; - length = null; - } - - public void WriteSymbol(int code) - { - // if (DeflaterConstants.DEBUGGING) { - // freqs[code]--; - // // Console.Write("writeSymbol("+freqs.length+","+code+"): "); - // } - dh.pending.WriteBits(codes[code] & 0xffff, length[code]); - } - - /// - /// Check that all frequencies are zero - /// - /// - /// At least one frequency is non-zero - /// - public void CheckEmpty() - { - bool empty = true; - for (int i = 0; i < freqs.Length; i++) - empty &= freqs[i] == 0; - - if (!empty) - throw new InvalidOperationException("!Empty"); - } - - /// - /// Set static codes and length - /// - /// new codes - /// length for new codes - public void SetStaticCodes(short[] staticCodes, byte[] staticLengths) - { - codes = staticCodes; - length = staticLengths; - } - - /// - /// Build dynamic codes and lengths - /// - public void BuildCodes() - { - int numSymbols = freqs.Length; - int[] nextCode = new int[maxLength]; - int code = 0; - - codes = new short[freqs.Length]; - - // if (DeflaterConstants.DEBUGGING) { - // //Console.WriteLine("buildCodes: "+freqs.Length); - // } - - for (int bits = 0; bits < maxLength; bits++) - { - nextCode[bits] = code; - code += bl_counts[bits] << (15 - bits); - - // if (DeflaterConstants.DEBUGGING) { - // //Console.WriteLine("bits: " + ( bits + 1) + " count: " + bl_counts[bits] - // +" nextCode: "+code); - // } - } - - for (int i = 0; i < numCodes; i++) - { - int bits = length[i]; - if (bits > 0) - { - - // if (DeflaterConstants.DEBUGGING) { - // //Console.WriteLine("codes["+i+"] = rev(" + nextCode[bits-1]+"), - // +bits); - // } - - codes[i] = BitReverse(nextCode[bits - 1]); - nextCode[bits - 1] += 1 << (16 - bits); - } - } - } - - public void BuildTree() - { - int numSymbols = freqs.Length; - - /* heap is a priority queue, sorted by frequency, least frequent - * nodes first. The heap is a binary tree, with the property, that - * the parent node is smaller than both child nodes. This assures - * that the smallest node is the first parent. - * - * The binary tree is encoded in an array: 0 is root node and - * the nodes 2*n+1, 2*n+2 are the child nodes of node n. - */ - int[] heap = new int[numSymbols]; - int heapLen = 0; - int maxCode = 0; - for (int n = 0; n < numSymbols; n++) - { - int freq = freqs[n]; - if (freq != 0) - { - // Insert n into heap - int pos = heapLen++; - int ppos; - - while (pos > 0 && freqs[heap[ppos = (pos - 1) / 2]] > freq) - { - heap[pos] = heap[ppos]; - pos = ppos; - } - - heap[pos] = n; - - maxCode = n; - } - } - - /* We could encode a single literal with 0 bits but then we - * don't see the literals. Therefore we force at least two - * literals to avoid this case. We don't care about order in - * this case, both literals get a 1 bit code. - */ - while (heapLen < 2) - { - int node = maxCode < 2 ? ++maxCode : 0; - heap[heapLen++] = node; - } - - numCodes = Math.Max(maxCode + 1, minNumCodes); - - int numLeafs = heapLen; - int[] childs = new int[4 * heapLen - 2]; - int[] values = new int[2 * heapLen - 1]; - int numNodes = numLeafs; - - for (int i = 0; i < heapLen; i++) - { - int node = heap[i]; - childs[2 * i] = node; - childs[2 * i + 1] = -1; - values[i] = freqs[node] << 8; - heap[i] = i; - } - - /* Construct the Huffman tree by repeatedly combining the least two - * frequent nodes. - */ - do - { - int first = heap[0]; - int last = heap[--heapLen]; - - // Propagate the hole to the leafs of the heap - int ppos = 0; - int path = 1; - - while (path < heapLen) - { - if (path + 1 < heapLen && values[heap[path]] > values[heap[path + 1]]) - path++; - - heap[ppos] = heap[path]; - ppos = path; - path = path * 2 + 1; - } - - /* Now propagate the last element down along path. Normally - * it shouldn't go too deep. - */ - int lastVal = values[last]; - - while ((path = ppos) > 0 && values[heap[ppos = (path - 1) / 2]] > lastVal) - heap[path] = heap[ppos]; - - heap[path] = last; - - - int second = heap[0]; - - // Create a new node father of first and second - last = numNodes++; - childs[2 * last] = first; - childs[2 * last + 1] = second; - int mindepth = Math.Min(values[first] & 0xff, values[second] & 0xff); - values[last] = lastVal = values[first] + values[second] - mindepth + 1; - - // Again, propagate the hole to the leafs - ppos = 0; - path = 1; - - while (path < heapLen) - { - if (path + 1 < heapLen && values[heap[path]] > values[heap[path + 1]]) - path++; - - heap[ppos] = heap[path]; - ppos = path; - path = ppos * 2 + 1; - } - - // Now propagate the new element down along path - while ((path = ppos) > 0 && values[heap[ppos = (path - 1) / 2]] > lastVal) - heap[path] = heap[ppos]; - - heap[path] = last; - } while (heapLen > 1); - - if (heap[0] != childs.Length / 2 - 1) - throw new AccessViolationException("Heap invariant violated"); - - BuildLength(childs); - } - - /// - /// Get encoded length - /// - /// Encoded length, the sum of frequencies * lengths - public int GetEncodedLength() - { - int len = 0; - - for (int i = 0; i < freqs.Length; i++) - len += freqs[i] * length[i]; - - return len; - } - - /// - /// Scan a literal or distance tree to determine the frequencies of the codes - /// in the bit length tree. - /// - public void CalcBLFreq(Tree blTree) - { - int max_count; /* max repeat count */ - int min_count; /* min repeat count */ - int count; /* repeat count of the current code */ - int curlen = -1; /* length of current code */ - - int i = 0; - while (i < numCodes) - { - count = 1; - int nextlen = length[i]; - - if (nextlen == 0) - { - max_count = 138; - min_count = 3; - } - else - { - max_count = 6; - min_count = 3; - if (curlen != nextlen) - { - blTree.freqs[nextlen]++; - count = 0; - } - } - - curlen = nextlen; - i++; - - while (i < numCodes && curlen == length[i]) - { - i++; - if (++count >= max_count) - break; - } - - if (count < min_count) - blTree.freqs[curlen] += (short)count; - else if (curlen != 0) - blTree.freqs[REP_3_6]++; - else if (count <= 10) - blTree.freqs[REP_3_10]++; - else - blTree.freqs[REP_11_138]++; - } - } - - /// - /// Write tree values - /// - /// Tree to write - public void WriteTree(Tree blTree) - { - int max_count; // max repeat count - int min_count; // min repeat count - int count; // repeat count of the current code - int curlen = -1; // length of current code - - int i = 0; - while (i < numCodes) - { - count = 1; - int nextlen = length[i]; - - if (nextlen == 0) - { - max_count = 138; - min_count = 3; - } - else - { - max_count = 6; - min_count = 3; - if (curlen != nextlen) - { - blTree.WriteSymbol(nextlen); - count = 0; - } - } - - curlen = nextlen; - i++; - - while (i < numCodes && curlen == length[i]) - { - i++; - if (++count >= max_count) - break; - } - - if (count < min_count) - { - while (count-- > 0) - blTree.WriteSymbol(curlen); - } - else if (curlen != 0) - { - blTree.WriteSymbol(REP_3_6); - dh.pending.WriteBits(count - 3, 2); - } - else if (count <= 10) - { - blTree.WriteSymbol(REP_3_10); - dh.pending.WriteBits(count - 3, 3); - } - else - { - blTree.WriteSymbol(REP_11_138); - dh.pending.WriteBits(count - 11, 7); - } - } - } - - void BuildLength(int[] childs) - { - length = new byte[freqs.Length]; - int numNodes = childs.Length / 2; - int numLeafs = (numNodes + 1) / 2; - int overflow = 0; - - for (int i = 0; i < maxLength; i++) - bl_counts[i] = 0; - - // First calculate optimal bit lengths - int[] lengths = new int[numNodes]; - lengths[numNodes - 1] = 0; - - for (int i = numNodes - 1; i >= 0; i--) - { - if (childs[2 * i + 1] != -1) - { - int bitLength = lengths[i] + 1; - - if (bitLength > maxLength) - { - bitLength = maxLength; - overflow++; - } - - lengths[childs[2 * i]] = lengths[childs[2 * i + 1]] = bitLength; - } - else - { - // A leaf node - int bitLength = lengths[i]; - bl_counts[bitLength - 1]++; - length[childs[2 * i]] = (byte)lengths[i]; - } - } - - if (overflow == 0) - return; - - int incrBitLen = maxLength - 1; - do - { - // Find the first bit length which could increase: - while (bl_counts[--incrBitLen] == 0) ; - - // Move this node one down and remove a corresponding - // number of overflow nodes. - do - { - bl_counts[incrBitLen]--; - bl_counts[++incrBitLen]++; - overflow -= 1 << (maxLength - 1 - incrBitLen); - } while (overflow > 0 && incrBitLen < maxLength - 1); - } while (overflow > 0); - - /* We may have overshot above. Move some nodes from maxLength to - * maxLength-1 in that case. - */ - bl_counts[maxLength - 1] += overflow; - bl_counts[maxLength - 2] -= overflow; - - /* Now recompute all bit lengths, scanning in increasing - * frequency. It is simpler to reconstruct all lengths instead of - * fixing only the wrong ones. This idea is taken from 'ar' - * written by Haruhiko Okumura. - * - * The nodes were inserted with decreasing frequency into the childs - * array. - */ - int nodePtr = 2 * numLeafs; - for (int bits = maxLength; bits != 0; bits--) - { - int n = bl_counts[bits - 1]; - while (n > 0) - { - int childPtr = 2 * childs[nodePtr++]; - if (childs[childPtr + 1] == -1) - { - // We found another leaf - length[childs[childPtr]] = (byte)bits; - n--; - } - } - } - // if (DeflaterConstants.DEBUGGING) { - // //Console.WriteLine("*** After overflow elimination. ***"); - // for (int i=0; i < numLeafs; i++) { - // //Console.WriteLine("Node "+childs[2*i]+" freq: "+freqs[childs[2*i]] - // + " len: "+length[childs[2*i]]); - // } - // } - } - - } - - #region Instance Fields - /// - /// Pending buffer to use - /// - public DeflaterPending pending; - - Tree literalTree; - Tree distTree; - Tree blTree; - - // Buffer for distances - short[] d_buf; - byte[] l_buf; - int last_lit; - int extra_bits; - #endregion - - static DeflaterHuffman() - { - // See RFC 1951 3.2.6 - // Literal codes - staticLCodes = new short[LITERAL_NUM]; - staticLLength = new byte[LITERAL_NUM]; - - int i = 0; - while (i < 144) - { - staticLCodes[i] = BitReverse((0x030 + i) << 8); - staticLLength[i++] = 8; - } - - while (i < 256) - { - staticLCodes[i] = BitReverse((0x190 - 144 + i) << 7); - staticLLength[i++] = 9; - } - - while (i < 280) - { - staticLCodes[i] = BitReverse((0x000 - 256 + i) << 9); - staticLLength[i++] = 7; - } - - while (i < LITERAL_NUM) - { - staticLCodes[i] = BitReverse((0x0c0 - 280 + i) << 8); - staticLLength[i++] = 8; - } - - // Distance codes - staticDCodes = new short[DIST_NUM]; - staticDLength = new byte[DIST_NUM]; - - for (i = 0; i < DIST_NUM; i++) - { - staticDCodes[i] = BitReverse(i << 11); - staticDLength[i] = 5; - } - } - - /// - /// Construct instance with pending buffer - /// - /// Pending buffer to use - public DeflaterHuffman(DeflaterPending pending) - { - this.pending = pending; - - literalTree = new Tree(this, LITERAL_NUM, 257, 15); - distTree = new Tree(this, DIST_NUM, 1, 15); - blTree = new Tree(this, BITLEN_NUM, 4, 7); - - d_buf = new short[BUFSIZE]; - l_buf = new byte[BUFSIZE]; - } - - /// - /// Reset internal state - /// - public void Reset() - { - last_lit = 0; - extra_bits = 0; - literalTree.Reset(); - distTree.Reset(); - blTree.Reset(); - } - - /// - /// Write all trees to pending buffer - /// - /// The number/rank of treecodes to send. - public void SendAllTrees(int blTreeCodes) - { - blTree.BuildCodes(); - literalTree.BuildCodes(); - distTree.BuildCodes(); - pending.WriteBits(literalTree.numCodes - 257, 5); - pending.WriteBits(distTree.numCodes - 1, 5); - pending.WriteBits(blTreeCodes - 4, 4); - - for (int rank = 0; rank < blTreeCodes; rank++) - pending.WriteBits(blTree.length[BL_ORDER[rank]], 3); - - literalTree.WriteTree(blTree); - distTree.WriteTree(blTree); - } - - /// - /// Compress current buffer writing data to pending buffer - /// - public void CompressBlock() - { - for (int i = 0; i < last_lit; i++) - { - int litlen = l_buf[i] & 0xff; - int dist = d_buf[i]; - if (dist-- != 0) - { - int lc = Lcode(litlen); - literalTree.WriteSymbol(lc); - - int bits = (lc - 261) / 4; - if (bits > 0 && bits <= 5) - pending.WriteBits(litlen & ((1 << bits) - 1), bits); - - int dc = Dcode(dist); - distTree.WriteSymbol(dc); - - bits = dc / 2 - 1; - if (bits > 0) - pending.WriteBits(dist & ((1 << bits) - 1), bits); - } - else - literalTree.WriteSymbol(litlen); - } - - literalTree.WriteSymbol(EOF_SYMBOL); - } - - /// - /// Flush block to output with no compression - /// - /// Data to write - /// Index of first byte to write - /// Count of bytes to write - /// True if this is the last block - public void FlushStoredBlock(byte[] stored, int storedOffset, int storedLength, bool lastBlock) - { - pending.WriteBits((DeflaterConstants.STORED_BLOCK << 1) + (lastBlock ? 1 : 0), 3); - pending.AlignToByte(); - pending.WriteShort(storedLength); - pending.WriteShort(~storedLength); - pending.WriteBlock(stored, storedOffset, storedLength); - Reset(); - } - - /// - /// Flush block to output with compression - /// - /// Data to flush - /// Index of first byte to flush - /// Count of bytes to flush - /// True if this is the last block - public void FlushBlock(byte[] stored, int storedOffset, int storedLength, bool lastBlock) - { - literalTree.freqs[EOF_SYMBOL]++; - - // Build trees - literalTree.BuildTree(); - distTree.BuildTree(); - - // Calculate bitlen frequency - literalTree.CalcBLFreq(blTree); - distTree.CalcBLFreq(blTree); - - // Build bitlen tree - blTree.BuildTree(); - - int blTreeCodes = 4; - for (int i = 18; i > blTreeCodes; i--) - if (blTree.length[BL_ORDER[i]] > 0) - blTreeCodes = i + 1; - - int opt_len = 14 + blTreeCodes * 3 + blTree.GetEncodedLength() + - literalTree.GetEncodedLength() + distTree.GetEncodedLength() + - extra_bits; - - int static_len = extra_bits; - - for (int i = 0; i < LITERAL_NUM; i++) - static_len += literalTree.freqs[i] * staticLLength[i]; - - for (int i = 0; i < DIST_NUM; i++) - static_len += distTree.freqs[i] * staticDLength[i]; - - if (opt_len >= static_len) - opt_len = static_len;// Force static trees - - if (storedOffset >= 0 && storedLength + 4 < opt_len >> 3) - { - // Store Block - - // if (DeflaterConstants.DEBUGGING) { - // //Console.WriteLine("Storing, since " + storedLength + " < " + opt_len - // + " <= " + static_len); - // } - FlushStoredBlock(stored, storedOffset, storedLength, lastBlock); - } - else if (opt_len == static_len) - { - // Encode with static tree - pending.WriteBits((DeflaterConstants.STATIC_TREES << 1) + (lastBlock ? 1 : 0), 3); - literalTree.SetStaticCodes(staticLCodes, staticLLength); - distTree.SetStaticCodes(staticDCodes, staticDLength); - CompressBlock(); - Reset(); - } - else - { - // Encode with dynamic tree - pending.WriteBits((DeflaterConstants.DYN_TREES << 1) + (lastBlock ? 1 : 0), 3); - SendAllTrees(blTreeCodes); - CompressBlock(); - Reset(); - } - } - - /// - /// Get value indicating if internal buffer is full - /// - /// true if buffer is full - public bool IsFull() => last_lit >= BUFSIZE; - - /// - /// Add literal to buffer - /// - /// Literal value to add to buffer. - /// Value indicating internal buffer is full - public bool TallyLit(int literal) - { - d_buf[last_lit] = 0; - l_buf[last_lit++] = (byte)literal; - literalTree.freqs[literal]++; - return IsFull(); - } - - /// - /// Add distance code and length to literal and distance trees - /// - /// Distance code - /// Length - /// Value indicating if internal buffer is full - public bool TallyDist(int distance, int length) - { - - d_buf[last_lit] = (short)distance; - l_buf[last_lit++] = (byte)(length - 3); - - int lc = Lcode(length - 3); - literalTree.freqs[lc]++; - - if (lc >= 265 && lc < 285) - extra_bits += (lc - 261) / 4; - - int dc = Dcode(distance - 1); - distTree.freqs[dc]++; - - if (dc >= 4) - extra_bits += dc / 2 - 1; - - return IsFull(); - } - - - /// - /// Reverse the bits of a 16 bit value. - /// - /// Value to reverse bits - /// Value with bits reversed - public static short BitReverse(int toReverse) - { - return (short)(bit4Reverse[toReverse & 0xF] << 12 | - bit4Reverse[(toReverse >> 4) & 0xF] << 8 | - bit4Reverse[(toReverse >> 8) & 0xF] << 4 | - bit4Reverse[toReverse >> 12]); - } - - static int Lcode(int length) - { - if (length == 255) - return 285; - - int code = 257; - - while (length >= 8) - { - code += 4; - length >>= 1; - } - - return code + length; - } - - static int Dcode(int distance) - { - int code = 0; - - while (distance >= 4) - { - code += 2; - distance >>= 1; - } - - return code + distance; - } - } -} diff --git a/UpdateLib/UpdateLib/Compression/Deflaters/DeflaterPending.cs b/UpdateLib/UpdateLib/Compression/Deflaters/DeflaterPending.cs deleted file mode 100644 index 6376660..0000000 --- a/UpdateLib/UpdateLib/Compression/Deflaters/DeflaterPending.cs +++ /dev/null @@ -1,53 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - - -namespace MatthiWare.UpdateLib.Compression.Deflaters -{ - /// - /// This class stores the pending output of the Deflater. - /// - /// author of the original java version : Jochen Hoenicke - /// - public class DeflaterPending : PendingBuffer - { - /// - /// Construct instance with default buffer size - /// - public DeflaterPending() : base(DeflaterConstants.PENDING_BUF_SIZE) - { - } - } -} diff --git a/UpdateLib/UpdateLib/Compression/Deflaters/Inflater.cs b/UpdateLib/UpdateLib/Compression/Deflaters/Inflater.cs deleted file mode 100644 index df7df7d..0000000 --- a/UpdateLib/UpdateLib/Compression/Deflaters/Inflater.cs +++ /dev/null @@ -1,857 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -using MatthiWare.UpdateLib.Compression.Checksum; -using MatthiWare.UpdateLib.Compression.Streams; -using System; - -namespace MatthiWare.UpdateLib.Compression.Deflaters -{ - /// - /// Inflater is used to decompress data that has been compressed according - /// to the "deflate" standard described in rfc1951. - /// - /// By default Zlib (rfc1950) headers and footers are expected in the input. - /// You can use constructor public Inflater(bool noHeader) passing true - /// if there is no Zlib header information - /// - /// The usage is as following. First you have to set some input with - /// SetInput(), then Inflate() it. If inflate doesn't - /// inflate any bytes there may be three reasons: - ///
    - ///
  • IsNeedingInput() returns true because the input buffer is empty. - /// You have to provide more input with SetInput(). - /// NOTE: IsNeedingInput() also returns true when, the stream is finished. - ///
  • - ///
  • IsNeedingDictionary() returns true, you have to provide a preset - /// dictionary with SetDictionary().
  • - ///
  • IsFinished returns true, the inflater has finished.
  • - ///
- /// Once the first output byte is produced, a dictionary will not be - /// needed at a later stage. - /// - /// author of the original java version : John Leuner, Jochen Hoenicke - ///
- public class Inflater - { - #region Constants/Readonly - /// - /// Copy lengths for literal codes 257..285 - /// - static readonly int[] CPLENS = { - 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, - 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258 - }; - - /// - /// Extra bits for literal codes 257..285 - /// - static readonly int[] CPLEXT = { - 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, - 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0 - }; - - /// - /// Copy offsets for distance codes 0..29 - /// - static readonly int[] CPDIST = { - 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, - 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, - 8193, 12289, 16385, 24577 - }; - - /// - /// Extra bits for distance codes - /// - static readonly int[] CPDEXT = { - 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, - 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, - 12, 12, 13, 13 - }; - - /// - /// These are the possible states for an inflater - /// - const int DECODE_HEADER = 0; - const int DECODE_DICT = 1; - const int DECODE_BLOCKS = 2; - const int DECODE_STORED_LEN1 = 3; - const int DECODE_STORED_LEN2 = 4; - const int DECODE_STORED = 5; - const int DECODE_DYN_HEADER = 6; - const int DECODE_HUFFMAN = 7; - const int DECODE_HUFFMAN_LENBITS = 8; - const int DECODE_HUFFMAN_DIST = 9; - const int DECODE_HUFFMAN_DISTBITS = 10; - const int DECODE_CHKSUM = 11; - const int FINISHED = 12; - #endregion - - #region Instance Fields - /// - /// This variable contains the current state. - /// - int mode; - - /// - /// The adler checksum of the dictionary or of the decompressed - /// stream, as it is written in the header resp. footer of the - /// compressed stream. - /// Only valid if mode is DECODE_DICT or DECODE_CHKSUM. - /// - int readAdler; - - /// - /// The number of bits needed to complete the current state. This - /// is valid, if mode is DECODE_DICT, DECODE_CHKSUM, - /// DECODE_HUFFMAN_LENBITS or DECODE_HUFFMAN_DISTBITS. - /// - int neededBits; - int repLength; - int repDist; - int uncomprLen; - - /// - /// True, if the last block flag was set in the last block of the - /// inflated stream. This means that the stream ends after the - /// current block. - /// - bool isLastBlock; - - /// - /// The total number of inflated bytes. - /// - long totalOut; - - /// - /// The total number of bytes set with setInput(). This is not the - /// value returned by the TotalIn property, since this also includes the - /// unprocessed input. - /// - long totalIn; - - /// - /// This variable stores the noHeader flag that was given to the constructor. - /// True means, that the inflated stream doesn't contain a Zlib header or - /// footer. - /// - bool noHeader; - readonly StreamManipulator input; - OutputWindow outputWindow; - InflaterDynHeader dynHeader; - InflaterHuffmanTree litlenTree, distTree; - IChecksum checksum; - #endregion - - #region Constructors - /// - /// Creates a new inflater or RFC1951 decompressor - /// RFC1950/Zlib headers and footers will be expected in the input data - /// - public Inflater() : this(false) - { - } - - /// - /// Creates a new inflater. - /// - /// - /// True if no RFC1950/Zlib header and footer fields are expected in the input data - /// - /// This is used for GZIPed/Zipped input. - /// - /// For compatibility with - /// Sun JDK you should provide one byte of input more than needed in - /// this case. - /// - public Inflater(bool NoHeader) - { - noHeader = NoHeader; - checksum = new Adler32(); - input = new StreamManipulator(); - outputWindow = new OutputWindow(); - mode = NoHeader ? DECODE_BLOCKS : DECODE_HEADER; - } - #endregion - - /// - /// Resets the inflater so that a new stream can be decompressed. All - /// pending input and output will be discarded. - /// - public void Reset() - { - mode = noHeader ? DECODE_BLOCKS : DECODE_HEADER; - totalIn = 0; - totalOut = 0; - input.Reset(); - outputWindow.Reset(); - dynHeader = null; - litlenTree = null; - distTree = null; - isLastBlock = false; - checksum.Reset(); - } - - /// - /// Decodes a zlib/RFC1950 header. - /// - /// - /// False if more input is needed. - /// - /// - /// The header is invalid. - /// - private bool DecodeHeader() - { - int header = input.PeekBits(16); - - if (header < 0) - return false; - - input.DropBits(16); - - // The header is written in "wrong" byte order - header = ((header << 8) | (header >> 8)) & 0xffff; - if (header % 31 != 0) - throw new NotSupportedException("Header checksum invalid"); - - if ((header & 0x0f00) != (Deflater.DEFLATED << 8)) - throw new NotSupportedException("Compression Method unknown"); - - /* Maximum size of the backwards window in bits. - * We currently ignore this, but we could use it to make the - * inflater window more space efficient. On the other hand the - * full window (15 bits) is needed most times, anyway. - int max_wbits = ((header & 0x7000) >> 12) + 8; - */ - - if ((header & 0x0020) == 0) - mode = DECODE_BLOCKS; // Dictionary flag? - else - { - mode = DECODE_DICT; - neededBits = 32; - } - return true; - } - - /// - /// Decodes the dictionary checksum after the deflate header. - /// - /// - /// False if more input is needed. - /// - private bool DecodeDict() - { - while (neededBits > 0) - { - int dictByte = input.PeekBits(8); - - if (dictByte < 0) - return false; - - input.DropBits(8); - readAdler = (readAdler << 8) | dictByte; - neededBits -= 8; - } - - return false; - } - - /// - /// Decodes the huffman encoded symbols in the input stream. - /// - /// - /// false if more input is needed, true if output window is - /// full or the current block ends. - /// - /// - /// if deflated stream is invalid. - /// - private bool DecodeHuffman() - { - int free = outputWindow.GetFreeSpace(); - while (free >= 258) - { - int symbol; - switch (mode) - { - case DECODE_HUFFMAN: - // This is the inner loop so it is optimized a bit - while (((symbol = litlenTree.GetSymbol(input)) & ~0xff) == 0) - { - outputWindow.Write(symbol); - - if (--free < 258) - return true; - } - - if (symbol < 257) - { - if (symbol < 0) - return false; - else - { - // symbol == 256: end of block - distTree = null; - litlenTree = null; - mode = DECODE_BLOCKS; - return true; - } - } - - try - { - repLength = CPLENS[symbol - 257]; - neededBits = CPLEXT[symbol - 257]; - } - catch (Exception e) - { - throw new Exception("Illegal rep length code", e); - } - goto case DECODE_HUFFMAN_LENBITS; // fall through - - case DECODE_HUFFMAN_LENBITS: - if (neededBits > 0) - { - mode = DECODE_HUFFMAN_LENBITS; - int i = input.PeekBits(neededBits); - - if (i < 0) - return false; - - input.DropBits(neededBits); - repLength += i; - } - - mode = DECODE_HUFFMAN_DIST; - goto case DECODE_HUFFMAN_DIST; // fall through - - case DECODE_HUFFMAN_DIST: - symbol = distTree.GetSymbol(input); - if (symbol < 0) - return false; - - try - { - repDist = CPDIST[symbol]; - neededBits = CPDEXT[symbol]; - } - catch (Exception e) - { - throw new Exception("Illegal rep dist code", e); - } - - goto case DECODE_HUFFMAN_DISTBITS; // fall through - - case DECODE_HUFFMAN_DISTBITS: - if (neededBits > 0) - { - mode = DECODE_HUFFMAN_DISTBITS; - int i = input.PeekBits(neededBits); - if (i < 0) - return false; - - input.DropBits(neededBits); - repDist += i; - } - - outputWindow.Repeat(repLength, repDist); - free -= repLength; - mode = DECODE_HUFFMAN; - break; - - default: - throw new NotSupportedException("Inflater unknown mode"); - } - } - return true; - } - - /// - /// Decodes the adler checksum after the deflate stream. - /// - /// - /// false if more input is needed. - /// - /// - /// If checksum doesn't match. - /// - private bool DecodeChksum() - { - while (neededBits > 0) - { - int chkByte = input.PeekBits(8); - if (chkByte < 0) - return false; - - input.DropBits(8); - readAdler = (readAdler << 8) | chkByte; - neededBits -= 8; - } - - if ((int)checksum.Value != readAdler) - throw new Exception("Adler chksum doesn't match: " + (int)checksum.Value + " vs. " + readAdler); - - mode = FINISHED; - return false; - } - - /// - /// Decodes the deflated stream. - /// - /// - /// false if more input is needed, or if finished. - /// - /// - /// if deflated stream is invalid. - /// - private bool Decode() - { - switch (mode) - { - case DECODE_HEADER: - return DecodeHeader(); - - case DECODE_DICT: - return DecodeDict(); - - case DECODE_CHKSUM: - return DecodeChksum(); - - case DECODE_BLOCKS: - if (isLastBlock) - { - if (noHeader) - { - mode = FINISHED; - return false; - } - else - { - input.SkipToByteBoundary(); - neededBits = 32; - mode = DECODE_CHKSUM; - return true; - } - } - - int type = input.PeekBits(3); - if (type < 0) - return false; - - input.DropBits(3); - - isLastBlock |= (type & 1) != 0; - switch (type >> 1) - { - case DeflaterConstants.STORED_BLOCK: - input.SkipToByteBoundary(); - mode = DECODE_STORED_LEN1; - break; - case DeflaterConstants.STATIC_TREES: - litlenTree = InflaterHuffmanTree.defLitLenTree; - distTree = InflaterHuffmanTree.defDistTree; - mode = DECODE_HUFFMAN; - break; - case DeflaterConstants.DYN_TREES: - dynHeader = new InflaterDynHeader(); - mode = DECODE_DYN_HEADER; - break; - default: - throw new NotSupportedException("Unknown block type " + type); - } - return true; - - case DECODE_STORED_LEN1: - { - if ((uncomprLen = input.PeekBits(16)) < 0) - return false; - - input.DropBits(16); - mode = DECODE_STORED_LEN2; - } - goto case DECODE_STORED_LEN2; // fall through - - case DECODE_STORED_LEN2: - { - int nlen = input.PeekBits(16); - if (nlen < 0) - return false; - - input.DropBits(16); - if (nlen != (uncomprLen ^ 0xffff)) - throw new FormatException("broken uncompressed block"); - - mode = DECODE_STORED; - } - goto case DECODE_STORED; // fall through - - case DECODE_STORED: - { - int more = outputWindow.CopyStored(input, uncomprLen); - uncomprLen -= more; - if (uncomprLen == 0) - { - mode = DECODE_BLOCKS; - return true; - } - return !input.IsNeedingInput; - } - - case DECODE_DYN_HEADER: - if (!dynHeader.Decode(input)) - return false; - - litlenTree = dynHeader.BuildLitLenTree(); - distTree = dynHeader.BuildDistTree(); - mode = DECODE_HUFFMAN; - goto case DECODE_HUFFMAN; // fall through - - case DECODE_HUFFMAN: - case DECODE_HUFFMAN_LENBITS: - case DECODE_HUFFMAN_DIST: - case DECODE_HUFFMAN_DISTBITS: - return DecodeHuffman(); - - case FINISHED: - return false; - - default: - throw new NotSupportedException("Inflater.Decode unknown mode"); - } - } - - /// - /// Sets the preset dictionary. This should only be called, if - /// needsDictionary() returns true and it should set the same - /// dictionary, that was used for deflating. The getAdler() - /// function returns the checksum of the dictionary needed. - /// - /// - /// The dictionary. - /// - public void SetDictionary(byte[] buffer) => SetDictionary(buffer, 0, buffer.Length); - - /// - /// Sets the preset dictionary. This should only be called, if - /// needsDictionary() returns true and it should set the same - /// dictionary, that was used for deflating. The getAdler() - /// function returns the checksum of the dictionary needed. - /// - /// - /// The dictionary. - /// - /// - /// The index into buffer where the dictionary starts. - /// - /// - /// The number of bytes in the dictionary. - /// - /// - /// No dictionary is needed. - /// - /// - /// The adler checksum for the buffer is invalid - /// - public void SetDictionary(byte[] buffer, int index, int count) - { - if (buffer == null) - throw new ArgumentNullException(nameof(buffer)); - - if (index < 0) - throw new ArgumentOutOfRangeException(nameof(index)); - - if (count < 0) - throw new ArgumentOutOfRangeException(nameof(count)); - - if (!IsNeedingDictionary) - throw new InvalidOperationException("Dictionary is not needed"); - - checksum.Update(buffer, index, count); - - if ((int)checksum.Value != readAdler) - throw new InvalidOperationException("Wrong checksum"); - - checksum.Reset(); - outputWindow.CopyDict(buffer, index, count); - mode = DECODE_BLOCKS; - } - - /// - /// Sets the input. This should only be called, if needsInput() - /// returns true. - /// - /// - /// the input. - /// - public void SetInput(byte[] buffer) - { - SetInput(buffer, 0, buffer.Length); - } - - /// - /// Sets the input. This should only be called, if needsInput() - /// returns true. - /// - /// - /// The source of input data - /// - /// - /// The index into buffer where the input starts. - /// - /// - /// The number of bytes of input to use. - /// - /// - /// No input is needed. - /// - /// - /// The index and/or count are wrong. - /// - public void SetInput(byte[] buffer, int index, int count) - { - input.SetInput(buffer, index, count); - totalIn += count; - } - - /// - /// Inflates the compressed stream to the output buffer. If this - /// returns 0, you should check, whether IsNeedingDictionary(), - /// IsNeedingInput() or IsFinished() returns true, to determine why no - /// further output is produced. - /// - /// - /// the output buffer. - /// - /// - /// The number of bytes written to the buffer, 0 if no further - /// output can be produced. - /// - /// - /// if buffer has length 0. - /// - /// - /// if deflated stream is invalid. - /// - public int Inflate(byte[] buffer) - { - if (buffer == null) - throw new ArgumentNullException(nameof(buffer)); - - return Inflate(buffer, 0, buffer.Length); - } - - /// - /// Inflates the compressed stream to the output buffer. If this - /// returns 0, you should check, whether needsDictionary(), - /// needsInput() or finished() returns true, to determine why no - /// further output is produced. - /// - /// - /// the output buffer. - /// - /// - /// the offset in buffer where storing starts. - /// - /// - /// the maximum number of bytes to output. - /// - /// - /// the number of bytes written to the buffer, 0 if no further output can be produced. - /// - /// - /// if count is less than 0. - /// - /// - /// if the index and / or count are wrong. - /// - /// - /// if deflated stream is invalid. - /// - public int Inflate(byte[] buffer, int offset, int count) - { - if (buffer == null) - throw new ArgumentNullException(nameof(buffer)); - - if (count < 0) - throw new ArgumentOutOfRangeException(nameof(count), "count cannot be negative"); - - if (offset < 0) - throw new ArgumentOutOfRangeException(nameof(offset), "offset cannot be negative"); - - if (offset + count > buffer.Length) - throw new ArgumentException("count exceeds buffer bounds"); - - // Special case: count may be zero - if (count == 0) - { - if (!IsFinished) - Decode(); // -jr- 08-Nov-2003 INFLATE_BUG fix.. - - return 0; - } - - int bytesCopied = 0; - - do - { - if (mode != DECODE_CHKSUM) - { - /* Don't give away any output, if we are waiting for the - * checksum in the input stream. - * - * With this trick we have always: - * IsNeedingInput() and not IsFinished() - * implies more output can be produced. - */ - int more = outputWindow.CopyOutput(buffer, offset, count); - - if (more > 0) - { - checksum.Update(buffer, offset, more); - offset += more; - bytesCopied += more; - totalOut += more; - count -= more; - - if (count == 0) - return bytesCopied; - } - } - } while (Decode() || ((outputWindow.GetAvailable() > 0) && (mode != DECODE_CHKSUM))); - return bytesCopied; - } - - /// - /// Returns true, if the input buffer is empty. - /// You should then call setInput(). - /// NOTE: This method also returns true when the stream is finished. - /// - public bool IsNeedingInput - { - get - { - return input.IsNeedingInput; - } - } - - /// - /// Returns true, if a preset dictionary is needed to inflate the input. - /// - public bool IsNeedingDictionary - { - get - { - return mode == DECODE_DICT && neededBits == 0; - } - } - - /// - /// Returns true, if the inflater has finished. This means, that no - /// input is needed and no output can be produced. - /// - public bool IsFinished - { - get - { - return mode == FINISHED && outputWindow.GetAvailable() == 0; - } - } - - /// - /// Gets the adler checksum. This is either the checksum of all - /// uncompressed bytes returned by inflate(), or if needsDictionary() - /// returns true (and thus no output was yet produced) this is the - /// adler checksum of the expected dictionary. - /// - /// - /// the adler checksum. - /// - public int Adler - { - get - { - return IsNeedingDictionary ? readAdler : (int)checksum.Value; - } - } - - /// - /// Gets the total number of output bytes returned by Inflate(). - /// - /// - /// the total number of output bytes. - /// - public long TotalOut - { - get - { - return totalOut; - } - } - - /// - /// Gets the total number of processed compressed input bytes. - /// - /// - /// The total number of bytes of processed input bytes. - /// - public long TotalIn - { - get - { - return totalIn - (long)RemainingInput; - } - } - - /// - /// Gets the number of unprocessed input bytes. Useful, if the end of the - /// stream is reached and you want to further process the bytes after - /// the deflate stream. - /// - /// - /// The number of bytes of the input which have not been processed. - /// - public int RemainingInput - { - // TODO: This should be a long? - get - { - return input.AvailableBytes; - } - - } - } -} diff --git a/UpdateLib/UpdateLib/Compression/Deflaters/InflaterDynHeader.cs b/UpdateLib/UpdateLib/Compression/Deflaters/InflaterDynHeader.cs deleted file mode 100644 index d115e8f..0000000 --- a/UpdateLib/UpdateLib/Compression/Deflaters/InflaterDynHeader.cs +++ /dev/null @@ -1,207 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -using MatthiWare.UpdateLib.Compression.Streams; -using System; - -namespace MatthiWare.UpdateLib.Compression.Deflaters -{ - public class InflaterDynHeader - { - #region Constants - const int LNUM = 0; - const int DNUM = 1; - const int BLNUM = 2; - const int BLLENS = 3; - const int LENS = 4; - const int REPS = 5; - - static readonly int[] repMin = { 3, 3, 11 }; - static readonly int[] repBits = { 2, 3, 7 }; - - static readonly int[] BL_ORDER = - { 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 }; - #endregion - - public bool Decode(StreamManipulator input) - { - decode_loop: - for (;;) - { - switch (mode) - { - case LNUM: - lnum = input.PeekBits(5); - if (lnum < 0) - return false; - - lnum += 257; - input.DropBits(5); - // System.err.println("LNUM: "+lnum); - mode = DNUM; - goto case DNUM; // fall through - case DNUM: - dnum = input.PeekBits(5); - if (dnum < 0) - { - return false; - } - dnum++; - input.DropBits(5); - // System.err.println("DNUM: "+dnum); - num = lnum + dnum; - litdistLens = new byte[num]; - mode = BLNUM; - goto case BLNUM; // fall through - case BLNUM: - blnum = input.PeekBits(4); - if (blnum < 0) - { - return false; - } - blnum += 4; - input.DropBits(4); - blLens = new byte[19]; - ptr = 0; - // System.err.println("BLNUM: "+blnum); - mode = BLLENS; - goto case BLLENS; // fall through - case BLLENS: - while (ptr < blnum) - { - int len = input.PeekBits(3); - if (len < 0) - return false; - - input.DropBits(3); - // System.err.println("blLens["+BL_ORDER[ptr]+"]: "+len); - blLens[BL_ORDER[ptr]] = (byte)len; - ptr++; - } - blTree = new InflaterHuffmanTree(blLens); - blLens = null; - ptr = 0; - mode = LENS; - goto case LENS; // fall through - case LENS: - { - int symbol; - while (((symbol = blTree.GetSymbol(input)) & ~15) == 0) - { - /* Normal case: symbol in [0..15] */ - - // System.err.println("litdistLens["+ptr+"]: "+symbol); - litdistLens[ptr++] = lastLen = (byte)symbol; - - if (ptr == num) - return true; - } - - /* need more input ? */ - if (symbol < 0) - return false; - - /* otherwise repeat code */ - if (symbol >= 17) - lastLen = 0; - else - { - if (ptr == 0) - throw new Exception("Repeating zero"); - } - repSymbol = symbol - 16; - } - mode = REPS; - goto case REPS; // fall through - case REPS: - { - int bits = repBits[repSymbol]; - int count = input.PeekBits(bits); - - if (count < 0) - return false; - - input.DropBits(bits); - count += repMin[repSymbol]; - // System.err.println("litdistLens repeated: "+count); - - if (ptr + count > num) - throw new Exception($"litdistLens repeated: {count}"); - - while (count-- > 0) - litdistLens[ptr++] = lastLen; - - if (ptr == num) - return true; - } - - mode = LENS; - goto decode_loop; - } - } - } - - public InflaterHuffmanTree BuildLitLenTree() - { - byte[] litlenLens = new byte[lnum]; - Array.Copy(litdistLens, 0, litlenLens, 0, lnum); - return new InflaterHuffmanTree(litlenLens); - } - - public InflaterHuffmanTree BuildDistTree() - { - byte[] distLens = new byte[dnum]; - Array.Copy(litdistLens, lnum, distLens, 0, dnum); - return new InflaterHuffmanTree(distLens); - } - - #region Instance Fields - byte[] blLens; - byte[] litdistLens; - - InflaterHuffmanTree blTree; - - /// - /// The current decode mode - /// - int mode; - int lnum, dnum, blnum, num; - int repSymbol; - byte lastLen; - int ptr; - #endregion - - } -} diff --git a/UpdateLib/UpdateLib/Compression/Deflaters/InflaterHuffmanTree.cs b/UpdateLib/UpdateLib/Compression/Deflaters/InflaterHuffmanTree.cs deleted file mode 100644 index c1e838d..0000000 --- a/UpdateLib/UpdateLib/Compression/Deflaters/InflaterHuffmanTree.cs +++ /dev/null @@ -1,257 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -using MatthiWare.UpdateLib.Compression.Streams; -using System; - -namespace MatthiWare.UpdateLib.Compression.Deflaters -{ - /// - /// Huffman tree used for inflation - /// - public class InflaterHuffmanTree - { - #region Constants - const int MAX_BITLEN = 15; - #endregion - - #region Instance Fields - short[] tree; - #endregion - - /// - /// Literal length tree - /// - public static InflaterHuffmanTree defLitLenTree; - - /// - /// Distance tree - /// - public static InflaterHuffmanTree defDistTree; - - static InflaterHuffmanTree() - { - try - { - byte[] codeLengths = new byte[288]; - int i = 0; - - while (i < 144) - codeLengths[i++] = 8; - - while (i < 256) - codeLengths[i++] = 9; - - while (i < 280) - codeLengths[i++] = 7; - - while (i < 288) - codeLengths[i++] = 8; - - defLitLenTree = new InflaterHuffmanTree(codeLengths); - - codeLengths = new byte[32]; - i = 0; - while (i < 32) - codeLengths[i++] = 5; - - defDistTree = new InflaterHuffmanTree(codeLengths); - } - catch (Exception e) - { - throw new Exception("InflaterHuffmanTree: static tree length illegal", e); - } - } - - #region Constructors - /// - /// Constructs a Huffman tree from the array of code lengths. - /// - /// - /// the array of code lengths - /// - public InflaterHuffmanTree(byte[] codeLengths) - { - BuildTree(codeLengths); - } - #endregion - - void BuildTree(byte[] codeLengths) - { - int[] blCount = new int[MAX_BITLEN + 1]; - int[] nextCode = new int[MAX_BITLEN + 1]; - - for (int i = 0; i < codeLengths.Length; i++) - { - int bits = codeLengths[i]; - - if (bits > 0) - blCount[bits]++; - } - - int code = 0; - int treeSize = 512; - for (int bits = 1; bits <= MAX_BITLEN; bits++) - { - nextCode[bits] = code; - code += blCount[bits] << (16 - bits); - if (bits >= 10) - { - /* We need an extra table for bit lengths >= 10. */ - int start = nextCode[bits] & 0x1ff80; - int end = code & 0x1ff80; - treeSize += (end - start) >> (16 - bits); - } - } - - /* -jr comment this out! doesnt work for dynamic trees and pkzip 2.04g - if (code != 65536) - { - throw new SharpZipBaseException("Code lengths don't add up properly."); - } - */ - /* Now create and fill the extra tables from longest to shortest - * bit len. This way the sub trees will be aligned. - */ - tree = new short[treeSize]; - int treePtr = 512; - for (int bits = MAX_BITLEN; bits >= 10; bits--) - { - int end = code & 0x1ff80; - code -= blCount[bits] << (16 - bits); - int start = code & 0x1ff80; - for (int i = start; i < end; i += 1 << 7) - { - tree[DeflaterHuffman.BitReverse(i)] = (short)((-treePtr << 4) | bits); - treePtr += 1 << (bits - 9); - } - } - - for (int i = 0; i < codeLengths.Length; i++) - { - int bits = codeLengths[i]; - if (bits == 0) - continue; - - code = nextCode[bits]; - int revcode = DeflaterHuffman.BitReverse(code); - if (bits <= 9) - { - do - { - tree[revcode] = (short)((i << 4) | bits); - revcode += 1 << bits; - } while (revcode < 512); - } - else - { - int subTree = tree[revcode & 511]; - int treeLen = 1 << (subTree & 15); - subTree = -(subTree >> 4); - do - { - tree[subTree | (revcode >> 9)] = (short)((i << 4) | bits); - revcode += 1 << bits; - } while (revcode < treeLen); - } - - nextCode[bits] = code + (1 << (16 - bits)); - } - - } - - /// - /// Reads the next symbol from input. The symbol is encoded using the - /// huffman tree. - /// - /// - /// input the input source. - /// - /// - /// the next symbol, or -1 if not enough input is available. - /// - public int GetSymbol(StreamManipulator input) - { - int lookahead, symbol; - if ((lookahead = input.PeekBits(9)) >= 0) - { - if ((symbol = tree[lookahead]) >= 0) - { - input.DropBits(symbol & 15); - return symbol >> 4; - } - - int subtree = -(symbol >> 4); - int bitlen = symbol & 15; - - if ((lookahead = input.PeekBits(bitlen)) >= 0) - { - symbol = tree[subtree | (lookahead >> 9)]; - input.DropBits(symbol & 15); - - return symbol >> 4; - } - else - { - int bits = input.AvailableBits; - lookahead = input.PeekBits(bits); - symbol = tree[subtree | (lookahead >> 9)]; - - if ((symbol & 15) <= bits) - { - input.DropBits(symbol & 15); - return symbol >> 4; - } - else - return -1; - } - } - else - { - int bits = input.AvailableBits; - lookahead = input.PeekBits(bits); - symbol = tree[lookahead]; - - if (symbol >= 0 && (symbol & 15) <= bits) - { - input.DropBits(symbol & 15); - return symbol >> 4; - } - else - return -1; - } - } - } -} diff --git a/UpdateLib/UpdateLib/Compression/Deflaters/PendingBuffer.cs b/UpdateLib/UpdateLib/Compression/Deflaters/PendingBuffer.cs deleted file mode 100644 index 30c15a3..0000000 --- a/UpdateLib/UpdateLib/Compression/Deflaters/PendingBuffer.cs +++ /dev/null @@ -1,258 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - - -using System; - -namespace MatthiWare.UpdateLib.Compression.Deflaters -{ - /// - /// This class is general purpose class for writing data to a buffer. - /// - /// It allows you to write bits as well as bytes - /// Based on DeflaterPending.java - /// - /// author of the original java version : Jochen Hoenicke - /// - public class PendingBuffer - { - #region Instance Fields - /// - /// Internal work buffer - /// - readonly byte[] buffer; - - int start; - int end; - - uint bits; - int bitCount; - #endregion - - #region Constructors - /// - /// construct instance using default buffer size of 4096 - /// - public PendingBuffer() : this(4096) - { - } - - /// - /// construct instance using specified buffer size - /// - /// - /// size to use for internal buffer - /// - public PendingBuffer(int bufferSize) - { - buffer = new byte[bufferSize]; - } - - #endregion - - /// - /// Clear internal state/buffers - /// - public void Reset() - { - start = end = bitCount = 0; - } - - /// - /// Write a byte to buffer - /// - /// - /// The value to write - /// - public void WriteByte(int value) - { - buffer[end++] = unchecked((byte)value); - } - - /// - /// Write a short value to buffer LSB first - /// - /// - /// The value to write. - /// - public void WriteShort(int value) - { - buffer[end++] = unchecked((byte)value); - buffer[end++] = unchecked((byte)(value >> 8)); - } - - /// - /// write an integer LSB first - /// - /// The value to write. - public void WriteInt(int value) - { - buffer[end++] = unchecked((byte)value); - buffer[end++] = unchecked((byte)(value >> 8)); - buffer[end++] = unchecked((byte)(value >> 16)); - buffer[end++] = unchecked((byte)(value >> 24)); - } - - /// - /// Write a block of data to buffer - /// - /// data to write - /// offset of first byte to write - /// number of bytes to write - public void WriteBlock(byte[] block, int offset, int length) - { - Array.Copy(block, offset, buffer, end, length); - end += length; - } - - /// - /// The number of bits written to the buffer - /// - public int BitCount - { - get - { - return bitCount; - } - } - - /// - /// Align internal buffer on a byte boundary - /// - public void AlignToByte() - { - if (bitCount > 0) - { - buffer[end++] = unchecked((byte)bits); - if (bitCount > 8) - { - buffer[end++] = unchecked((byte)(bits >> 8)); - } - } - bits = 0; - bitCount = 0; - } - - /// - /// Write bits to internal buffer - /// - /// source of bits - /// number of bits to write - public void WriteBits(int b, int count) - { - bits |= (uint)(b << bitCount); - bitCount += count; - if (bitCount >= 16) - { - buffer[end++] = unchecked((byte)bits); - buffer[end++] = unchecked((byte)(bits >> 8)); - bits >>= 16; - bitCount -= 16; - } - } - - /// - /// Write a short value to internal buffer most significant byte first - /// - /// value to write - public void WriteShortMSB(int s) - { - buffer[end++] = unchecked((byte)(s >> 8)); - buffer[end++] = unchecked((byte)s); - } - - /// - /// Indicates if buffer has been flushed - /// - public bool IsFlushed - { - get - { - return end == 0; - } - } - - /// - /// Flushes the pending buffer into the given output array. If the - /// output array is to small, only a partial flush is done. - /// - /// The output array. - /// The offset into output array. - /// The maximum number of bytes to store. - /// The number of bytes flushed. - public int Flush(byte[] output, int offset, int length) - { - if (bitCount >= 8) - { - buffer[end++] = unchecked((byte)bits); - bits >>= 8; - bitCount -= 8; - } - - if (length > end - start) - { - length = end - start; - Array.Copy(buffer, start, output, offset, length); - start = 0; - end = 0; - } - else - { - Array.Copy(buffer, start, output, offset, length); - start += length; - } - - return length; - } - - /// - /// Convert internal buffer to byte array. - /// Buffer is empty on completion - /// - /// - /// The internal buffer contents converted to a byte array. - /// - public byte[] ToByteArray() - { - AlignToByte(); - - byte[] result = new byte[end - start]; - Array.Copy(buffer, start, result, 0, result.Length); - start = 0; - end = 0; - return result; - } - } -} diff --git a/UpdateLib/UpdateLib/Compression/GZip/GZip.cs b/UpdateLib/UpdateLib/Compression/GZip/GZip.cs deleted file mode 100644 index 3af8332..0000000 --- a/UpdateLib/UpdateLib/Compression/GZip/GZip.cs +++ /dev/null @@ -1,62 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -using MatthiWare.UpdateLib.Utils; -using System; -using System.IO; - -namespace MatthiWare.UpdateLib.Compression.GZip -{ - public static class GZip - { - public static void Decompress(Stream inStream, Stream outStream) - { - if (inStream == null || outStream == null) - throw new ArgumentNullException("Streams"); - - using (var gzip = new GZipInputStream(inStream)) - IOUtils.Copy(gzip, outStream, new byte[4096]); - } - - public static void Decompress(Stream inStream, Stream outStream, int level) - { - if (inStream == null || outStream == null) - throw new ArgumentNullException("Streams"); - - using (var gzip = new GZipOutputStream(outStream, level)) - IOUtils.Copy(inStream, gzip, new byte[4096]); - } - } -} diff --git a/UpdateLib/UpdateLib/Compression/GZip/GZipConstants.cs b/UpdateLib/UpdateLib/Compression/GZip/GZipConstants.cs deleted file mode 100644 index b1fa152..0000000 --- a/UpdateLib/UpdateLib/Compression/GZip/GZipConstants.cs +++ /dev/null @@ -1,86 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - - -namespace MatthiWare.UpdateLib.Compression.GZip -{ - /// - /// This class contains constants used for gzip. - /// - public static class GZipConstants - { - /// - /// Magic number found at start of GZIP header - /// - public const int GZIP_MAGIC = 0x1F8B; - - /* The flag byte is divided into individual bits as follows: - - bit 0 FTEXT - bit 1 FHCRC - bit 2 FEXTRA - bit 3 FNAME - bit 4 FCOMMENT - bit 5 reserved - bit 6 reserved - bit 7 reserved - */ - - /// - /// Flag bit mask for text - /// - public const int FTEXT = 0x1; - - /// - /// Flag bitmask for Crc - /// - public const int FHCRC = 0x2; - - /// - /// Flag bit mask for extra - /// - public const int FEXTRA = 0x4; - - /// - /// flag bitmask for name - /// - public const int FNAME = 0x8; - - /// - /// flag bit mask indicating comment is present - /// - public const int FCOMMENT = 0x10; - } -} diff --git a/UpdateLib/UpdateLib/Compression/GZip/GZipException.cs b/UpdateLib/UpdateLib/Compression/GZip/GZipException.cs deleted file mode 100644 index 2e11775..0000000 --- a/UpdateLib/UpdateLib/Compression/GZip/GZipException.cs +++ /dev/null @@ -1,51 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -using System; - -namespace MatthiWare.UpdateLib.Compression.GZip -{ - - [Serializable] - public class GZipException : Exception - { - public GZipException() { } - public GZipException(string message) : base(message) { } - public GZipException(string message, Exception inner) : base(message, inner) { } - protected GZipException( - System.Runtime.Serialization.SerializationInfo info, - System.Runtime.Serialization.StreamingContext context) : base(info, context) { } - } -} diff --git a/UpdateLib/UpdateLib/Compression/GZip/GZipInputStream.cs b/UpdateLib/UpdateLib/Compression/GZip/GZipInputStream.cs deleted file mode 100644 index 04f0233..0000000 --- a/UpdateLib/UpdateLib/Compression/GZip/GZipInputStream.cs +++ /dev/null @@ -1,382 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -using System; -using System.IO; - -using MatthiWare.UpdateLib.Compression.Checksum; -using MatthiWare.UpdateLib.Compression.Deflaters; -using MatthiWare.UpdateLib.Compression.Streams; - -namespace MatthiWare.UpdateLib.Compression.GZip -{ - - /// - /// This filter stream is used to decompress a "GZIP" format stream. - /// The "GZIP" format is described baseInputStream RFC 1952. - /// - /// author of the original java version : John Leuner - /// - /// This sample shows how to unzip a gzipped file - /// - /// using System; - /// using System.IO; - /// - /// using ICSharpCode.SharpZipLib.Core; - /// using ICSharpCode.SharpZipLib.GZip; - /// - /// class MainClass - /// { - /// public static void Main(string[] args) - /// { - /// using (Stream inStream = new GZipInputStream(File.OpenRead(args[0]))) - /// using (FileStream outStream = File.Create(Path.GetFileNameWithoutExtension(args[0]))) { - /// byte[] buffer = new byte[4096]; - /// StreamUtils.Copy(inStream, outStream, buffer); - /// } - /// } - /// } - /// - /// - public class GZipInputStream : InflaterInputStream - { - #region Instance Fields - /// - /// CRC-32 value for uncompressed data - /// - protected Crc32 crc; - - /// - /// Flag to indicate if we've read the GZIP header yet for the current member (block of compressed data). - /// This is tracked per-block as the file is parsed. - /// - bool readGZIPHeader; - - /// - /// Flag to indicate if at least one block in a stream with concatenated blocks was read successfully. - /// This allows us to exit gracefully if downstream data is not in gzip format. - /// - bool completedLastBlock; - #endregion - - #region Constructors - /// - /// Creates a GZipInputStream with the default buffer size - /// - /// - /// The stream to read compressed data from (baseInputStream GZIP format) - /// - public GZipInputStream(Stream baseInputStream, bool isOwner = true) - : this(baseInputStream, 4096) - { - IsStreamOwner = isOwner; - } - - /// - /// Creates a GZIPInputStream with the specified buffer size - /// - /// - /// The stream to read compressed data from (baseInputStream GZIP format) - /// - /// - /// Size of the buffer to use - /// - public GZipInputStream(Stream baseInputStream, int size) - : base(baseInputStream, new Inflater(true), size) - { - } - #endregion - - #region Stream overrides - /// - /// Reads uncompressed data into an array of bytes - /// - /// - /// The buffer to read uncompressed data into - /// - /// - /// The offset indicating where the data should be placed - /// - /// - /// The number of uncompressed bytes to be read - /// - /// Returns the number of bytes actually read. - public override int Read(byte[] buffer, int offset, int count) - { - // A GZIP file can contain multiple blocks of compressed data, although this is quite rare. - // A compressed block could potentially be empty, so we need to loop until we reach EOF or - // we find data. - while (true) - { - - // If we haven't read the header for this block, read it - if (!readGZIPHeader) - { - - // Try to read header. If there is no header (0 bytes available), this is EOF. If there is - // an incomplete header, this will throw an exception. - try - { - if (!ReadHeader()) - return 0; - } - catch (Exception ex) when (completedLastBlock && (ex is GZipException || ex is EndOfStreamException)) - { - // if we completed the last block (i.e. we're in a stream that has multiple blocks concatenated - // we want to return gracefully from any header parsing exceptions since sometimes there may - // be trailing garbage on a stream - return 0; - } - } - - // Try to read compressed data - int bytesRead = base.Read(buffer, offset, count); - if (bytesRead > 0) - crc.Update(buffer, offset, bytesRead); - - // If this is the end of stream, read the footer - if (inflater.IsFinished) - ReadFooter(); - - if (bytesRead > 0) - return bytesRead; - } - } - #endregion - - #region Support routines - bool ReadHeader() - { - // Initialize CRC for this block - crc = new Crc32(); - - // Make sure there is data in file. We can't rely on ReadLeByte() to fill the buffer, as this could be EOF, - // which is fine, but ReadLeByte() throws an exception if it doesn't find data, so we do this part ourselves. - if (inputBuffer.Available <= 0) - { - inputBuffer.Fill(); - - if (inputBuffer.Available <= 0) - return false; // No header, EOF. - } - - // 1. Check the two magic bytes - var headCRC = new Crc32(); - int magic = inputBuffer.ReadLeByte(); - - if (magic < 0) - throw new EndOfStreamException("EOS reading GZIP header"); - - headCRC.Update(magic); - - if (magic != (GZipConstants.GZIP_MAGIC >> 8)) - throw new GZipException("Error GZIP header, first magic byte doesn't match"); - - //magic = baseInputStream.ReadByte(); - magic = inputBuffer.ReadLeByte(); - - if (magic < 0) - throw new EndOfStreamException("EOS reading GZIP header"); - - if (magic != (GZipConstants.GZIP_MAGIC & 0xFF)) - throw new GZipException("Error GZIP header, second magic byte doesn't match"); - - headCRC.Update(magic); - - // 2. Check the compression type (must be 8) - int compressionType = inputBuffer.ReadLeByte(); - - if (compressionType < 0) - throw new EndOfStreamException("EOS reading GZIP header"); - - if (compressionType != 8) - throw new GZipException("Error GZIP header, data not in deflate format"); - - headCRC.Update(compressionType); - - // 3. Check the flags - int flags = inputBuffer.ReadLeByte(); - if (flags < 0) - throw new EndOfStreamException("EOS reading GZIP header"); - - headCRC.Update(flags); - - /* This flag byte is divided into individual bits as follows: - bit 0 FTEXT - bit 1 FHCRC - bit 2 FEXTRA - bit 3 FNAME - bit 4 FCOMMENT - bit 5 reserved - bit 6 reserved - bit 7 reserved - */ - - // 3.1 Check the reserved bits are zero - - if ((flags & 0xE0) != 0) - throw new GZipException("Reserved flag bits in GZIP header != 0"); - - // 4.-6. Skip the modification time, extra flags, and OS type - for (int i = 0; i < 6; i++) - { - int readByte = inputBuffer.ReadLeByte(); - - if (readByte < 0) - throw new EndOfStreamException("EOS reading GZIP header"); - - headCRC.Update(readByte); - } - - // 7. Read extra field - if ((flags & GZipConstants.FEXTRA) != 0) - { - - // XLEN is total length of extra subfields, we will skip them all - int len1, len2; - len1 = inputBuffer.ReadLeByte(); - len2 = inputBuffer.ReadLeByte(); - - if ((len1 < 0) || (len2 < 0)) - throw new EndOfStreamException("EOS reading GZIP header"); - - headCRC.Update(len1); - headCRC.Update(len2); - - int extraLen = (len2 << 8) | len1; // gzip is LSB first - for (int i = 0; i < extraLen; i++) - { - int readByte = inputBuffer.ReadLeByte(); - if (readByte < 0) - throw new EndOfStreamException("EOS reading GZIP header"); - - headCRC.Update(readByte); - } - } - - // 8. Read file name - if ((flags & GZipConstants.FNAME) != 0) - { - int readByte; - while ((readByte = inputBuffer.ReadLeByte()) > 0) - headCRC.Update(readByte); - - if (readByte < 0) - throw new EndOfStreamException("EOS reading GZIP header"); - - headCRC.Update(readByte); - } - - // 9. Read comment - if ((flags & GZipConstants.FCOMMENT) != 0) - { - int readByte; - while ((readByte = inputBuffer.ReadLeByte()) > 0) - headCRC.Update(readByte); - - if (readByte < 0) - throw new EndOfStreamException("EOS reading GZIP header"); - - headCRC.Update(readByte); - } - - // 10. Read header CRC - if ((flags & GZipConstants.FHCRC) != 0) - { - int tempByte; - int crcval = inputBuffer.ReadLeByte(); - - if (crcval < 0) - throw new EndOfStreamException("EOS reading GZIP header"); - - tempByte = inputBuffer.ReadLeByte(); - - if (tempByte < 0) - throw new EndOfStreamException("EOS reading GZIP header"); - - crcval = (crcval << 8) | tempByte; - - if (crcval != ((int)headCRC.Value & 0xffff)) - throw new GZipException("Header CRC value mismatch"); - } - - readGZIPHeader = true; - return true; - } - - void ReadFooter() - { - byte[] footer = new byte[8]; - - // End of stream; reclaim all bytes from inf, read the final byte count, and reset the inflator - long bytesRead = inflater.TotalOut & 0xffffffff; - inputBuffer.Available += inflater.RemainingInput; - inflater.Reset(); - - // Read footer from inputBuffer - int needed = 8; - while (needed > 0) - { - int count = inputBuffer.ReadClearTextBuffer(footer, 8 - needed, needed); - if (count <= 0) - throw new EndOfStreamException("EOS reading GZIP footer"); - - needed -= count; // Jewel Jan 16 - } - - // Calculate CRC - int crcval = (footer[0] & 0xff) | ((footer[1] & 0xff) << 8) | ((footer[2] & 0xff) << 16) | (footer[3] << 24); - if (crcval != (int)crc.Value) - throw new GZipException("GZIP crc sum mismatch, theirs \"" + crcval + "\" and ours \"" + (int)crc.Value); - - // NOTE The total here is the original total modulo 2 ^ 32. - uint total = - ((uint)footer[4] & 0xff) | - (((uint)footer[5] & 0xff) << 8) | - (((uint)footer[6] & 0xff) << 16) | - ((uint)footer[7] << 24); - - if (bytesRead != total) - throw new GZipException("Number of bytes mismatch in footer"); - - // Mark header read as false so if another header exists, we'll continue reading through the file - readGZIPHeader = false; - - // Indicate that we succeeded on at least one block so we can exit gracefully if there is trailing garbage downstream - completedLastBlock = true; - } - #endregion - } -} diff --git a/UpdateLib/UpdateLib/Compression/GZip/GZipOutputStream.cs b/UpdateLib/UpdateLib/Compression/GZip/GZipOutputStream.cs deleted file mode 100644 index 0e05719..0000000 --- a/UpdateLib/UpdateLib/Compression/GZip/GZipOutputStream.cs +++ /dev/null @@ -1,258 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -using System; -using System.IO; - -using MatthiWare.UpdateLib.Compression.Checksum; -using MatthiWare.UpdateLib.Compression.Deflaters; -using MatthiWare.UpdateLib.Compression.Streams; - -namespace MatthiWare.UpdateLib.Compression.GZip -{ - /// - /// This filter stream is used to compress a stream into a "GZIP" stream. - /// The "GZIP" format is described in RFC 1952. - /// - /// author of the original java version : John Leuner - /// - /// This sample shows how to gzip a file - /// - /// using System; - /// using System.IO; - /// - /// using ICSharpCode.SharpZipLib.GZip; - /// using ICSharpCode.SharpZipLib.Core; - /// - /// class MainClass - /// { - /// public static void Main(string[] args) - /// { - /// using (Stream s = new GZipOutputStream(File.Create(args[0] + ".gz"))) - /// using (FileStream fs = File.OpenRead(args[0])) { - /// byte[] writeData = new byte[4096]; - /// Streamutils.Copy(s, fs, writeData); - /// } - /// } - /// } - /// } - /// - /// - public class GZipOutputStream : DeflaterOutputStream - { - enum OutputState - { - Header, - Footer, - Finished, - Closed, - }; - - #region Instance Fields - /// - /// CRC-32 value for uncompressed data - /// - protected Crc32 crc = new Crc32(); - OutputState state_ = OutputState.Header; - #endregion - - #region Constructors - /// - /// Creates a GzipOutputStream with the default buffer size - /// - /// - /// The stream to read data (to be compressed) from - /// - public GZipOutputStream(Stream baseOutputStream, bool isOwner = true) - : this(baseOutputStream, 4096) - { - IsStreamOwner = isOwner; - } - - /// - /// Creates a GZipOutputStream with the specified buffer size - /// - /// - /// The stream to read data (to be compressed) from - /// - /// - /// Size of the buffer to use - /// - public GZipOutputStream(Stream baseOutputStream, int size) : base(baseOutputStream, new Deflater(Deflater.DEFAULT_COMPRESSION, true), size) - { - } - #endregion - - #region Public API - /// - /// Sets the active compression level (1-9). The new level will be activated - /// immediately. - /// - /// The compression level to set. - /// - /// Level specified is not supported. - /// - /// - public void SetLevel(int level) - { - if (level < Deflater.BEST_SPEED) - throw new ArgumentOutOfRangeException(nameof(level)); - - deflater_.SetLevel(level); - } - - /// - /// Get the current compression level. - /// - /// The current compression level. - public int GetLevel() => deflater_.GetLevel(); - #endregion - - #region Stream overrides - /// - /// Write given buffer to output updating crc - /// - /// Buffer to write - /// Offset of first byte in buf to write - /// Number of bytes to write - public override void Write(byte[] buffer, int offset, int count) - { - if (state_ == OutputState.Header) - WriteHeader(); - - if (state_ != OutputState.Footer) - throw new InvalidOperationException("Write not permitted in current state"); - - crc.Update(buffer, offset, count); - base.Write(buffer, offset, count); - } - - /// - /// Writes remaining compressed output data to the output stream - /// and closes it. - /// - protected override void Dispose(bool disposing) - { - try - { - Finish(); - } - finally - { - if (state_ != OutputState.Closed) - { - state_ = OutputState.Closed; - - if (IsStreamOwner) - baseOutputStream_.Dispose(); - } - } - } - #endregion - - #region DeflaterOutputStream overrides - /// - /// Finish compression and write any footer information required to stream - /// - public override void Finish() - { - // If no data has been written a header should be added. - if (state_ == OutputState.Header) - WriteHeader(); - - if (state_ == OutputState.Footer) - { - state_ = OutputState.Finished; - base.Finish(); - - var totalin = (uint)(deflater_.TotalIn & 0xffffffff); - var crcval = (uint)(crc.Value & 0xffffffff); - - byte[] gzipFooter; - - unchecked - { - gzipFooter = new byte[] { - (byte) crcval, (byte) (crcval >> 8), - (byte) (crcval >> 16), (byte) (crcval >> 24), - - (byte) totalin, (byte) (totalin >> 8), - (byte) (totalin >> 16), (byte) (totalin >> 24) - }; - } - - baseOutputStream_.Write(gzipFooter, 0, gzipFooter.Length); - } - } - #endregion - - #region Support Routines - void WriteHeader() - { - if (state_ == OutputState.Header) - { - state_ = OutputState.Footer; - - var mod_time = (int)((DateTime.Now.Ticks - new DateTime(1970, 1, 1).Ticks) / 10000000L); // Ticks give back 100ns intervals - byte[] gzipHeader = { - // The two magic bytes - (GZipConstants.GZIP_MAGIC >> 8), - (GZipConstants.GZIP_MAGIC & 0xff), - - // The compression type - Deflater.DEFLATED, - - // The flags (not set) - 0, - - // The modification time - (byte) mod_time, - (byte) (mod_time >> 8), - (byte) (mod_time >> 16), - (byte) (mod_time >> 24), - - // The extra flags - 0, - - // The OS type (unknown) - 255 - }; - - baseOutputStream_.Write(gzipHeader, 0, gzipHeader.Length); - } - } - #endregion - } -} diff --git a/UpdateLib/UpdateLib/Compression/PatchBuilder.cs b/UpdateLib/UpdateLib/Compression/PatchBuilder.cs deleted file mode 100644 index 5e9936a..0000000 --- a/UpdateLib/UpdateLib/Compression/PatchBuilder.cs +++ /dev/null @@ -1,23 +0,0 @@ -using MatthiWare.UpdateLib.Common; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace MatthiWare.UpdateLib.Compression -{ - public class PatchBuilder - { - - public event ProgressChangedHandler ProgressChanged; - - public void Generate() - { - - } - - protected void OnProgressChanged(bool completed, double progress) - => ProgressChanged?.Invoke(completed, progress); - - } -} diff --git a/UpdateLib/UpdateLib/Compression/Patcher.cs b/UpdateLib/UpdateLib/Compression/Patcher.cs deleted file mode 100644 index b0dcec8..0000000 --- a/UpdateLib/UpdateLib/Compression/Patcher.cs +++ /dev/null @@ -1,37 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using MatthiWare.UpdateLib.Common; - -namespace MatthiWare.UpdateLib.Compression -{ - public class Patcher - { - public event ProgressChangedHandler ProgressChanged; - - public void Patch() - { - - } - - protected void OnProgressChanged(bool completed, double progress) - => ProgressChanged?.Invoke(completed, progress); - } -} diff --git a/UpdateLib/UpdateLib/Compression/Streams/DeflaterOutputStream.cs b/UpdateLib/UpdateLib/Compression/Streams/DeflaterOutputStream.cs deleted file mode 100644 index 4e814c2..0000000 --- a/UpdateLib/UpdateLib/Compression/Streams/DeflaterOutputStream.cs +++ /dev/null @@ -1,388 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -using MatthiWare.UpdateLib.Compression.Deflaters; -using System; -using System.IO; -using System.Security.Cryptography; - -namespace MatthiWare.UpdateLib.Compression.Streams -{ - /// - /// A special stream deflating or compressing the bytes that are - /// written to it. It uses a Deflater to perform actual deflating.
- /// Authors of the original java version : Tom Tromey, Jochen Hoenicke - ///
- public class DeflaterOutputStream : Stream - { - #region Constructors - /// - /// Creates a new DeflaterOutputStream with a default Deflater and default buffer size. - /// - /// - /// the output stream where deflated output should be written. - /// - public DeflaterOutputStream(Stream baseOutputStream) - : this(baseOutputStream, new Deflater(), 512) - { - } - - /// - /// Creates a new DeflaterOutputStream with the given Deflater and - /// default buffer size. - /// - /// - /// the output stream where deflated output should be written. - /// - /// - /// the underlying deflater. - /// - public DeflaterOutputStream(Stream baseOutputStream, Deflater deflater) - : this(baseOutputStream, deflater, 512) - { - } - - /// - /// Creates a new DeflaterOutputStream with the given Deflater and - /// buffer size. - /// - /// - /// The output stream where deflated output is written. - /// - /// - /// The underlying deflater to use - /// - /// - /// The buffer size in bytes to use when deflating (minimum value 512) - /// - /// - /// bufsize is less than or equal to zero. - /// - /// - /// baseOutputStream does not support writing - /// - /// - /// deflater instance is null - /// - public DeflaterOutputStream(Stream baseOutputStream, Deflater deflater, int bufferSize) - { - if (baseOutputStream == null) - throw new ArgumentNullException(nameof(baseOutputStream)); - - if (baseOutputStream.CanWrite == false) - { - throw new ArgumentException("Must support writing", nameof(baseOutputStream)); - } - - if (deflater == null) - throw new ArgumentNullException(nameof(deflater)); - - if (bufferSize < 512) - throw new ArgumentOutOfRangeException(nameof(bufferSize)); - - baseOutputStream_ = baseOutputStream; - buffer_ = new byte[bufferSize]; - deflater_ = deflater; - } - - #endregion - - #region Public API - /// - /// Finishes the stream by calling finish() on the deflater. - /// - /// - /// Not all input is deflated - /// - public virtual void Finish() - { - deflater_.Finish(); - while (!deflater_.IsFinished) - { - int len = deflater_.Deflate(buffer_, 0, buffer_.Length); - if (len <= 0) - break; - - baseOutputStream_.Write(buffer_, 0, len); - } - - if (!deflater_.IsFinished) - throw new IOException("Can't deflate all input?"); - - baseOutputStream_.Flush(); - } - - /// - /// Gets or sets a flag indicating ownership of underlying stream. - /// When the flag is true will close the underlying stream also. - /// - /// The default value is true. - public bool IsStreamOwner { get; set; } = true; - - /// - /// Allows client to determine if an entry can be patched after its added - /// - public bool CanPatchEntries - { - get - { - return baseOutputStream_.CanSeek; - } - } - - #endregion - - #region Deflation Support - /// - /// Deflates everything in the input buffers. This will call - /// def.deflate() until all bytes from the input buffers - /// are processed. - /// - protected void Deflate() - { - while (!deflater_.IsNeedingInput) - { - int deflateCount = deflater_.Deflate(buffer_, 0, buffer_.Length); - - if (deflateCount <= 0) - break; - - baseOutputStream_.Write(buffer_, 0, deflateCount); - } - - if (!deflater_.IsNeedingInput) - throw new IOException("DeflaterOutputStream can't deflate all input?"); - } - #endregion - - #region Stream Overrides - /// - /// Gets value indicating stream can be read from - /// - public override bool CanRead - { - get - { - return false; - } - } - - /// - /// Gets a value indicating if seeking is supported for this stream - /// This property always returns false - /// - public override bool CanSeek - { - get - { - return false; - } - } - - /// - /// Get value indicating if this stream supports writing - /// - public override bool CanWrite - { - get - { - return baseOutputStream_.CanWrite; - } - } - - /// - /// Get current length of stream - /// - public override long Length - { - get - { - return baseOutputStream_.Length; - } - } - - /// - /// Gets the current position within the stream. - /// - /// Any attempt to set position - public override long Position - { - get - { - return baseOutputStream_.Position; - } - set - { - throw new NotSupportedException("Position property not supported"); - } - } - - /// - /// Sets the current position of this stream to the given value. Not supported by this class! - /// - /// The offset relative to the to seek. - /// The to seek from. - /// The new position in the stream. - /// Any access - public override long Seek(long offset, SeekOrigin origin) - { - throw new NotSupportedException("DeflaterOutputStream Seek not supported"); - } - - /// - /// Sets the length of this stream to the given value. Not supported by this class! - /// - /// The new stream length. - /// Any access - public override void SetLength(long value) - { - throw new NotSupportedException("DeflaterOutputStream SetLength not supported"); - } - - /// - /// Read a byte from stream advancing position by one - /// - /// The byte read cast to an int. THe value is -1 if at the end of the stream. - /// Any access - public override int ReadByte() - { - throw new NotSupportedException("DeflaterOutputStream ReadByte not supported"); - } - - /// - /// Read a block of bytes from stream - /// - /// The buffer to store read data in. - /// The offset to start storing at. - /// The maximum number of bytes to read. - /// The actual number of bytes read. Zero if end of stream is detected. - /// Any access - public override int Read(byte[] buffer, int offset, int count) - { - throw new NotSupportedException("DeflaterOutputStream Read not supported"); - } - - /// - /// Flushes the stream by calling Flush on the deflater and then - /// on the underlying stream. This ensures that all bytes are flushed. - /// - public override void Flush() - { - deflater_.Flush(); - Deflate(); - baseOutputStream_.Flush(); - } - - /// - /// Calls and closes the underlying - /// stream when is true. - /// - protected override void Dispose(bool disposing) - { - if (!isClosed_) - { - isClosed_ = true; - - try - { - Finish(); - } - finally - { - if (IsStreamOwner) - baseOutputStream_.Dispose(); - } - } - } - - /// - /// Writes a single byte to the compressed output stream. - /// - /// - /// The byte value. - /// - public override void WriteByte(byte value) - { - byte[] b = new byte[1]; - b[0] = value; - Write(b, 0, 1); - } - - /// - /// Writes bytes from an array to the compressed stream. - /// - /// - /// The byte array - /// - /// - /// The offset into the byte array where to start. - /// - /// - /// The number of bytes to write. - /// - public override void Write(byte[] buffer, int offset, int count) - { - deflater_.SetInput(buffer, offset, count); - Deflate(); - } - #endregion - - #region Instance Fields - /// - /// This buffer is used temporarily to retrieve the bytes from the - /// deflater and write them to the underlying output stream. - /// - byte[] buffer_; - - /// - /// The deflater which is used to deflate the stream. - /// - protected Deflater deflater_; - - /// - /// Base stream the deflater depends on. - /// - protected Stream baseOutputStream_; - - bool isClosed_; - #endregion - - #region Static Fields - - // Static to help ensure that multiple files within a zip will get different random salt - private static RandomNumberGenerator _aesRnd = RandomNumberGenerator.Create(); - #endregion - } -} diff --git a/UpdateLib/UpdateLib/Compression/Streams/InflaterInputStream.cs b/UpdateLib/UpdateLib/Compression/Streams/InflaterInputStream.cs deleted file mode 100644 index c13add9..0000000 --- a/UpdateLib/UpdateLib/Compression/Streams/InflaterInputStream.cs +++ /dev/null @@ -1,642 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -using System; -using System.IO; - -using MatthiWare.UpdateLib.Compression.Deflaters; - -namespace MatthiWare.UpdateLib.Compression.Streams -{ - /// - /// An input buffer customised for use by - /// - /// - /// The buffer supports decryption of incoming data. - /// - public class InflaterInputBuffer - { - #region Constructors - /// - /// Initialise a new instance of with a default buffer size - /// - /// The stream to buffer. - public InflaterInputBuffer(Stream stream) : this(stream, 4096) - { - } - - /// - /// Initialise a new instance of - /// - /// The stream to buffer. - /// The size to use for the buffer - /// A minimum buffer size of 1KB is permitted. Lower sizes are treated as 1KB. - public InflaterInputBuffer(Stream stream, int bufferSize) - { - inputStream = stream; - - if (bufferSize < 1024) - bufferSize = 1024; - - rawData = new byte[bufferSize]; - clearText = rawData; - } - #endregion - - /// - /// Get the length of bytes bytes in the - /// - public int RawLength - { - get - { - return rawLength; - } - } - - /// - /// Get the contents of the raw data buffer. - /// - /// This may contain encrypted data. - public byte[] RawData - { - get - { - return rawData; - } - } - - /// - /// Get the number of useable bytes in - /// - public int ClearTextLength - { - get - { - return clearTextLength; - } - } - - /// - /// Get the contents of the clear text buffer. - /// - public byte[] ClearText - { - get - { - return clearText; - } - } - - /// - /// Get/set the number of bytes available - /// - public int Available - { - get { return available; } - set { available = value; } - } - - /// - /// Call passing the current clear text buffer contents. - /// - /// The inflater to set input for. - public void SetInflaterInput(Inflater inflater) - { - if (available > 0) - { - inflater.SetInput(clearText, clearTextLength - available, available); - available = 0; - } - } - - /// - /// Fill the buffer from the underlying input stream. - /// - public void Fill() - { - rawLength = 0; - int toRead = rawData.Length; - - while (toRead > 0) - { - int count = inputStream.Read(rawData, rawLength, toRead); - if (count <= 0) - break; - - rawLength += count; - toRead -= count; - } - - clearTextLength = rawLength; - - - available = clearTextLength; - } - - /// - /// Read a buffer directly from the input stream - /// - /// The buffer to fill - /// Returns the number of bytes read. - public int ReadRawBuffer(byte[] buffer) => ReadRawBuffer(buffer, 0, buffer.Length); - - /// - /// Read a buffer directly from the input stream - /// - /// The buffer to read into - /// The offset to start reading data into. - /// The number of bytes to read. - /// Returns the number of bytes read. - public int ReadRawBuffer(byte[] outBuffer, int offset, int length) - { - if (length < 0) - throw new ArgumentOutOfRangeException(nameof(length)); - - int currentOffset = offset; - int currentLength = length; - - while (currentLength > 0) - { - if (available <= 0) - { - Fill(); - if (available <= 0) - return 0; - } - - int toCopy = Math.Min(currentLength, available); - - Array.Copy(rawData, rawLength - available, outBuffer, currentOffset, toCopy); - currentOffset += toCopy; - currentLength -= toCopy; - available -= toCopy; - } - return length; - } - - /// - /// Read clear text data from the input stream. - /// - /// The buffer to add data to. - /// The offset to start adding data at. - /// The number of bytes to read. - /// Returns the number of bytes actually read. - public int ReadClearTextBuffer(byte[] outBuffer, int offset, int length) - { - if (length < 0) - throw new ArgumentOutOfRangeException(nameof(length)); - - int currentOffset = offset; - int currentLength = length; - - while (currentLength > 0) - { - if (available <= 0) - { - Fill(); - if (available <= 0) - return 0; - } - - int toCopy = Math.Min(currentLength, available); - Array.Copy(clearText, clearTextLength - available, outBuffer, currentOffset, toCopy); - currentOffset += toCopy; - currentLength -= toCopy; - available -= toCopy; - } - return length; - } - - /// - /// Read a from the input stream. - /// - /// Returns the byte read. - public int ReadLeByte() - { - if (available <= 0) - { - Fill(); - - if (available <= 0) - throw new EndOfStreamException("EOF in header"); - } - - byte result = rawData[rawLength - available]; - available -= 1; - return result; - } - - /// - /// Read an in little endian byte order. - /// - /// The short value read case to an int. - public int ReadLeShort() => ReadLeByte() | (ReadLeByte() << 8); - - /// - /// Read an in little endian byte order. - /// - /// The int value read. - public int ReadLeInt() => ReadLeShort() | (ReadLeShort() << 16); - - /// - /// Read a in little endian byte order. - /// - /// The long value read. - public long ReadLeLong() => (uint)ReadLeInt() | ((long)ReadLeInt() << 32); - - #region Instance Fields - int rawLength; - byte[] rawData; - - int clearTextLength; - byte[] clearText; - - int available; - Stream inputStream; - #endregion - } - - /// - /// This filter stream is used to decompress data compressed using the "deflate" - /// format. The "deflate" format is described in RFC 1951. - /// - /// This stream may form the basis for other decompression filters, such - /// as the GZipInputStream. - /// - /// Author of the original java version : John Leuner. - /// - public class InflaterInputStream : Stream - { - #region Constructors - /// - /// Create an InflaterInputStream with the default decompressor - /// and a default buffer size of 4KB. - /// - /// - /// The InputStream to read bytes from - /// - public InflaterInputStream(Stream baseInputStream) - : this(baseInputStream, new Inflater(), 4096) - { - } - - /// - /// Create an InflaterInputStream with the specified decompressor - /// and a default buffer size of 4KB. - /// - /// - /// The source of input data - /// - /// - /// The decompressor used to decompress data read from baseInputStream - /// - public InflaterInputStream(Stream baseInputStream, Inflater inf) - : this(baseInputStream, inf, 4096) - { - } - - /// - /// Create an InflaterInputStream with the specified decompressor - /// and the specified buffer size. - /// - /// - /// The InputStream to read bytes from - /// - /// - /// The decompressor to use - /// - /// - /// Size of the buffer to use - /// - public InflaterInputStream(Stream baseInputStream, Inflater inflater, int bufferSize) - { - if (bufferSize <= 0) - throw new ArgumentOutOfRangeException(nameof(bufferSize)); - - this.baseInputStream = baseInputStream ?? throw new ArgumentNullException(nameof(baseInputStream)); - this.inflater = inflater ?? throw new ArgumentNullException(nameof(inflater)); - - inputBuffer = new InflaterInputBuffer(baseInputStream, bufferSize); - } - - #endregion - - /// - /// Gets or sets a flag indicating ownership of underlying stream. - /// When the flag is true will close the underlying stream also. - /// - /// The default value is true. - public bool IsStreamOwner { get; set; } = true; - - /// - /// Skip specified number of bytes of uncompressed data - /// - /// - /// Number of bytes to skip - /// - /// - /// The number of bytes skipped, zero if the end of - /// stream has been reached - /// - /// - /// The number of bytes to skip is less than or equal to zero. - /// - public long Skip(long count) - { - if (count <= 0) - throw new ArgumentOutOfRangeException(nameof(count)); - - // v0.80 Skip by seeking if underlying stream supports it... - if (baseInputStream.CanSeek) - { - baseInputStream.Seek(count, SeekOrigin.Current); - return count; - } - else - { - int length = 2048; - if (count < length) - length = (int)count; - - byte[] tmp = new byte[length]; - int readCount = 1; - long toSkip = count; - - while ((toSkip > 0) && (readCount > 0)) - { - if (toSkip < length) - length = (int)toSkip; - - readCount = baseInputStream.Read(tmp, 0, length); - toSkip -= readCount; - } - - return count - toSkip; - } - } - - /// - /// Returns 0 once the end of the stream (EOF) has been reached. - /// Otherwise returns 1. - /// - public virtual int Available - { - get - { - return inflater.IsFinished ? 0 : 1; - } - } - - /// - /// Fills the buffer with more data to decompress. - /// - /// - /// Stream ends early - /// - protected void Fill() - { - // Protect against redundant calls - if (inputBuffer.Available <= 0) - { - inputBuffer.Fill(); - - if (inputBuffer.Available <= 0) - throw new EndOfStreamException("Unexpected EOF"); - } - - inputBuffer.SetInflaterInput(inflater); - } - - #region Stream Overrides - /// - /// Gets a value indicating whether the current stream supports reading - /// - public override bool CanRead - { - get - { - return baseInputStream.CanRead; - } - } - - /// - /// Gets a value of false indicating seeking is not supported for this stream. - /// - public override bool CanSeek - { - get - { - return false; - } - } - - /// - /// Gets a value of false indicating that this stream is not writeable. - /// - public override bool CanWrite - { - get - { - return false; - } - } - - /// - /// A value representing the length of the stream in bytes. - /// - public override long Length - { - get - { - //return inputBuffer.RawLength; - throw new NotSupportedException("InflaterInputStream Length is not supported"); - } - } - - /// - /// The current position within the stream. - /// Throws a NotSupportedException when attempting to set the position - /// - /// Attempting to set the position - public override long Position - { - get - { - return baseInputStream.Position; - } - set - { - throw new NotSupportedException("InflaterInputStream Position not supported"); - } - } - - /// - /// Flushes the baseInputStream - /// - public override void Flush() => baseInputStream.Flush(); - - /// - /// Sets the position within the current stream - /// Always throws a NotSupportedException - /// - /// The relative offset to seek to. - /// The defining where to seek from. - /// The new position in the stream. - /// Any access - public override long Seek(long offset, SeekOrigin origin) - { - throw new NotSupportedException("Seek not supported"); - } - - /// - /// Set the length of the current stream - /// Always throws a NotSupportedException - /// - /// The new length value for the stream. - /// Any access - public override void SetLength(long value) - { - throw new NotSupportedException("InflaterInputStream SetLength not supported"); - } - - /// - /// Writes a sequence of bytes to stream and advances the current position - /// This method always throws a NotSupportedException - /// - /// Thew buffer containing data to write. - /// The offset of the first byte to write. - /// The number of bytes to write. - /// Any access - public override void Write(byte[] buffer, int offset, int count) - { - throw new NotSupportedException("InflaterInputStream Write not supported"); - } - - /// - /// Writes one byte to the current stream and advances the current position - /// Always throws a NotSupportedException - /// - /// The byte to write. - /// Any access - public override void WriteByte(byte value) - { - throw new NotSupportedException("InflaterInputStream WriteByte not supported"); - } - - /// - /// Closes the input stream. When - /// is true the underlying stream is also closed. - /// - protected override void Dispose(bool disposing) - { - if (!isClosed) - { - isClosed = true; - - if (IsStreamOwner) - baseInputStream.Dispose(); - } - } - - /// - /// Reads decompressed data into the provided buffer byte array - /// - /// - /// The array to read and decompress data into - /// - /// - /// The offset indicating where the data should be placed - /// - /// - /// The number of bytes to decompress - /// - /// The number of bytes read. Zero signals the end of stream - /// - /// Inflater needs a dictionary - /// - public override int Read(byte[] buffer, int offset, int count) - { - if (inflater.IsNeedingDictionary) - throw new InvalidOperationException("Need a dictionary"); - - int remainingBytes = count; - while (true) - { - int bytesRead = inflater.Inflate(buffer, offset, remainingBytes); - offset += bytesRead; - remainingBytes -= bytesRead; - - if (remainingBytes == 0 || inflater.IsFinished) - break; - - if (inflater.IsNeedingInput) - Fill(); - else if (bytesRead == 0) - throw new IOException("Nothing reead"); - } - - return count - remainingBytes; - } - #endregion - - #region Instance Fields - /// - /// Decompressor for this stream - /// - protected Inflater inflater; - - /// - /// Input buffer for this stream. - /// - protected InflaterInputBuffer inputBuffer; - - /// - /// Base stream the inflater reads from. - /// - private Stream baseInputStream; - - /// - /// The compressed size - /// - protected long csize; - - /// - /// Flag indicating wether this instance has been closed or not. - /// - bool isClosed; - #endregion - } -} diff --git a/UpdateLib/UpdateLib/Compression/Streams/OutputWindow.cs b/UpdateLib/UpdateLib/Compression/Streams/OutputWindow.cs deleted file mode 100644 index aded4b3..0000000 --- a/UpdateLib/UpdateLib/Compression/Streams/OutputWindow.cs +++ /dev/null @@ -1,233 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -using System; - -namespace MatthiWare.UpdateLib.Compression.Streams -{ - /// - /// Contains the output from the Inflation process. - /// We need to have a window so that we can refer backwards into the output stream - /// to repeat stuff.
- /// Author of the original java version : John Leuner - ///
- public class OutputWindow - { - #region Constants - const int WindowSize = 1 << 15; - const int WindowMask = WindowSize - 1; - #endregion - - #region Instance Fields - byte[] window = new byte[WindowSize]; //The window is 2^15 bytes - int windowEnd; - int windowFilled; - #endregion - - /// - /// Write a byte to this output window - /// - /// value to write - /// - /// if window is full - /// - public void Write(int value) - { - if (windowFilled++ == WindowSize) - throw new InvalidOperationException("Window full"); - - window[windowEnd++] = (byte)value; - windowEnd &= WindowMask; - } - - - private void SlowRepeat(int repStart, int length, int distance) - { - while (length-- > 0) - { - window[windowEnd++] = window[repStart++]; - windowEnd &= WindowMask; - repStart &= WindowMask; - } - } - - /// - /// Append a byte pattern already in the window itself - /// - /// length of pattern to copy - /// distance from end of window pattern occurs - /// - /// If the repeated data overflows the window - /// - public void Repeat(int length, int distance) - { - if ((windowFilled += length) > WindowSize) - throw new InvalidOperationException("Window full"); - - int repStart = (windowEnd - distance) & WindowMask; - int border = WindowSize - length; - - if ((repStart <= border) && (windowEnd < border)) - { - if (length <= distance) - { - Array.Copy(window, repStart, window, windowEnd, length); - windowEnd += length; - } - else - { - // We have to copy manually, since the repeat pattern overlaps. - while (length-- > 0) - window[windowEnd++] = window[repStart++]; - } - } - else - SlowRepeat(repStart, length, distance); - } - - /// - /// Copy from input manipulator to internal window - /// - /// source of data - /// length of data to copy - /// the number of bytes copied - public int CopyStored(StreamManipulator input, int length) - { - length = Math.Min(Math.Min(length, WindowSize - windowFilled), input.AvailableBytes); - int copied; - - int tailLen = WindowSize - windowEnd; - if (length > tailLen) - { - copied = input.CopyBytes(window, windowEnd, tailLen); - - if (copied == tailLen) - copied += input.CopyBytes(window, 0, length - tailLen); - } - else - copied = input.CopyBytes(window, windowEnd, length); - - windowEnd = (windowEnd + copied) & WindowMask; - windowFilled += copied; - - return copied; - } - - /// - /// Copy dictionary to window - /// - /// source dictionary - /// offset of start in source dictionary - /// length of dictionary - /// - /// If window isnt empty - /// - public void CopyDict(byte[] dictionary, int offset, int length) - { - if (dictionary == null) - throw new ArgumentNullException(nameof(dictionary)); - - if (windowFilled > 0) - throw new InvalidOperationException(); - - if (length > WindowSize) - { - offset += length - WindowSize; - length = WindowSize; - } - - Array.Copy(dictionary, offset, window, 0, length); - windowEnd = length & WindowMask; - } - - /// - /// Get remaining unfilled space in window - /// - /// Number of bytes left in window - public int GetFreeSpace()=> WindowSize - windowFilled; - - /// - /// Get bytes available for output in window - /// - /// Number of bytes filled - public int GetAvailable()=>windowFilled; - - /// - /// Copy contents of window to output - /// - /// buffer to copy to - /// offset to start at - /// number of bytes to count - /// The number of bytes copied - /// - /// If a window underflow occurs - /// - public int CopyOutput(byte[] output, int offset, int len) - { - int copyEnd = windowEnd; - - if (len > windowFilled) - len = windowFilled; - else - copyEnd = (windowEnd - windowFilled + len) & WindowMask; - - int copied = len; - int tailLen = len - copyEnd; - - if (tailLen > 0) - { - Array.Copy(window, WindowSize - tailLen, output, offset, tailLen); - offset += tailLen; - len = copyEnd; - } - - Array.Copy(window, copyEnd - len, output, offset, len); - windowFilled -= copied; - - if (windowFilled < 0) - throw new InvalidOperationException(); - - return copied; - } - - /// - /// Reset by clearing window so GetAvailable returns 0 - /// - public void Reset() - { - windowFilled = windowEnd = 0; - } - } -} diff --git a/UpdateLib/UpdateLib/Compression/Streams/StreamManipulator.cs b/UpdateLib/UpdateLib/Compression/Streams/StreamManipulator.cs deleted file mode 100644 index d78211e..0000000 --- a/UpdateLib/UpdateLib/Compression/Streams/StreamManipulator.cs +++ /dev/null @@ -1,282 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -using System; - -namespace MatthiWare.UpdateLib.Compression.Streams -{ - /// - /// This class allows us to retrieve a specified number of bits from - /// the input buffer, as well as copy big byte blocks. - /// - /// It uses an int buffer to store up to 31 bits for direct - /// manipulation. This guarantees that we can get at least 16 bits, - /// but we only need at most 15, so this is all safe. - /// - /// There are some optimizations in this class, for example, you must - /// never peek more than 8 bits more than needed, and you must first - /// peek bits before you may drop them. This is not a general purpose - /// class but optimized for the behaviour of the Inflater. - /// - /// authors of the original java version : John Leuner, Jochen Hoenicke - /// - public class StreamManipulator - { - /// - /// Get the next sequence of bits but don't increase input pointer. bitCount must be - /// less or equal 16 and if this call succeeds, you must drop - /// at least n - 8 bits in the next call. - /// - /// The number of bits to peek. - /// - /// the value of the bits, or -1 if not enough bits available. */ - /// - public int PeekBits(int bitCount) - { - if (bitsInBuffer_ < bitCount) - { - if (windowStart_ == windowEnd_) - return -1; // ok - - buffer_ |= (uint)((window_[windowStart_++] & 0xff | - (window_[windowStart_++] & 0xff) << 8) << bitsInBuffer_); - bitsInBuffer_ += 16; - } - - return (int)(buffer_ & ((1 << bitCount) - 1)); - } - - /// - /// Drops the next n bits from the input. You should have called PeekBits - /// with a bigger or equal n before, to make sure that enough bits are in - /// the bit buffer. - /// - /// The number of bits to drop. - public void DropBits(int bitCount) - { - buffer_ >>= bitCount; - bitsInBuffer_ -= bitCount; - } - - /// - /// Gets the next n bits and increases input pointer. This is equivalent - /// to followed by , except for correct error handling. - /// - /// The number of bits to retrieve. - /// - /// the value of the bits, or -1 if not enough bits available. - /// - public int GetBits(int bitCount) - { - int bits = PeekBits(bitCount); - - if (bits >= 0) - DropBits(bitCount); - - return bits; - } - - /// - /// Gets the number of bits available in the bit buffer. This must be - /// only called when a previous PeekBits() returned -1. - /// - /// - /// the number of bits available. - /// - public int AvailableBits - { - get - { - return bitsInBuffer_; - } - } - - /// - /// Gets the number of bytes available. - /// - /// - /// The number of bytes available. - /// - public int AvailableBytes - { - get - { - return windowEnd_ - windowStart_ + (bitsInBuffer_ >> 3); - } - } - - /// - /// Skips to the next byte boundary. - /// - public void SkipToByteBoundary() - { - buffer_ >>= (bitsInBuffer_ & 7); - bitsInBuffer_ &= ~7; - } - - /// - /// Returns true when SetInput can be called - /// - public bool IsNeedingInput - { - get - { - return windowStart_ == windowEnd_; - } - } - - /// - /// Copies bytes from input buffer to output buffer starting - /// at output[offset]. You have to make sure, that the buffer is - /// byte aligned. If not enough bytes are available, copies fewer - /// bytes. - /// - /// - /// The buffer to copy bytes to. - /// - /// - /// The offset in the buffer at which copying starts - /// - /// - /// The length to copy, 0 is allowed. - /// - /// - /// The number of bytes copied, 0 if no bytes were available. - /// - /// - /// Length is less than zero - /// - /// - /// Bit buffer isnt byte aligned - /// - public int CopyBytes(byte[] output, int offset, int length) - { - if (length < 0) - throw new ArgumentOutOfRangeException(nameof(length)); - - if ((bitsInBuffer_ & 7) != 0) - // bits_in_buffer may only be 0 or a multiple of 8 - throw new InvalidOperationException("Bit buffer is not byte aligned!"); - - int count = 0; - while ((bitsInBuffer_ > 0) && (length > 0)) - { - output[offset++] = (byte)buffer_; - buffer_ >>= 8; - bitsInBuffer_ -= 8; - length--; - count++; - } - - if (length == 0) - return count; - - int avail = windowEnd_ - windowStart_; - - if (length > avail) - length = avail; - - Array.Copy(window_, windowStart_, output, offset, length); - windowStart_ += length; - - if (((windowStart_ - windowEnd_) & 1) != 0) - { - // We always want an even number of bytes in input, see peekBits - buffer_ = (uint)(window_[windowStart_++] & 0xff); - bitsInBuffer_ = 8; - } - - return count + length; - } - - /// - /// Resets state and empties internal buffers - /// - public void Reset() - { - buffer_ = 0; - windowStart_ = windowEnd_ = bitsInBuffer_ = 0; - } - - /// - /// Add more input for consumption. - /// Only call when IsNeedingInput returns true - /// - /// data to be input - /// offset of first byte of input - /// number of bytes of input to add. - public void SetInput(byte[] buffer, int offset, int count) - { - if (buffer == null) - throw new ArgumentNullException(nameof(buffer)); - - if (offset < 0) - throw new ArgumentOutOfRangeException(nameof(offset), "Cannot be negative"); - - if (count < 0) - throw new ArgumentOutOfRangeException(nameof(count), "Cannot be negative"); - - if (windowStart_ < windowEnd_) - throw new InvalidOperationException("Old input was not completely processed"); - - int end = offset + count; - - // We want to throw an ArrayIndexOutOfBoundsException early. - // Note the check also handles integer wrap around. - if ((offset > end) || (end > buffer.Length)) - throw new ArgumentOutOfRangeException(nameof(count)); - - if ((count & 1) != 0) - { - // We always want an even number of bytes in input, see PeekBits - buffer_ |= (uint)((buffer[offset++] & 0xff) << bitsInBuffer_); - bitsInBuffer_ += 8; - } - - window_ = buffer; - windowStart_ = offset; - windowEnd_ = end; - } - - #region Instance Fields - private byte[] window_; - private int windowStart_; - private int windowEnd_; - - private uint buffer_; - private int bitsInBuffer_; - #endregion - } -} diff --git a/UpdateLib/UpdateLib/Compression/VCDiff/AddressCache.cs b/UpdateLib/UpdateLib/Compression/VCDiff/AddressCache.cs deleted file mode 100644 index 8e4d05f..0000000 --- a/UpdateLib/UpdateLib/Compression/VCDiff/AddressCache.cs +++ /dev/null @@ -1,81 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.IO; -using MatthiWare.UpdateLib.Utils; - -namespace MatthiWare.UpdateLib.Compression.VCDiff -{ - internal class AddressCache - { - const byte SelfMode = 0; - const byte HereMode = 1; - - int m_nearSize, m_sameSize, m_nextNearSlot; - int[] m_near, m_same; - - Stream m_addressStream; - - internal AddressCache(int nearSize, int sameSize) - { - m_nearSize = nearSize; - m_sameSize = sameSize; - m_near = new int[nearSize]; - m_same = new int[sameSize * 256]; - } - - public void Reset(byte[] addresses) - { - m_nextNearSlot = 0; - Array.Clear(m_near, 0, m_near.Length); - Array.Clear(m_same, 0, m_same.Length); - - m_addressStream = new MemoryStream(addresses, false); - } - - internal int DecodeAddress(int here, byte mode) - { - int ret; - - if (mode == SelfMode) - ret = m_addressStream.ReadBigEndian7BitEncodedInt(); - else if (mode == HereMode) - ret = here - m_addressStream.ReadBigEndian7BitEncodedInt(); - else if (mode - 2 < m_nearSize) // near cache - ret = m_near[mode - 2] + m_addressStream.ReadBigEndian7BitEncodedInt(); - else // same cache - ret = m_same[((mode - (2 + m_nearSize)) * 256) + m_addressStream.CheckedReadByte()]; - - Update(ret); - - return ret; - } - - private void Update(int address) - { - if (m_nearSize > 0) - { - m_near[m_nextNearSlot] = address; - m_nextNearSlot = (m_nextNearSlot + 1) % m_nearSize; - } - - if (m_sameSize > 0) - m_same[address % (m_sameSize * 256)] = address; - } - - } -} diff --git a/UpdateLib/UpdateLib/Compression/VCDiff/CodeTable.cs b/UpdateLib/UpdateLib/Compression/VCDiff/CodeTable.cs deleted file mode 100644 index 5042faa..0000000 --- a/UpdateLib/UpdateLib/Compression/VCDiff/CodeTable.cs +++ /dev/null @@ -1,111 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using MatthiWare.UpdateLib.Common; -using System; - -namespace MatthiWare.UpdateLib.Compression.VCDiff -{ - internal class CodeTable - { - internal static CodeTable Default = BuildDefaultCodeTable(); - Instruction[,] m_instructions = new Instruction[256, 2]; - - internal CodeTable(Instruction[,] instructions) - { - if (instructions == null) - throw new ArgumentNullException(nameof(instructions)); - if (instructions.Rank != 2) - throw new ArgumentException("Array must have a rank of 2", nameof(instructions)); - if (instructions.GetLength(0) != 256) - throw new ArgumentException("Array must have a outer length of 256", nameof(instructions)); - if (instructions.GetLength(1) != 2) - throw new ArgumentException("Array must have a innter length of 2", nameof(instructions)); - - Array.Copy(instructions, 0, m_instructions, 0, 512); - } - - internal Instruction this[int x, int y] - { - get - { - return m_instructions[x, y]; - } - } - - private static CodeTable BuildDefaultCodeTable() - { - // default are NoOps with size and mode 0. - Instruction[,] instructions = new Instruction[256, 2]; - instructions[0, 0] = new Instruction(InstructionType.Run, 0, 0); - - for (byte i = 0; i < 18; i++) - instructions[i + 1, 0] = new Instruction(InstructionType.Add, i, 0); - - int index = 19; - - // instructions 19-162 - for (byte mode = 0; mode < 9; mode++) - { - instructions[index++, 0] = new Instruction(InstructionType.Copy, 0, mode); - for (byte size = 4; size < 19; size++) - instructions[index++, 0] = new Instruction(InstructionType.Copy, size, mode); - } - - // instructions 163-234 - for (byte mode = 0; mode < 6; mode++) - for (byte addSize = 1; addSize < 5; addSize++) - for (byte copySize = 4; copySize < 7; copySize++) - { - instructions[index, 0] = new Instruction(InstructionType.Add, addSize, 0); - instructions[index++, 0] = new Instruction(InstructionType.Copy, copySize, mode); - } - - // instructions 235-246 - for (byte mode = 6; mode < 9; mode++) - for (byte addSize = 1; addSize < 5; addSize++) - { - instructions[index, 0] = new Instruction(InstructionType.Add, addSize, 0); - instructions[index++, 1] = new Instruction(InstructionType.Copy, 4, mode); - } - - for (byte mode = 0; mode < 9; mode++) - { - instructions[index, 0] = new Instruction(InstructionType.Copy, 4, mode); - instructions[index++, 1] = new Instruction(InstructionType.Add, 1, 0); - } - - return new CodeTable(instructions); - } - - internal byte[] GetBytes() - { - byte[] ret = new byte[1536]; - - for (int i = 0; i < 256; i++) - { - ret[i] = (byte)m_instructions[i, 0].Type; - ret[i + 256] = (byte)m_instructions[i, 1].Type; - ret[i + 512] = m_instructions[i, 0].Size; - ret[i + 768] = m_instructions[i, 1].Size; - ret[i + 1024] = m_instructions[i, 0].Size; - ret[i + 1028] = m_instructions[i, 1].Size; - } - - return ret; - } - } -} diff --git a/UpdateLib/UpdateLib/Compression/VCDiff/Instruction.cs b/UpdateLib/UpdateLib/Compression/VCDiff/Instruction.cs deleted file mode 100644 index ac35e63..0000000 --- a/UpdateLib/UpdateLib/Compression/VCDiff/Instruction.cs +++ /dev/null @@ -1,36 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using MatthiWare.UpdateLib.Common; - -namespace MatthiWare.UpdateLib.Compression.VCDiff -{ - internal struct Instruction - { - public readonly InstructionType Type; - - public readonly byte Size; - - public readonly byte Mode; - - internal Instruction(InstructionType type, byte size, byte mode) - { - Type = type; - Size = size; - Mode = mode; - } - } -} diff --git a/UpdateLib/UpdateLib/Compression/VCDiff/VCDiffDecoder.cs b/UpdateLib/UpdateLib/Compression/VCDiff/VCDiffDecoder.cs deleted file mode 100644 index b8e32d8..0000000 --- a/UpdateLib/UpdateLib/Compression/VCDiff/VCDiffDecoder.cs +++ /dev/null @@ -1,198 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.IO; -using MatthiWare.UpdateLib.Utils; -using MatthiWare.UpdateLib.Common; - -namespace MatthiWare.UpdateLib.Compression.VCDiff -{ - public sealed class VCDiffDecoder - { - private Stream m_original, m_delta, m_output; - - private CodeTable m_codeTable = CodeTable.Default; - - private AddressCache m_cache = new AddressCache(4, 3); - - public event ProgressChangedHandler ProgressChanged; - - public VCDiffDecoder(Stream original, Stream delta, Stream output) - { - if (original == null) throw new ArgumentNullException(nameof(original)); - if (delta == null) throw new ArgumentNullException(nameof(delta)); - if (output == null) throw new ArgumentNullException(nameof(output)); - - if (!original.CanRead || !original.CanSeek) - throw new ArgumentException("Must be able to read and seek in stream", nameof(original)); - - if (!delta.CanRead) - throw new ArgumentException("Must be able to read in stream", nameof(delta)); - - if (!output.CanWrite || !output.CanSeek || !output.CanRead) - throw new ArgumentException("Must be able to read, seek and write in stream", nameof(output)); - - m_original = original; - m_delta = delta; - m_output = output; - } - - public void Decode() - { - ReadHeader(); - - while (DecodeWindow()) - OnProgressChanged(false, (m_delta.Position * 1.0) / m_delta.Length); - - OnProgressChanged(true, 1); - } - - private void OnProgressChanged(bool completed, double progress) - => ProgressChanged?.Invoke(completed, progress); - - private void ReadHeader() - { - byte[] header = m_delta.CheckedReadBytes(4); - - if (header[0] != 0xd6 || - header[1] != 0xc3 || - header[2] != 0xc4) - throw new VCDiffFormatException("Invalid header in delta stream"); - - if (header[3] != 0) - throw new VCDiffFormatException("Only VCDiff Version 0 is supported"); - - byte headerIndicator = m_delta.CheckedReadByte(); - - if ((headerIndicator & 1) != 0) - throw new VCDiffFormatException("Secondary compressors are not supported"); - - if ((headerIndicator & 0xf8) != 0) - throw new VCDiffFormatException("Invalid header indicator, bits 3-7 not all zero"); - } - - private bool DecodeWindow() - { - int windowIndicator = m_delta.ReadByte(); - - if (windowIndicator == -1) - return false; - - Stream sourceStream; - int sourceStreamPostReadSeek = -1; - windowIndicator &= 0xfb; - - switch (windowIndicator & 3) - { - case 0: - sourceStream = null; - break; - case 1: - sourceStream = m_original; - break; - case 2: - sourceStream = m_output; - sourceStreamPostReadSeek = (int)m_output.Position; - break; - default: - throw new VCDiffFormatException("Invalid window indicator"); - } - - - int sourceLength = m_delta.ReadBigEndian7BitEncodedInt(); - int sourcePosition = m_delta.ReadBigEndian7BitEncodedInt(); - - sourceStream.Position = sourcePosition; - byte[] sourceData = sourceStream.CheckedReadBytes(sourceLength); - if (sourceStreamPostReadSeek != -1) - sourceStream.Position = sourceStreamPostReadSeek; - - m_delta.ReadBigEndian7BitEncodedInt(); - - int targetLength = m_delta.ReadBigEndian7BitEncodedInt(); - byte[] targetData = new byte[targetLength]; - MemoryStream targetDataStream = new MemoryStream(targetData, true); - - if (m_delta.CheckedReadByte() != 0) - throw new VCDiffFormatException("Unable to handle compressed delta sections"); - - int addRunDataLength = m_delta.ReadBigEndian7BitEncodedInt(); - int instructionsLength = m_delta.ReadBigEndian7BitEncodedInt(); - int addressesLength = m_delta.ReadBigEndian7BitEncodedInt(); - - byte[] addRunData = m_delta.CheckedReadBytes(addRunDataLength); - byte[] instructions = m_delta.CheckedReadBytes(instructionsLength); - byte[] addresses = m_delta.CheckedReadBytes(addressesLength); - - int addRunDataIndex = 0; - MemoryStream instructionStream = new MemoryStream(instructions, false); - - m_cache.Reset(addresses); - - while (true) - { - int instructionIndex = instructionStream.ReadByte(); - if (instructionIndex == -1) - break; - - for (int i = 0; i < 2; i++) - { - Instruction instruction = m_codeTable[instructionIndex, i]; - int size = instruction.Size; - - if (size == 0 && instruction.Type != InstructionType.NoOp) - size = instructionStream.ReadBigEndian7BitEncodedInt(); - - switch (instruction.Type) - { - case InstructionType.NoOp: - break; - case InstructionType.Add: - targetDataStream.Write(addRunData, addRunDataIndex, size); - addRunDataIndex += size; - break; - case InstructionType.Copy: - int addr = m_cache.DecodeAddress((int)targetDataStream.Position + sourceLength, instruction.Mode); - if (addr < sourceData.Length) - targetDataStream.Write(sourceData, addr, size); - else - { - addr -= sourceLength; - if (addr + size < targetDataStream.Position) - targetDataStream.Write(targetData, addr, size); - else - for (int j = 0; j < size; j++) - targetDataStream.WriteByte(targetData[addr++]); - } - break; - case InstructionType.Run: - byte data = addRunData[addRunDataIndex++]; - for (int j = 0; j < size; j++) - targetDataStream.WriteByte(data); - break; - default: - throw new VCDiffFormatException("Invalid instruction type found"); - } - } - - m_output.Write(targetData, 0, targetLength); - } - - return true; - } - } -} diff --git a/UpdateLib/UpdateLib/Compression/VCDiff/VCDiffFormatException.cs b/UpdateLib/UpdateLib/Compression/VCDiff/VCDiffFormatException.cs deleted file mode 100644 index 02f9621..0000000 --- a/UpdateLib/UpdateLib/Compression/VCDiff/VCDiffFormatException.cs +++ /dev/null @@ -1,35 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.Runtime.Serialization; - -namespace MatthiWare.UpdateLib.Compression.VCDiff -{ - [Serializable] - public class VCDiffFormatException : Exception - { - public VCDiffFormatException() { } - - public VCDiffFormatException(string message) : base(message) { } - - public VCDiffFormatException(string message, Exception inner) : base(message, inner) { } - - protected VCDiffFormatException( - SerializationInfo info, - StreamingContext context) : base(info, context) { } - } -} diff --git a/UpdateLib/UpdateLib/Compression/Zip/Zip.cs b/UpdateLib/UpdateLib/Compression/Zip/Zip.cs deleted file mode 100644 index 8c8614b..0000000 --- a/UpdateLib/UpdateLib/Compression/Zip/Zip.cs +++ /dev/null @@ -1,22 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -namespace MatthiWare.UpdateLib.Compression.Zip -{ - public static class Zip - { - } -} diff --git a/UpdateLib/UpdateLib/Compression/Zip/ZipConstants.cs b/UpdateLib/UpdateLib/Compression/Zip/ZipConstants.cs deleted file mode 100644 index 3a03c92..0000000 --- a/UpdateLib/UpdateLib/Compression/Zip/ZipConstants.cs +++ /dev/null @@ -1,470 +0,0 @@ -using System; -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -using System.Text; - -namespace MatthiWare.UpdateLib.Compression.Zip -{ - #region Enumerations - - /// - /// Determines how entries are tested to see if they should use Zip64 extensions or not. - /// - public enum UseZip64 - { - /// - /// Zip64 will not be forced on entries during processing. - /// - /// An entry can have this overridden if required - Off, - /// - /// Zip64 should always be used. - /// - On, - /// - /// #ZipLib will determine use based on entry values when added to archive. - /// - Dynamic, - } - - /// - /// The kind of compression used for an entry in an archive - /// - public enum CompressionMethod - { - /// - /// A direct copy of the file contents is held in the archive - /// - Stored = 0, - - /// - /// Common Zip compression method using a sliding dictionary - /// of up to 32KB and secondary compression from Huffman/Shannon-Fano trees - /// - Deflated = 8, - - /// - /// An extension to deflate with a 64KB window. Not supported by #Zip currently - /// - Deflate64 = 9, - - /// - /// BZip2 compression. Not supported by #Zip. - /// - BZip2 = 11 - - } - - /// - /// Defines the contents of the general bit flags field for an archive entry. - /// - [Flags] - public enum GeneralBitFlags - { - /// - /// Bit 0 if set indicates that the file is encrypted - /// - Encrypted = 0x0001, - /// - /// Bits 1 and 2 - Two bits defining the compression method (only for Method 6 Imploding and 8,9 Deflating) - /// - Method = 0x0006, - /// - /// Bit 3 if set indicates a trailing data desciptor is appended to the entry data - /// - Descriptor = 0x0008, - /// - /// Bit 4 is reserved for use with method 8 for enhanced deflation - /// - ReservedPKware4 = 0x0010, - /// - /// Bit 5 if set indicates the file contains Pkzip compressed patched data. - /// Requires version 2.7 or greater. - /// - Patched = 0x0020, - /// - /// Bit 6 if set indicates strong encryption has been used for this entry. - /// - StrongEncryption = 0x0040, - /// - /// Bit 7 is currently unused - /// - Unused7 = 0x0080, - /// - /// Bit 8 is currently unused - /// - Unused8 = 0x0100, - /// - /// Bit 9 is currently unused - /// - Unused9 = 0x0200, - /// - /// Bit 10 is currently unused - /// - Unused10 = 0x0400, - /// - /// Bit 11 if set indicates the filename and - /// comment fields for this file must be encoded using UTF-8. - /// - UnicodeText = 0x0800, - /// - /// Bit 12 is documented as being reserved by PKware for enhanced compression. - /// - EnhancedCompress = 0x1000, - /// - /// Bit 13 if set indicates that values in the local header are masked to hide - /// their actual values, and the central directory is encrypted. - /// - /// - /// Used when encrypting the central directory contents. - /// - HeaderMasked = 0x2000, - /// - /// Bit 14 is documented as being reserved for use by PKware - /// - ReservedPkware14 = 0x4000, - /// - /// Bit 15 is documented as being reserved for use by PKware - /// - ReservedPkware15 = 0x8000 - } - - #endregion - - /// - /// This class contains constants used for Zip format files - /// - public static class ZipConstants - { - #region Versions - /// - /// The version made by field for entries in the central header when created by this library - /// - /// - /// This is also the Zip version for the library when comparing against the version required to extract - /// for an entry. See . - /// - public const int VersionMadeBy = 51; // was 45 before AES - - /// - /// The version required for Zip64 extensions (4.5 or higher) - /// - public const int VersionZip64 = 45; - #endregion - - #region Header Sizes - /// - /// Size of local entry header (excluding variable length fields at end) - /// - public const int LocalHeaderBaseSize = 30; - - /// - /// Size of Zip64 data descriptor - /// - public const int Zip64DataDescriptorSize = 24; - - /// - /// Size of data descriptor - /// - public const int DataDescriptorSize = 16; - - /// - /// Size of central header entry (excluding variable fields) - /// - public const int CentralHeaderBaseSize = 46; - - /// - /// Size of end of central record (excluding variable fields) - /// - public const int EndOfCentralRecordBaseSize = 22; - - /// - /// Size of 'classic' cryptographic header stored before any entry data - /// - public const int CryptoHeaderSize = 12; - #endregion - - #region Header Signatures - - /// - /// Signature for local entry header - /// - public const int LocalHeaderSignature = 'P' | ('K' << 8) | (3 << 16) | (4 << 24); - - /// - /// Signature for local entry header - /// - [Obsolete("Use LocalHeaderSignature instead")] - public const int LOCSIG = 'P' | ('K' << 8) | (3 << 16) | (4 << 24); - - /// - /// Signature for spanning entry - /// - public const int SpanningSignature = 'P' | ('K' << 8) | (7 << 16) | (8 << 24); - - /// - /// Signature for spanning entry - /// - [Obsolete("Use SpanningSignature instead")] - public const int SPANNINGSIG = 'P' | ('K' << 8) | (7 << 16) | (8 << 24); - - /// - /// Signature for temporary spanning entry - /// - public const int SpanningTempSignature = 'P' | ('K' << 8) | ('0' << 16) | ('0' << 24); - - /// - /// Signature for temporary spanning entry - /// - [Obsolete("Use SpanningTempSignature instead")] - public const int SPANTEMPSIG = 'P' | ('K' << 8) | ('0' << 16) | ('0' << 24); - - /// - /// Signature for data descriptor - /// - /// - /// This is only used where the length, Crc, or compressed size isnt known when the - /// entry is created and the output stream doesnt support seeking. - /// The local entry cannot be 'patched' with the correct values in this case - /// so the values are recorded after the data prefixed by this header, as well as in the central directory. - /// - public const int DataDescriptorSignature = 'P' | ('K' << 8) | (7 << 16) | (8 << 24); - - /// - /// Signature for data descriptor - /// - /// - /// This is only used where the length, Crc, or compressed size isnt known when the - /// entry is created and the output stream doesnt support seeking. - /// The local entry cannot be 'patched' with the correct values in this case - /// so the values are recorded after the data prefixed by this header, as well as in the central directory. - /// - [Obsolete("Use DataDescriptorSignature instead")] - public const int EXTSIG = 'P' | ('K' << 8) | (7 << 16) | (8 << 24); - - /// - /// Signature for central header - /// - [Obsolete("Use CentralHeaderSignature instead")] - public const int CENSIG = 'P' | ('K' << 8) | (1 << 16) | (2 << 24); - - /// - /// Signature for central header - /// - public const int CentralHeaderSignature = 'P' | ('K' << 8) | (1 << 16) | (2 << 24); - - /// - /// Signature for Zip64 central file header - /// - public const int Zip64CentralFileHeaderSignature = 'P' | ('K' << 8) | (6 << 16) | (6 << 24); - - /// - /// Signature for Zip64 central file header - /// - [Obsolete("Use Zip64CentralFileHeaderSignature instead")] - public const int CENSIG64 = 'P' | ('K' << 8) | (6 << 16) | (6 << 24); - - /// - /// Signature for Zip64 central directory locator - /// - public const int Zip64CentralDirLocatorSignature = 'P' | ('K' << 8) | (6 << 16) | (7 << 24); - - /// - /// Signature for archive extra data signature (were headers are encrypted). - /// - public const int ArchiveExtraDataSignature = 'P' | ('K' << 8) | (6 << 16) | (7 << 24); - - /// - /// Central header digitial signature - /// - public const int CentralHeaderDigitalSignature = 'P' | ('K' << 8) | (5 << 16) | (5 << 24); - - /// - /// Central header digitial signature - /// - [Obsolete("Use CentralHeaderDigitalSignaure instead")] - public const int CENDIGITALSIG = 'P' | ('K' << 8) | (5 << 16) | (5 << 24); - - /// - /// End of central directory record signature - /// - public const int EndOfCentralDirectorySignature = 'P' | ('K' << 8) | (5 << 16) | (6 << 24); - - /// - /// End of central directory record signature - /// - [Obsolete("Use EndOfCentralDirectorySignature instead")] - public const int ENDSIG = 'P' | ('K' << 8) | (5 << 16) | (6 << 24); - #endregion - - /// - /// The original Zip specification (https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT) states - /// that file names should only be encoded with IBM Code Page 437 or UTF-8. - /// In practice, most zip apps use OEM or system encoding (typically cp437 on Windows). - /// Let's be good citizens and default to UTF-8 http://utf8everywhere.org/ - /// - static int defaultCodePage = Encoding.UTF8.CodePage; - - /// - /// Default encoding used for string conversion. 0 gives the default system OEM code page. - /// Using the default code page isnt the full solution neccessarily - /// there are many variable factors, codepage 850 is often a good choice for - /// European users, however be careful about compatability. - /// - public static int DefaultCodePage - { - get - { - return defaultCodePage; - } - set - { - if ((value < 0) || (value > 65535) || - (value == 1) || (value == 2) || (value == 3) || (value == 42)) - throw new ArgumentOutOfRangeException(nameof(value)); - - defaultCodePage = value; - } - } - - /// - /// Convert a portion of a byte array to a string. - /// - /// - /// Data to convert to string - /// - /// - /// Number of bytes to convert starting from index 0 - /// - /// - /// data[0]..data[count - 1] converted to a string - /// - public static string ConvertToString(byte[] data, int count) - { - if (data == null) - return string.Empty; - - return Encoding.GetEncoding(DefaultCodePage).GetString(data, 0, count); - } - - /// - /// Convert a byte array to string - /// - /// - /// Byte array to convert - /// - /// - /// dataconverted to a string - /// - public static string ConvertToString(byte[] data) - { - if (data == null) - return string.Empty; - - return ConvertToString(data, data.Length); - } - - /// - /// Convert a byte array to string - /// - /// The applicable general purpose bits flags - /// - /// Byte array to convert - /// - /// The number of bytes to convert. - /// - /// dataconverted to a string - /// - public static string ConvertToStringExt(int flags, byte[] data, int count) - { - if (data == null) - return string.Empty; - - return (flags & (int)GeneralBitFlags.UnicodeText) != 0 ? - Encoding.UTF8.GetString(data, 0, count) : - ConvertToString(data, count); - } - - /// - /// Convert a byte array to string - /// - /// - /// Byte array to convert - /// - /// The applicable general purpose bits flags - /// - /// dataconverted to a string - /// - public static string ConvertToStringExt(int flags, byte[] data) - { - if (data == null) - return string.Empty; - - return ((flags & (int)GeneralBitFlags.UnicodeText) != 0) ? Encoding.UTF8.GetString(data, 0, data.Length) : ConvertToString(data, data.Length); - } - - /// - /// Convert a string to a byte array - /// - /// - /// String to convert to an array - /// - /// Converted array - public static byte[] ConvertToArray(string str) - { - if (str == null) - return new byte[0]; - - return Encoding.GetEncoding(DefaultCodePage).GetBytes(str); - } - - /// - /// Convert a string to a byte array - /// - /// The applicable general purpose bits flags - /// - /// String to convert to an array - /// - /// Converted array - public static byte[] ConvertToArray(int flags, string str) - { - if (str == null) - return new byte[0]; - - return ((flags & (int)GeneralBitFlags.UnicodeText) != 0) ? Encoding.UTF8.GetBytes(str) : ConvertToArray(str); - } - } -} diff --git a/UpdateLib/UpdateLib/Compression/Zip/ZipEntry.cs b/UpdateLib/UpdateLib/Compression/Zip/ZipEntry.cs deleted file mode 100644 index 9c0831e..0000000 --- a/UpdateLib/UpdateLib/Compression/Zip/ZipEntry.cs +++ /dev/null @@ -1,1056 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -using System; -using System.IO; - -namespace MatthiWare.UpdateLib.Compression.Zip -{ - /// - /// Defines known values for the property. - /// - public enum HostSystemID - { - /// - /// Host system = MSDOS - /// - Msdos = 0, - /// - /// Host system = Amiga - /// - Amiga = 1, - /// - /// Host system = Open VMS - /// - OpenVms = 2, - /// - /// Host system = Unix - /// - Unix = 3, - /// - /// Host system = VMCms - /// - VMCms = 4, - /// - /// Host system = Atari ST - /// - AtariST = 5, - /// - /// Host system = OS2 - /// - OS2 = 6, - /// - /// Host system = Macintosh - /// - Macintosh = 7, - /// - /// Host system = ZSystem - /// - ZSystem = 8, - /// - /// Host system = Cpm - /// - Cpm = 9, - /// - /// Host system = Windows NT - /// - WindowsNT = 10, - /// - /// Host system = MVS - /// - MVS = 11, - /// - /// Host system = VSE - /// - Vse = 12, - /// - /// Host system = Acorn RISC - /// - AcornRisc = 13, - /// - /// Host system = VFAT - /// - Vfat = 14, - /// - /// Host system = Alternate MVS - /// - AlternateMvs = 15, - /// - /// Host system = BEOS - /// - BeOS = 16, - /// - /// Host system = Tandem - /// - Tandem = 17, - /// - /// Host system = OS400 - /// - OS400 = 18, - /// - /// Host system = OSX - /// - OSX = 19, - /// - /// Host system = WinZIP AES - /// - WinZipAES = 99, - } - - /// - /// This class represents an entry in a zip archive. This can be a file - /// or a directory - /// ZipFile and ZipInputStream will give you instances of this class as - /// information about the members in an archive. ZipOutputStream - /// uses an instance of this class when creating an entry in a Zip file. - ///
- ///
Author of the original java version : Jochen Hoenicke - ///
- public class ZipEntry - { - [Flags] - enum Known : byte - { - None = 0, - Size = 0x01, - CompressedSize = 0x02, - Crc = 0x04, - Time = 0x08, - ExternalAttributes = 0x10, - } - - #region Constructors - /// - /// Creates a zip entry with the given name. - /// - /// - /// The name for this entry. Can include directory components. - /// The convention for names is 'unix' style paths with relative names only. - /// There are with no device names and path elements are separated by '/' characters. - /// - /// - /// The name passed is null - /// - public ZipEntry(string name) - : this(name, 0, ZipConstants.VersionMadeBy, CompressionMethod.Deflated) - { - } - - /// - /// Creates a zip entry with the given name and version required to extract - /// - /// - /// The name for this entry. Can include directory components. - /// The convention for names is 'unix' style paths with no device names and - /// path elements separated by '/' characters. This is not enforced see CleanName - /// on how to ensure names are valid if this is desired. - /// - /// - /// The minimum 'feature version' required this entry - /// - /// - /// The name passed is null - /// - internal ZipEntry(string name, int versionRequiredToExtract) - : this(name, versionRequiredToExtract, ZipConstants.VersionMadeBy, - CompressionMethod.Deflated) - { - } - - /// - /// Initializes an entry with the given name and made by information - /// - /// Name for this entry - /// Version and HostSystem Information - /// Minimum required zip feature version required to extract this entry - /// Compression method for this entry. - /// - /// The name passed is null - /// - /// - /// versionRequiredToExtract should be 0 (auto-calculate) or > 10 - /// - /// - /// This constructor is used by the ZipFile class when reading from the central header - /// It is not generally useful, use the constructor specifying the name only. - /// - internal ZipEntry(string name, int versionRequiredToExtract, int madeByInfo, - CompressionMethod method) - { - if (name == null) - throw new ArgumentNullException(nameof(name)); - - if (name.Length > 0xffff) - throw new ArgumentException("Name is too long", nameof(name)); - - if ((versionRequiredToExtract != 0) && (versionRequiredToExtract < 10)) - throw new ArgumentOutOfRangeException(nameof(versionRequiredToExtract)); - - - DateTime = DateTime.Now; - this.name = CleanName(name); - versionMadeBy = (ushort)madeByInfo; - versionToExtract = (ushort)versionRequiredToExtract; - this.method = method; - } - - #endregion - - /// - /// Get a value indicating wether the entry has a CRC value available. - /// - public bool HasCrc - { - get - { - return (known & Known.Crc) != 0; - } - } - - /// - /// Get / set a flag indicating wether entry name and comment text are - /// encoded in unicode UTF8. - /// - /// This is an assistant that interprets the flags property. - public bool IsUnicodeText - { - get - { - return (flags & (int)GeneralBitFlags.UnicodeText) != 0; - } - set - { - if (value) - { - flags |= (int)GeneralBitFlags.UnicodeText; - } - else - { - flags &= ~(int)GeneralBitFlags.UnicodeText; - } - } - } - - /// - /// Get/Set general purpose bit flag for entry - /// - /// - /// General purpose bit flag
- ///
- /// Bit 0: If set, indicates the file is encrypted
- /// Bit 1-2 Only used for compression type 6 Imploding, and 8, 9 deflating
- /// Imploding:
- /// Bit 1 if set indicates an 8K sliding dictionary was used. If clear a 4k dictionary was used
- /// Bit 2 if set indicates 3 Shannon-Fanno trees were used to encode the sliding dictionary, 2 otherwise
- ///
- /// Deflating:
- /// Bit 2 Bit 1
- /// 0 0 Normal compression was used
- /// 0 1 Maximum compression was used
- /// 1 0 Fast compression was used
- /// 1 1 Super fast compression was used
- ///
- /// Bit 3: If set, the fields crc-32, compressed size - /// and uncompressed size are were not able to be written during zip file creation - /// The correct values are held in a data descriptor immediately following the compressed data.
- /// Bit 4: Reserved for use by PKZIP for enhanced deflating
- /// Bit 5: If set indicates the file contains compressed patch data
- /// Bit 6: If set indicates strong encryption was used.
- /// Bit 7-10: Unused or reserved
- /// Bit 11: If set the name and comments for this entry are in unicode.
- /// Bit 12-15: Unused or reserved
- ///
- /// - /// - public int Flags - { - get - { - return flags; - } - set - { - flags = value; - } - } - - /// - /// Get/Set index of this entry in Zip file - /// - /// This is only valid when the entry is part of a - public long ZipFileIndex - { - get - { - return zipFileIndex; - } - set - { - zipFileIndex = value; - } - } - - /// - /// Get/set offset for use in central header - /// - public long Offset - { - get - { - return offset; - } - set - { - offset = value; - } - } - - /// - /// Get/Set external file attributes as an integer. - /// The values of this are operating system dependant see - /// HostSystem for details - /// - public int ExternalFileAttributes - { - get - { - return ((known & Known.ExternalAttributes) == 0) ? -1 : externalFileAttributes; - } - - set - { - externalFileAttributes = value; - known |= Known.ExternalAttributes; - } - } - - /// - /// Get the version made by for this entry or zero if unknown. - /// The value / 10 indicates the major version number, and - /// the value mod 10 is the minor version number - /// - public int VersionMadeBy - { - get - { - return (versionMadeBy & 0xff); - } - } - - /// - /// Get a value indicating this entry is for a DOS/Windows system. - /// - public bool IsDOSEntry - { - get - { - return ((HostSystem == (int)HostSystemID.Msdos) || - (HostSystem == (int)HostSystemID.WindowsNT)); - } - } - - /// - /// Test the external attributes for this to - /// see if the external attributes are Dos based (including WINNT and variants) - /// and match the values - /// - /// The attributes to test. - /// Returns true if the external attributes are known to be DOS/Windows - /// based and have the same attributes set as the value passed. - bool HasDosAttributes(int attributes) - { - bool result = false; - - if ((known & Known.ExternalAttributes) != 0) - result |= (((HostSystem == (int)HostSystemID.Msdos) || - (HostSystem == (int)HostSystemID.WindowsNT)) && - (ExternalFileAttributes & attributes) == attributes); - - return result; - } - - /// - /// Gets the compatability information for the external file attribute - /// If the external file attributes are compatible with MS-DOS and can be read - /// by PKZIP for DOS version 2.04g then this value will be zero. Otherwise the value - /// will be non-zero and identify the host system on which the attributes are compatible. - /// - /// - /// - /// The values for this as defined in the Zip File format and by others are shown below. The values are somewhat - /// misleading in some cases as they are not all used as shown. You should consult the relevant documentation - /// to obtain up to date and correct information. The modified appnote by the infozip group is - /// particularly helpful as it documents a lot of peculiarities. The document is however a little dated. - /// - /// 0 - MS-DOS and OS/2 (FAT / VFAT / FAT32 file systems) - /// 1 - Amiga - /// 2 - OpenVMS - /// 3 - Unix - /// 4 - VM/CMS - /// 5 - Atari ST - /// 6 - OS/2 HPFS - /// 7 - Macintosh - /// 8 - Z-System - /// 9 - CP/M - /// 10 - Windows NTFS - /// 11 - MVS (OS/390 - Z/OS) - /// 12 - VSE - /// 13 - Acorn Risc - /// 14 - VFAT - /// 15 - Alternate MVS - /// 16 - BeOS - /// 17 - Tandem - /// 18 - OS/400 - /// 19 - OS/X (Darwin) - /// 99 - WinZip AES - /// remainder - unused - /// - /// - public int HostSystem - { - get - { - return (versionMadeBy >> 8) & 0xff; - } - - set - { - versionMadeBy &= 0xff; - versionMadeBy |= (ushort)((value & 0xff) << 8); - } - } - - /// - /// Get minimum Zip feature version required to extract this entry - /// - /// - /// Minimum features are defined as:
- /// 1.0 - Default value
- /// 1.1 - File is a volume label
- /// 2.0 - File is a folder/directory
- /// 2.0 - File is compressed using Deflate compression
- /// 2.0 - File is encrypted using traditional encryption
- /// 2.1 - File is compressed using Deflate64
- /// 2.5 - File is compressed using PKWARE DCL Implode
- /// 2.7 - File is a patch data set
- /// 4.5 - File uses Zip64 format extensions
- /// 4.6 - File is compressed using BZIP2 compression
- /// 5.0 - File is encrypted using DES
- /// 5.0 - File is encrypted using 3DES
- /// 5.0 - File is encrypted using original RC2 encryption
- /// 5.0 - File is encrypted using RC4 encryption
- /// 5.1 - File is encrypted using AES encryption
- /// 5.1 - File is encrypted using corrected RC2 encryption
- /// 5.1 - File is encrypted using corrected RC2-64 encryption
- /// 6.1 - File is encrypted using non-OAEP key wrapping
- /// 6.2 - Central directory encryption (not confirmed yet)
- /// 6.3 - File is compressed using LZMA
- /// 6.3 - File is compressed using PPMD+
- /// 6.3 - File is encrypted using Blowfish
- /// 6.3 - File is encrypted using Twofish
- ///
- /// - public int Version - { - get - { - // Return recorded version if known. - if (versionToExtract != 0) - return versionToExtract & 0x00ff; // Only lower order byte. High order is O/S file system. - else - { - int result = 10; - - if (CentralHeaderRequiresZip64) - result = ZipConstants.VersionZip64; - else if (CompressionMethod.Deflated == method) - result = 20; - else if (IsDirectory == true) - result = 20; - else if (HasDosAttributes(0x08)) - result = 11; - - return result; - } - } - } - - /// - /// Get a value indicating whether this entry can be decompressed by the library. - /// - /// This is based on the and - /// wether the compression method is supported. - public bool CanDecompress - { - get - { - return (Version <= ZipConstants.VersionMadeBy) && - ((Version == 10) || - (Version == 11) || - (Version == 20) || - (Version == 45) || - (Version == 51)) && - IsCompressionMethodSupported(); - } - } - - /// - /// Force this entry to be recorded using Zip64 extensions. - /// - public void ForceZip64() - { - forceZip64_ = true; - } - - /// - /// Get a value indicating wether Zip64 extensions were forced. - /// - /// A value of true if Zip64 extensions have been forced on; false if not. - public bool IsZip64Forced() => forceZip64_; - - /// - /// Gets a value indicating if the entry requires Zip64 extensions - /// to store the full entry values. - /// - /// A value of true if a local header requires Zip64 extensions; false if not. - public bool LocalHeaderRequiresZip64 - { - get - { - bool result = forceZip64_; - - if (!result) - { - // TODO: A better estimation of the true limit based on compression overhead should be used - // to determine when an entry should use Zip64. - result = - ((size >= uint.MaxValue) || (compressedSize >= uint.MaxValue)) && - ((versionToExtract == 0) || (versionToExtract >= ZipConstants.VersionZip64)); - } - - return result; - } - } - - /// - /// Get a value indicating wether the central directory entry requires Zip64 extensions to be stored. - /// - public bool CentralHeaderRequiresZip64 - { - get - { - return LocalHeaderRequiresZip64 || (offset >= uint.MaxValue); - } - } - - /// - /// Get/Set DosTime value. - /// - /// - /// The MS-DOS date format can only represent dates between 1/1/1980 and 12/31/2107. - /// - public long DosTime - { - get - { - return ((known & Known.Time) == 0) ? 0 : dosTime; - } - - set - { - unchecked - { - dosTime = (uint)value; - } - - known |= Known.Time; - } - } - - /// - /// Gets/Sets the time of last modification of the entry. - /// - /// - /// The property is updated to match this as far as possible. - /// - public DateTime DateTime - { - get - { - uint sec = Math.Min(59, 2 * (dosTime & 0x1f)); - uint min = Math.Min(59, (dosTime >> 5) & 0x3f); - uint hrs = Math.Min(23, (dosTime >> 11) & 0x1f); - uint mon = Math.Max(1, Math.Min(12, ((dosTime >> 21) & 0xf))); - uint year = ((dosTime >> 25) & 0x7f) + 1980; - int day = Math.Max(1, Math.Min(DateTime.DaysInMonth((int)year, (int)mon), (int)((dosTime >> 16) & 0x1f))); - return new System.DateTime((int)year, (int)mon, day, (int)hrs, (int)min, (int)sec); - } - - set - { - var year = (uint)value.Year; - var month = (uint)value.Month; - var day = (uint)value.Day; - var hour = (uint)value.Hour; - var minute = (uint)value.Minute; - var second = (uint)value.Second; - - if (year < 1980) - { - year = 1980; - month = 1; - day = 1; - hour = 0; - minute = 0; - second = 0; - } - else if (year > 2107) - { - year = 2107; - month = 12; - day = 31; - hour = 23; - minute = 59; - second = 59; - } - - DosTime = ((year - 1980) & 0x7f) << 25 | - (month << 21) | - (day << 16) | - (hour << 11) | - (minute << 5) | - (second >> 1); - } - } - - /// - /// Returns the entry name. - /// - /// - /// The unix naming convention is followed. - /// Path components in the entry should always separated by forward slashes ('/'). - /// Dos device names like C: should also be removed. - /// See the class, or - /// - public string Name - { - get - { - return name; - } - } - - /// - /// Gets/Sets the size of the uncompressed data. - /// - /// - /// The size or -1 if unknown. - /// - /// Setting the size before adding an entry to an archive can help - /// avoid compatability problems with some archivers which dont understand Zip64 extensions. - public long Size - { - get - { - return (known & Known.Size) != 0 ? (long)size : -1L; - } - set - { - size = (ulong)value; - known |= Known.Size; - } - } - - /// - /// Gets/Sets the size of the compressed data. - /// - /// - /// The compressed entry size or -1 if unknown. - /// - public long CompressedSize - { - get - { - return (known & Known.CompressedSize) != 0 ? (long)compressedSize : -1L; - } - set - { - compressedSize = (ulong)value; - known |= Known.CompressedSize; - } - } - - /// - /// Gets/Sets the crc of the uncompressed data. - /// - /// - /// Crc is not in the range 0..0xffffffffL - /// - /// - /// The crc value or -1 if unknown. - /// - public long Crc - { - get - { - return (known & Known.Crc) != 0 ? crc & 0xffffffffL : -1L; - } - set - { - if ((crc & 0xffffffff00000000L) != 0) - throw new ArgumentOutOfRangeException(nameof(value)); - - crc = (uint)value; - known |= Known.Crc; - } - } - - /// - /// Gets/Sets the compression method. Only Deflated and Stored are supported. - /// - /// - /// The compression method for this entry - /// - /// - /// - public CompressionMethod CompressionMethod - { - get - { - return method; - } - - set - { - if (!IsCompressionMethodSupported(value)) - throw new NotSupportedException("Compression method not supported"); - - method = value; - } - } - - /// - /// Gets/Sets the extra data. - /// - /// - /// Extra data is longer than 64KB (0xffff) bytes. - /// - /// - /// Extra data or null if not set. - /// - public byte[] ExtraData - { - - get - { - // TODO: This is slightly safer but less efficient. Think about wether it should change. - // return (byte[]) extra.Clone(); - return extra; - } - - set - { - if (value == null) - extra = null; - else - { - if (value.Length > 0xffff) - throw new ArgumentOutOfRangeException(nameof(value)); - - extra = new byte[value.Length]; - Array.Copy(value, 0, extra, 0, value.Length); - } - } - } - - /// - /// Process extra data fields updating the entry based on the contents. - /// - /// True if the extra data fields should be handled - /// for a local header, rather than for a central header. - /// - internal void ProcessExtraData(bool localHeader) - { - var extraData = new ZipExtraData(extra); - - if (extraData.Find(0x0001)) - { - // Version required to extract is ignored here as some archivers dont set it correctly - // in theory it should be version 45 or higher - - // The recorded size will change but remember that this is zip64. - forceZip64_ = true; - - if (extraData.ValueLength < 4) - throw new ZipException("Extra data extended Zip64 information length is invalid"); - - // (localHeader ||) was deleted, because actually there is no specific difference with reading sizes between local header & central directory - // https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT - // ... - // 4.4 Explanation of fields - // ... - // 4.4.8 compressed size: (4 bytes) - // 4.4.9 uncompressed size: (4 bytes) - // - // The size of the file compressed (4.4.8) and uncompressed, - // (4.4.9) respectively. When a decryption header is present it - // will be placed in front of the file data and the value of the - // compressed file size will include the bytes of the decryption - // header. If bit 3 of the general purpose bit flag is set, - // these fields are set to zero in the local header and the - // correct values are put in the data descriptor and - // in the central directory. If an archive is in ZIP64 format - // and the value in this field is 0xFFFFFFFF, the size will be - // in the corresponding 8 byte ZIP64 extended information - // extra field. When encrypting the central directory, if the - // local header is not in ZIP64 format and general purpose bit - // flag 13 is set indicating masking, the value stored for the - // uncompressed size in the Local Header will be zero. - // - // Othewise there is problem with minizip implementation - if (size == uint.MaxValue) - size = (ulong)extraData.ReadLong(); - - if (compressedSize == uint.MaxValue) - compressedSize = (ulong)extraData.ReadLong(); - - if (!localHeader && (offset == uint.MaxValue)) - offset = extraData.ReadLong(); - - // Disk number on which file starts is ignored - } - else if (((versionToExtract & 0xff) >= ZipConstants.VersionZip64) && - (size == uint.MaxValue || compressedSize == uint.MaxValue)) - throw new ZipException("Zip64 Extended information required but is missing."); - - DateTime = GetDateTime(extraData); - } - - private DateTime GetDateTime(ZipExtraData extraData) - { - // Check for Unix timestamp - ExtendedUnixData unixData = extraData.GetData(); - if (unixData != null && - // Only apply modification time, but require all other values to be present - // This is done to match InfoZIP's behaviour - ((unixData.Include & ExtendedUnixData.Flags.ModificationTime) != 0) && - ((unixData.Include & ExtendedUnixData.Flags.AccessTime) != 0) && - ((unixData.Include & ExtendedUnixData.Flags.CreateTime) != 0)) - return unixData.ModificationTime; - - // Fall back to DOS time - uint sec = Math.Min(59, 2 * (dosTime & 0x1f)); - uint min = Math.Min(59, (dosTime >> 5) & 0x3f); - uint hrs = Math.Min(23, (dosTime >> 11) & 0x1f); - uint mon = Math.Max(1, Math.Min(12, ((dosTime >> 21) & 0xf))); - uint year = ((dosTime >> 25) & 0x7f) + 1980; - int day = Math.Max(1, Math.Min(DateTime.DaysInMonth((int)year, (int)mon), (int)((dosTime >> 16) & 0x1f))); - return new DateTime((int)year, (int)mon, day, (int)hrs, (int)min, (int)sec, DateTimeKind.Utc); - } - - /// - /// Gets/Sets the entry comment. - /// - /// - /// If comment is longer than 0xffff. - /// - /// - /// The comment or null if not set. - /// - /// - /// A comment is only available for entries when read via the class. - /// The class doesnt have the comment data available. - /// - public string Comment - { - get - { - return comment; - } - set - { - // This test is strictly incorrect as the length is in characters - // while the storage limit is in bytes. - // While the test is partially correct in that a comment of this length or greater - // is definitely invalid, shorter comments may also have an invalid length - // where there are multi-byte characters - // The full test is not possible here however as the code page to apply conversions with - // isnt available. - if ((value != null) && (value.Length > 0xffff)) - throw new ArgumentOutOfRangeException(nameof(value), "cannot exceed 65535"); - - comment = value; - } - } - - /// - /// Gets a value indicating if the entry is a directory. - /// however. - /// - /// - /// A directory is determined by an entry name with a trailing slash '/'. - /// The external file attributes can also indicate an entry is for a directory. - /// Currently only dos/windows attributes are tested in this manner. - /// The trailing slash convention should always be followed. - /// - public bool IsDirectory - { - get - { - int nameLength = name.Length; - return ((nameLength > 0) && - ((name[nameLength - 1] == '/') || (name[nameLength - 1] == '\\'))) || - HasDosAttributes(16); - } - } - - /// - /// Get a value of true if the entry appears to be a file; false otherwise - /// - /// - /// This only takes account of DOS/Windows attributes. Other operating systems are ignored. - /// For linux and others the result may be incorrect. - /// - public bool IsFile - { - get - { - return !IsDirectory && !HasDosAttributes(8); - } - } - - /// - /// Test entry to see if data can be extracted. - /// - /// Returns true if data can be extracted for this entry; false otherwise. - public bool IsCompressionMethodSupported() => IsCompressionMethodSupported(CompressionMethod); - - #region ICloneable Members - /// - /// Creates a copy of this zip entry. - /// - /// An that is a copy of the current instance. - public object Clone() - { - var result = (ZipEntry)MemberwiseClone(); - - // Ensure extra data is unique if it exists. - if (extra != null) - { - result.extra = new byte[extra.Length]; - Array.Copy(extra, 0, result.extra, 0, extra.Length); - } - - return result; - } - - #endregion - - /// - /// Gets a string representation of this ZipEntry. - /// - /// A readable textual representation of this - public override string ToString() => name; - - /// - /// Test a compression method to see if this library - /// supports extracting data compressed with that method - /// - /// The compression method to test. - /// Returns true if the compression method is supported; false otherwise - public static bool IsCompressionMethodSupported(CompressionMethod method) - { - return - (method == CompressionMethod.Deflated) || - (method == CompressionMethod.Stored); - } - - /// - /// Cleans a name making it conform to Zip file conventions. - /// Devices names ('c:\') and UNC share names ('\\server\share') are removed - /// and forward slashes ('\') are converted to back slashes ('/'). - /// Names are made relative by trimming leading slashes which is compatible - /// with the ZIP naming convention. - /// - /// The name to clean - /// The 'cleaned' name. - /// - /// The Zip name transform class is more flexible. - /// - public static string CleanName(string name) - { - if (name == null) - return string.Empty; - - if (Path.IsPathRooted(name)) - // NOTE: - // for UNC names... \\machine\share\zoom\beet.txt gives \zoom\beet.txt - name = name.Substring(Path.GetPathRoot(name).Length); - - name = name.Replace(@"\", "/"); - - while ((name.Length > 0) && (name[0] == '/')) - name = name.Remove(0, 1); - - return name; - } - - #region Instance Fields - Known known; - int externalFileAttributes = -1; // contains external attributes (O/S dependant) - - ushort versionMadeBy; // Contains host system and version information - // only relevant for central header entries - - string name; - ulong size; - ulong compressedSize; - ushort versionToExtract; // Version required to extract (library handles <= 2.0) - uint crc; - uint dosTime; - - CompressionMethod method = CompressionMethod.Deflated; - byte[] extra; - string comment; - - int flags; // general purpose bit flags - - long zipFileIndex = -1; // used by ZipFile - long offset; // used by ZipFile and ZipOutputStream - - bool forceZip64_; - #endregion - } -} diff --git a/UpdateLib/UpdateLib/Compression/Zip/ZipException.cs b/UpdateLib/UpdateLib/Compression/Zip/ZipException.cs deleted file mode 100644 index 646fbdc..0000000 --- a/UpdateLib/UpdateLib/Compression/Zip/ZipException.cs +++ /dev/null @@ -1,51 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -using System; - -namespace MatthiWare.UpdateLib.Compression.Zip -{ - - [Serializable] - public class ZipException : Exception - { - public ZipException() { } - public ZipException(string message) : base(message) { } - public ZipException(string message, Exception inner) : base(message, inner) { } - protected ZipException( - System.Runtime.Serialization.SerializationInfo info, - System.Runtime.Serialization.StreamingContext context) : base(info, context) { } - } -} diff --git a/UpdateLib/UpdateLib/Compression/Zip/ZipExtraData.cs b/UpdateLib/UpdateLib/Compression/Zip/ZipExtraData.cs deleted file mode 100644 index 627bbda..0000000 --- a/UpdateLib/UpdateLib/Compression/Zip/ZipExtraData.cs +++ /dev/null @@ -1,970 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -using System; -using System.IO; - -namespace MatthiWare.UpdateLib.Compression.Zip -{ - // TODO: Sort out wether tagged data is useful and what a good implementation might look like. - // Its just a sketch of an idea at the moment. - - /// - /// ExtraData tagged value interface. - /// - public interface ITaggedData - { - /// - /// Get the ID for this tagged data value. - /// - short TagID { get; } - - /// - /// Set the contents of this instance from the data passed. - /// - /// The data to extract contents from. - /// The offset to begin extracting data from. - /// The number of bytes to extract. - void SetData(byte[] data, int offset, int count); - - /// - /// Get the data representing this instance. - /// - /// Returns the data for this instance. - byte[] GetData(); - } - - /// - /// A raw binary tagged value - /// - public class RawTaggedData : ITaggedData - { - /// - /// Initialise a new instance. - /// - /// The tag ID. - public RawTaggedData(short tag) - { - _tag = tag; - } - - #region ITaggedData Members - - /// - /// Get the ID for this tagged data value. - /// - public short TagID - { - get { return _tag; } - set { _tag = value; } - } - - /// - /// Set the data from the raw values provided. - /// - /// The raw data to extract values from. - /// The index to start extracting values from. - /// The number of bytes available. - public void SetData(byte[] data, int offset, int count) - { - if (data == null) - throw new ArgumentNullException(nameof(data)); - - _data = new byte[count]; - Array.Copy(data, offset, _data, 0, count); - } - - /// - /// Get the binary data representing this instance. - /// - /// The raw binary data representing this instance. - public byte[] GetData() => _data; - - #endregion - - /// - /// Get /set the binary data representing this instance. - /// - /// The raw binary data representing this instance. - public byte[] Data - { - get { return _data; } - set { _data = value; } - } - - #region Instance Fields - /// - /// The tag ID for this instance. - /// - short _tag; - - byte[] _data; - #endregion - } - - /// - /// Class representing extended unix date time values. - /// - public class ExtendedUnixData : ITaggedData - { - /// - /// Flags indicate which values are included in this instance. - /// - [Flags] - public enum Flags : byte - { - /// - /// The modification time is included - /// - ModificationTime = 0x01, - - /// - /// The access time is included - /// - AccessTime = 0x02, - - /// - /// The create time is included. - /// - CreateTime = 0x04, - } - - #region ITaggedData Members - - /// - /// Get the ID - /// - public short TagID - { - get { return 0x5455; } - } - - /// - /// Set the data from the raw values provided. - /// - /// The raw data to extract values from. - /// The index to start extracting values from. - /// The number of bytes available. - public void SetData(byte[] data, int index, int count) - { - using (MemoryStream ms = new MemoryStream(data, index, count, false)) - using (ZipHelperStream helperStream = new ZipHelperStream(ms)) - { - // bit 0 if set, modification time is present - // bit 1 if set, access time is present - // bit 2 if set, creation time is present - - _flags = (Flags)helperStream.ReadByte(); - if (((_flags & Flags.ModificationTime) != 0)) - { - int iTime = helperStream.ReadLEInt(); - - _modificationTime = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc) + - new TimeSpan(0, 0, 0, iTime, 0); - - // Central-header version is truncated after modification time - if (count <= 5) return; - } - - if ((_flags & Flags.AccessTime) != 0) - { - int iTime = helperStream.ReadLEInt(); - - _lastAccessTime = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc) + - new TimeSpan(0, 0, 0, iTime, 0); - } - - if ((_flags & Flags.CreateTime) != 0) - { - int iTime = helperStream.ReadLEInt(); - - _createTime = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc) + - new TimeSpan(0, 0, 0, iTime, 0); - } - } - } - - /// - /// Get the binary data representing this instance. - /// - /// The raw binary data representing this instance. - public byte[] GetData() - { - using (MemoryStream ms = new MemoryStream()) - using (ZipHelperStream helperStream = new ZipHelperStream(ms)) - { - helperStream.IsStreamOwner = false; - helperStream.WriteByte((byte)_flags); // Flags - - if ((_flags & Flags.ModificationTime) != 0) - { - TimeSpan span = _modificationTime - new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc); - var seconds = (int)span.TotalSeconds; - helperStream.WriteLEInt(seconds); - } - - if ((_flags & Flags.AccessTime) != 0) - { - TimeSpan span = _lastAccessTime - new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc); - var seconds = (int)span.TotalSeconds; - helperStream.WriteLEInt(seconds); - } - - if ((_flags & Flags.CreateTime) != 0) - { - TimeSpan span = _createTime - new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc); - var seconds = (int)span.TotalSeconds; - helperStream.WriteLEInt(seconds); - } - - return ms.ToArray(); - } - } - - #endregion - - /// - /// Test a value to see if is valid and can be represented here. - /// - /// The value to test. - /// Returns true if the value is valid and can be represented; false if not. - /// The standard Unix time is a signed integer data type, directly encoding the Unix time number, - /// which is the number of seconds since 1970-01-01. - /// Being 32 bits means the values here cover a range of about 136 years. - /// The minimum representable time is 1901-12-13 20:45:52, - /// and the maximum representable time is 2038-01-19 03:14:07. - /// - public static bool IsValidValue(DateTime value) - { - return ((value >= new DateTime(1901, 12, 13, 20, 45, 52)) || - (value <= new DateTime(2038, 1, 19, 03, 14, 07))); - } - - /// - /// Get /set the Modification Time - /// - /// - /// - public DateTime ModificationTime - { - get { return _modificationTime; } - set - { - if (!IsValidValue(value)) - throw new ArgumentOutOfRangeException(nameof(value)); - - _flags |= Flags.ModificationTime; - _modificationTime = value; - } - } - - /// - /// Get / set the Access Time - /// - /// - /// - public DateTime AccessTime - { - get { return _lastAccessTime; } - set - { - if (!IsValidValue(value)) - throw new ArgumentOutOfRangeException(nameof(value)); - - _flags |= Flags.AccessTime; - _lastAccessTime = value; - } - } - - /// - /// Get / Set the Create Time - /// - /// - /// - public DateTime CreateTime - { - get { return _createTime; } - set - { - if (!IsValidValue(value)) - throw new ArgumentOutOfRangeException(nameof(value)); - - _flags |= Flags.CreateTime; - _createTime = value; - } - } - - /// - /// Get/set the values to include. - /// - public Flags Include - { - get { return _flags; } - set { _flags = value; } - } - - #region Instance Fields - Flags _flags; - DateTime _modificationTime = new DateTime(1970, 1, 1); - DateTime _lastAccessTime = new DateTime(1970, 1, 1); - DateTime _createTime = new DateTime(1970, 1, 1); - #endregion - } - - /// - /// Class handling NT date time values. - /// - public class NTTaggedData : ITaggedData - { - /// - /// Get the ID for this tagged data value. - /// - public short TagID - { - get { return 10; } - } - - /// - /// Set the data from the raw values provided. - /// - /// The raw data to extract values from. - /// The index to start extracting values from. - /// The number of bytes available. - public void SetData(byte[] data, int index, int count) - { - using (MemoryStream ms = new MemoryStream(data, index, count, false)) - using (ZipHelperStream helperStream = new ZipHelperStream(ms)) - { - helperStream.ReadLEInt(); // Reserved - while (helperStream.Position < helperStream.Length) - { - int ntfsTag = helperStream.ReadLEShort(); - int ntfsLength = helperStream.ReadLEShort(); - - if (ntfsTag == 1) - { - if (ntfsLength >= 24) - { - long lastModificationTicks = helperStream.ReadLELong(); - _lastModificationTime = DateTime.FromFileTimeUtc(lastModificationTicks); - - long lastAccessTicks = helperStream.ReadLELong(); - _lastAccessTime = DateTime.FromFileTimeUtc(lastAccessTicks); - - long createTimeTicks = helperStream.ReadLELong(); - _createTime = DateTime.FromFileTimeUtc(createTimeTicks); - } - - break; - } - else - { - // An unknown NTFS tag so simply skip it. - helperStream.Seek(ntfsLength, SeekOrigin.Current); - } - } - } - } - - /// - /// Get the binary data representing this instance. - /// - /// The raw binary data representing this instance. - public byte[] GetData() - { - using (MemoryStream ms = new MemoryStream()) - using (ZipHelperStream helperStream = new ZipHelperStream(ms)) - { - helperStream.IsStreamOwner = false; - helperStream.WriteLEInt(0); // Reserved - helperStream.WriteLEShort(1); // Tag - helperStream.WriteLEShort(24); // Length = 3 x 8. - helperStream.WriteLELong(_lastModificationTime.ToFileTimeUtc()); - helperStream.WriteLELong(_lastAccessTime.ToFileTimeUtc()); - helperStream.WriteLELong(_createTime.ToFileTimeUtc()); - - return ms.ToArray(); - } - } - - /// - /// Test a valuie to see if is valid and can be represented here. - /// - /// The value to test. - /// Returns true if the value is valid and can be represented; false if not. - /// - /// NTFS filetimes are 64-bit unsigned integers, stored in Intel - /// (least significant byte first) byte order. They determine the - /// number of 1.0E-07 seconds (1/10th microseconds!) past WinNT "epoch", - /// which is "01-Jan-1601 00:00:00 UTC". 28 May 60056 is the upper limit - /// - public static bool IsValidValue(DateTime value) - { - bool result = true; - - try - { - value.ToFileTimeUtc(); - } - catch - { - result = false; - } - - return result; - } - - /// - /// Get/set the last modification time. - /// - public DateTime LastModificationTime - { - get { return _lastModificationTime; } - set - { - if (!IsValidValue(value)) - throw new ArgumentOutOfRangeException(nameof(value)); - - _lastModificationTime = value; - } - } - - /// - /// Get /set the create time - /// - public DateTime CreateTime - { - get { return _createTime; } - set - { - if (!IsValidValue(value)) - throw new ArgumentOutOfRangeException(nameof(value)); - - _createTime = value; - } - } - - /// - /// Get /set the last access time. - /// - public DateTime LastAccessTime - { - get { return _lastAccessTime; } - set - { - if (!IsValidValue(value)) - throw new ArgumentOutOfRangeException(nameof(value)); - - _lastAccessTime = value; - } - } - - #region Instance Fields - DateTime _lastAccessTime = DateTime.FromFileTimeUtc(0); - DateTime _lastModificationTime = DateTime.FromFileTimeUtc(0); - DateTime _createTime = DateTime.FromFileTimeUtc(0); - #endregion - } - - /// - /// A factory that creates tagged data instances. - /// - interface ITaggedDataFactory - { - /// - /// Get data for a specific tag value. - /// - /// The tag ID to find. - /// The data to search. - /// The offset to begin extracting data from. - /// The number of bytes to extract. - /// The located value found, or null if not found. - ITaggedData Create(short tag, byte[] data, int offset, int count); - } - - /// - /// - /// A class to handle the extra data field for Zip entries - /// - /// - /// Extra data contains 0 or more values each prefixed by a header tag and length. - /// They contain zero or more bytes of actual data. - /// The data is held internally using a copy on write strategy. This is more efficient but - /// means that for extra data created by passing in data can have the values modified by the caller - /// in some circumstances. - /// - sealed public class ZipExtraData : IDisposable - { - #region Constructors - /// - /// Initialise a default instance. - /// - public ZipExtraData() - { - Clear(); - } - - /// - /// Initialise with known extra data. - /// - /// The extra data. - public ZipExtraData(byte[] data) - { - _data = data ?? new byte[0]; - } - #endregion - - /// - /// Get the raw extra data value - /// - /// Returns the raw byte[] extra data this instance represents. - public byte[] GetEntryData() - { - if (Length > ushort.MaxValue) - throw new ZipException("Data exceeds maximum length"); - - return (byte[])_data.Clone(); - } - - /// - /// Clear the stored data. - /// - public void Clear() - { - if ((_data == null) || (_data.Length != 0)) - _data = new byte[0]; - } - - /// - /// Gets the current extra data length. - /// - public int Length - { - get { return _data.Length; } - } - - /// - /// Get a read-only for the associated tag. - /// - /// The tag to locate data for. - /// Returns a containing tag data or null if no tag was found. - public Stream GetStreamForTag(int tag) - { - Stream result = null; - - if (Find(tag)) - result = new MemoryStream(_data, _index, _readValueLength, false); - - return result; - } - - /// - /// Get the tagged data for a tag. - /// - /// The tag to search for. - /// Returns a tagged value or null if none found. - public T GetData() - where T : class, ITaggedData, new() - { - T result = new T(); - - if (!Find(result.TagID)) - return default(T); - - result.SetData(_data, _readValueStart, _readValueLength); - - return result; - } - - /// - /// Get the length of the last value found by - /// - /// This is only valid if has previously returned true. - public int ValueLength - { - get { return _readValueLength; } - } - - /// - /// Get the index for the current read value. - /// - /// This is only valid if has previously returned true. - /// Initially the result will be the index of the first byte of actual data. The value is updated after calls to - /// , and . - public int CurrentReadIndex - { - get { return _index; } - } - - /// - /// Get the number of bytes remaining to be read for the current value; - /// - public int UnreadCount - { - get - { - if ((_readValueStart > _data.Length) || - (_readValueStart < 4)) - throw new ZipException("Find must be called before calling a Read method"); - - return _readValueStart + _readValueLength - _index; - } - } - - /// - /// Find an extra data value - /// - /// The identifier for the value to find. - /// Returns true if the value was found; false otherwise. - public bool Find(int headerID) - { - _readValueStart = _data.Length; - _readValueLength = 0; - _index = 0; - - int localLength = _readValueStart; - int localTag = headerID - 1; - - // Trailing bytes that cant make up an entry (as there arent enough - // bytes for a tag and length) are ignored! - while ((localTag != headerID) && (_index < _data.Length - 3)) - { - localTag = ReadShortInternal(); - localLength = ReadShortInternal(); - - if (localTag != headerID) - _index += localLength; - } - - bool result = (localTag == headerID) && ((_index + localLength) <= _data.Length); - - if (result) - { - _readValueStart = _index; - _readValueLength = localLength; - } - - return result; - } - - /// - /// Add a new entry to extra data. - /// - /// The value to add. - public void AddEntry(ITaggedData taggedData) - { - if (taggedData == null) - throw new ArgumentNullException(nameof(taggedData)); - - AddEntry(taggedData.TagID, taggedData.GetData()); - } - - /// - /// Add a new entry to extra data - /// - /// The ID for this entry. - /// The data to add. - /// If the ID already exists its contents are replaced. - public void AddEntry(int headerID, byte[] fieldData) - { - if ((headerID > ushort.MaxValue) || (headerID < 0)) - throw new ArgumentOutOfRangeException(nameof(headerID)); - - int addLength = (fieldData == null) ? 0 : fieldData.Length; - - if (addLength > ushort.MaxValue) - throw new ArgumentOutOfRangeException(nameof(fieldData), "exceeds maximum length"); - - // Test for new length before adjusting data. - int newLength = _data.Length + addLength + 4; - - if (Find(headerID)) - newLength -= (ValueLength + 4); - - if (newLength > ushort.MaxValue) - throw new ZipException("Data exceeds maximum length"); - - Delete(headerID); - - byte[] newData = new byte[newLength]; - _data.CopyTo(newData, 0); - - int index = _data.Length; - _data = newData; - - SetShort(ref index, headerID); - SetShort(ref index, addLength); - - if (fieldData != null) - fieldData.CopyTo(newData, index); - } - - /// - /// Start adding a new entry. - /// - /// Add data using , , , or . - /// The new entry is completed and actually added by calling - /// - public void StartNewEntry() - { - _newEntry = new MemoryStream(); - } - - /// - /// Add entry data added since using the ID passed. - /// - /// The identifier to use for this entry. - public void AddNewEntry(int headerID) - { - byte[] newData = _newEntry.ToArray(); - _newEntry = null; - AddEntry(headerID, newData); - } - - /// - /// Add a byte of data to the pending new entry. - /// - /// The byte to add. - /// - public void AddData(byte data) - { - _newEntry.WriteByte(data); - } - - /// - /// Add data to a pending new entry. - /// - /// The data to add. - /// - public void AddData(byte[] data) - { - if (data == null) - throw new ArgumentNullException(nameof(data)); - - _newEntry.Write(data, 0, data.Length); - } - - /// - /// Add a short value in little endian order to the pending new entry. - /// - /// The data to add. - /// - public void AddLeShort(int toAdd) - { - unchecked - { - _newEntry.WriteByte((byte)toAdd); - _newEntry.WriteByte((byte)(toAdd >> 8)); - } - } - - /// - /// Add an integer value in little endian order to the pending new entry. - /// - /// The data to add. - /// - public void AddLeInt(int toAdd) - { - unchecked - { - AddLeShort((short)toAdd); - AddLeShort((short)(toAdd >> 16)); - } - } - - /// - /// Add a long value in little endian order to the pending new entry. - /// - /// The data to add. - /// - public void AddLeLong(long toAdd) - { - unchecked - { - AddLeInt((int)(toAdd & 0xffffffff)); - AddLeInt((int)(toAdd >> 32)); - } - } - - /// - /// Delete an extra data field. - /// - /// The identifier of the field to delete. - /// Returns true if the field was found and deleted. - public bool Delete(int headerID) - { - bool result = false; - - if (Find(headerID)) - { - result = true; - int trueStart = _readValueStart - 4; - - byte[] newData = new byte[_data.Length - (ValueLength + 4)]; - Array.Copy(_data, 0, newData, 0, trueStart); - - int trueEnd = trueStart + ValueLength + 4; - Array.Copy(_data, trueEnd, newData, trueStart, _data.Length - trueEnd); - _data = newData; - } - - return result; - } - - #region Reading Support - /// - /// Read a long in little endian form from the last found data value - /// - /// Returns the long value read. - public long ReadLong() - { - ReadCheck(8); - return (ReadInt() & 0xffffffff) | (((long)ReadInt()) << 32); - } - - /// - /// Read an integer in little endian form from the last found data value. - /// - /// Returns the integer read. - public int ReadInt() - { - ReadCheck(4); - - int result = _data[_index] + (_data[_index + 1] << 8) + - (_data[_index + 2] << 16) + (_data[_index + 3] << 24); - - _index += 4; - - return result; - } - - /// - /// Read a short value in little endian form from the last found data value. - /// - /// Returns the short value read. - public int ReadShort() - { - ReadCheck(2); - - int result = _data[_index] + (_data[_index + 1] << 8); - _index += 2; - - return result; - } - - /// - /// Read a byte from an extra data - /// - /// The byte value read or -1 if the end of data has been reached. - public int ReadByte() - { - int result = -1; - - if ((_index < _data.Length) && (_readValueStart + _readValueLength > _index)) - result = _data[_index++]; - - return result; - } - - /// - /// Skip data during reading. - /// - /// The number of bytes to skip. - public void Skip(int amount) - { - ReadCheck(amount); - _index += amount; - } - - void ReadCheck(int length) - { - if ((_readValueStart > _data.Length) || - (_readValueStart < 4)) - throw new ZipException("Find must be called before calling a Read method"); - - if (_index > _readValueStart + _readValueLength - length) - throw new ZipException("End of extra data"); - - if (_index + length < 4) - throw new ZipException("Cannot read before start of tag"); - } - - /// - /// Internal form of that reads data at any location. - /// - /// Returns the short value read. - int ReadShortInternal() - { - if (_index > _data.Length - 2) - throw new ZipException("End of extra data"); - - int result = _data[_index++] + (_data[_index++] << 8); - - return result; - } - - void SetShort(ref int index, int source) - { - _data[index++] = (byte)source; - _data[index++] = (byte)(source >> 8); - } - - #endregion - - #region IDisposable Members - - /// - /// Dispose of this instance. - /// - public void Dispose() - { - if (_newEntry != null) - { - _newEntry.Dispose(); - } - } - - #endregion - - #region Instance Fields - int _index; - int _readValueStart; - int _readValueLength; - - MemoryStream _newEntry; - byte[] _data; - #endregion - } -} diff --git a/UpdateLib/UpdateLib/Compression/Zip/ZipFile.cs b/UpdateLib/UpdateLib/Compression/Zip/ZipFile.cs deleted file mode 100644 index 44140ef..0000000 --- a/UpdateLib/UpdateLib/Compression/Zip/ZipFile.cs +++ /dev/null @@ -1,566 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors -* -* Permission is hereby granted, free of charge, to any person obtaining a copy of this -* software and associated documentation files (the "Software"), to deal in the Software -* without restriction, including without limitation the rights to use, copy, modify, merge, -* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -* to whom the Software is furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in all copies or -* substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -* PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -* FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -* DEALINGS IN THE SOFTWARE. -*/ - -using System; -using System.Collections; -using System.IO; -using System.Runtime.CompilerServices; - -using MatthiWare.UpdateLib.Utils; - -namespace MatthiWare.UpdateLib.Compression.Zip -{ - #region ZipFile Class - /// - /// This class represents a Zip archive. You can ask for the contained - /// entries, or get an input stream for a file entry. The entry is - /// automatically decompressed. - /// - /// You can also update the archive adding or deleting entries. - /// - /// This class is thread safe for input: You can open input streams for arbitrary - /// entries in different threads. - ///
- ///
Author of the original java version : Jochen Hoenicke - ///
- /// - /// - /// using System; - /// using System.Text; - /// using System.Collections; - /// using System.IO; - /// - /// using ICSharpCode.SharpZipLib.Zip; - /// - /// class MainClass - /// { - /// static public void Main(string[] args) - /// { - /// using (ZipFile zFile = new ZipFile(args[0])) { - /// Console.WriteLine("Listing of : " + zFile.Name); - /// Console.WriteLine(""); - /// Console.WriteLine("Raw Size Size Date Time Name"); - /// Console.WriteLine("-------- -------- -------- ------ ---------"); - /// foreach (ZipEntry e in zFile) { - /// if ( e.IsFile ) { - /// DateTime d = e.DateTime; - /// Console.WriteLine("{0, -10}{1, -10}{2} {3} {4}", e.Size, e.CompressedSize, - /// d.ToString("dd-MM-yy"), d.ToString("HH:mm"), - /// e.Name); - /// } - /// } - /// } - /// } - /// } - /// - /// - public class ZipFile : IEnumerable, IDisposable - { - #region Constructors - - /// - /// Opens a Zip file reading the given . - /// - /// The to read archive data from. - /// The supplied argument is null. - /// - /// An i/o error occurs. - /// - /// - /// The file doesn't contain a valid zip archive. - /// - public ZipFile(FileStream file) - { - if (file == null) - throw new ArgumentNullException(nameof(file)); - - if (!file.CanSeek) - throw new ArgumentException("Stream is not seekable", nameof(file)); - - baseStream_ = file; - name_ = file.Name; - isStreamOwner = true; - - try - { - ReadEntries(); - } - catch - { - DisposeInternal(true); - throw; - } - } - - #endregion - - #region Destructors and Closing - /// - /// Finalize this instance. - /// - ~ZipFile() - { - Dispose(false); - } - - /// - /// Closes the ZipFile. If the stream is owned then this also closes the underlying input stream. - /// Once closed, no further instance methods should be called. - /// - /// - /// An i/o error occurs. - /// - public void Close() - { - DisposeInternal(true); - GC.SuppressFinalize(this); - } - - #endregion - - #region Properties - /// - /// Get/set a flag indicating if the underlying stream is owned by the ZipFile instance. - /// If the flag is true then the stream will be closed when Close is called. - /// - /// - /// The default value is true in all cases. - /// - public bool IsStreamOwner - { - get { return isStreamOwner; } - set { isStreamOwner = value; } - } - - /// - /// Get the number of entries contained in this . - /// - public long Count - { - get - { - return entries_.Length; - } - } - - /// - /// Indexer property for ZipEntries - /// - [IndexerName("EntryByIndex")] - public ZipEntry this[int index] - { - get - { - return (ZipEntry)entries_[index].Clone(); - } - } - - #endregion - - #region Input Handling - /// - /// Gets an enumerator for the Zip entries in this Zip file. - /// - /// Returns an for this archive. - /// - /// The Zip file has been closed. - /// - public IEnumerator GetEnumerator() - { - if (isDisposed_) - { - throw new ObjectDisposedException("ZipFile"); - } - - return new ZipEntryEnumerator(entries_); - } - - /// - /// Return the index of the entry with a matching name - /// - /// Entry name to find - /// If true the comparison is case insensitive - /// The index position of the matching entry or -1 if not found - /// - /// The Zip file has been closed. - /// - public int FindEntry(string name, bool ignoreCase) - { - if (isDisposed_) - { - throw new ObjectDisposedException("ZipFile"); - } - - // TODO: This will be slow as the next ice age for huge archives! - for (int i = 0; i < entries_.Length; i++) - { - if (string.Compare(name, entries_[i].Name, ignoreCase ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal) == 0) - { - return i; - } - } - return -1; - } - - /// - /// Searches for a zip entry in this archive with the given name. - /// String comparisons are case insensitive - /// - /// - /// The name to find. May contain directory components separated by slashes ('/'). - /// - /// - /// A clone of the zip entry, or null if no entry with that name exists. - /// - /// - /// The Zip file has been closed. - /// - public ZipEntry GetEntry(string name) - { - if (isDisposed_) - { - throw new ObjectDisposedException("ZipFile"); - } - - int index = FindEntry(name, true); - return (index >= 0) ? (ZipEntry)entries_[index].Clone() : null; - } - - #endregion - - #endregion - - #region Disposing - - #region IDisposable Members - void IDisposable.Dispose() - { - Close(); - } - #endregion - - void DisposeInternal(bool disposing) - { - if (!isDisposed_) - { - isDisposed_ = true; - entries_ = new ZipEntry[0]; - - if (IsStreamOwner && (baseStream_ != null)) - lock (baseStream_) - baseStream_.Dispose(); - } - } - - /// - /// Releases the unmanaged resources used by the this instance and optionally releases the managed resources. - /// - /// true to release both managed and unmanaged resources; - /// false to release only unmanaged resources. - protected virtual void Dispose(bool disposing) - { - DisposeInternal(disposing); - } - - #endregion - - #region Internal routines - #region Reading - /// - /// Read an unsigned short in little endian byte order. - /// - /// Returns the value read. - /// - /// The stream ends prematurely - /// - ushort ReadLEUshort() - { - int data1 = baseStream_.ReadByte(); - - if (data1 < 0) - { - throw new EndOfStreamException("End of stream"); - } - - int data2 = baseStream_.ReadByte(); - - if (data2 < 0) - { - throw new EndOfStreamException("End of stream"); - } - - - return unchecked((ushort)((ushort)data1 | (ushort)(data2 << 8))); - } - - /// - /// Read a uint in little endian byte order. - /// - /// Returns the value read. - /// - /// An i/o error occurs. - /// - /// - /// The file ends prematurely - /// - uint ReadLEUint() - { - return (uint)(ReadLEUshort() | (ReadLEUshort() << 16)); - } - - ulong ReadLEUlong() - { - return ReadLEUint() | ((ulong)ReadLEUint() << 32); - } - - #endregion - // NOTE this returns the offset of the first byte after the signature. - long LocateBlockWithSignature(int signature, long endLocation, int minimumBlockSize, int maximumVariableData) - { - using (ZipHelperStream les = new ZipHelperStream(baseStream_)) - { - return les.LocateBlockWithSignature(signature, endLocation, minimumBlockSize, maximumVariableData); - } - } - - /// - /// Search for and read the central directory of a zip file filling the entries array. - /// - /// - /// An i/o error occurs. - /// - /// - /// The central directory is malformed or cannot be found - /// - void ReadEntries() - { - // Search for the End Of Central Directory. When a zip comment is - // present the directory will start earlier - // - // The search is limited to 64K which is the maximum size of a trailing comment field to aid speed. - // This should be compatible with both SFX and ZIP files but has only been tested for Zip files - // If a SFX file has the Zip data attached as a resource and there are other resources occuring later then - // this could be invalid. - // Could also speed this up by reading memory in larger blocks. - - if (baseStream_.CanSeek == false) - throw new ZipException("ZipFile stream must be seekable"); - - long locatedEndOfCentralDir = LocateBlockWithSignature(ZipConstants.EndOfCentralDirectorySignature, - baseStream_.Length, ZipConstants.EndOfCentralRecordBaseSize, 0xffff); - - if (locatedEndOfCentralDir < 0) - throw new ZipException("Cannot find central directory"); - - // Read end of central directory record - ushort thisDiskNumber = ReadLEUshort(); - ushort startCentralDirDisk = ReadLEUshort(); - ulong entriesForThisDisk = ReadLEUshort(); - ulong entriesForWholeCentralDir = ReadLEUshort(); - ulong centralDirSize = ReadLEUint(); - long offsetOfCentralDir = ReadLEUint(); - uint commentSize = ReadLEUshort(); - - comment_ = (commentSize > 0) ? - ZipConstants.ConvertToString(baseStream_.CheckedReadBytes((int)commentSize)) : - string.Empty; - - bool isZip64 = false; - - // Check if zip64 header information is required. - if ((thisDiskNumber == 0xffff) || - (startCentralDirDisk == 0xffff) || - (entriesForThisDisk == 0xffff) || - (entriesForWholeCentralDir == 0xffff) || - (centralDirSize == 0xffffffff) || - (offsetOfCentralDir == 0xffffffff)) - { - isZip64 = true; - - long offset = LocateBlockWithSignature(ZipConstants.Zip64CentralDirLocatorSignature, locatedEndOfCentralDir, 0, 0x1000); - if (offset < 0) - throw new ZipException("Cannot find Zip64 locator"); - - // number of the disk with the start of the zip64 end of central directory 4 bytes - // relative offset of the zip64 end of central directory record 8 bytes - // total number of disks 4 bytes - ReadLEUint(); // startDisk64 is not currently used - ulong offset64 = ReadLEUlong(); - uint totalDisks = ReadLEUint(); - - baseStream_.Position = (long)offset64; - long sig64 = ReadLEUint(); - - if (sig64 != ZipConstants.Zip64CentralFileHeaderSignature) - throw new ZipException(string.Format("Invalid Zip64 Central directory signature at {0:X}", offset64)); - - // NOTE: Record size = SizeOfFixedFields + SizeOfVariableData - 12. - ulong recordSize = ReadLEUlong(); - int versionMadeBy = ReadLEUshort(); - int versionToExtract = ReadLEUshort(); - uint thisDisk = ReadLEUint(); - uint centralDirDisk = ReadLEUint(); - entriesForThisDisk = ReadLEUlong(); - entriesForWholeCentralDir = ReadLEUlong(); - centralDirSize = ReadLEUlong(); - offsetOfCentralDir = (long)ReadLEUlong(); - - // NOTE: zip64 extensible data sector (variable size) is ignored. - } - - entries_ = new ZipEntry[entriesForThisDisk]; - - // SFX/embedded support, find the offset of the first entry vis the start of the stream - // This applies to Zip files that are appended to the end of an SFX stub. - // Or are appended as a resource to an executable. - // Zip files created by some archivers have the offsets altered to reflect the true offsets - // and so dont require any adjustment here... - // TODO: Difficulty with Zip64 and SFX offset handling needs resolution - maths? - if (!isZip64 && (offsetOfCentralDir < locatedEndOfCentralDir - (4 + (long)centralDirSize))) - { - offsetOfFirstEntry = locatedEndOfCentralDir - (4 + (long)centralDirSize + offsetOfCentralDir); - - if (offsetOfFirstEntry <= 0) - throw new ZipException("Invalid embedded zip archive"); - } - - baseStream_.Seek(offsetOfFirstEntry + offsetOfCentralDir, SeekOrigin.Begin); - - for (ulong i = 0; i < entriesForThisDisk; i++) - { - if (ReadLEUint() != ZipConstants.CentralHeaderSignature) - throw new ZipException("Wrong Central Directory signature"); - - int versionMadeBy = ReadLEUshort(); - int versionToExtract = ReadLEUshort(); - int bitFlags = ReadLEUshort(); - int method = ReadLEUshort(); - uint dostime = ReadLEUint(); - uint crc = ReadLEUint(); - var csize = (long)ReadLEUint(); - var size = (long)ReadLEUint(); - int nameLen = ReadLEUshort(); - int extraLen = ReadLEUshort(); - int commentLen = ReadLEUshort(); - - int diskStartNo = ReadLEUshort(); // Not currently used - int internalAttributes = ReadLEUshort(); // Not currently used - - uint externalAttributes = ReadLEUint(); - long offset = ReadLEUint(); - - byte[] buffer = new byte[Math.Max(nameLen, commentLen)]; - - baseStream_.CheckedReadBytes(buffer, 0, nameLen); - string name = ZipConstants.ConvertToStringExt(bitFlags, buffer, nameLen); - - var entry = new ZipEntry(name, versionToExtract, versionMadeBy, (CompressionMethod)method); - entry.Crc = crc & 0xffffffffL; - entry.Size = size & 0xffffffffL; - entry.CompressedSize = csize & 0xffffffffL; - entry.Flags = bitFlags; - entry.DosTime = dostime; - entry.ZipFileIndex = (long)i; - entry.Offset = offset; - entry.ExternalFileAttributes = (int)externalAttributes; - - if (extraLen > 0) - entry.ExtraData = baseStream_.CheckedReadBytes(extraLen); - - entry.ProcessExtraData(false); - - if (commentLen > 0) - { - baseStream_.CheckedReadBytes(buffer, 0, commentLen); - entry.Comment = ZipConstants.ConvertToStringExt(bitFlags, buffer, commentLen); - } - - entries_[i] = entry; - } - } - - #endregion - - #region Instance Fields - bool isDisposed_; - string name_; - string comment_; - Stream baseStream_; - bool isStreamOwner; - long offsetOfFirstEntry; - ZipEntry[] entries_; - #endregion - - #region Support Classes - - /// - /// An enumerator for Zip entries - /// - class ZipEntryEnumerator : IEnumerator - { - #region Constructors - public ZipEntryEnumerator(ZipEntry[] entries) - { - array = entries; - } - - #endregion - #region IEnumerator Members - public object Current - { - get - { - return array[index]; - } - } - - public void Reset() - { - index = -1; - } - - public bool MoveNext() - { - return (++index < array.Length); - } - #endregion - #region Instance Fields - ZipEntry[] array; - int index = -1; - #endregion - } - #endregion - } -} diff --git a/UpdateLib/UpdateLib/Compression/Zip/ZipHelperStream.cs b/UpdateLib/UpdateLib/Compression/Zip/ZipHelperStream.cs deleted file mode 100644 index 9ae6de7..0000000 --- a/UpdateLib/UpdateLib/Compression/Zip/ZipHelperStream.cs +++ /dev/null @@ -1,618 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -using System; -using System.IO; - -namespace MatthiWare.UpdateLib.Compression.Zip -{ - /// - /// Holds data pertinent to a data descriptor. - /// - public class DescriptorData - { - /// - /// Get /set the compressed size of data. - /// - public long CompressedSize - { - get { return compressedSize; } - set { compressedSize = value; } - } - - /// - /// Get / set the uncompressed size of data - /// - public long Size - { - get { return size; } - set { size = value; } - } - - /// - /// Get /set the crc value. - /// - public long Crc - { - get { return crc; } - set { crc = (value & 0xffffffff); } - } - - #region Instance Fields - long size; - long compressedSize; - long crc; - #endregion - } - - class EntryPatchData - { - public long SizePatchOffset - { - get { return sizePatchOffset_; } - set { sizePatchOffset_ = value; } - } - - public long CrcPatchOffset - { - get { return crcPatchOffset_; } - set { crcPatchOffset_ = value; } - } - - #region Instance Fields - long sizePatchOffset_; - long crcPatchOffset_; - #endregion - } - - /// - /// This class assists with writing/reading from Zip files. - /// - internal class ZipHelperStream : Stream - { - #region Constructors - /// - /// Initialise an instance of this class. - /// - /// The name of the file to open. - public ZipHelperStream(string name) - { - stream_ = new FileStream(name, FileMode.Open, FileAccess.ReadWrite); - isOwner_ = true; - } - - /// - /// Initialise a new instance of . - /// - /// The stream to use. - public ZipHelperStream(Stream stream) - { - stream_ = stream; - } - #endregion - - /// - /// Get / set a value indicating wether the the underlying stream is owned or not. - /// - /// If the stream is owned it is closed when this instance is closed. - public bool IsStreamOwner - { - get { return isOwner_; } - set { isOwner_ = value; } - } - - #region Base Stream Methods - public override bool CanRead - { - get { return stream_.CanRead; } - } - - public override bool CanSeek - { - get { return stream_.CanSeek; } - } - - public override bool CanTimeout - { - get { return stream_.CanTimeout; } - } - - public override long Length - { - get { return stream_.Length; } - } - - public override long Position - { - get { return stream_.Position; } - set { stream_.Position = value; } - } - - public override bool CanWrite - { - get { return stream_.CanWrite; } - } - - public override void Flush() - { - stream_.Flush(); - } - - public override long Seek(long offset, SeekOrigin origin) - { - return stream_.Seek(offset, origin); - } - - public override void SetLength(long value) - { - stream_.SetLength(value); - } - - public override int Read(byte[] buffer, int offset, int count) - { - return stream_.Read(buffer, offset, count); - } - - public override void Write(byte[] buffer, int offset, int count) - { - stream_.Write(buffer, offset, count); - } - - /// - /// Close the stream. - /// - /// - /// The underlying stream is closed only if is true. - /// - protected override void Dispose(bool disposing) - { - Stream toClose = stream_; - stream_ = null; - if (isOwner_ && (toClose != null)) - { - isOwner_ = false; - toClose.Dispose(); - } - } - - #endregion - - // Write the local file header - // TODO: ZipHelperStream.WriteLocalHeader is not yet used and needs checking for ZipFile and ZipOuptutStream usage - void WriteLocalHeader(ZipEntry entry, EntryPatchData patchData) - { - CompressionMethod method = entry.CompressionMethod; - bool headerInfoAvailable = true; // How to get this? - bool patchEntryHeader = false; - - WriteLEInt(ZipConstants.LocalHeaderSignature); - - WriteLEShort(entry.Version); - WriteLEShort(entry.Flags); - WriteLEShort((byte)method); - WriteLEInt((int)entry.DosTime); - - if (headerInfoAvailable) - { - WriteLEInt((int)entry.Crc); - - if (entry.LocalHeaderRequiresZip64) - { - WriteLEInt(-1); - WriteLEInt(-1); - } - else - { - WriteLEInt((int)entry.CompressedSize); - WriteLEInt((int)entry.Size); - } - } - else - { - if (patchData != null) - { - patchData.CrcPatchOffset = stream_.Position; - } - WriteLEInt(0); // Crc - - if (patchData != null) - { - patchData.SizePatchOffset = stream_.Position; - } - - // For local header both sizes appear in Zip64 Extended Information - if (entry.LocalHeaderRequiresZip64 && patchEntryHeader) - { - WriteLEInt(-1); - WriteLEInt(-1); - } - else - { - WriteLEInt(0); // Compressed size - WriteLEInt(0); // Uncompressed size - } - } - - byte[] name = ZipConstants.ConvertToArray(entry.Flags, entry.Name); - - if (name.Length > 0xFFFF) - throw new ZipException("Entry name too long."); - - var ed = new ZipExtraData(entry.ExtraData); - - if (entry.LocalHeaderRequiresZip64 && (headerInfoAvailable || patchEntryHeader)) - { - ed.StartNewEntry(); - - if (headerInfoAvailable) - { - ed.AddLeLong(entry.Size); - ed.AddLeLong(entry.CompressedSize); - } - else - { - ed.AddLeLong(-1); - ed.AddLeLong(-1); - } - - ed.AddNewEntry(1); - - if (!ed.Find(1)) - throw new ZipException("Internal error cant find extra data"); - - if (patchData != null) - patchData.SizePatchOffset = ed.CurrentReadIndex; - } - else - { - ed.Delete(1); - } - - byte[] extra = ed.GetEntryData(); - - WriteLEShort(name.Length); - WriteLEShort(extra.Length); - - if (name.Length > 0) - stream_.Write(name, 0, name.Length); - - if (entry.LocalHeaderRequiresZip64 && patchEntryHeader) - patchData.SizePatchOffset += stream_.Position; - - if (extra.Length > 0) - stream_.Write(extra, 0, extra.Length); - } - - /// - /// Locates a block with the desired . - /// - /// The signature to find. - /// Location, marking the end of block. - /// Minimum size of the block. - /// The maximum variable data. - /// Eeturns the offset of the first byte after the signature; -1 if not found - public long LocateBlockWithSignature(int signature, long endLocation, int minimumBlockSize, int maximumVariableData) - { - long pos = endLocation - minimumBlockSize; - if (pos < 0) - return -1; - - long giveUpMarker = Math.Max(pos - maximumVariableData, 0); - - // TODO: This loop could be optimised for speed. - do - { - if (pos < giveUpMarker) - return -1; - - Seek(pos--, SeekOrigin.Begin); - - } while (ReadLEInt() != signature); - - return Position; - } - - /// - /// Write Zip64 end of central directory records (File header and locator). - /// - /// The number of entries in the central directory. - /// The size of entries in the central directory. - /// The offset of the dentral directory. - public void WriteZip64EndOfCentralDirectory(long noOfEntries, long sizeEntries, long centralDirOffset) - { - long centralSignatureOffset = stream_.Position; - WriteLEInt(ZipConstants.Zip64CentralFileHeaderSignature); - WriteLELong(44); // Size of this record (total size of remaining fields in header or full size - 12) - WriteLEShort(ZipConstants.VersionMadeBy); // Version made by - WriteLEShort(ZipConstants.VersionZip64); // Version to extract - WriteLEInt(0); // Number of this disk - WriteLEInt(0); // number of the disk with the start of the central directory - WriteLELong(noOfEntries); // No of entries on this disk - WriteLELong(noOfEntries); // Total No of entries in central directory - WriteLELong(sizeEntries); // Size of the central directory - WriteLELong(centralDirOffset); // offset of start of central directory - // zip64 extensible data sector not catered for here (variable size) - - // Write the Zip64 end of central directory locator - WriteLEInt(ZipConstants.Zip64CentralDirLocatorSignature); - - // no of the disk with the start of the zip64 end of central directory - WriteLEInt(0); - - // relative offset of the zip64 end of central directory record - WriteLELong(centralSignatureOffset); - - // total number of disks - WriteLEInt(1); - } - - /// - /// Write the required records to end the central directory. - /// - /// The number of entries in the directory. - /// The size of the entries in the directory. - /// The start of the central directory. - /// The archive comment. (This can be null). - public void WriteEndOfCentralDirectory(long noOfEntries, long sizeEntries, - long startOfCentralDirectory, byte[] comment) - { - - if ((noOfEntries >= 0xffff) || - (startOfCentralDirectory >= 0xffffffff) || - (sizeEntries >= 0xffffffff)) - WriteZip64EndOfCentralDirectory(noOfEntries, sizeEntries, startOfCentralDirectory); - - WriteLEInt(ZipConstants.EndOfCentralDirectorySignature); - - // TODO: ZipFile Multi disk handling not done - WriteLEShort(0); // number of this disk - WriteLEShort(0); // no of disk with start of central dir - - - // Number of entries - if (noOfEntries >= 0xffff) - { - WriteLEUshort(0xffff); // Zip64 marker - WriteLEUshort(0xffff); - } - else - { - WriteLEShort((short)noOfEntries); // entries in central dir for this disk - WriteLEShort((short)noOfEntries); // total entries in central directory - } - - // Size of the central directory - if (sizeEntries >= 0xffffffff) - WriteLEUint(0xffffffff); // Zip64 marker - else - WriteLEInt((int)sizeEntries); - - - // offset of start of central directory - if (startOfCentralDirectory >= 0xffffffff) - WriteLEUint(0xffffffff); // Zip64 marker - else - WriteLEInt((int)startOfCentralDirectory); - - int commentLength = (comment != null) ? comment.Length : 0; - - if (commentLength > 0xffff) - throw new ZipException(string.Format("Comment length({0}) is too long can only be 64K", commentLength)); - - WriteLEShort(commentLength); - - if (commentLength > 0) - Write(comment, 0, comment.Length); - } - - #region LE value reading/writing - /// - /// Read an unsigned short in little endian byte order. - /// - /// Returns the value read. - /// - /// An i/o error occurs. - /// - /// - /// The file ends prematurely - /// - public int ReadLEShort() - { - int byteValue1 = stream_.ReadByte(); - - if (byteValue1 < 0) - throw new EndOfStreamException(); - - int byteValue2 = stream_.ReadByte(); - if (byteValue2 < 0) - throw new EndOfStreamException(); - - return byteValue1 | (byteValue2 << 8); - } - - /// - /// Read an int in little endian byte order. - /// - /// Returns the value read. - /// - /// An i/o error occurs. - /// - /// - /// The file ends prematurely - /// - public int ReadLEInt() => ReadLEShort() | (ReadLEShort() << 16); - - /// - /// Read a long in little endian byte order. - /// - /// The value read. - public long ReadLELong() => (uint)ReadLEInt() | ((long)ReadLEInt() << 32); - - /// - /// Write an unsigned short in little endian byte order. - /// - /// The value to write. - public void WriteLEShort(int value) - { - stream_.WriteByte((byte)(value & 0xff)); - stream_.WriteByte((byte)((value >> 8) & 0xff)); - } - - /// - /// Write a ushort in little endian byte order. - /// - /// The value to write. - public void WriteLEUshort(ushort value) - { - stream_.WriteByte((byte)(value & 0xff)); - stream_.WriteByte((byte)(value >> 8)); - } - - /// - /// Write an int in little endian byte order. - /// - /// The value to write. - public void WriteLEInt(int value) - { - WriteLEShort(value); - WriteLEShort(value >> 16); - } - - /// - /// Write a uint in little endian byte order. - /// - /// The value to write. - public void WriteLEUint(uint value) - { - WriteLEUshort((ushort)(value & 0xffff)); - WriteLEUshort((ushort)(value >> 16)); - } - - /// - /// Write a long in little endian byte order. - /// - /// The value to write. - public void WriteLELong(long value) - { - WriteLEInt((int)value); - WriteLEInt((int)(value >> 32)); - } - - /// - /// Write a ulong in little endian byte order. - /// - /// The value to write. - public void WriteLEUlong(ulong value) - { - WriteLEUint((uint)(value & 0xffffffff)); - WriteLEUint((uint)(value >> 32)); - } - - #endregion - - /// - /// Write a data descriptor. - /// - /// The entry to write a descriptor for. - /// Returns the number of descriptor bytes written. - public int WriteDataDescriptor(ZipEntry entry) - { - if (entry == null) - throw new ArgumentNullException(nameof(entry)); - - int result = 0; - - // Add data descriptor if flagged as required - if ((entry.Flags & (int)GeneralBitFlags.Descriptor) != 0) - { - // The signature is not PKZIP originally but is now described as optional - // in the PKZIP Appnote documenting trhe format. - WriteLEInt(ZipConstants.DataDescriptorSignature); - WriteLEInt(unchecked((int)(entry.Crc))); - - result += 8; - - if (entry.LocalHeaderRequiresZip64) - { - WriteLELong(entry.CompressedSize); - WriteLELong(entry.Size); - result += 16; - } - else - { - WriteLEInt((int)entry.CompressedSize); - WriteLEInt((int)entry.Size); - result += 8; - } - } - - return result; - } - - /// - /// Read data descriptor at the end of compressed data. - /// - /// if set to true [zip64]. - /// The data to fill in. - /// Returns the number of bytes read in the descriptor. - public void ReadDataDescriptor(bool zip64, DescriptorData data) - { - int intValue = ReadLEInt(); - - // In theory this may not be a descriptor according to PKZIP appnote. - // In practise its always there. - if (intValue != ZipConstants.DataDescriptorSignature) - throw new ZipException("Data descriptor signature not found"); - - data.Crc = ReadLEInt(); - - if (zip64) - { - data.CompressedSize = ReadLELong(); - data.Size = ReadLELong(); - } - else - { - data.CompressedSize = ReadLEInt(); - data.Size = ReadLEInt(); - } - } - - #region Instance Fields - bool isOwner_; - Stream stream_; - #endregion - } -} diff --git a/UpdateLib/UpdateLib/Compression/Zip/ZipInputStream.cs b/UpdateLib/UpdateLib/Compression/Zip/ZipInputStream.cs deleted file mode 100644 index 995a5c6..0000000 --- a/UpdateLib/UpdateLib/Compression/Zip/ZipInputStream.cs +++ /dev/null @@ -1,608 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -using MatthiWare.UpdateLib.Compression.Checksum; -using MatthiWare.UpdateLib.Compression.Deflaters; -using MatthiWare.UpdateLib.Compression.Streams; -using System; -using System.IO; - -namespace MatthiWare.UpdateLib.Compression.Zip -{ - /// - /// This is an InflaterInputStream that reads the files baseInputStream an zip archive - /// one after another. It has a special method to get the zip entry of - /// the next file. The zip entry contains information about the file name - /// size, compressed size, Crc, etc. - /// It includes support for Stored and Deflated entries. - ///
- ///
Author of the original java version : Jochen Hoenicke - ///
- /// - /// This sample shows how to read a zip file - /// - /// using System; - /// using System.Text; - /// using System.IO; - /// - /// using ICSharpCode.SharpZipLib.Zip; - /// - /// class MainClass - /// { - /// public static void Main(string[] args) - /// { - /// using ( ZipInputStream s = new ZipInputStream(File.OpenRead(args[0]))) { - /// - /// ZipEntry theEntry; - /// const int size = 2048; - /// byte[] data = new byte[2048]; - /// - /// while ((theEntry = s.GetNextEntry()) != null) { - /// if ( entry.IsFile ) { - /// Console.Write("Show contents (y/n) ?"); - /// if (Console.ReadLine() == "y") { - /// while (true) { - /// size = s.Read(data, 0, data.Length); - /// if (size > 0) { - /// Console.Write(new ASCIIEncoding().GetString(data, 0, size)); - /// } else { - /// break; - /// } - /// } - /// } - /// } - /// } - /// } - /// } - /// } - /// - /// - public class ZipInputStream : InflaterInputStream - { - #region Instance Fields - - /// - /// Delegate for reading bytes from a stream. - /// - delegate int ReadDataHandler(byte[] b, int offset, int length); - - /// - /// The current reader this instance. - /// - ReadDataHandler internalReader; - - IChecksum checksum = new Crc32(); - ZipEntry entry; - - long size; - int method; - int flags; - string password; - #endregion - - #region Constructors - /// - /// Creates a new Zip input stream, for reading a zip archive. - /// - /// The underlying providing data. - public ZipInputStream(Stream baseInputStream) - : base(baseInputStream, new Inflater(true)) - { - internalReader = new ReadDataHandler(ReadingNotAvailable); - } - - /// - /// Creates a new Zip input stream, for reading a zip archive. - /// - /// The underlying providing data. - /// Size of the buffer. - public ZipInputStream(Stream baseInputStream, int bufferSize) - : base(baseInputStream, new Inflater(true), bufferSize) - { - internalReader = new ReadDataHandler(ReadingNotAvailable); - } - #endregion - - /// - /// Optional password used for encryption when non-null - /// - /// A password for all encrypted entries in this - public string Password - { - get - { - return password; - } - set - { - password = value; - } - } - - - /// - /// Gets a value indicating if there is a current entry and it can be decompressed - /// - /// - /// The entry can only be decompressed if the library supports the zip features required to extract it. - /// See the ZipEntry Version property for more details. - /// - public bool CanDecompressEntry - { - get - { - return (entry != null) && entry.CanDecompress; - } - } - - /// - /// Advances to the next entry in the archive - /// - /// - /// The next entry in the archive or null if there are no more entries. - /// - /// - /// If the previous entry is still open CloseEntry is called. - /// - /// - /// Input stream is closed - /// - /// - /// Password is not set, password is invalid, compression method is invalid, - /// version required to extract is not supported - /// - public ZipEntry GetNextEntry() - { - if (checksum == null) - throw new InvalidOperationException("Closed."); - - if (entry != null) - CloseEntry(); - - int header = inputBuffer.ReadLeInt(); - - if (header == ZipConstants.CentralHeaderSignature || - header == ZipConstants.EndOfCentralDirectorySignature || - header == ZipConstants.CentralHeaderDigitalSignature || - header == ZipConstants.ArchiveExtraDataSignature || - header == ZipConstants.Zip64CentralFileHeaderSignature) - { - // No more individual entries exist - Dispose(); - return null; - } - - // -jr- 07-Dec-2003 Ignore spanning temporary signatures if found - // Spanning signature is same as descriptor signature and is untested as yet. - if ((header == ZipConstants.SpanningTempSignature) || (header == ZipConstants.SpanningSignature)) - header = inputBuffer.ReadLeInt(); - - if (header != ZipConstants.LocalHeaderSignature) - throw new ZipException("Wrong Local header signature: 0x" + string.Format("{0:X}", header)); - - var versionRequiredToExtract = (short)inputBuffer.ReadLeShort(); - - flags = inputBuffer.ReadLeShort(); - method = inputBuffer.ReadLeShort(); - var dostime = (uint)inputBuffer.ReadLeInt(); - int crc2 = inputBuffer.ReadLeInt(); - csize = inputBuffer.ReadLeInt(); - size = inputBuffer.ReadLeInt(); - int nameLen = inputBuffer.ReadLeShort(); - int extraLen = inputBuffer.ReadLeShort(); - - byte[] buffer = new byte[nameLen]; - inputBuffer.ReadRawBuffer(buffer); - - string name = ZipConstants.ConvertToStringExt(flags, buffer); - - entry = new ZipEntry(name, versionRequiredToExtract) - { - Flags = flags, - CompressionMethod = (CompressionMethod)method - }; - - if ((flags & 8) == 0) - { - entry.Crc = crc2 & 0xFFFFFFFFL; - entry.Size = size & 0xFFFFFFFFL; - entry.CompressedSize = csize & 0xFFFFFFFFL; - } - else - { - - // This allows for GNU, WinZip and possibly other archives, the PKZIP spec - // says these values are zero under these circumstances. - if (crc2 != 0) - entry.Crc = crc2 & 0xFFFFFFFFL; - - if (size != 0) - entry.Size = size & 0xFFFFFFFFL; - - if (csize != 0) - entry.CompressedSize = csize & 0xFFFFFFFFL; - } - - entry.DosTime = dostime; - - // If local header requires Zip64 is true then the extended header should contain - // both values. - - // Handle extra data if present. This can set/alter some fields of the entry. - if (extraLen > 0) - { - byte[] extra = new byte[extraLen]; - inputBuffer.ReadRawBuffer(extra); - entry.ExtraData = extra; - } - - entry.ProcessExtraData(true); - if (entry.CompressedSize >= 0) - csize = entry.CompressedSize; - - if (entry.Size >= 0) - size = entry.Size; - - if (method == (int)CompressionMethod.Stored && csize != size) - throw new ZipException("Stored, but compressed != uncompressed"); - - // Determine how to handle reading of data if this is attempted. - if (entry.IsCompressionMethodSupported()) - internalReader = new ReadDataHandler(InitialRead); - else - internalReader = new ReadDataHandler(ReadingNotSupported); - - return entry; - } - - /// - /// Read data descriptor at the end of compressed data. - /// - void ReadDataDescriptor() - { - if (inputBuffer.ReadLeInt() != ZipConstants.DataDescriptorSignature) - throw new ZipException("Data descriptor signature not found"); - - entry.Crc = inputBuffer.ReadLeInt() & 0xFFFFFFFFL; - - if (entry.LocalHeaderRequiresZip64) - { - csize = inputBuffer.ReadLeLong(); - size = inputBuffer.ReadLeLong(); - } - else - { - csize = inputBuffer.ReadLeInt(); - size = inputBuffer.ReadLeInt(); - } - - entry.CompressedSize = csize; - entry.Size = size; - } - - /// - /// Complete cleanup as the final part of closing. - /// - /// True if the crc value should be tested - void CompleteCloseEntry(bool testCrc) - { - if ((flags & 8) != 0) - ReadDataDescriptor(); - - size = 0; - - if (testCrc && - ((checksum.Value & 0xFFFFFFFFL) != entry.Crc) && - (entry.Crc != -1)) - throw new ZipException("CRC mismatch"); - - checksum.Reset(); - - if (method == (int)CompressionMethod.Deflated) - inflater.Reset(); - - entry = null; - } - - /// - /// Closes the current zip entry and moves to the next one. - /// - /// - /// The stream is closed - /// - /// - /// The Zip stream ends early - /// - public void CloseEntry() - { - if (checksum == null) - throw new InvalidOperationException("Closed"); - - if (entry == null) - return; - - if (method == (int)CompressionMethod.Deflated) - { - if ((flags & 8) != 0) - { - // We don't know how much we must skip, read until end. - byte[] tmp = new byte[4096]; - - // Read will close this entry - while (Read(tmp, 0, tmp.Length) > 0) ; - - return; - } - - csize -= inflater.TotalIn; - inputBuffer.Available += inflater.RemainingInput; - } - - if ((inputBuffer.Available > csize) && (csize >= 0)) - inputBuffer.Available = (int)(inputBuffer.Available - csize); - else - { - csize -= inputBuffer.Available; - inputBuffer.Available = 0; - while (csize != 0) - { - long skipped = Skip(csize); - - if (skipped <= 0) - throw new ZipException("Zip archive ends early."); - - csize -= skipped; - } - } - - CompleteCloseEntry(false); - } - - /// - /// Returns 1 if there is an entry available - /// Otherwise returns 0. - /// - public override int Available - { - get - { - return entry != null ? 1 : 0; - } - } - - /// - /// Returns the current size that can be read from the current entry if available - /// - /// Thrown if the entry size is not known. - /// Thrown if no entry is currently available. - public override long Length - { - get - { - if (entry == null) - throw new InvalidOperationException("No current entry"); - - if (entry.Size < 0) - throw new ZipException("Length not available for the current entry"); - - return entry.Size; - } - - } - - /// - /// Reads a byte from the current zip entry. - /// - /// - /// The byte or -1 if end of stream is reached. - /// - public override int ReadByte() - { - byte[] b = new byte[1]; - - return (Read(b, 0, 1) <= 0) ? -1 : b[0] & 0xff; - } - - /// - /// Handle attempts to read by throwing an . - /// - /// The destination array to store data in. - /// The offset at which data read should be stored. - /// The maximum number of bytes to read. - /// Returns the number of bytes actually read. - int ReadingNotAvailable(byte[] destination, int offset, int count) - { - throw new IOException("Unable to read from this stream"); - } - - /// - /// Handle attempts to read from this entry by throwing an exception - /// - int ReadingNotSupported(byte[] destination, int offset, int count) - { - throw new ZipException("The compression method for this entry is not supported"); - } - - /// - /// Perform the initial read on an entry which may include - /// reading encryption headers and setting up inflation. - /// - /// The destination to fill with data read. - /// The offset to start reading at. - /// The maximum number of bytes to read. - /// The actual number of bytes read. - int InitialRead(byte[] destination, int offset, int count) - { - if (!CanDecompressEntry) - throw new ZipException($"Library cannot extract this entry. Version required is ({entry.Version})"); - - if ((csize > 0) || ((flags & (int)GeneralBitFlags.Descriptor) != 0)) - { - if ((method == (int)CompressionMethod.Deflated) && (inputBuffer.Available > 0)) - inputBuffer.SetInflaterInput(inflater); - - internalReader = new ReadDataHandler(BodyRead); - return BodyRead(destination, offset, count); - } - else - { - internalReader = new ReadDataHandler(ReadingNotAvailable); - return 0; - } - } - - /// - /// Read a block of bytes from the stream. - /// - /// The destination for the bytes. - /// The index to start storing data. - /// The number of bytes to attempt to read. - /// Returns the number of bytes read. - /// Zero bytes read means end of stream. - public override int Read(byte[] buffer, int offset, int count) - { - if (buffer == null) - throw new ArgumentNullException(nameof(buffer)); - - if (offset < 0) - throw new ArgumentOutOfRangeException(nameof(offset), "Cannot be negative"); - - if (count < 0) - throw new ArgumentOutOfRangeException(nameof(count), "Cannot be negative"); - - if ((buffer.Length - offset) < count) - throw new ArgumentException("Invalid offset/count combination"); - - return internalReader(buffer, offset, count); - } - - /// - /// Reads a block of bytes from the current zip entry. - /// - /// - /// The number of bytes read (this may be less than the length requested, even before the end of stream), or 0 on end of stream. - /// - /// - /// An i/o error occured. - /// - /// - /// The deflated stream is corrupted. - /// - /// - /// The stream is not open. - /// - int BodyRead(byte[] buffer, int offset, int count) - { - if (checksum == null) - throw new InvalidOperationException("Closed"); - - if ((entry == null) || (count <= 0)) - return 0; - - if (offset + count > buffer.Length) - throw new ArgumentException("Offset + count exceeds buffer size"); - - bool finished = false; - - switch (method) - { - case (int)CompressionMethod.Deflated: - - count = base.Read(buffer, offset, count); - - if (count <= 0) - { - if (!inflater.IsFinished) - throw new ZipException("Inflater not finished!"); - - inputBuffer.Available = inflater.RemainingInput; - - // A csize of -1 is from an unpatched local header - if ((flags & 8) == 0 && - (inflater.TotalIn != csize && csize != 0xFFFFFFFF && csize != -1 || inflater.TotalOut != size)) - throw new ZipException("Size mismatch: " + csize + ";" + size + " <-> " + inflater.TotalIn + ";" + inflater.TotalOut); - - inflater.Reset(); - finished = true; - } - break; - - case (int)CompressionMethod.Stored: - - if ((count > csize) && (csize >= 0)) - count = (int)csize; - - if (count > 0) - { - count = inputBuffer.ReadClearTextBuffer(buffer, offset, count); - - if (count > 0) - { - csize -= count; - size -= count; - } - } - - if (csize == 0) - finished = true; - else - if (count < 0) - throw new ZipException("EOF in stored block"); - - break; - } - - if (count > 0) - checksum.Update(buffer, offset, count); - - if (finished) - CompleteCloseEntry(true); - - return count; - } - - /// - /// Closes the zip input stream - /// - protected override void Dispose(bool disposing) - { - internalReader = new ReadDataHandler(ReadingNotAvailable); - checksum = null; - entry = null; - - base.Dispose(disposing); - } - } -} diff --git a/UpdateLib/UpdateLib/Compression/Zip/ZipOutputStream.cs b/UpdateLib/UpdateLib/Compression/Zip/ZipOutputStream.cs deleted file mode 100644 index 3ca7c4c..0000000 --- a/UpdateLib/UpdateLib/Compression/Zip/ZipOutputStream.cs +++ /dev/null @@ -1,735 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -using MatthiWare.UpdateLib.Compression.Checksum; -using MatthiWare.UpdateLib.Compression.Deflaters; -using MatthiWare.UpdateLib.Compression.Streams; -using System; -using System.Collections.Generic; -using System.IO; - -namespace MatthiWare.UpdateLib.Compression.Zip -{ - /// - /// This is a DeflaterOutputStream that writes the files into a zip - /// archive one after another. It has a special method to start a new - /// zip entry. The zip entries contains information about the file name - /// size, compressed size, CRC, etc. - /// - /// It includes support for Stored and Deflated entries. - /// This class is not thread safe. - ///
- ///
Author of the original java version : Jochen Hoenicke - ///
- /// This sample shows how to create a zip file - /// - /// using System; - /// using System.IO; - /// - /// using ICSharpCode.SharpZipLib.Core; - /// using ICSharpCode.SharpZipLib.Zip; - /// - /// class MainClass - /// { - /// public static void Main(string[] args) - /// { - /// string[] filenames = Directory.GetFiles(args[0]); - /// byte[] buffer = new byte[4096]; - /// - /// using ( ZipOutputStream s = new ZipOutputStream(File.Create(args[1])) ) { - /// - /// s.SetLevel(9); // 0 - store only to 9 - means best compression - /// - /// foreach (string file in filenames) { - /// ZipEntry entry = new ZipEntry(file); - /// s.PutNextEntry(entry); - /// - /// using (FileStream fs = File.OpenRead(file)) { - /// StreamUtils.Copy(fs, s, buffer); - /// } - /// } - /// } - /// } - /// } - /// - /// - public class ZipOutputStream : DeflaterOutputStream - { - #region Constructors - /// - /// Creates a new Zip output stream, writing a zip archive. - /// - /// - /// The output stream to which the archive contents are written. - /// - public ZipOutputStream(Stream baseOutputStream) - : base(baseOutputStream, new Deflater(Deflater.DEFAULT_COMPRESSION, true)) - { - } - - /// - /// Creates a new Zip output stream, writing a zip archive. - /// - /// The output stream to which the archive contents are written. - /// Size of the buffer to use. - public ZipOutputStream(Stream baseOutputStream, int bufferSize) - : base(baseOutputStream, new Deflater(Deflater.DEFAULT_COMPRESSION, true), bufferSize) - { - } - #endregion - - /// - /// Gets a flag value of true if the central header has been added for this archive; false if it has not been added. - /// - /// No further entries can be added once this has been done. - public bool IsFinished - { - get - { - return entries == null; - } - } - - /// - /// Set the zip file comment. - /// - /// - /// The comment text for the entire archive. - /// - /// - /// The converted comment is longer than 0xffff bytes. - /// - public void SetComment(string comment) - { - // TODO: Its not yet clear how to handle unicode comments here. - byte[] commentBytes = ZipConstants.ConvertToArray(comment); - - if (commentBytes.Length > 0xffff) - throw new ArgumentOutOfRangeException(nameof(comment)); - - zipComment = commentBytes; - } - - /// - /// Sets the compression level. The new level will be activated - /// immediately. - /// - /// The new compression level (1 to 9). - /// - /// Level specified is not supported. - /// - /// - public void SetLevel(int level) - { - deflater_.SetLevel(level); - defaultCompressionLevel = level; - } - - /// - /// Get the current deflater compression level - /// - /// The current compression level - public int GetLevel() - { - return deflater_.GetLevel(); - } - - /// - /// Get / set a value indicating how Zip64 Extension usage is determined when adding entries. - /// - /// Older archivers may not understand Zip64 extensions. - /// If backwards compatability is an issue be careful when adding entries to an archive. - /// Setting this property to off is workable but less desirable as in those circumstances adding a file - /// larger then 4GB will fail. - public UseZip64 UseZip64 - { - get { return useZip64_; } - set { useZip64_ = value; } - } - - /// - /// Write an unsigned short in little endian byte order. - /// - private void WriteLeShort(int value) - { - unchecked - { - baseOutputStream_.WriteByte((byte)(value & 0xff)); - baseOutputStream_.WriteByte((byte)((value >> 8) & 0xff)); - } - } - - /// - /// Write an int in little endian byte order. - /// - private void WriteLeInt(int value) - { - unchecked - { - WriteLeShort(value); - WriteLeShort(value >> 16); - } - } - - /// - /// Write an int in little endian byte order. - /// - private void WriteLeLong(long value) - { - unchecked - { - WriteLeInt((int)value); - WriteLeInt((int)(value >> 32)); - } - } - - /// - /// Starts a new Zip entry. It automatically closes the previous - /// entry if present. - /// All entry elements bar name are optional, but must be correct if present. - /// If the compression method is stored and the output is not patchable - /// the compression for that entry is automatically changed to deflate level 0 - /// - /// - /// the entry. - /// - /// - /// if entry passed is null. - /// - /// - /// if an I/O error occured. - /// - /// - /// if stream was finished - /// - /// - /// Too many entries in the Zip file
- /// Entry name is too long
- /// Finish has already been called
- ///
- public void PutNextEntry(ZipEntry entry) - { - if (entry == null) - throw new ArgumentNullException(nameof(entry)); - - if (entries == null) - throw new InvalidOperationException("ZipOutputStream was finished"); - - if (curEntry != null) - CloseEntry(); - - if (entries.Count == int.MaxValue) - throw new ZipException("Too many entries for Zip file"); - - CompressionMethod method = entry.CompressionMethod; - int compressionLevel = defaultCompressionLevel; - - // Clear flags that the library manages internally - entry.Flags &= (int)GeneralBitFlags.UnicodeText; - patchEntryHeader = false; - - bool headerInfoAvailable; - - // No need to compress - definitely no data. - if (entry.Size == 0) - { - entry.CompressedSize = entry.Size; - entry.Crc = 0; - method = CompressionMethod.Stored; - headerInfoAvailable = true; - } - else - { - headerInfoAvailable = (entry.Size >= 0) && entry.HasCrc && entry.CompressedSize >= 0; - - // Switch to deflation if storing isnt possible. - if (method == CompressionMethod.Stored) - { - if (!headerInfoAvailable) - { - if (!CanPatchEntries) - { - // Can't patch entries so storing is not possible. - method = CompressionMethod.Deflated; - compressionLevel = 0; - } - } - else // entry.size must be > 0 - { - entry.CompressedSize = entry.Size; - headerInfoAvailable = entry.HasCrc; - } - } - } - - if (headerInfoAvailable == false) - { - if (CanPatchEntries == false) - { - // Only way to record size and compressed size is to append a data descriptor - // after compressed data. - - // Stored entries of this form have already been converted to deflating. - entry.Flags |= 8; - } - else - { - patchEntryHeader = true; - } - } - - entry.Offset = offset; - entry.CompressionMethod = method; - - curMethod = method; - sizePatchPos = -1; - - if ((useZip64_ == UseZip64.On) || ((entry.Size < 0) && (useZip64_ == UseZip64.Dynamic))) - entry.ForceZip64(); - - // Write the local file header - WriteLeInt(ZipConstants.LocalHeaderSignature); - - WriteLeShort(entry.Version); - WriteLeShort(entry.Flags); - WriteLeShort((byte)entry.CompressionMethod); - WriteLeInt((int)entry.DosTime); - - // TODO: Refactor header writing. Its done in several places. - if (headerInfoAvailable) - { - WriteLeInt((int)entry.Crc); - - if (entry.LocalHeaderRequiresZip64) - { - WriteLeInt(-1); - WriteLeInt(-1); - } - else - { - WriteLeInt((int)entry.CompressedSize); - WriteLeInt((int)entry.Size); - } - } - else - { - if (patchEntryHeader) - crcPatchPos = baseOutputStream_.Position; - - WriteLeInt(0); // Crc - - if (patchEntryHeader) - sizePatchPos = baseOutputStream_.Position; - - // For local header both sizes appear in Zip64 Extended Information - if (entry.LocalHeaderRequiresZip64 || patchEntryHeader) - { - WriteLeInt(-1); - WriteLeInt(-1); - } - else - { - WriteLeInt(0); // Compressed size - WriteLeInt(0); // Uncompressed size - } - } - - byte[] name = ZipConstants.ConvertToArray(entry.Flags, entry.Name); - - if (name.Length > 0xFFFF) - throw new ZipException("Entry name too long."); - - var ed = new ZipExtraData(entry.ExtraData); - - if (entry.LocalHeaderRequiresZip64) - { - ed.StartNewEntry(); - - if (headerInfoAvailable) - { - ed.AddLeLong(entry.Size); - ed.AddLeLong(entry.CompressedSize); - } - else - { - ed.AddLeLong(-1); - ed.AddLeLong(-1); - } - - ed.AddNewEntry(1); - - if (!ed.Find(1)) - throw new ZipException("Internal error cant find extra data"); - - if (patchEntryHeader) - sizePatchPos = ed.CurrentReadIndex; - } - else - ed.Delete(1); - - byte[] extra = ed.GetEntryData(); - - WriteLeShort(name.Length); - WriteLeShort(extra.Length); - - if (name.Length > 0) - baseOutputStream_.Write(name, 0, name.Length); - - if (entry.LocalHeaderRequiresZip64 && patchEntryHeader) - sizePatchPos += baseOutputStream_.Position; - - if (extra.Length > 0) - baseOutputStream_.Write(extra, 0, extra.Length); - - offset += ZipConstants.LocalHeaderBaseSize + name.Length + extra.Length; - - // Activate the entry. - curEntry = entry; - checksum.Reset(); - - if (method == CompressionMethod.Deflated) - { - deflater_.Reset(); - deflater_.SetLevel(compressionLevel); - } - - size = 0; - } - - /// - /// Closes the current entry, updating header and footer information as required - /// - /// - /// An I/O error occurs. - /// - /// - /// No entry is active. - /// - public void CloseEntry() - { - if (curEntry == null) - throw new InvalidOperationException("No open entry"); - - long csize = size; - - // First finish the deflater, if appropriate - if (curMethod == CompressionMethod.Deflated) - { - if (size >= 0) - { - base.Finish(); - csize = deflater_.TotalOut; - } - else - deflater_.Reset(); - } - - if (curEntry.Size < 0) - curEntry.Size = size; - else if (curEntry.Size != size) - throw new ZipException("size was " + size + ", but I expected " + curEntry.Size); - - if (curEntry.CompressedSize < 0) - curEntry.CompressedSize = csize; - else if (curEntry.CompressedSize != csize) - throw new ZipException("compressed size was " + csize + ", but I expected " + curEntry.CompressedSize); - - if (curEntry.Crc < 0) - curEntry.Crc = checksum.Value; - else if (curEntry.Crc != checksum.Value) - throw new ZipException("crc was " + checksum.Value + ", but I expected " + curEntry.Crc); - - offset += csize; - - // Patch the header if possible - if (patchEntryHeader) - { - patchEntryHeader = false; - - long curPos = baseOutputStream_.Position; - baseOutputStream_.Seek(crcPatchPos, SeekOrigin.Begin); - WriteLeInt((int)curEntry.Crc); - - if (curEntry.LocalHeaderRequiresZip64) - { - if (sizePatchPos == -1) - throw new ZipException("Entry requires zip64 but this has been turned off"); - - baseOutputStream_.Seek(sizePatchPos, SeekOrigin.Begin); - WriteLeLong(curEntry.Size); - WriteLeLong(curEntry.CompressedSize); - } - else - { - WriteLeInt((int)curEntry.CompressedSize); - WriteLeInt((int)curEntry.Size); - } - - baseOutputStream_.Seek(curPos, SeekOrigin.Begin); - } - - // Add data descriptor if flagged as required - if ((curEntry.Flags & 8) != 0) - { - WriteLeInt(ZipConstants.DataDescriptorSignature); - WriteLeInt(unchecked((int)curEntry.Crc)); - - if (curEntry.LocalHeaderRequiresZip64) - { - WriteLeLong(curEntry.CompressedSize); - WriteLeLong(curEntry.Size); - offset += ZipConstants.Zip64DataDescriptorSize; - } - else - { - WriteLeInt((int)curEntry.CompressedSize); - WriteLeInt((int)curEntry.Size); - offset += ZipConstants.DataDescriptorSize; - } - } - - entries.Add(curEntry); - curEntry = null; - } - - /// - /// Writes the given buffer to the current entry. - /// - /// The buffer containing data to write. - /// The offset of the first byte to write. - /// The number of bytes to write. - /// Archive size is invalid - /// No entry is active. - public override void Write(byte[] buffer, int offset, int count) - { - if (curEntry == null) - throw new InvalidOperationException("No open entry."); - - if (buffer == null) - throw new ArgumentNullException(nameof(buffer)); - - if (offset < 0) - throw new ArgumentOutOfRangeException(nameof(offset), "Cannot be negative"); - - if (count < 0) - throw new ArgumentOutOfRangeException(nameof(count), "Cannot be negative"); - - if ((buffer.Length - offset) < count) - throw new ArgumentException("Invalid offset/count combination"); - - checksum.Update(buffer, offset, count); - size += count; - - switch (curMethod) - { - case CompressionMethod.Deflated: - base.Write(buffer, offset, count); - break; - - case CompressionMethod.Stored: - baseOutputStream_.Write(buffer, offset, count); - break; - } - } - - /// - /// Finishes the stream. This will write the central directory at the - /// end of the zip file and flush the stream. - /// - /// - /// This is automatically called when the stream is closed. - /// - /// - /// An I/O error occurs. - /// - /// - /// Comment exceeds the maximum length
- /// Entry name exceeds the maximum length - ///
- public override void Finish() - { - if (entries == null) - return; - - if (curEntry != null) - CloseEntry(); - - long numEntries = entries.Count; - long sizeEntries = 0; - - foreach (ZipEntry entry in entries) - { - WriteLeInt(ZipConstants.CentralHeaderSignature); - WriteLeShort(ZipConstants.VersionMadeBy); - WriteLeShort(entry.Version); - WriteLeShort(entry.Flags); - WriteLeShort((short)entry.CompressionMethod); - WriteLeInt((int)entry.DosTime); - WriteLeInt((int)entry.Crc); - - WriteLeInt(entry.IsZip64Forced() || (entry.CompressedSize >= uint.MaxValue) ? - -1 : - (int)entry.CompressedSize); - - WriteLeInt(entry.IsZip64Forced() || (entry.Size >= uint.MaxValue) ? - -1 : - (int)entry.Size); - - byte[] name = ZipConstants.ConvertToArray(entry.Flags, entry.Name); - - if (name.Length > 0xffff) - throw new ZipException("Name too long."); - - var ed = new ZipExtraData(entry.ExtraData); - - if (entry.CentralHeaderRequiresZip64) - { - ed.StartNewEntry(); - if (entry.IsZip64Forced() || - (entry.Size >= 0xffffffff)) - ed.AddLeLong(entry.Size); - - if (entry.IsZip64Forced() || - (entry.CompressedSize >= 0xffffffff)) - ed.AddLeLong(entry.CompressedSize); - - if (entry.Offset >= 0xffffffff) - ed.AddLeLong(entry.Offset); - - ed.AddNewEntry(1); - } - else - ed.Delete(1); - - byte[] extra = ed.GetEntryData(); - - byte[] entryComment = - (entry.Comment != null) ? - ZipConstants.ConvertToArray(entry.Flags, entry.Comment) : - new byte[0]; - - if (entryComment.Length > 0xffff) - throw new ZipException("Comment too long."); - - WriteLeShort(name.Length); - WriteLeShort(extra.Length); - WriteLeShort(entryComment.Length); - WriteLeShort(0); // disk number - WriteLeShort(0); // internal file attributes - // external file attributes - - if (entry.ExternalFileAttributes != -1) - WriteLeInt(entry.ExternalFileAttributes); - else - WriteLeInt(entry.IsDirectory ? 16 : 0); // mark entry as directory (from nikolam.AT.perfectinfo.com) - - WriteLeInt(entry.Offset >= uint.MaxValue ? -1 : (int)entry.Offset); - - if (name.Length > 0) - baseOutputStream_.Write(name, 0, name.Length); - - if (extra.Length > 0) - baseOutputStream_.Write(extra, 0, extra.Length); - - if (entryComment.Length > 0) - baseOutputStream_.Write(entryComment, 0, entryComment.Length); - - sizeEntries += ZipConstants.CentralHeaderBaseSize + name.Length + extra.Length + entryComment.Length; - } - - using (ZipHelperStream zhs = new ZipHelperStream(baseOutputStream_)) - zhs.WriteEndOfCentralDirectory(numEntries, sizeEntries, offset, zipComment); - - entries = null; - } - - #region Instance Fields - /// - /// The entries for the archive. - /// - List entries = new List(); - - /// - /// Used to track the crc of data added to entries. - /// - IChecksum checksum = new Crc32(); - - /// - /// The current entry being added. - /// - ZipEntry curEntry; - - int defaultCompressionLevel = Deflater.DEFAULT_COMPRESSION; - - CompressionMethod curMethod = CompressionMethod.Deflated; - - /// - /// Used to track the size of data for an entry during writing. - /// - long size; - - /// - /// Offset to be recorded for each entry in the central header. - /// - long offset; - - /// - /// Comment for the entire archive recorded in central header. - /// - byte[] zipComment = new byte[0]; - - /// - /// Flag indicating that header patching is required for the current entry. - /// - bool patchEntryHeader; - - /// - /// Position to patch crc - /// - long crcPatchPos = -1; - - /// - /// Position to patch size. - /// - long sizePatchPos = -1; - - // Default is dynamic which is not backwards compatible and can cause problems - // with XP's built in compression which cant read Zip64 archives. - // However it does avoid the situation were a large file is added and cannot be completed correctly. - // NOTE: Setting the size for entries before they are added is the best solution! - UseZip64 useZip64_ = UseZip64.On; - #endregion - } -} diff --git a/UpdateLib/UpdateLib/Controls/UpdaterControl.Designer.cs b/UpdateLib/UpdateLib/Controls/UpdaterControl.Designer.cs deleted file mode 100644 index 46bf967..0000000 --- a/UpdateLib/UpdateLib/Controls/UpdaterControl.Designer.cs +++ /dev/null @@ -1,49 +0,0 @@ -namespace MatthiWare.UpdateLib.Controls -{ - partial class UpdaterControl - { - /// - /// 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 Component Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.SuspendLayout(); - // - // UpdaterControl - // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.Color.Transparent; - this.DoubleBuffered = true; - this.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.Name = "UpdaterControl"; - this.Size = new System.Drawing.Size(369, 77); - this.ResumeLayout(false); - - } - - #endregion - } -} diff --git a/UpdateLib/UpdateLib/Controls/UpdaterControl.cs b/UpdateLib/UpdateLib/Controls/UpdaterControl.cs deleted file mode 100644 index 919c063..0000000 --- a/UpdateLib/UpdateLib/Controls/UpdaterControl.cs +++ /dev/null @@ -1,288 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Windows.Forms; -using MatthiWare.UpdateLib.Properties; - -namespace MatthiWare.UpdateLib.Controls -{ - [ToolboxBitmap(typeof(UpdaterControl), "UpdaterControl.bmp")] - [Obsolete("We will no longer be supporting the UpdaterControl")] - public partial class UpdaterControl : UserControl - { - private const int ICON_SIZE = 16; - private const int XY_OFFSET = 2; - private const int PROGRESS_SPEED = 200; - - private Brush brush; - private float x_text, y_text; - - private const string CHECK_FOR_UPDATES = "Please check for updates"; - - private Point oldLocation; - private ToolTip tooltip = new ToolTip(); - - private Dictionary cachedMeasure = new Dictionary(); - private string _text = CHECK_FOR_UPDATES; - public override string Text - { - get { return _text; } - set - { - if (_text != value) - { - _text = value; - Invalidate(); - } - - } - } - - private int progressIndex = 0; - private Bitmap[] progressImages = new Bitmap[50]; - - private Dictionary cachedImages = new Dictionary(); - - private Timer timer; - - private UpdaterIcon _icon = UpdaterIcon.Info; - private UpdaterIcon Icon - { - get { return _icon; } - set - { - if (_icon != value) - { - _icon = value; - Invalidate(); - } - - } - } - - public enum UpdaterIcon : byte - { - Info = 0, - Error = 1, - Done = 2, - Update = 3, - Progress = 4 - } - - public UpdaterControl() - { - InitializeComponent(); - - SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor | ControlStyles.UserPaint, true); - SetStyle(ControlStyles.ContainerControl, false); - - Size = new Size(XY_OFFSET * 2 + ICON_SIZE, XY_OFFSET * 2 + ICON_SIZE); - timer = new Timer(); - timer.Interval = PROGRESS_SPEED; - timer.Tick += update_progress; - - // caching - LoadImages(); - MakeBrushFromForeColor(); - CalcFont(); - - } - - private void update_progress(object sender, EventArgs e) - { - Invalidate(); - if (++progressIndex >= progressImages.Length) - progressIndex = 0; - } - - private void StartProgress() - { - progressIndex = 0; - timer.Start(); - } - - private void StopProgress() - { - timer.Stop(); - } - - public override Font Font - { - get - { - return base.Font; - } - - set - { - base.Font = value; - // invalidate the cache - cachedMeasure.Clear(); - CalcFont(); - } - } - - private void CalcFont() - { - SizeF size = GetAndCacheSize(); - - int height = XY_OFFSET * 2 + ICON_SIZE; - - x_text = XY_OFFSET * 2 + ICON_SIZE; - y_text = (height / 2) - (size.Height / 2); - } - - private SizeF GetAndCacheSize() - { - if (!cachedMeasure.ContainsKey(Text)) - { - Graphics g = Graphics.FromImage(new Bitmap(1,1)); - SizeF size = g.MeasureString(Text, base.Font); - - cachedMeasure.Add(Text, size); - } - - return cachedMeasure[Text]; - } - - public override Color ForeColor - { - get - { - return base.ForeColor; - } - - set - { - base.ForeColor = value; - MakeBrushFromForeColor(); - } - } - - private void MakeBrushFromForeColor() - { - brush = new SolidBrush(base.ForeColor); - } - - private void LoadImages() - { - Resources.status_download.RotateFlip(RotateFlipType.RotateNoneFlipY); - cachedImages.Add(UpdaterIcon.Info, Resources.status_info); - cachedImages.Add(UpdaterIcon.Error, Resources.status_error); - cachedImages.Add(UpdaterIcon.Done, Resources.status_done); - cachedImages.Add(UpdaterIcon.Update, Resources.status_update); - - Bitmap spritesheet = Resources.status_working; - - int i = 0; - for (int x = 0; x < 10; x++) - { - for (int y = 0; y < 5; y++) - { - Bitmap bmp = new Bitmap(16, 16); - Graphics g = Graphics.FromImage(bmp); - - Rectangle dest = new Rectangle(0, 0, 16, 16); - Rectangle src = new Rectangle(x * 16, y * 16, 16, 16); - - g.DrawImage(spritesheet, dest, src, GraphicsUnit.Pixel); - - g.Dispose(); - - progressImages[i++] = bmp; - } - } - - } - - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); - - DrawIcon(e.Graphics); - DrawText(e.Graphics); - } - - private void DrawIcon(Graphics g) - { - g.DrawImage((Icon == UpdaterIcon.Progress) ? progressImages[progressIndex] : cachedImages[Icon], - XY_OFFSET, - XY_OFFSET, - ICON_SIZE, - ICON_SIZE); - } - - private void DrawText(Graphics g) - { - g.DrawString(Text, Font, brush, x_text, y_text); - } - - protected override void OnMouseEnter(EventArgs e) - { - base.OnMouseEnter(e); - - oldLocation = Location; - int newWidth = CalcNewWidth(); - Width = newWidth; - - if (Location.X + newWidth > ParentForm.Width) - { - int amountToRemove = ParentForm.Width - (Location.X + newWidth) - (XY_OFFSET * 2 + ICON_SIZE); - Point x = Location; - x.X += amountToRemove; - Location = x; - } - } - - protected override void OnMouseLeave(EventArgs e) - { - base.OnMouseLeave(e); - - Location = oldLocation; - Width = XY_OFFSET * 2 + ICON_SIZE; - - tooltip.Active = false; - } - - protected override void OnMouseHover(EventArgs e) - { - base.OnMouseHover(e); - - - tooltip.ToolTipIcon = ToolTipIcon.Info; - tooltip.ToolTipTitle = Text; - tooltip.UseAnimation = true; - tooltip.Active = true; - tooltip.Show("Please click here to start checking for updates", Parent, Location.X + Width + (ICON_SIZE), Location.Y + Height); - - } - - protected override void OnClick(EventArgs e) - { - base.OnClick(e); - - Text = "Checking for updates.."; - Icon = UpdaterIcon.Progress; - - int currWidth = Width; - int newWidth = CalcNewWidth(); - - int offset = currWidth - newWidth; - Point x = Location; - x.X += offset; - Location = x; - Width = newWidth; - - StartProgress(); - - - } - - private int CalcNewWidth() - { - SizeF size = GetAndCacheSize(); - return (int)size.Width + (XY_OFFSET * 2 + ICON_SIZE); - } - - } -} diff --git a/UpdateLib/UpdateLib/Controls/UpdaterControl.resx b/UpdateLib/UpdateLib/Controls/UpdaterControl.resx deleted file mode 100644 index 7080a7d..0000000 --- a/UpdateLib/UpdateLib/Controls/UpdaterControl.resx +++ /dev/null @@ -1,120 +0,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/UpdateLib/UpdateLib/Files/CacheFile.cs b/UpdateLib/UpdateLib/Files/CacheFile.cs index dc0584d..85e1226 100644 --- a/UpdateLib/UpdateLib/Files/CacheFile.cs +++ b/UpdateLib/UpdateLib/Files/CacheFile.cs @@ -9,14 +9,14 @@ namespace MatthiWare.UpdateLib.Files [Serializable] public class CacheFile : FileBase { - private static Lazy m_filePath = new Lazy(() => $"{IOUtils.AppDataPath}\\Cache.xml"); + private static Lazy m_filePath = new Lazy(() => $""); public UpdateVersion CurrentVersion { get; set; } public override CacheFile Load() - => Load(m_filePath); + => Load(m_filePath.Value); public override void Save() - => Save(m_filePath); + => Save(m_filePath.Value); } } diff --git a/UpdateLib/UpdateLib/Files/HashCacheFile.cs b/UpdateLib/UpdateLib/Files/HashCacheFile.cs index 132a3d3..51e3afd 100644 --- a/UpdateLib/UpdateLib/Files/HashCacheFile.cs +++ b/UpdateLib/UpdateLib/Files/HashCacheFile.cs @@ -61,12 +61,12 @@ public void AddOrUpdateEntry(string fullPath, string hash = "") Items.Add(entry); } - Updater.Instance.Logger.Debug(nameof(HashCacheFile), nameof(AddOrUpdateEntry), $"Cache updated for file -> '{entry.FilePath}'"); + //Updater.Instance.Logger.Debug(nameof(HashCacheFile), nameof(AddOrUpdateEntry), $"Cache updated for file -> '{entry.FilePath}'"); } } #region Save/Load - private static string GetStoragePath() => $@"{IOUtils.CachePath}\{FILE_NAME}"; + private static string GetStoragePath() => ""; /// /// Loads the from the default storage location diff --git a/UpdateLib/UpdateLib/Files/UpdateCatalogFile.cs b/UpdateLib/UpdateLib/Files/UpdateCatalogFile.cs index 43827a8..9e55b5c 100644 --- a/UpdateLib/UpdateLib/Files/UpdateCatalogFile.cs +++ b/UpdateLib/UpdateLib/Files/UpdateCatalogFile.cs @@ -31,7 +31,6 @@ using MatthiWare.UpdateLib.Common; using MatthiWare.UpdateLib.Common.Abstraction; -using MatthiWare.UpdateLib.Compression.GZip; namespace MatthiWare.UpdateLib.Files { @@ -71,11 +70,11 @@ public UpdateInfo GetLatestUpdateForVersion(UpdateVersion currentVersion) public override UpdateCatalogFile Load() => throw new NotImplementedException(); public override UpdateCatalogFile Load(Stream stream) - => base.Load(new GZipInputStream(stream, false)); + => base.Load(stream); public override void Save() => throw new NotImplementedException(); public override void Save(Stream stream) - => base.Save(new GZipOutputStream(stream, false)); + => base.Save(stream); } } diff --git a/UpdateLib/UpdateLib/Files/UpdateMetadataFile.cs b/UpdateLib/UpdateLib/Files/UpdateMetadataFile.cs index 6a9a96e..18473d3 100644 --- a/UpdateLib/UpdateLib/Files/UpdateMetadataFile.cs +++ b/UpdateLib/UpdateLib/Files/UpdateMetadataFile.cs @@ -7,7 +7,6 @@ using MatthiWare.UpdateLib.Common; using MatthiWare.UpdateLib.Common.Abstraction; -using MatthiWare.UpdateLib.Compression.GZip; namespace MatthiWare.UpdateLib.Files { @@ -41,11 +40,11 @@ public UpdateMetadataFile() { } public override UpdateMetadataFile Load() => throw new NotImplementedException(); public override UpdateMetadataFile Load(Stream stream) - => base.Load(new GZipInputStream(stream, false)); + => base.Load(stream); public override void Save() => throw new NotImplementedException(); public override void Save(Stream stream) - => base.Save(new GZipOutputStream(stream, false)); + => base.Save(stream); } } diff --git a/UpdateLib/UpdateLib/Logging/ILogWriter.cs b/UpdateLib/UpdateLib/Logging/ILogWriter.cs deleted file mode 100644 index d5a50b2..0000000 --- a/UpdateLib/UpdateLib/Logging/ILogWriter.cs +++ /dev/null @@ -1,28 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using MatthiWare.UpdateLib.Common; - -namespace MatthiWare.UpdateLib.Logging -{ - public interface ILogWriter - { - LoggingLevel LoggingLevel { get; } - - void Log(string text); - } -} diff --git a/UpdateLib/UpdateLib/Logging/ILogger.cs b/UpdateLib/UpdateLib/Logging/ILogger.cs deleted file mode 100644 index 0699618..0000000 --- a/UpdateLib/UpdateLib/Logging/ILogger.cs +++ /dev/null @@ -1,35 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using MatthiWare.UpdateLib.Common; -using System; -using System.Collections.Generic; - -namespace MatthiWare.UpdateLib.Logging -{ - public interface ILogger - { - LoggingLevel LogLevel { get; set; } - ICollection Writers { get; } - void Log(string tag, string msg, LoggingLevel level); - void Debug(string className, string methodName, string msg); - void Info(string className, string methodName, string msg); - void Warn(string className, string methodName, string msg); - void Error(string className, string methodName, string msg); - void Error(string className, string methodName, Exception e); - } -} diff --git a/UpdateLib/UpdateLib/Logging/Logger.cs b/UpdateLib/UpdateLib/Logging/Logger.cs deleted file mode 100644 index d93d950..0000000 --- a/UpdateLib/UpdateLib/Logging/Logger.cs +++ /dev/null @@ -1,68 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.Collections.Generic; -using System.Linq; -using MatthiWare.UpdateLib.Common; - -namespace MatthiWare.UpdateLib.Logging -{ - public class Logger : ILogger - { - public LoggingLevel LogLevel { get; set; } = LoggingLevel.Debug; - - public ICollection Writers { get; } = new List(); - - private const string TEMPLATE = "[{0}][{1}][{2}]: {3}"; - - public void Log(string tag, string msg, LoggingLevel level) - { - if (level < LogLevel) return; - - Writers - .Where(w => w.LoggingLevel >= LogLevel && level >= w.LoggingLevel) - .ToList() - .ForEach(w => w.Log(string.Format(TEMPLATE, DateTime.Now, level, tag, msg))); - } - - public void Debug(string className, string methodName, string msg) - { - Log($"{className}::{methodName}", msg, LoggingLevel.Debug); - } - - public void Info(string className, string methodName, string msg) - { - Log($"{className}::{methodName}", msg, LoggingLevel.Info); - } - - public void Warn(string className, string methodName, string msg) - { - Log($"{className}::{methodName}", msg, LoggingLevel.Warn); - } - - public void Error(string className, string methodName, string msg) - { - Log($"{className}::{methodName}", msg, LoggingLevel.Error); - } - - public void Error(string className, string methodName, Exception e) - { - Error(className, string.IsNullOrEmpty(methodName) ? e.TargetSite.Name : methodName, e.ToString()); - } - } -} diff --git a/UpdateLib/UpdateLib/Logging/Writers/ConsoleLogWriter.cs b/UpdateLib/UpdateLib/Logging/Writers/ConsoleLogWriter.cs deleted file mode 100644 index 102f0d5..0000000 --- a/UpdateLib/UpdateLib/Logging/Writers/ConsoleLogWriter.cs +++ /dev/null @@ -1,32 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using MatthiWare.UpdateLib.Common; -using System.Diagnostics; - -namespace MatthiWare.UpdateLib.Logging.Writers -{ - public class ConsoleLogWriter : ILogWriter - { - public LoggingLevel LoggingLevel { get { return LoggingLevel.Debug; } } - - public void Log(string text) - { - Debug.WriteLine(text); - } - } -} diff --git a/UpdateLib/UpdateLib/Logging/Writers/FileLogWriter.cs b/UpdateLib/UpdateLib/Logging/Writers/FileLogWriter.cs deleted file mode 100644 index c7db11e..0000000 --- a/UpdateLib/UpdateLib/Logging/Writers/FileLogWriter.cs +++ /dev/null @@ -1,72 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.IO; - -using MatthiWare.UpdateLib.Common; -using MatthiWare.UpdateLib.Tasks; -using MatthiWare.UpdateLib.Threading; -using MatthiWare.UpdateLib.Utils; - -namespace MatthiWare.UpdateLib.Logging.Writers -{ - public class FileLogWriter : ILogWriter - { - public LoggingLevel LoggingLevel { get { return LoggingLevel.Debug; } } - - private Lazy m_logFile = new Lazy(GetLogFile); - - private ConcurrentQueue m_logQueue = new ConcurrentQueue(); - private AsyncTask m_logTask; - - public FileLogWriter() - { - m_logTask = AsyncTaskFactory.From(new Action(Log)); - } - - private static FileInfo GetLogFile() - { - FileInfo m_logFile = new FileInfo($@"{IOUtils.LogPath}\log_{DateTime.Now.ToString("yyyyMMdd")}.log"); - - if (!m_logFile.Directory.Exists) - m_logFile.Directory.Create(); - - return m_logFile; - } - - public void Log(string text) - { - m_logQueue.Enqueue(text); - - if (!m_logTask.IsRunning) - m_logTask.Start(); - } - - private void Log() - { - using (StreamWriter writer = new StreamWriter(m_logFile.Value.Open(FileMode.OpenOrCreate, FileAccess.Write))) - while (m_logQueue.TryDequeue(out string text)) - { - writer.BaseStream.Seek(0, SeekOrigin.End); - writer.WriteLine(text); - } - - } - } -} - diff --git a/UpdateLib/UpdateLib/Properties/Resources.Designer.cs b/UpdateLib/UpdateLib/Properties/Resources.Designer.cs deleted file mode 100644 index dc9696e..0000000 --- a/UpdateLib/UpdateLib/Properties/Resources.Designer.cs +++ /dev/null @@ -1,133 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace MatthiWare.UpdateLib.Properties { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // 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")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MatthiWare.UpdateLib.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap status_done { - get { - object obj = ResourceManager.GetObject("status_done", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap status_download { - get { - object obj = ResourceManager.GetObject("status_download", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap status_error { - get { - object obj = ResourceManager.GetObject("status_error", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap status_info { - get { - object obj = ResourceManager.GetObject("status_info", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap status_update { - get { - object obj = ResourceManager.GetObject("status_update", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap status_warning { - get { - object obj = ResourceManager.GetObject("status_warning", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap status_working { - get { - object obj = ResourceManager.GetObject("status_working", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - } -} diff --git a/UpdateLib/UpdateLib/Properties/Resources.resx b/UpdateLib/UpdateLib/Properties/Resources.resx deleted file mode 100644 index acdb544..0000000 --- a/UpdateLib/UpdateLib/Properties/Resources.resx +++ /dev/null @@ -1,142 +0,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 - - - - ..\Resources\status_done.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\status_download.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\status_error.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\status_info.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\status_update.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\status_warning.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\status_working.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - \ No newline at end of file diff --git a/UpdateLib/UpdateLib/Resources/project_16px.png b/UpdateLib/UpdateLib/Resources/project_16px.png deleted file mode 100644 index 25fe53638760c704f3418e4eba29e18e92140f68..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 244 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt^DJzX3_ zECi1R9uz!ez!SXSuz`?|aJkI32EiFCPGtH%*&WB%=Uy77a@+GCY;=hC=^8;`1(tCCNR6^{wxE0GE#x_SCe{z$LSF+fzdfRu-U6Hl+s_Qzw p3#OlR-?k~zzN+O#cVex$S(_g z71~H}%hr{<9anm^oa;XLa-t2`$eB+b>haJx_-sbGEpCBX9PpL2PngktQ|BFhx1wP= z{{s9#3g02uRI}Avn%ziESjpE9 zOq{Xzp2prM8Z-K3OU&ZJPogwJ%64IR7=CR*`!)5JV3pWvodw5Tw>4O?nd9LQpn%`- zQ-ksvPKxh3-3ByYl34F5MCvpTMMWVF@RcBwD5^YAc`FZ9NIDgmHW}?=b_B2yQ5tMf w?<8Q>dJG08aZT_S0xi!f&<2b#$%Fs)3CHe%gtRvDcmMzZ07*qoM6N<$g7{I%`Tzg` diff --git a/UpdateLib/UpdateLib/Resources/status_download.png b/UpdateLib/UpdateLib/Resources/status_download.png deleted file mode 100644 index f94bfe7311824d2896bda232ae8df1b12b49d637..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 493 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61SBU+%rFB|Ea{HEjtmSN`)Ym%P6qN7l0AZa z85r9685nwi_%BdXqXPp&Z6yQ4%Weh+o2Lv6l4pu-TFZfIISV`@iy0XB4ude`@%$Aj zKtah8*NBqf{Irtt#G+J&g2c?c61}|C5(N`I13g1y6XxhD1_nkuPZ!4!3;*OF{z?lX znD;*q;&}8qPFG+Hr-zej0z)kG>hnbpyH-!yy8Ws2`-=0`in9wvv>2HqOio;nxtg<& z)8(ah=Y<2}n}k+`tbeN~AevvbcuF}FP{j)=mP6NPmEGO=W-q@>?{2#l;`3X*4ls!E z_6f`H@ULca`O9wq_)0>2ZI^vnf5MlrrAw~PyDZ0Ywwl@H=IeX6%kPHi*{KH?T-*Jh z%SAQh@Z<9Ry{FEz>eUEae9yeHXu89cZNF>a5c1jX?pf8Ff4U{7}EZIQ8~^vD|-5A$$KntY7fTTK~V((t`|lFSFF7{`yK0V=d$TiSY2XvE5`aId!oK9m-MmRoAuWLY}N5MwluX_%m)ya;H~7!;I9 zG#XvV68B;6$+FCC*{98z=%#Lx857Y)5ap#HZE3wNwKaWw(wJy``6d6HJkNQ4Ip^F< z9yB(t`p;q+xx0Duy>krXVI-1V@*c*G#+>Pzn!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ty2`7b~chmmuhpuK}qXDD@sZtqeQ zex-{gfYvqBeElAAH`Sq=vN?E%*7YS93xM)=A!xS2URQ#h5;Py;T(RV00pN0PI)hUr zpFlpYgnW$H3Ejad&U&*Fki=nRttV(`$Wz3o^CHPp$W!!2fXx@*Vh)(5nR#;f2C*rU zUm;lqAWxB5hW%r%)66UYk~oa4^K5KwLY9IZmwDeoR_23N4d*Hs8sOLH*6i;0z>bl5 zo5FrR1`*^Q3>4j+9>0Gk22eVQ!)SClrSqtP*eMDrhgKB9+l%rOKK1W<0eIZgjDD0Z z^yRmSd49MJ?gmf@f|{+>_uRrvVRruX*%p`ICq@^AfH)|Mxy8HYe7Ie{LGh=835Wvm smcn`T!OPCc#h0s0cB?36?D9p1poj507*qoM6N<$f`snslK=n! diff --git a/UpdateLib/UpdateLib/Resources/status_working.png b/UpdateLib/UpdateLib/Resources/status_working.png deleted file mode 100644 index 6003cee9e14bbbe11ce52b62bffff9b1e695c252..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1600 zcmX|>2{crD9LHy4W{j~-WeLN~B#&Y&Gjq+*@It(V7jwKp*&<7pLX2aZXqhO_6Irsp zSM-jhrp0n9TgsNS7^NZ}DM_f1N%Q`7&+$9w{_f}ge&6r^_dEC8b4Bj1yNC)}3J3&( z=l?xofeRiA1h5j$pbqR{A`E~5fLIp;ULVTi@qnF1 zqk$r@fPhy5E*O9k1nh+wv;crTe;oRA7M$TOSQ{3cK3|CkuUine*VO}opm4ApJet8V zVOT;~G*uo4DWRDRq=_74q=aM0<8e4Dg(-((sUS@`D31IVLn96bv(W_4(b7dxum)r` znm$p^fT3+>Y-PsTKvIH~@RkHJn{I(rN2#JQ%9c!`mZq{2)sUpUfw0{iV(IJYVhM`j zRp(j}2n@m5-p(^||A&%;303YYCqxvLGZl_|hBSshhchGd4n15N72jSiuA7=}FgvLe za_@G!ULW?&?t$1jxiO69sHVYQukM{Qf3a1MKPlun6zSKpCzde(W`3cXs!RtS%n6ti zx$)@tqxZGHBzd?BW!6yea}{;37RM7&pj4tFq#i<>Ps ztRPkfI9XI?Ir-D*gQqZ#sLNymu>{qgHq}-x*U{4R_ER$%BjcgcB$Kxu`i4K)g8Ycb z$nuR?Uu401qPxtmxJagsF7;8Oa6nbUIr;4mgIuJ1(C~`>0jR8jD!acN`=fPpHAMGo z^K4gDz?azkxN@V3+8%zaPV7x$6mG*xV~*EW)v;GiB1qHAg^TsQ_`bfdY^;==+)SgE zoiRR@_x)P6y$v_{;gusd1R_0grZMwEWcz4;M~ddSbgp3GSwP^vNpju0$G5<8FA>XggM=joc!Tajt-dUel$09b{ zm=RiiF4g6{4pMv6TNB=eGA9INcPpPwg39~?OINR@uf6ssO5W}1SknuZtxdS9mb)b_ zekIU%TcEg(YyPLNNQylY)8>pr!eV|wOG_%x3Heo*Qu{52)#=KqQYA(Gz)5Vb%)CvR z{pOBkU|58@S*FjMRJtaY=DcK`J)5iMMww$Ngr>EtRCLHHjhd=wfTehpTX~^z*7GHxX7EIbuxVVDNf##m5%FuBKqG{4GbzCsnlpuJH z3l2_4eIUHM-{xNUspD0eutS25-Zw9ik4~|Txa%eyEwSPGhnfh~pS3SN-$uXw(YN(% z{0slumT+6KykYd8Bew^msvV5Oky$?XZgshM4<^&nzg{)V+sEqZk_rWRy2UHWH623{ zsF`KokJJ78GZ4dFrblM2#sXR)Vx98ARC;Kd#^dv%Tyi$}5~;%6wwRo0yL9qrsO{}x zTk|u8ggCmGubPuSvRD<0$%yQV9?xbs&1V?`YjQ^12lwrP8my`TjRl!3~1 zCSST;. - */ - -using System; -using System.Diagnostics; -using System.IO; -using System.Runtime.InteropServices; -using System.Security.AccessControl; -using System.Security.Principal; - -using MatthiWare.UpdateLib.Common; -using MatthiWare.UpdateLib.Utils; - -using Microsoft.Win32; - -namespace MatthiWare.UpdateLib.Security -{ - public static class PermissionUtil - { - private const string uacRegistryKey = "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System"; - private const string uacRegistryValue = "EnableLUA"; - - private static uint STANDARD_RIGHTS_READ = 0x00020000; - private static uint TOKEN_QUERY = 0x0008; - private static uint TOKEN_READ = (STANDARD_RIGHTS_READ | TOKEN_QUERY); - - [DllImport("advapi32.dll", SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - private static extern bool OpenProcessToken(IntPtr ProcessHandle, UInt32 DesiredAccess, out IntPtr TokenHandle); - - [DllImport("advapi32.dll", SetLastError = true)] - private static extern bool GetTokenInformation(IntPtr TokenHandle, TOKEN_INFORMATION_CLASS TokenInformationClass, IntPtr TokenInformation, uint TokenInformationLength, out uint ReturnLength); - - public static bool IsUacEnabled => m_lazyIsUacEnabled; - - public static bool IsProcessElevated => m_lazyIsElevated; - - private static Lazy m_lazyIsUacEnabled = new Lazy(() => - { - RegistryKey uacKey = Registry.LocalMachine.OpenSubKey(uacRegistryKey, false); - bool result = uacKey.GetValue(uacRegistryValue).Equals(1); - return result; - }); - - private static Lazy m_lazyIsElevated = new Lazy(() => - { - if (IsUacEnabled) - { - IntPtr tokenHandle; - if (!OpenProcessToken(Process.GetCurrentProcess().Handle, TOKEN_READ, out tokenHandle)) - { - Updater.Instance.Logger.Warn(nameof(PermissionUtil), nameof(IsProcessElevated), "Could not get process token. Win32 Error Code: " + Marshal.GetLastWin32Error()); - return false; - } - - TOKEN_ELEVATION_TYPE elevationResult = TOKEN_ELEVATION_TYPE.TokenElevationTypeDefault; - - int elevationResultSize = Marshal.SizeOf((int)elevationResult); - uint returnedSize = 0; - IntPtr elevationTypePtr = Marshal.AllocHGlobal(elevationResultSize); - - bool success = GetTokenInformation(tokenHandle, TOKEN_INFORMATION_CLASS.TokenElevationType, elevationTypePtr, (uint)elevationResultSize, out returnedSize); - if (!success) - { - Updater.Instance.Logger.Warn(nameof(PermissionUtil), nameof(IsProcessElevated), "Unable to determine the current elevation."); - return false; - } - - elevationResult = (TOKEN_ELEVATION_TYPE)Marshal.ReadInt32(elevationTypePtr); - bool isProcessAdmin = elevationResult == TOKEN_ELEVATION_TYPE.TokenElevationTypeFull; - return isProcessAdmin; - } - else - { - WindowsIdentity identity = WindowsIdentity.GetCurrent(); - WindowsPrincipal principal = new WindowsPrincipal(identity); - return principal.IsInRole(WindowsBuiltInRole.Administrator); - } - }); - - - public static bool DirectoryHasPermission(string dir, FileSystemRights accessRights = FileSystemRights.Modify) - { - if (string.IsNullOrEmpty(dir)) - return false; - - try - { - AuthorizationRuleCollection rules = Directory.GetAccessControl(dir).GetAccessRules(true, true, typeof(SecurityIdentifier)); - WindowsIdentity identity = WindowsIdentity.GetCurrent(); - - foreach (FileSystemAccessRule rule in rules) - if (identity.Groups.Contains(rule.IdentityReference) || rule.IdentityReference == identity.User) - if ((accessRights & rule.FileSystemRights) == accessRights && rule.AccessControlType == AccessControlType.Allow) - return true; - } - catch (Exception e) - { - Updater.Instance.Logger.Warn(nameof(PermissionUtil), nameof(DirectoryHasPermission), $"Current user has no access rights to: '{dir}'{Environment.NewLine}{e.ToString()}"); - } - - return false; - } - - public static bool CheckRegPermission(RegistryKeyEntry key) - { - try - { - RegistryHelper.InternalOpenSubKey(key.Parent.DestinationLocation, key.Name); - return true; - } - catch (Exception ex) - { - Updater.Instance.Logger.Error(nameof(PermissionUtil), nameof(CheckRegPermission), ex); - return false; - } - } - } -} diff --git a/UpdateLib/UpdateLib/Tasks/AsyncTask.cs b/UpdateLib/UpdateLib/Tasks/AsyncTask.cs deleted file mode 100644 index 9fae9f0..0000000 --- a/UpdateLib/UpdateLib/Tasks/AsyncTask.cs +++ /dev/null @@ -1,436 +0,0 @@ -/* Copyright - * - * UpdateLib - .Net auto update library - * - * File: AsyncTask.cs v0.5 - * - * Author: Matthias Beerens - * - * Copyright (C) 2016 - MatthiWare - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Diagnostics; -using System.Threading; - -using MatthiWare.UpdateLib.Common; - -namespace MatthiWare.UpdateLib.Tasks -{ - /// - /// Base class for all Tasks that need to be run Async - /// - public abstract class AsyncTask - { - - #region private fields - - protected Exception m_lastException = null; - - private bool m_useSyncContext = true; - private SynchronizationContext m_syncContext; - - internal bool IsChildTask { get; set; } = false; - -#if DEBUG - public Stopwatch m_sw = new Stopwatch(); -#endif - - private readonly Queue m_childTasks = new Queue(); - private ManualResetEvent m_waitHandle = new ManualResetEvent(true); - private readonly object sync = new object(); - - private bool m_running = false; - private bool m_cancelled = false; - private bool m_completed = false; - - #endregion - - #region events - - /// - /// Raises when this is completed. - /// - public event EventHandler TaskCompleted; - /// - /// Raises when the progress changed. - /// - public event EventHandler TaskProgressChanged; - - #endregion - - #region properties - - public Exception LastException - { - get - { - lock (sync) - return m_lastException; - } - } - - /// - /// Gets if there have been any errors in the task. - /// - public bool HasErrors - { - get - { - lock (sync) - return m_lastException != null; - } - } - - public bool IsCompleted - { - get - { - lock (sync) - return m_completed; - } - } - - /// - /// Gets if the current is cancelled. - /// - public bool IsCancelled - { - get - { - lock (sync) - return m_cancelled; - } - } - - - - /// - /// Gets if the current is Running. - /// - public bool IsRunning - { - get - { - lock (sync) - return m_running; - } - } - - #endregion - - #region static methods - - /// - /// Blocks the calling threads and calls on each in . - /// - /// The tasks to await. - public static void WaitAll(IEnumerable tasks) - { - foreach (AsyncTask task in tasks) - task.AwaitTask(); - } - - #endregion - - #region FluentAPI - - /// - /// Enable if we should switch back to the synchronization context to continue our Task completed. - /// - /// default is true. - /// Indicate if we should use the synchronization context - /// The task object for fluent API. - public AsyncTask ConfigureAwait(bool useSyncContext) - { - m_useSyncContext = useSyncContext; - return this; - } - - /// - /// Starts the task - /// - /// Returns the current Task. - public AsyncTask Start() - { - lock (sync) - { - if (m_running) - return this; - - Reset(); - - m_syncContext = SynchronizationContext.Current; - - Action worker = new Action(() => - { - try - { - m_running = true; - DoWork(); - } - catch (Exception ex) - { - m_lastException = ex; - - Updater.Instance.Logger.Error(GetType().Name, null, ex); - } - finally - { - AwaitWorkers(); - - m_running = false; - m_completed = true; - } - }); - -#if DEBUG - m_sw.Start(); -#endif - - worker.BeginInvoke(new AsyncCallback((IAsyncResult r) => - { -#if DEBUG - m_sw.Stop(); - Updater.Instance.Logger.Debug(GetType().Name, nameof(Start), $"Completed in {m_sw.ElapsedMilliseconds}ms"); -#endif - worker.EndInvoke(r); - - OnTaskCompleted(m_lastException, IsCancelled); - - m_waitHandle.Set(); - - }), null); ; - - return this; - } - } - - /// - /// Blocks the calling thread until the complete task is done. - /// DO NOT call this in the worker method use method instead. - /// - public AsyncTask AwaitTask() - { - lock (sync) - { - if (IsChildTask && !m_completed && !m_running) - Reset(); - - if (m_waitHandle != null) - { - m_waitHandle.WaitOne(); - m_waitHandle.Close(); - m_waitHandle = null; - } - - return this; - } - } - - #endregion - - /// - /// Resets the task back to its initial state - /// - private void Reset() - { - m_cancelled = false; - m_running = false; - m_lastException = null; - m_completed = false; - - m_waitHandle.Reset(); - m_childTasks.Clear(); - -#if DEBUG - m_sw.Reset(); -#endif - } - - /// - /// The worker method. - /// - protected abstract void DoWork(); - - /// - /// Cancels the current - /// Check in the worker code to see if the got cancelled. - /// - public virtual void Cancel() - { - lock (sync) - m_cancelled = true; - } - - /// - /// Adds a new inner task - /// - /// - /// Optional arguments for the action - protected void Enqueue(Delegate action, params object[] args) - { - lock (sync) - { - // Don't allow to start another child task when the parent task has been cancelled or contains errors. - if (m_lastException != null || m_cancelled) - return; - - var task = AsyncTaskFactory.From(action, args); - - task.IsChildTask = true; - task.TaskCompleted += (o, e) => - { - if (e.Error != null) - { - m_lastException = e.Error?.InnerException ?? e.Error; - - Updater.Instance.Logger.Error(GetType().Name, null, LastException); - } - }; - - m_childTasks.Enqueue(task); - - WorkerScheduler.Instance.Schedule(task); - } - } - - /// - /// Blocks the calling thread until all the workers are done. - /// - protected void AwaitWorkers() - { - lock (sync) - while (m_childTasks.Count != 0) - m_childTasks.Dequeue().AwaitTask(); - } - - /// - /// Raises the event. - /// - /// The amount of work that is done. - /// The total amount of work. - protected virtual void OnTaskProgressChanged(int done, int total) - => OnTaskProgressChanged((int)((done / (double)total) * 100)); - - /// /// Raises the event. - /// - /// The percentage of work that is done. - protected virtual void OnTaskProgressChanged(int percent) - => OnTaskProgressChanged(new ProgressChangedEventArgs(percent, null)); - - private int m_lastProgressUpdate = -1; - - /// - /// Raises the event. - /// - /// The event. - protected virtual void OnTaskProgressChanged(ProgressChangedEventArgs e) - { - // filter out redundant calls - if (m_lastProgressUpdate == e.ProgressPercentage) - return; - - m_lastProgressUpdate = e.ProgressPercentage; - - if (!m_useSyncContext || m_syncContext == null) - TaskProgressChanged?.Invoke(this, e); - else - m_syncContext.Post(new SendOrPostCallback((o) => TaskProgressChanged?.Invoke(this, e)), null); - - } - - /// - /// Raises the event. - /// - /// If an occured pass the object. - /// Indicates whether the got cancelled. - protected virtual void OnTaskCompleted(Exception e, bool cancelled = false) - => OnTaskCompleted(new AsyncCompletedEventArgs(e, cancelled, null)); - - /// - /// Raises the event. - /// - /// The event. - protected virtual void OnTaskCompleted(AsyncCompletedEventArgs e) - { - if (!m_useSyncContext || m_syncContext == null) - TaskCompleted?.Invoke(this, e); - else - m_syncContext.Post(new SendOrPostCallback((o) => TaskCompleted?.Invoke(this, e)), null); - } - } - - /// - /// Base class for all Tasks that need to be run Async - /// - /// The type of the Result object - public abstract class AsyncTask : AsyncTask - { - /// - /// Gets or sets the result - /// - public virtual ResultType Result { get; protected set; } = default(ResultType); - } - - /// - /// Base class for all Tasks that need to be run Async - /// - /// The task type to be returned from the FluentAPI - /// The type of the Result object - public abstract class AsyncTask : AsyncTask where TaskType : AsyncTask - { - #region FluentAPI - - /// - /// Enable if we should switch back to the synchronization context to continue our Task completed. - /// - /// default is true. - /// Indicate if we should use the synchronization context - /// The task object for fluent API. - public new TaskType ConfigureAwait(bool useSyncContext) - { - return (TaskType)base.ConfigureAwait(useSyncContext); - } - - /// - /// Starts the task - /// - /// Returns the current Task. - public new TaskType Start() - { - return (TaskType)base.Start(); - - } - - /// - /// Blocks the calling thread until the complete task is done. - /// DO NOT call this in the worker method use method instead. - /// - /// - public new TaskType AwaitTask() - { - return (TaskType)base.AwaitTask(); - - } - - #endregion - } - - -} diff --git a/UpdateLib/UpdateLib/Tasks/AsyncTaskFactory.cs b/UpdateLib/UpdateLib/Tasks/AsyncTaskFactory.cs deleted file mode 100644 index c6ccb2b..0000000 --- a/UpdateLib/UpdateLib/Tasks/AsyncTaskFactory.cs +++ /dev/null @@ -1,105 +0,0 @@ -/* Copyright - * - * UpdateLib - .Net auto update library - * - * File: AsyncTaskFactory.cs v0.5 - * - * Author: Matthias Beerens - * - * Copyright (C) 2016 - MatthiWare - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; - -namespace MatthiWare.UpdateLib.Tasks -{ - /// - /// Factory methods for creating and starting a new task - /// - public class AsyncTaskFactory - { - /// - /// Starts a new task - /// - /// The action delegate - /// The parameters to pass to the action - /// The object - public static AsyncTask StartNew(Delegate action, params object[] args) - => new AnonymousTask(action, args).Start(); - - /// - /// Starts a new task - /// - /// The result type - /// The action delegate - /// The parameters to pass to the action - /// The object with result property - public static AsyncTask StartNew(Delegate action, params object[] args) - => new AnonymousTask(action, args).Start(); - - /// - /// Creates a new task - /// - /// The action delegate - /// The parameters to pass to the action - /// The object - public static AsyncTask From(Delegate action, params object[] args) - => new AnonymousTask(action, args); - - /// - /// Creates a new task - /// - /// The result type - /// The action delegate - /// The parameters to pass to the action - /// The object with result property - public static AsyncTask From(Delegate action, params object[] args) - => new AnonymousTask(action, args); - - private class AnonymousTask : AsyncTask - { - private Delegate action; - private object[] args; - - public AnonymousTask(Delegate action, params object[] args) - { - this.action = action; - this.args = args; - } - - protected override void DoWork() - => action.DynamicInvoke(args); - } - - private class AnonymousTask : AsyncTask> - { - private Delegate action; - private object[] args; - - public AnonymousTask(Delegate action, params object[] args) - { - this.action = action; - this.args = args; - } - - protected override void DoWork() - { - Result = (TResult)action.DynamicInvoke(args); - } - } - - } -} diff --git a/UpdateLib/UpdateLib/Tasks/CheckForUpdatedItemsTask.cs b/UpdateLib/UpdateLib/Tasks/CheckForUpdatedItemsTask.cs deleted file mode 100644 index c70dd02..0000000 --- a/UpdateLib/UpdateLib/Tasks/CheckForUpdatedItemsTask.cs +++ /dev/null @@ -1,107 +0,0 @@ -/* Copyright - * - * UpdateLib - .Net auto update library - * - * File: CheckForUpdatedItemsTask.cs v0.5 - * - * Author: Matthias Beerens - * - * Copyright (C) 2016 - MatthiWare - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using MatthiWare.UpdateLib.Common; -using MatthiWare.UpdateLib.Files; -using MatthiWare.UpdateLib.Utils; -using System; -using System.Collections.Generic; -using System.Linq; - -namespace MatthiWare.UpdateLib.Tasks -{ - public class CheckForUpdatedItemsTask : AsyncTask - { - private Files.UpdateInfo m_updateFile; - private HashCacheFile m_cacheFile; - - public CheckForUpdatedItemsTask(Files.UpdateInfo update, HashCacheFile cache) - { - m_updateFile = update ?? throw new ArgumentNullException(nameof(update)); - m_cacheFile = cache ?? throw new ArgumentNullException(nameof(cache)); - } - - protected override void DoWork() - { - foreach (DirectoryEntry dir in m_updateFile.Folders) - Enqueue(new Action(CheckFiles), dir); - - foreach (DirectoryEntry dir in m_updateFile.Registry) - Enqueue(new Action(CheckRegister), dir); - - AwaitWorkers(); - - Result = m_updateFile.FileCount > 0 || m_updateFile.RegistryKeyCount > 0; - } - - private void CheckFiles(DirectoryEntry dir) - { - dir.Items.RemoveAll(fe => - { - string convertedPath = Updater.Instance.Converter.Convert(fe.DestinationLocation); - HashCacheEntry cacheEntry = m_cacheFile.Items.Find(hash => hash.FilePath.Equals(convertedPath)); - - if (cacheEntry == null) - return false; - - return (fe as FileEntry)?.Hash.Equals(cacheEntry.Hash) ?? true; - }); - - IEnumerable dirsToCheck = dir.Directories.Where(d => d.Count > 0); - int left = dirsToCheck.Count(); - - foreach (DirectoryEntry subDir in dir.Directories) - { - if (--left == 0) - CheckFiles(subDir); - else - Enqueue(new Action(CheckFiles), subDir); - } - } - - private void CheckRegister(DirectoryEntry dir) - { - dir.Items.RemoveAll(entry => - { - RegistryKeyEntry key = entry as RegistryKeyEntry; - - if (key == null) - return true; - - return RegistryHelper.IsSame(key); - }); - - IEnumerable dirsToCheck = dir.Directories.Where(d => d.Count > 0); - int left = dirsToCheck.Count(); - - foreach (DirectoryEntry subDir in dir.Directories) - { - if (--left == 0) - CheckRegister(subDir); - else - Enqueue(new Action(CheckRegister), dir); - } - } - } -} diff --git a/UpdateLib/UpdateLib/Tasks/CheckForUpdatesCompletedEventArgs.cs b/UpdateLib/UpdateLib/Tasks/CheckForUpdatesCompletedEventArgs.cs deleted file mode 100644 index 977d103..0000000 --- a/UpdateLib/UpdateLib/Tasks/CheckForUpdatesCompletedEventArgs.cs +++ /dev/null @@ -1,49 +0,0 @@ -/* Copyright - * - * UpdateLib - .Net auto update library - * - * File: CheckForUpdatesCompletedEventArgs.cs v0.5 - * - * Author: Matthias Beerens - * - * Copyright (C) 2016 - MatthiWare - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using MatthiWare.UpdateLib.Common; -using System; -using System.ComponentModel; - -namespace MatthiWare.UpdateLib.Tasks -{ - public class CheckForUpdatesCompletedEventArgs : AsyncCompletedEventArgs - { - public UpdateVersion LatestVersion { get; set; } - public bool UpdateAvailable { get; set; } - - public CheckForUpdatesCompletedEventArgs(CheckForUpdatesTask.CheckForUpdatesResult result, Exception error, bool cancelled, object userState) - : base(error, cancelled, userState) - { - LatestVersion = result.Version; - UpdateAvailable = result.UpdateAvailable; - } - - public CheckForUpdatesCompletedEventArgs(CheckForUpdatesTask.CheckForUpdatesResult result, AsyncCompletedEventArgs e) - : this(result, e.Error, e.Cancelled, e.UserState) - { - - } - } -} diff --git a/UpdateLib/UpdateLib/Tasks/CheckForUpdatesTask.cs b/UpdateLib/UpdateLib/Tasks/CheckForUpdatesTask.cs deleted file mode 100644 index a889391..0000000 --- a/UpdateLib/UpdateLib/Tasks/CheckForUpdatesTask.cs +++ /dev/null @@ -1,134 +0,0 @@ -/* Copyright - * - * UpdateLib - .Net auto update library - * - * File: CheckForUpdatesTask.cs v0.5 - * - * Author: Matthias Beerens - * - * Copyright (C) 2016 - MatthiWare - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.Collections.Generic; -using System.Net; - -using MatthiWare.UpdateLib.Common; -using MatthiWare.UpdateLib.Common.Abstraction; -using MatthiWare.UpdateLib.Common.Exceptions; -using MatthiWare.UpdateLib.Files; -using MatthiWare.UpdateLib.Utils; - -using static MatthiWare.UpdateLib.Tasks.CheckForUpdatesTask; - -namespace MatthiWare.UpdateLib.Tasks -{ - public class CheckForUpdatesTask : AsyncTask - { - public IList Urls { get; set; } - - private WebClient m_wc; - private UpdateVersion m_version; - private Updater m_updater; - - private const string REPLACE_FILE_NAME = "%file%"; - - public CheckForUpdatesTask(IList urls, UpdateVersion currentVersion) - { - Urls = urls ?? throw new ArgumentNullException(nameof(urls)); - m_version = currentVersion ?? throw new ArgumentNullException(nameof(currentVersion)); - if (urls.Count == 0) throw new ArgumentException("Empty url list provided", nameof(urls)); - - m_wc = new WebClient(); - m_updater = Updater.Instance; - } - - protected override void DoWork() - { - Result = new CheckForUpdatesResult(); - - if (!NetworkUtils.HasConnection()) throw new NoInternetException("No internet available"); - - if (IsCancelled) return; - - // load the updatefile from disk - var file = DownloadFile(Urls.Replace(REPLACE_FILE_NAME, UpdateCatalogFile.FILE_NAME), $"{IOUtils.AppDataPath}\\{UpdateCatalogFile.FILE_NAME}"); - - if (IsCancelled) return; - - if (file.Catalog == null || file.Catalog.Count == 0) throw new InvalidUpdateServerException(); - - Result.UpdateInfo = file.GetLatestUpdateForVersion(m_version); - Result.ApplicationName = file.ApplicationName; - Result.DownloadURLs = file.DownloadUrls; - - if (!Result.UpdateAvailable || IsCancelled) return; - - if (Result.DownloadURLs == null || Result.DownloadURLs.Count == 0) throw new InvalidUpdateServerException(); - - var meta = DownloadFile(Result.DownloadURLs.Replace(REPLACE_FILE_NAME, Result.UpdateInfo.FileName), $"{IOUtils.TempPath}\\{UpdateMetadataFile.FILE_NAME}"); - - if (IsCancelled) return; - - var privilegesCheckTask = new CheckRequiredPrivilegesTask(meta).ConfigureAwait(false).Start(); - Result.AdminRightsNeeded = privilegesCheckTask.AwaitTask().Result; - } - - private T DownloadFile(IEnumerable urlsToUse, string localFile) where T : FileBase, new() - { - var enumerator = urlsToUse.GetEnumerator(); - - m_updater.Logger.Info(nameof(CheckForUpdatesTask), nameof(DownloadFile), $"Getting {typeof(T).GetDescription()}"); - - do - { - if (!enumerator.MoveNext() || string.IsNullOrEmpty(enumerator.Current)) - throw new UnableToDownloadUpdateException(); - } while (!DownloadLocalFile(enumerator.Current, localFile)); - - return FileManager.LoadFile(localFile); - } - - private bool DownloadLocalFile(string url, string localFile) - { - m_updater.Logger.Debug(nameof(CheckForUpdatesTask), nameof(DownloadLocalFile), $"Attempting to download file from {url}"); - - try - { - m_wc.DownloadFile(url, localFile); - - m_updater.Logger.Info(nameof(CheckForUpdatesTask), nameof(DownloadLocalFile), $"Succesfully downloaded file from {url}"); - } - catch (Exception e) - { - m_updater.Logger.Error(nameof(CheckForUpdatesTask), nameof(DoWork), e); - return false; - } - - return true; - } - - public class CheckForUpdatesResult - { - public UpdateVersion Version { get { return UpdateInfo.Version; } } - public bool UpdateAvailable => UpdateInfo != null; - public UpdateInfo UpdateInfo { get; set; } - public string ApplicationName { get; set; } - public IList DownloadURLs { get; set; } - public bool AdminRightsNeeded { get; set; } - } - } -} diff --git a/UpdateLib/UpdateLib/Tasks/CheckRequiredPrivilegesTask.cs b/UpdateLib/UpdateLib/Tasks/CheckRequiredPrivilegesTask.cs deleted file mode 100644 index 9f683ef..0000000 --- a/UpdateLib/UpdateLib/Tasks/CheckRequiredPrivilegesTask.cs +++ /dev/null @@ -1,92 +0,0 @@ -/* Copyright - * - * UpdateLib - .Net auto update library - * - * File: CheckRequiredPrivilegesTask.cs v0.5 - * - * Author: Matthias Beerens - * - * Copyright (C) 2016 - MatthiWare - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System.Linq; - -using MatthiWare.UpdateLib.Common; -using MatthiWare.UpdateLib.Files; -using MatthiWare.UpdateLib.Security; -using MatthiWare.UpdateLib.Utils; - -namespace MatthiWare.UpdateLib.Tasks -{ - public class CheckRequiredPrivilegesTask : AsyncTask - { - - public UpdateMetadataFile UpdateFile { get; set; } - - public CheckRequiredPrivilegesTask(UpdateMetadataFile updateFile) - { - UpdateFile = updateFile; - } - - protected override void DoWork() - { - Result = false; - - if (PermissionUtil.IsProcessElevated) - return; - - foreach (DirectoryEntry dir in UpdateFile.Folders) - if (!CheckHasSufficientPermissionsForDirectory(dir)) - { - Result = true; - return; - } - - - foreach (DirectoryEntry dir in UpdateFile.Registry) - if (!CheckHasSufficientPermissionForRegistry(dir)) - { - Result = true; - return; - } - - Updater.Instance.Logger.Info(nameof(CheckRequiredPrivilegesTask), nameof(DoWork), $"Elavation required: {Result}"); - } - - private bool CheckHasSufficientPermissionsForDirectory(DirectoryEntry dir) - { - string localPath = Updater.Instance.Converter.Convert(dir.DestinationLocation); - - if (!PermissionUtil.DirectoryHasPermission(localPath)) - return false; - - foreach (DirectoryEntry subDir in dir.Directories) - if (!CheckHasSufficientPermissionsForDirectory(subDir)) - return false; - - return true; - } - - private bool CheckHasSufficientPermissionForRegistry(DirectoryEntry dir) - { - foreach (RegistryKeyEntry key in dir.GetItems().Select(e => e as RegistryKeyEntry).NotNull()) - if (!PermissionUtil.CheckRegPermission(key)) - return false; - - return true; - } - } -} diff --git a/UpdateLib/UpdateLib/Tasks/CleanUpTask.cs b/UpdateLib/UpdateLib/Tasks/CleanUpTask.cs deleted file mode 100644 index 3487dc2..0000000 --- a/UpdateLib/UpdateLib/Tasks/CleanUpTask.cs +++ /dev/null @@ -1,60 +0,0 @@ -/* Copyright - * - * UpdateLib - .Net auto update library - * - * File: CleanUpTask.cs v0.5 - * - * Author: Matthias Beerens - * - * Copyright (C) 2016 - MatthiWare - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.IO; - -namespace MatthiWare.UpdateLib.Tasks -{ - public class CleanUpTask : AsyncTask - { - public string PathToClean { get; set; } - public string SearchPattern { get; set; } - public bool IncludeSubDirectories { get; set; } - - public CleanUpTask(string pathToCleanUp, string searchPattern = "*.old.tmp", bool includeSubDirs = true) - { - PathToClean = Updater.Instance.Converter.Convert(pathToCleanUp); - SearchPattern = searchPattern; - IncludeSubDirectories = includeSubDirs; - } - protected override void DoWork() - { - DirectoryInfo dir = new DirectoryInfo(PathToClean); - FileInfo[] files = dir.GetFiles(SearchPattern, IncludeSubDirectories ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly); - - foreach (FileInfo file in files) - { - try - { - file.Delete(); - } - catch (Exception e) - { - Updater.Instance.Logger.Error(nameof(CleanUpTask), nameof(DoWork), e); - } - } - } - } -} diff --git a/UpdateLib/UpdateLib/Tasks/DownloadManager.cs b/UpdateLib/UpdateLib/Tasks/DownloadManager.cs deleted file mode 100644 index 9e35f3f..0000000 --- a/UpdateLib/UpdateLib/Tasks/DownloadManager.cs +++ /dev/null @@ -1,118 +0,0 @@ -/* Copyright - * - * UpdateLib - .Net auto update library - * - * File: DownloadManager.cs v0.5 - * - * Author: Matthias Beerens - * - * Copyright (C) 2016 - MatthiWare - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.IO; -using System.Net; - -using MatthiWare.UpdateLib.Common; -using MatthiWare.UpdateLib.Common.Exceptions; -using MatthiWare.UpdateLib.Security; -using MatthiWare.UpdateLib.Utils; - -namespace MatthiWare.UpdateLib.Tasks -{ - public class DownloadManager - { - private UpdateInfo m_updateInfo; - - private IList m_urls; - - public event EventHandler ProgressChanged; - public event EventHandler Completed; - - private int index = 0; - - private Updater updater; - - public DownloadManager(UpdateInfo updateInfo, IList urls) - { - m_urls = urls ?? throw new ArgumentNullException(nameof(urls)); - m_updateInfo = updateInfo ?? throw new ArgumentNullException(nameof(updateInfo)); - - if (m_urls.Count == 0) throw new ArgumentException("No download sources specified ", nameof(urls)); - - updater = Updater.Instance; - } - - public void Download() - { - var urlToUse = GetNextUrl(); - - if (string.IsNullOrEmpty(urlToUse)) - throw new WebException("Unable to download patch from specified download sources"); - - var local = new FileInfo($"{IOUtils.TempPath}\\{m_updateInfo.FileName}"); - - if (!local.Directory.Exists) local.Directory.Create(); - if (local.Exists) local.Delete(); - - var task = new DownloadTask(urlToUse, local.FullName); - - task.TaskProgressChanged += (o, e) => OnProgressChanged(e.ProgressPercentage, 110); - - task.TaskCompleted += (o, e) => - { - if (e.Error != null) - { - updater.Logger.Error(nameof(DownloadManager), nameof(Download), e.Error); - updater.Logger.Info(nameof(DownloadManager), nameof(Download), "Attempting to download patch from next url.."); - - task.Url = GetNextUrl(); - - if (string.IsNullOrEmpty(task.Url)) - OnCompleted(new WebException("Unable to download patch from specified download sources", e.Error)); - else - task.Start(); - - return; - } - - var hash = HashUtil.GetHash(local.FullName); - - if (m_updateInfo.Hash != hash) - { - OnCompleted(new InvalidHashException($"Hash doesn't match was expecting '{m_updateInfo.Hash}' but got '{hash}'")); - return; - } - - OnProgressChanged(100, 100); - OnCompleted(null); - }; - - task.Start(); - } - - protected void OnProgressChanged(int done, int total) - => ProgressChanged?.Invoke(this, new ProgressChangedEventArgs((int)((done / (double)total) * 100), null)); - - protected void OnCompleted(Exception e) - => Completed?.Invoke(this, new AsyncCompletedEventArgs(e, false, null)); - - private string GetNextUrl() - => (index < m_urls.Count) ? m_urls[index++].Replace("%file%", m_updateInfo.FileName) : string.Empty; - } -} diff --git a/UpdateLib/UpdateLib/Tasks/DownloadTask.cs b/UpdateLib/UpdateLib/Tasks/DownloadTask.cs deleted file mode 100644 index 999531d..0000000 --- a/UpdateLib/UpdateLib/Tasks/DownloadTask.cs +++ /dev/null @@ -1,85 +0,0 @@ -/* Copyright - * - * UpdateLib - .Net auto update library - * -/* Copyright - * - * UpdateLib - .Net auto update library - * - * File: DownloadTask.cs v0.5 - * - * Author: Matthias Beerens - * - * Copyright (C) 2016 - MatthiWare - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.IO; -using System.Net; -using System.Threading; - -namespace MatthiWare.UpdateLib.Tasks -{ - public class DownloadTask : AsyncTask - { - private WebClient webClient; - private ManualResetEvent wait; - private Updater m_updater; - - public string Url { get; set; } - public string Local { get; set; } - - public DownloadTask(string url, string local) - { - if (string.IsNullOrEmpty(local)) throw new ArgumentNullException(nameof(local)); - if (string.IsNullOrEmpty(url)) throw new ArgumentNullException(nameof(url)); - - Url = url; - Local = local; - - webClient = new WebClient(); - webClient.DownloadProgressChanged += (o, e) => { OnTaskProgressChanged(e.ProgressPercentage); }; - webClient.DownloadFileCompleted += (o, e) => { wait.Set(); }; - - m_updater = Updater.Instance; - } - - protected override void DoWork() - { - if (IsCancelled) - return; - - wait = new ManualResetEvent(false); - - m_updater.Logger.Debug(nameof(DownloadTask), nameof(DoWork), $"LocalFile => {Local}"); - m_updater.Logger.Debug(nameof(DownloadTask), nameof(DoWork), $"RemoteFile => {Url}"); - - var fi = new FileInfo(Local); - - if (!fi.Directory.Exists) - fi.Directory.Create(); - - var uri = new Uri(Url); - webClient.DownloadFileAsync(uri, Local); - - wait.WaitOne(); - wait.Close(); - wait = null; - - OnTaskProgressChanged(100); - } - } -} diff --git a/UpdateLib/UpdateLib/Tasks/LoadCacheTask.cs b/UpdateLib/UpdateLib/Tasks/LoadCacheTask.cs deleted file mode 100644 index c0b8850..0000000 --- a/UpdateLib/UpdateLib/Tasks/LoadCacheTask.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using System.Linq; -using System.Reflection; - -using MatthiWare.UpdateLib.Common; -using MatthiWare.UpdateLib.Files; -using MatthiWare.UpdateLib.Utils; - -namespace MatthiWare.UpdateLib.Tasks -{ - public class LoadCacheTask : AsyncTask - { - private Lazy m_lazyUpdateVersion = new Lazy(() => - { - ApplicationVersionAttribute attr = Assembly.GetEntryAssembly()?.GetCustomAttributes(typeof(ApplicationVersionAttribute), true).FirstOrDefault() as ApplicationVersionAttribute; - - return attr?.Version ?? "0.0.0"; - }); - - - - protected override void DoWork() - { - try - { - Result = FileManager.LoadFile(); - } - catch (Exception e) - { - Updater.Instance.Logger.Error(nameof(LoadCacheTask), nameof(DoWork), e); - - Result = new CacheFile(); - Result.CurrentVersion = m_lazyUpdateVersion; - Result.Save(); - } - } - } -} diff --git a/UpdateLib/UpdateLib/Tasks/UpdatableTask.cs b/UpdateLib/UpdateLib/Tasks/UpdatableTask.cs deleted file mode 100644 index 4309a12..0000000 --- a/UpdateLib/UpdateLib/Tasks/UpdatableTask.cs +++ /dev/null @@ -1,49 +0,0 @@ -/* Copyright - * - * UpdateLib - .Net auto update library - * - * File: UpdatableTask.cs v0.5 - * - * Author: Matthias Beerens - * - * Copyright (C) 2016 - MatthiWare - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -namespace MatthiWare.UpdateLib.Tasks -{ - public abstract class UpdatableTask : AsyncTask - { - private new void Start() - { - base.Start(); - } - - public void Update() - { - Start(); - } - - public override void Cancel() - { - base.Cancel(); - - Rollback(); - } - - public abstract void Rollback(); - - } -} diff --git a/UpdateLib/UpdateLib/Tasks/UpdateCacheTask.cs b/UpdateLib/UpdateLib/Tasks/UpdateCacheTask.cs deleted file mode 100644 index ce2c51a..0000000 --- a/UpdateLib/UpdateLib/Tasks/UpdateCacheTask.cs +++ /dev/null @@ -1,125 +0,0 @@ -/* Copyright - * - * UpdateLib - .Net auto update library - * - * File: UpdateCacheTask.cs v0.5 - * - * Author: Matthias Beerens - * - * Copyright (C) 2016 - MatthiWare - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using MatthiWare.UpdateLib.Common; -using MatthiWare.UpdateLib.Files; -using MatthiWare.UpdateLib.Utils; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; - -namespace MatthiWare.UpdateLib.Tasks -{ - public class UpdateCacheTask : AsyncTask - { - private Dictionary existingEntries = null; - private IEnumerable files = null; - - protected override void DoWork() - { - existingEntries = new Dictionary(); - - try - { - // first of lets load the file, (file might be corrupt..) - Result = FileManager.LoadFile(); - - Result.Items.ForEach(e => existingEntries.Add(e, false)); - } - catch (Exception e) - { - Updater.Instance.Logger.Error(nameof(UpdateCacheTask), nameof(DoWork), e); - Result = null; - } - - var dir = new DirectoryInfo(Updater.Instance.Converter.Convert("%appdir%")); - files = dir.GetFiles("*", SearchOption.AllDirectories).Where(f => !f.FullName.Contains(".old.tmp")); - - Updater.Instance.Logger.Debug(nameof(UpdateCacheTask), nameof(DoWork), $"found {files.Count()} files to recheck."); - - if (Result == null) // The file doesn't exist yet - { - Result = CreateNewHashCacheFile(); - - return; - } - - CheckFiles(); - - existingEntries.Where(e => e.Value == false).ForEach(e => Result.Items.Remove(e.Key)); - - Result.Save(); - } - - private void CheckFiles() - { - foreach (System.IO.FileInfo f in files) - { - HashCacheEntry entry = base.Result.Items.Find(match => match.FilePath == f.FullName); - if (entry == null) - { - try - { - base.Result.Items.Add(new HashCacheEntry(f.FullName)); - } - catch (Exception ex) // file might no longer exist or is in use - { - Updater.Instance.Logger.Error(nameof(UpdateCacheTask), nameof(DoWork), ex); - } - - continue; - } - - existingEntries[entry] = true; - - // check to see if the file has been modified since last cache check - entry.Recalculate(); - } - } - - private HashCacheFile CreateNewHashCacheFile() - { - Updater.Instance.Logger.Warn(nameof(UpdateCacheTask), nameof(DoWork), $"{nameof(HashCacheFile)} doesn't exist. Creating.."); - - var result = new HashCacheFile(); - - foreach (System.IO.FileInfo f in files) - { - try - { - result.Items.Add(new HashCacheEntry(f.FullName)); - } - catch (Exception ex) // file might no longer exist or is in use - { - Updater.Instance.Logger.Error(nameof(UpdateCacheTask), nameof(DoWork), ex); - } - } - - result.Save(); - - return result; - } - } -} diff --git a/UpdateLib/UpdateLib/Tasks/UpdateRegistryTask.cs b/UpdateLib/UpdateLib/Tasks/UpdateRegistryTask.cs deleted file mode 100644 index 5cbbb87..0000000 --- a/UpdateLib/UpdateLib/Tasks/UpdateRegistryTask.cs +++ /dev/null @@ -1,138 +0,0 @@ -/* Copyright - * - * UpdateLib - .Net auto update library - * - * File: UpdateRegistryTask.cs v0.5 - * - * Author: Matthias Beerens - * - * Copyright (C) 2016 - MatthiWare - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using MatthiWare.UpdateLib.Common; -using MatthiWare.UpdateLib.Utils; -using Microsoft.Win32; -using System; -using System.Collections.Generic; -using System.Linq; - -namespace MatthiWare.UpdateLib.Tasks -{ - public class UpdateRegistryTask : UpdatableTask - { - - public IEnumerable Keys { get; set; } - - private List cachedUpdates = new List(); - - public UpdateRegistryTask(IEnumerable keys) - { - Keys = keys; - } - - protected override void DoWork() - { - cachedUpdates.Clear(); - - int total = Keys.Count(); - int count = 0; - - foreach (RegistryKeyEntry key in Keys) - { - UpdateKey(key); - - OnTaskProgressChanged(++count, total); - } - } - - private void UpdateKey(RegistryKeyEntry key) - { - string path = key.Parent.DestinationLocation; - - RollbackData rollback = new RollbackData(key); - - cachedUpdates.Add(rollback); - - RegistryHelper.Update(key, rollback); - - Updater.Instance.Logger.Info( - nameof(UpdateRegistryTask), - nameof(UpdateKey), - $"Succesfully updated {key.DestinationLocation}"); - } - - public override void Rollback() - { - int total = cachedUpdates.Count; - int count = 0; - - foreach (RollbackData data in cachedUpdates) - { - RollbackFailSafe(data); - - OnTaskProgressChanged(++count, total); - } - } - - private void RollbackFailSafe(RollbackData data) - { - try - { - RegistryKey key = RegistryHelper.GetOrMakeKey(data.path); - - if (!data.existed) - { - key.DeleteValue(data.key); - - Updater.Instance.Logger.Warn( - nameof(UpdateRegistryTask), - nameof(Rollback), - $"Deleted -> {data.path}\\{data.key}"); - - return; - } - - key.SetValue(data.key, data.cachedValue, data.type); - - Updater.Instance.Logger.Warn( - nameof(UpdateRegistryTask), - nameof(Rollback), - $"Rolled back -> {data.path}\\{data.key}"); - } - catch (Exception e) - { - Updater.Instance.Logger.Error(nameof(UpdateRegistryTask), nameof(Rollback), e); - } - } - - public struct RollbackData - { - public bool existed; - public string path; - public string key; - public object cachedValue; - public RegistryValueKind type; - - public RollbackData(RegistryKeyEntry l_key) - { - key = l_key.Name; - path = l_key.Parent.DestinationLocation; - existed = RegistryHelper.Exists(l_key, out cachedValue); - type = RegistryValueKind.Unknown; - } - } - } -} diff --git a/UpdateLib/UpdateLib/UI/Components/ChangelogPage.Designer.cs b/UpdateLib/UpdateLib/UI/Components/ChangelogPage.Designer.cs deleted file mode 100644 index 55dbc85..0000000 --- a/UpdateLib/UpdateLib/UI/Components/ChangelogPage.Designer.cs +++ /dev/null @@ -1,83 +0,0 @@ -namespace MatthiWare.UpdateLib.UI.Components -{ - partial class ChangelogPage - { - /// - /// 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 Component Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ChangelogPage)); - this.txtTitle = new System.Windows.Forms.Label(); - this.richTextBox1 = new System.Windows.Forms.RichTextBox(); - this.SuspendLayout(); - // - // txtTitle - // - this.txtTitle.AutoSize = true; - this.txtTitle.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.txtTitle.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(43)))), ((int)(((byte)(129)))), ((int)(((byte)(181))))); - this.txtTitle.Location = new System.Drawing.Point(12, 12); - this.txtTitle.Name = "txtTitle"; - this.txtTitle.Size = new System.Drawing.Size(224, 25); - this.txtTitle.TabIndex = 1; - this.txtTitle.Text = "Changelog / Patchnotes"; - // - // richTextBox1 - // - this.richTextBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.richTextBox1.BackColor = System.Drawing.SystemColors.Window; - this.richTextBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.richTextBox1.Cursor = System.Windows.Forms.Cursors.IBeam; - this.richTextBox1.Location = new System.Drawing.Point(14, 52); - this.richTextBox1.Name = "richTextBox1"; - this.richTextBox1.ReadOnly = true; - this.richTextBox1.Size = new System.Drawing.Size(612, 359); - this.richTextBox1.TabIndex = 2; - this.richTextBox1.Text = resources.GetString("richTextBox1.Text"); - // - // ChangelogPage - // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.SystemColors.Window; - this.Controls.Add(this.richTextBox1); - this.Controls.Add(this.txtTitle); - this.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.Name = "ChangelogPage"; - this.Size = new System.Drawing.Size(637, 425); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.Label txtTitle; - private System.Windows.Forms.RichTextBox richTextBox1; - } -} diff --git a/UpdateLib/UpdateLib/UI/Components/ChangelogPage.cs b/UpdateLib/UpdateLib/UI/Components/ChangelogPage.cs deleted file mode 100644 index cad8560..0000000 --- a/UpdateLib/UpdateLib/UI/Components/ChangelogPage.cs +++ /dev/null @@ -1,127 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.Windows.Forms; - -namespace MatthiWare.UpdateLib.UI.Components -{ - public partial class ChangelogPage : UserControl, IWizardPage - { - public ChangelogPage(UpdaterForm parent) - { - InitializeComponent(); - - _updaterForm = parent; - } - - public UserControl Conent - { - get - { - return this; - } - } - - - - public bool NeedsCancel - { - get - { - return false; - } - } - - public bool NeedsExecution - { - get - { - return false; - } - } - - public string Title - { - get - { - return txtTitle.Text; - } - } - - private UpdaterForm _updaterForm; - public UpdaterForm UpdaterForm - { - get - { - return _updaterForm; - } - } - - private bool _isbusy; - public bool IsBusy - { - get - { - return _isbusy; - } - - set - { - _isbusy = value; - } - } - - public bool IsDone - {get;set; - } - - public bool HasErrors - { - get; set; - } - - public void PageEntered() - { - IsDone = true; - } - - public event EventHandler PageUpdate; - - public bool NeedsRollBack { get { return false; } } - - public void UpdateState() - { - - } - - public void Cancel() - { - IsDone = true; - } - - public void Execute() - { - throw new NotImplementedException(); - } - - public void Rollback() - { - - } - } -} diff --git a/UpdateLib/UpdateLib/UI/Components/ChangelogPage.resx b/UpdateLib/UpdateLib/UI/Components/ChangelogPage.resx deleted file mode 100644 index 35f5067..0000000 --- a/UpdateLib/UpdateLib/UI/Components/ChangelogPage.resx +++ /dev/null @@ -1,235 +0,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 - - - # Change Log -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](http://keepachangelog.com/) -and this project adheres to [Semantic Versioning](http://semver.org/). - -## [Unreleased] -### Added -- zh-CN and zh-TW translations from @tianshuo. -- de translation from @mpbzh. -- it-IT translation from @roalz. -- sv translation from @magol. -- tr-TR translation from @karalamalar. -- fr translation from @zapashcanon. - -### Changed -- Start versioning based on the current English version at 0.3.0 to help -translation authors keep things up-to-date. -- Fix typos in zh-CN translation. -- Fix typos in pt-BR translation. - -## [0.3.0] - 2015-12-03 -### Added -- RU translation from @aishek. -- pt-BR translation from @tallesl. -- es-ES translation from @ZeliosAriex. - -## [0.2.0] - 2015-10-06 -### Changed -- Remove exclusionary mentions of "open source" since this project can benefit -both "open" and "closed" source projects equally. - -## [0.1.0] - 2015-10-06 -### Added -- Answer "Should you ever rewrite a change log?". - -### Changed -- Improve argument against commit logs. -- Start following [SemVer](http://semver.org) properly. - -## [0.0.8] - 2015-02-17 -### Changed -- Update year to match in every README example. -- Reluctantly stop making fun of Brits only, since most of the world - writes dates in a strange way. - -### Fixed -- Fix typos in recent README changes. -- Update outdated unreleased diff link. - -## [0.0.7] - 2015-02-16 -### Added -- Link, and make it obvious that date format is ISO 8601. - -### Changed -- Clarified the section on "Is there a standard change log format?". - -### Fixed -- Fix Markdown links to tag comparison URL with footnote-style links. - -## [0.0.6] - 2014-12-12 -### Added -- README section on "yanked" releases. - -## [0.0.5] - 2014-08-09 -### Added -- Markdown links to version tags on release headings. -- Unreleased section to gather unreleased changes and encourage note -keeping prior to releases. - -## [0.0.4] - 2014-08-09 -### Added -- Better explanation of the difference between the file ("CHANGELOG") -and its function "the change log". - -### Changed -- Refer to a "change log" instead of a "CHANGELOG" throughout the site -to differentiate between the file and the purpose of the file - the -logging of changes. - -### Removed -- Remove empty sections from CHANGELOG, they occupy too much space and -create too much noise in the file. People will have to assume that the -missing sections were intentionally left out because they contained no -notable changes. - -## [0.0.3] - 2014-08-09 -### Added -- "Why should I care?" section mentioning The Changelog podcast. - -## [0.0.2] - 2014-07-10 -### Added -- Explanation of the recommended reverse chronological release ordering. - -## 0.0.1 - 2014-05-31 -### Added -- This CHANGELOG file to hopefully serve as an evolving example of a standardized open source project CHANGELOG. -- CNAME file to enable GitHub Pages custom domain -- README now contains answers to common questions about CHANGELOGs -- Good examples and basic guidelines, including proper date formatting. -- Counter-examples: "What makes unicorns cry?" - -[Unreleased]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.3.0...HEAD -[0.3.0]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.2.0...v0.3.0 -[0.2.0]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.1.0...v0.2.0 -[0.1.0]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.0.8...v0.1.0 -[0.0.8]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.0.7...v0.0.8 -[0.0.7]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.0.6...v0.0.7 -[0.0.6]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.0.5...v0.0.6 -[0.0.5]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.0.4...v0.0.5 -[0.0.4]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.0.3...v0.0.4 -[0.0.3]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.0.2...v0.0.3 -[0.0.2]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.0.1...v0.0.2 - - \ No newline at end of file diff --git a/UpdateLib/UpdateLib/UI/Components/FinishPage.Designer.cs b/UpdateLib/UpdateLib/UI/Components/FinishPage.Designer.cs deleted file mode 100644 index e58fabf..0000000 --- a/UpdateLib/UpdateLib/UI/Components/FinishPage.Designer.cs +++ /dev/null @@ -1,97 +0,0 @@ -namespace MatthiWare.UpdateLib.UI.Components -{ - partial class FinishPage - { - /// - /// 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 Component Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FinishPage)); - this.txtFinished = new System.Windows.Forms.Label(); - this.txtDescription = new System.Windows.Forms.Label(); - this.cbRestart = new System.Windows.Forms.CheckBox(); - this.SuspendLayout(); - // - // txtFinished - // - this.txtFinished.AutoSize = true; - this.txtFinished.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.txtFinished.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(43)))), ((int)(((byte)(129)))), ((int)(((byte)(181))))); - this.txtFinished.Location = new System.Drawing.Point(12, 12); - this.txtFinished.Name = "txtFinished"; - this.txtFinished.Size = new System.Drawing.Size(85, 25); - this.txtFinished.TabIndex = 0; - this.txtFinished.Text = "Finished"; - // - // txtDescription - // - this.txtDescription.AutoSize = true; - this.txtDescription.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.txtDescription.Location = new System.Drawing.Point(14, 52); - this.txtDescription.Name = "txtDescription"; - this.txtDescription.Size = new System.Drawing.Size(433, 136); - this.txtDescription.TabIndex = 1; - this.txtDescription.Text = resources.GetString("txtDescription.Text"); - // - // cbRestart - // - this.cbRestart.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.cbRestart.AutoSize = true; - this.cbRestart.Checked = true; - this.cbRestart.CheckState = System.Windows.Forms.CheckState.Checked; - this.cbRestart.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.cbRestart.Location = new System.Drawing.Point(17, 202); - this.cbRestart.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.cbRestart.Name = "cbRestart"; - this.cbRestart.Size = new System.Drawing.Size(136, 21); - this.cbRestart.TabIndex = 2; - this.cbRestart.Text = "Restart application"; - this.cbRestart.UseVisualStyleBackColor = true; - this.cbRestart.CheckedChanged += new System.EventHandler(this.cbRestart_CheckedChanged); - // - // FinishPage - // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.SystemColors.Window; - this.Controls.Add(this.cbRestart); - this.Controls.Add(this.txtDescription); - this.Controls.Add(this.txtFinished); - this.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.Name = "FinishPage"; - this.Size = new System.Drawing.Size(701, 245); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.Label txtFinished; - private System.Windows.Forms.Label txtDescription; - private System.Windows.Forms.CheckBox cbRestart; - } -} diff --git a/UpdateLib/UpdateLib/UI/Components/FinishPage.cs b/UpdateLib/UpdateLib/UI/Components/FinishPage.cs deleted file mode 100644 index e2512b5..0000000 --- a/UpdateLib/UpdateLib/UI/Components/FinishPage.cs +++ /dev/null @@ -1,170 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.Windows.Forms; - -namespace MatthiWare.UpdateLib.UI.Components -{ - public partial class FinishPage : UserControl, IWizardPage - { - - private UpdaterForm _updaterForm; - - public FinishPage(UpdaterForm parent) - { - InitializeComponent(); - - _updaterForm = parent; - - txtDescription.Text = txtDescription.Text.Replace("%AppName%", parent.ApplicationName); - txtDescription.Text = txtDescription.Text.Replace("%version%", parent.UpdateInfo.Version); - } - - public void UpdateState() - { - var version = _updaterForm.UpdateInfo.Version; - string appName = _updaterForm.ApplicationName; - - if (_updaterForm.HasHadErrors) - { - cbRestart.Checked = false; - cbRestart.Enabled = false; - - txtDescription.Text = $"{appName} was unable to update to version {version}!\n\n" + - "Check the log files for more information!\n\n" + - "Press Finish to close this wizard."; - - txtFinished.Text = "Finished (with errors)"; - } - else if (_updaterForm.UserCancelled) - { - cbRestart.Checked = false; - cbRestart.Enabled = false; - - txtDescription.Text = $"{appName} was unable to update to version {version}!\n\n" + - "Update process cancelled by the user.\n\n" + - "Press Finish to close this wizard."; - - txtFinished.Text = "Finished (cancelled)"; - } - } - - public UserControl Conent - { - get - { - return this; - } - } - - private bool _isbusy; - public bool IsBusy - { - get - { - return _isbusy; - } - - set - { - _isbusy = value; - } - } - - private bool _isdone; - public bool IsDone - { - get - { - return _isdone; - } - - set - { - _isdone = value; - } - } - - public void PageEntered() - { - IsDone = true; - } - - public bool NeedsCancel - { - get - { - return false; - } - } - - public bool NeedsExecution - { - get - { - return false; - } - } - - public string Title - { - get - { - return txtFinished.Text; - } - } - - - public UpdaterForm UpdaterForm - { - get - { - return _updaterForm; - } - } - - public bool NeedsRollBack { get { return false; } } - - public bool HasErrors - { - get; set; - } - - public event EventHandler PageUpdate; - - public void Cancel() - { - IsDone = true; - } - - public void Execute() - { - throw new NotImplementedException(); - } - - private void cbRestart_CheckedChanged(object sender, EventArgs e) - { - UpdaterForm.NeedsRestart = cbRestart.Checked; - } - - public void Rollback() - { - - } - } -} diff --git a/UpdateLib/UpdateLib/UI/Components/FinishPage.resx b/UpdateLib/UpdateLib/UI/Components/FinishPage.resx deleted file mode 100644 index 166646a..0000000 --- a/UpdateLib/UpdateLib/UI/Components/FinishPage.resx +++ /dev/null @@ -1,131 +0,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 - - - %AppName% has been succesfully updated to version %version%. - -%AppName% needs to restart for the changes to take effect. - -If you do not want this you can uncheck the Restart application checkbox. - -Press Finish to close this wizard. - - - - \ No newline at end of file diff --git a/UpdateLib/UpdateLib/UI/Components/IntroPage.Designer.cs b/UpdateLib/UpdateLib/UI/Components/IntroPage.Designer.cs deleted file mode 100644 index 8c406d0..0000000 --- a/UpdateLib/UpdateLib/UI/Components/IntroPage.Designer.cs +++ /dev/null @@ -1,77 +0,0 @@ -namespace MatthiWare.UpdateLib.UI.Components -{ - partial class IntroPage - { - /// - /// 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 Component Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(IntroPage)); - this.txtWelcome = new System.Windows.Forms.Label(); - this.txtDesc = new System.Windows.Forms.Label(); - this.SuspendLayout(); - // - // txtWelcome - // - this.txtWelcome.AutoSize = true; - this.txtWelcome.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.txtWelcome.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(43)))), ((int)(((byte)(129)))), ((int)(((byte)(181))))); - this.txtWelcome.Location = new System.Drawing.Point(12, 12); - this.txtWelcome.Name = "txtWelcome"; - this.txtWelcome.Size = new System.Drawing.Size(360, 25); - this.txtWelcome.TabIndex = 0; - this.txtWelcome.Text = "Welcome to the %AppName% Updater!"; - // - // txtDesc - // - this.txtDesc.AutoSize = true; - this.txtDesc.Location = new System.Drawing.Point(14, 52); - this.txtDesc.Name = "txtDesc"; - this.txtDesc.Size = new System.Drawing.Size(425, 119); - this.txtDesc.TabIndex = 1; - this.txtDesc.Text = resources.GetString("txtDesc.Text"); - // - // IntroPage - // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.SystemColors.Window; - this.Controls.Add(this.txtDesc); - this.Controls.Add(this.txtWelcome); - this.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.Name = "IntroPage"; - this.Size = new System.Drawing.Size(515, 232); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.Label txtWelcome; - private System.Windows.Forms.Label txtDesc; - } -} diff --git a/UpdateLib/UpdateLib/UI/Components/IntroPage.cs b/UpdateLib/UpdateLib/UI/Components/IntroPage.cs deleted file mode 100644 index ad000c8..0000000 --- a/UpdateLib/UpdateLib/UI/Components/IntroPage.cs +++ /dev/null @@ -1,138 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.Windows.Forms; - -namespace MatthiWare.UpdateLib.UI.Components -{ - public partial class IntroPage : UserControl, IWizardPage - { - public IntroPage(UpdaterForm parent) - { - InitializeComponent(); - - _updateForm = parent; - - txtDesc.Text = txtDesc.Text.Replace("%AppName%", parent.ApplicationName); - txtWelcome.Text = txtWelcome.Text.Replace("%AppName%", parent.ApplicationName); - } - - public UserControl Conent - { - get - { - return this; - } - } - - private bool _isbusy; - public bool IsBusy - { - get - { - return _isbusy; - } - - set - { - _isbusy = value; - } - } - - private bool _isdone; - public bool IsDone - { - get - { - return _isdone; - } - - set - { - _isdone = value; - } - } - - public void PageEntered() - { - IsDone = true; - } - - public bool NeedsCancel - { - get - { - return false; - } - } - - public bool NeedsExecution - { - get - { - return false; - } - } - - public string Title - { - get - { - return txtWelcome.Text; - } - } - - private UpdaterForm _updateForm; - public UpdaterForm UpdaterForm - { - get - { - return _updateForm; - } - } - - public bool HasErrors - { - get; set; - } - - public event EventHandler PageUpdate; - - public void UpdateState() - { - - } - - public bool NeedsRollBack { get { return false; } } - - public void Cancel() - { - IsDone = true; - } - - public void Execute() - { - throw new NotImplementedException(); - } - - public void Rollback() - { - - } - } -} diff --git a/UpdateLib/UpdateLib/UI/Components/IntroPage.resx b/UpdateLib/UpdateLib/UI/Components/IntroPage.resx deleted file mode 100644 index 94af550..0000000 --- a/UpdateLib/UpdateLib/UI/Components/IntroPage.resx +++ /dev/null @@ -1,129 +0,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 - - - This wizard will guide you throug the update process of %AppName%. - -To return to the previous screen, click Previous. - -To cancel the update process at any time, click Cancel. - -Click Next to continue. - - \ No newline at end of file diff --git a/UpdateLib/UpdateLib/UI/Components/RollbackPage.Designer.cs b/UpdateLib/UpdateLib/UI/Components/RollbackPage.Designer.cs deleted file mode 100644 index 2164900..0000000 --- a/UpdateLib/UpdateLib/UI/Components/RollbackPage.Designer.cs +++ /dev/null @@ -1,142 +0,0 @@ -namespace MatthiWare.UpdateLib.UI.Components -{ - partial class RollbackPage - { - /// - /// 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 Component Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - System.Windows.Forms.ListViewGroup listViewGroup1 = new System.Windows.Forms.ListViewGroup("Installed version", System.Windows.Forms.HorizontalAlignment.Left); - System.Windows.Forms.ListViewGroup listViewGroup2 = new System.Windows.Forms.ListViewGroup("Local versions", System.Windows.Forms.HorizontalAlignment.Left); - System.Windows.Forms.ListViewGroup listViewGroup3 = new System.Windows.Forms.ListViewGroup("Available versions", System.Windows.Forms.HorizontalAlignment.Left); - this.lblHeader = new System.Windows.Forms.Label(); - this.ilIcons = new System.Windows.Forms.ImageList(this.components); - this.lvItems = new System.Windows.Forms.ListView(); - this.clmnVersion = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.clmnStatus = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.clmnProgress = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.clmnDescription = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.clmnPath = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.SuspendLayout(); - // - // lblHeader - // - this.lblHeader.AutoSize = true; - this.lblHeader.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblHeader.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(43)))), ((int)(((byte)(129)))), ((int)(((byte)(181))))); - this.lblHeader.Location = new System.Drawing.Point(17, 18); - this.lblHeader.Name = "lblHeader"; - this.lblHeader.Size = new System.Drawing.Size(359, 25); - this.lblHeader.TabIndex = 3; - this.lblHeader.Text = "Rollback/repair manager %AppName%"; - // - // ilIcons - // - this.ilIcons.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit; - this.ilIcons.ImageSize = new System.Drawing.Size(16, 16); - this.ilIcons.TransparentColor = System.Drawing.Color.Transparent; - // - // lvItems - // - this.lvItems.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.lvItems.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.clmnVersion, - this.clmnStatus, - this.clmnProgress, - this.clmnDescription, - this.clmnPath}); - this.lvItems.FullRowSelect = true; - listViewGroup1.Header = "Installed version"; - listViewGroup1.Name = "lvgInstalled"; - listViewGroup2.Header = "Local versions"; - listViewGroup2.Name = "lvgLocal"; - listViewGroup3.Header = "Available versions"; - listViewGroup3.Name = "lvgAvailable"; - this.lvItems.Groups.AddRange(new System.Windows.Forms.ListViewGroup[] { - listViewGroup1, - listViewGroup2, - listViewGroup3}); - this.lvItems.Location = new System.Drawing.Point(17, 46); - this.lvItems.Name = "lvItems"; - this.lvItems.Size = new System.Drawing.Size(505, 282); - this.lvItems.TabIndex = 4; - this.lvItems.UseCompatibleStateImageBehavior = false; - this.lvItems.View = System.Windows.Forms.View.Details; - // - // clmnVersion - // - this.clmnVersion.Text = "Version"; - this.clmnVersion.Width = 125; - // - // clmnStatus - // - this.clmnStatus.Text = "Status"; - this.clmnStatus.Width = 131; - // - // clmnProgress - // - this.clmnProgress.Text = "Progress"; - this.clmnProgress.Width = 85; - // - // clmnDescription - // - this.clmnDescription.Text = "Description"; - this.clmnDescription.Width = 100; - // - // clmnPath - // - this.clmnPath.Text = "Path"; - this.clmnPath.Width = 350; - // - // RollbackPage - // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.SystemColors.Window; - this.Controls.Add(this.lvItems); - this.Controls.Add(this.lblHeader); - this.Font = new System.Drawing.Font("Segoe UI", 9.75F); - this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.Name = "RollbackPage"; - this.Size = new System.Drawing.Size(538, 341); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - private System.Windows.Forms.Label lblHeader; - private System.Windows.Forms.ImageList ilIcons; - private System.Windows.Forms.ListView lvItems; - private System.Windows.Forms.ColumnHeader clmnVersion; - private System.Windows.Forms.ColumnHeader clmnStatus; - private System.Windows.Forms.ColumnHeader clmnProgress; - private System.Windows.Forms.ColumnHeader clmnDescription; - private System.Windows.Forms.ColumnHeader clmnPath; - } -} diff --git a/UpdateLib/UpdateLib/UI/Components/RollbackPage.cs b/UpdateLib/UpdateLib/UI/Components/RollbackPage.cs deleted file mode 100644 index b088ae3..0000000 --- a/UpdateLib/UpdateLib/UI/Components/RollbackPage.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Windows.Forms; - -namespace MatthiWare.UpdateLib.UI.Components -{ - public partial class RollbackPage : UserControl - { - public RollbackPage() - { - InitializeComponent(); - } - } -} diff --git a/UpdateLib/UpdateLib/UI/Components/RollbackPage.resx b/UpdateLib/UpdateLib/UI/Components/RollbackPage.resx deleted file mode 100644 index be67fa0..0000000 --- a/UpdateLib/UpdateLib/UI/Components/RollbackPage.resx +++ /dev/null @@ -1,123 +0,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 - - - 17, 17 - - \ No newline at end of file diff --git a/UpdateLib/UpdateLib/UI/Components/UpdatePage.Designer.cs b/UpdateLib/UpdateLib/UI/Components/UpdatePage.Designer.cs deleted file mode 100644 index 8aec832..0000000 --- a/UpdateLib/UpdateLib/UI/Components/UpdatePage.Designer.cs +++ /dev/null @@ -1,142 +0,0 @@ -namespace MatthiWare.UpdateLib.UI.Components -{ - partial class UpdatePage - { - /// - /// 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 Component Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - this.lblHeader = new System.Windows.Forms.Label(); - this.lblSubheader = new System.Windows.Forms.Label(); - this.lvItems = new System.Windows.Forms.ListView(); - this.clmnName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.clmnStatus = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.clmnProgress = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.clmnDescription = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.clmnPath = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.ilIcons = new System.Windows.Forms.ImageList(this.components); - this.SuspendLayout(); - // - // lblHeader - // - this.lblHeader.AutoSize = true; - this.lblHeader.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblHeader.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(43)))), ((int)(((byte)(129)))), ((int)(((byte)(181))))); - this.lblHeader.Location = new System.Drawing.Point(14, 14); - this.lblHeader.Name = "lblHeader"; - this.lblHeader.Size = new System.Drawing.Size(140, 25); - this.lblHeader.TabIndex = 0; - this.lblHeader.Text = "Apply updates"; - // - // lblSubheader - // - this.lblSubheader.AutoSize = true; - this.lblSubheader.Location = new System.Drawing.Point(14, 52); - this.lblSubheader.Name = "lblSubheader"; - this.lblSubheader.Size = new System.Drawing.Size(252, 17); - this.lblSubheader.TabIndex = 1; - this.lblSubheader.Text = "Press Update to start the update process."; - // - // lvItems - // - this.lvItems.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.lvItems.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.clmnName, - this.clmnStatus, - this.clmnProgress, - this.clmnDescription, - this.clmnPath}); - this.lvItems.FullRowSelect = true; - this.lvItems.Location = new System.Drawing.Point(17, 72); - this.lvItems.Name = "lvItems"; - this.lvItems.Size = new System.Drawing.Size(505, 255); - this.lvItems.TabIndex = 2; - this.lvItems.UseCompatibleStateImageBehavior = false; - this.lvItems.View = System.Windows.Forms.View.Details; - // - // clmnName - // - this.clmnName.Text = "File name"; - this.clmnName.Width = 125; - // - // clmnStatus - // - this.clmnStatus.Text = "Status"; - this.clmnStatus.Width = 131; - // - // clmnProgress - // - this.clmnProgress.Text = "Progress"; - this.clmnProgress.Width = 85; - // - // clmnDescription - // - this.clmnDescription.Text = "Description"; - this.clmnDescription.Width = 100; - // - // clmnPath - // - this.clmnPath.Text = "Path"; - this.clmnPath.Width = 350; - // - // ilIcons - // - this.ilIcons.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit; - this.ilIcons.ImageSize = new System.Drawing.Size(16, 16); - this.ilIcons.TransparentColor = System.Drawing.Color.Transparent; - // - // UpdatePage - // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.SystemColors.Window; - this.Controls.Add(this.lvItems); - this.Controls.Add(this.lblSubheader); - this.Controls.Add(this.lblHeader); - this.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.Name = "UpdatePage"; - this.Size = new System.Drawing.Size(538, 341); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.Label lblHeader; - private System.Windows.Forms.Label lblSubheader; - private System.Windows.Forms.ListView lvItems; - private System.Windows.Forms.ImageList ilIcons; - private System.Windows.Forms.ColumnHeader clmnName; - private System.Windows.Forms.ColumnHeader clmnStatus; - private System.Windows.Forms.ColumnHeader clmnProgress; - private System.Windows.Forms.ColumnHeader clmnPath; - private System.Windows.Forms.ColumnHeader clmnDescription; - } -} diff --git a/UpdateLib/UpdateLib/UI/Components/UpdatePage.cs b/UpdateLib/UpdateLib/UI/Components/UpdatePage.cs deleted file mode 100644 index 1834367..0000000 --- a/UpdateLib/UpdateLib/UI/Components/UpdatePage.cs +++ /dev/null @@ -1,374 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Windows.Forms; - -using MatthiWare.UpdateLib.Common; -using MatthiWare.UpdateLib.Files; -using MatthiWare.UpdateLib.Properties; -using MatthiWare.UpdateLib.Tasks; -using MatthiWare.UpdateLib.Threading; -using MatthiWare.UpdateLib.Utils; - -namespace MatthiWare.UpdateLib.UI.Components -{ - public partial class UpdatePage : UserControl, IWizardPage - { - - public UpdateMetadataFile UpdateFile { get; set; } - - public event EventHandler PageUpdate; - - private AtomicInteger amountToDownload = new AtomicInteger(); - private Dictionary m_items = new Dictionary(); - private bool hasRegTask = false; - - public UpdatePage(UpdaterForm parent) - { - InitializeComponent(); - - _updaterForm = parent; - - UpdateFile = parent.UpdateInfo; - - ImageList ilItems = MakeImageList(); - lvItems.SmallImageList = ilItems; - - - FillListView(); - - - } - - private ImageList MakeImageList() - { - ImageList imgList = new ImageList(); - - imgList.Images.Add("status_download", Resources.status_download); - imgList.Images.Add("status_done", Resources.status_done); - imgList.Images.Add("status_error", Resources.status_error); - imgList.Images.Add("status_info", Resources.status_info); - imgList.Images.Add("status_update", Resources.status_update); - imgList.Images.Add("status_warning", Resources.status_warning); - - return imgList; - } - - private void FillListView() - { - amountToDownload.Value = UpdateFile.FileCount; - - lvItems.BeginUpdate(); - - AddDirectoryToListView( - UpdateFile.Folders - .SelectMany(dir => dir.GetItems()) - .Select(e => e as FileEntry) - .Distinct() - .NotNull()); - - AddRegistryToListView(UpdateFile.Registry - .SelectMany(dir => dir.GetItems()) - .Select(e => e as RegistryKeyEntry) - .Distinct() - .NotNull()); - - lvItems.Columns[4].Width = -1; - lvItems.Columns[0].Width = -1; - - lvItems.EndUpdate(); - } - - private void AddDirectoryToListView(IEnumerable files) - { - foreach (FileEntry entry in files) - { - ListViewItem item = new ListViewItem(new string[] { entry.Name, "Ready to download", "0%", entry.Description, Updater.Instance.Converter.Convert(entry.DestinationLocation) }); - item.Tag = entry; - - DownloadTask task = new DownloadTask(entry); - task.TaskProgressChanged += Task_TaskProgressChanged; - task.TaskCompleted += Task_TaskCompleted; - - m_items.Add(task, item); - - lvItems.Items.Add(item); - } - } - - private void AddRegistryToListView(IEnumerable keys) - { - if (keys.Count() == 0) - return; - - amountToDownload.Increment(); - hasRegTask = true; - - ListViewItem item = new ListViewItem(new string[] { "Update registry", "Waiting for other tasks to complete", "0%", "Applies changes to the registry" }); - - UpdateRegistryTask task = new UpdateRegistryTask(keys); - task.TaskProgressChanged += Task_TaskProgressChanged; - task.TaskCompleted += Task_TaskCompleted; - - m_items.Add(task, item); - - lvItems.Items.Add(item); - } - - public void StartUpdate() - { - IsBusy = true; - PageUpdate?.Invoke(this, new EventArgs()); - - var items = m_items.Where(x => (x.Key as DownloadTask != null)); - - foreach (var kvp in items) - { - SetImageKey(kvp.Value, "status_download"); - SetSubItemText(kvp.Value.SubItems[1], "Downloading.."); - - kvp.Key.Start(); - } - - - if (hasRegTask && items.Count() == 0) - StartRegUpdate(); - - } - - private void StartRegUpdate() - { - var kvp = m_items.Where(x => (x.Key as UpdateRegistryTask) != null).NotNull().FirstOrDefault(); - - if (kvp.Key == null || kvp.Value == null) - return; - - var view = kvp.Value; - - SetImageKey(view, "status_download"); - SetSubItemText(view.SubItems[1], "Updating.."); - - kvp.Key.Start(); - - } - - private void Task_TaskCompleted(object sender, AsyncCompletedEventArgs e) - { - var task = (UpdatableTask)sender; - var view = m_items[task]; - - if (e.Cancelled) - { - SetSubItemText(view.SubItems[1], "Rolled back"); - SetImageKey(view, "status_warning"); - - return; - } - - if (e.Error != null) - { - HasErrors = true; - PageUpdate?.Invoke(this, EventArgs.Empty); - - Updater.Instance.Logger.Error(nameof(UpdatePage), nameof(StartUpdate), e.Error); - - SetSubItemText(view.SubItems[1], "Error"); - SetImageKey(view, "status_error"); - - return; - } - - SetSubItemText(view.SubItems[1], "Done"); - SetImageKey(view, "status_done"); - - int left = amountToDownload.Decrement(); - - if (left == 1 && hasRegTask) - StartRegUpdate(); - else if (left == 0) - { - IsBusy = false; - IsDone = true; - PageUpdate?.Invoke(this, EventArgs.Empty); - } - } - - private void Task_TaskProgressChanged(object sender, ProgressChangedEventArgs e) - { - UpdatableTask task = (UpdatableTask)sender; - - SetSubItemText(m_items[task].SubItems[2], $"{e.ProgressPercentage}%"); - } - - public void CancelUpdate() - { - - } - - private void StartDownloadItem(ListViewItem item) - { - - //Test(item); - - } - - private void SetImageKey(ListViewItem item, string key) - { - this.InvokeOnUI(() => item.ImageKey = key); - //if (InvokeRequired) - //{ - // Invoke(new Action(SetImageKey), item, key); - // return; - //} - //item.ImageKey = key; - } - - private void SetSubItemText(ListViewItem.ListViewSubItem item, string key) - { - this.InvokeOnUI(() => item.Text = key); - //if (InvokeRequired) - //{ - // Invoke(new Action(SetSubItemText), item, key); - // return; - //} - - //item.Text = key; - } - - public void Cancel() - { - if (NeedsRollBack) - Rollback(); - - IsDone = true; - - - PageUpdate?.Invoke(this, EventArgs.Empty); - } - - public void Execute() - { - StartUpdate(); - } - - private UpdaterForm _updaterForm; - public UpdaterForm UpdaterForm - { - get - { - return _updaterForm; - } - } - - public UserControl Conent - { - get - { - return this; - } - } - - public bool NeedsCancel - { - get - { - return true; - } - } - - public bool NeedsExecution - { - get - { - return true; - } - } - - public bool NeedsRollBack { get { return true; } } - - public bool IsBusy - { - get; set; - - } - - public void PageEntered() - { - - } - - public void UpdateState() - { - - } - - public void Rollback() - { - IsBusy = true; - - foreach (var item in m_items) - { - UpdatableTask task = item.Key; - ListViewItem view = item.Value; - - if (task.IsCancelled || (!task.IsCompleted && !task.IsRunning)) - { - SetSubItemText(view.SubItems[1], "No action"); - - SetImageKey(view, "status_warning"); - - continue; - } - - - task.Cancel(); - - SetSubItemText(view.SubItems[1], "Rolled back"); - - SetImageKey(view, "status_warning"); - } - - IsBusy = false; - HasErrors = false; - IsDone = true; - - PageUpdate?.Invoke(this, EventArgs.Empty); - } - - public bool IsDone - { - get; set; - } - - public string Title - { - get - { - return lblHeader.Text; - } - } - - public bool HasErrors - { - get; set; - } - } -} diff --git a/UpdateLib/UpdateLib/UI/Components/UpdatePage.resx b/UpdateLib/UpdateLib/UI/Components/UpdatePage.resx deleted file mode 100644 index be67fa0..0000000 --- a/UpdateLib/UpdateLib/UI/Components/UpdatePage.resx +++ /dev/null @@ -1,123 +0,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 - - - 17, 17 - - \ No newline at end of file diff --git a/UpdateLib/UpdateLib/UI/IWizardPage.cs b/UpdateLib/UpdateLib/UI/IWizardPage.cs deleted file mode 100644 index 7824d6d..0000000 --- a/UpdateLib/UpdateLib/UI/IWizardPage.cs +++ /dev/null @@ -1,41 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.Windows.Forms; - -namespace MatthiWare.UpdateLib.UI -{ - public interface IWizardPage - { - event EventHandler PageUpdate; - UpdaterForm UpdaterForm { get; } - void Cancel(); - void Execute(); - UserControl Conent { get; } - bool NeedsCancel { get; } - bool NeedsExecution { get; } - bool IsBusy { get; set; } - bool IsDone { get; set; } - string Title { get; } - void PageEntered(); - void Rollback(); - bool HasErrors { get; set; } - bool NeedsRollBack { get; } - void UpdateState(); - } -} diff --git a/UpdateLib/UpdateLib/UI/MessageDialog.Designer.cs b/UpdateLib/UpdateLib/UI/MessageDialog.Designer.cs deleted file mode 100644 index ef98053..0000000 --- a/UpdateLib/UpdateLib/UI/MessageDialog.Designer.cs +++ /dev/null @@ -1,152 +0,0 @@ -namespace MatthiWare.UpdateLib.UI -{ - partial class MessageDialog - { - /// - /// 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() - { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MessageDialog)); - this.panel1 = new System.Windows.Forms.Panel(); - this.btn2 = new System.Windows.Forms.Button(); - this.btn1 = new System.Windows.Forms.Button(); - this.btn3 = new System.Windows.Forms.Button(); - this.pbIcon = new System.Windows.Forms.PictureBox(); - this.lblHeader = new System.Windows.Forms.Label(); - this.lblDesc = new System.Windows.Forms.Label(); - this.panel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pbIcon)).BeginInit(); - this.SuspendLayout(); - // - // panel1 - // - this.panel1.BackColor = System.Drawing.SystemColors.Control; - this.panel1.Controls.Add(this.btn2); - this.panel1.Controls.Add(this.btn1); - this.panel1.Controls.Add(this.btn3); - this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom; - this.panel1.Location = new System.Drawing.Point(0, 100); - this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(401, 46); - this.panel1.TabIndex = 0; - // - // btn2 - // - this.btn2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btn2.Location = new System.Drawing.Point(227, 11); - this.btn2.Name = "btn2"; - this.btn2.Size = new System.Drawing.Size(75, 23); - this.btn2.TabIndex = 3; - this.btn2.UseVisualStyleBackColor = true; - this.btn2.Visible = false; - // - // btn1 - // - this.btn1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btn1.Location = new System.Drawing.Point(146, 11); - this.btn1.Name = "btn1"; - this.btn1.Size = new System.Drawing.Size(75, 23); - this.btn1.TabIndex = 2; - this.btn1.UseVisualStyleBackColor = true; - this.btn1.Visible = false; - // - // btn3 - // - this.btn3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btn3.Location = new System.Drawing.Point(308, 11); - this.btn3.Name = "btn3"; - this.btn3.Size = new System.Drawing.Size(75, 23); - this.btn3.TabIndex = 1; - this.btn3.UseVisualStyleBackColor = true; - this.btn3.Visible = false; - // - // pbIcon - // - this.pbIcon.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; - this.pbIcon.Location = new System.Drawing.Point(12, 12); - this.pbIcon.Name = "pbIcon"; - this.pbIcon.Size = new System.Drawing.Size(48, 48); - this.pbIcon.TabIndex = 1; - this.pbIcon.TabStop = false; - // - // lblHeader - // - this.lblHeader.AutoSize = true; - this.lblHeader.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblHeader.ForeColor = System.Drawing.Color.MidnightBlue; - this.lblHeader.Location = new System.Drawing.Point(65, 12); - this.lblHeader.Name = "lblHeader"; - this.lblHeader.Size = new System.Drawing.Size(212, 25); - this.lblHeader.TabIndex = 2; - this.lblHeader.Text = "Version 1.0.0.0 available"; - // - // lblDesc - // - this.lblDesc.AutoSize = true; - this.lblDesc.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblDesc.Location = new System.Drawing.Point(67, 46); - this.lblDesc.Name = "lblDesc"; - this.lblDesc.Size = new System.Drawing.Size(218, 34); - this.lblDesc.TabIndex = 3; - this.lblDesc.Text = "Update now?\r\nPress yes to update or no to cancel."; - // - // MessageDialog - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.AutoSize = true; - this.BackColor = System.Drawing.SystemColors.Window; - this.ClientSize = new System.Drawing.Size(401, 146); - this.Controls.Add(this.lblDesc); - this.Controls.Add(this.lblHeader); - this.Controls.Add(this.pbIcon); - this.Controls.Add(this.panel1); - 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.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "MessageDialog"; - this.ShowIcon = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Message Dialog"; - this.panel1.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.pbIcon)).EndInit(); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.Panel panel1; - private System.Windows.Forms.Button btn3; - private System.Windows.Forms.PictureBox pbIcon; - private System.Windows.Forms.Label lblHeader; - private System.Windows.Forms.Label lblDesc; - private System.Windows.Forms.Button btn1; - private System.Windows.Forms.Button btn2; - } -} \ No newline at end of file diff --git a/UpdateLib/UpdateLib/UI/MessageDialog.cs b/UpdateLib/UpdateLib/UI/MessageDialog.cs deleted file mode 100644 index 3d5c384..0000000 --- a/UpdateLib/UpdateLib/UI/MessageDialog.cs +++ /dev/null @@ -1,119 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System.Drawing; -using System.Windows.Forms; - -namespace MatthiWare.UpdateLib.UI -{ - public partial class MessageDialog : Form - { - public static DialogResult Show(IWin32Window owner, string title, string header, string desc, Icon icon, MessageBoxButtons buttons = MessageBoxButtons.YesNo) - { - return new MessageDialog( - title, - header, - desc, - icon, - buttons).ShowDialog(owner); - } - - public static DialogResult Show(string title, string header, string desc, Icon icon, MessageBoxButtons buttons = MessageBoxButtons.YesNo) - { - return Show(null, title, header, desc, icon, buttons); - } - - public string Header - { - get { return this.lblHeader.Text; } - set { this.lblHeader.Text = value; } - } - - public string Description - { - get { return this.lblDesc.Text; } - set { this.lblDesc.Text = value; } - } - - public Icon DialogIcon - { - set { this.pbIcon.BackgroundImage = value.ToBitmap(); } - } - - public MessageDialog() - { - InitializeComponent(); - } - - public MessageDialog(string title, string header, string desc, Icon icon, MessageBoxButtons buttons = MessageBoxButtons.YesNo) - : this() - { - Header = header; - Description = desc; - Text = title; - DialogIcon = icon; - Icon = icon; - - ShowIcon = true; - - SetUpButtons(buttons); - } - - private void SetUpButtons(MessageBoxButtons buttons) - { - switch (buttons) - { - case MessageBoxButtons.OK: - default: - SetUpButton(btn3, "OK", DialogResult.OK, true); - break; - case MessageBoxButtons.OKCancel: - SetUpButton(btn2, "OK", DialogResult.OK, true); - SetUpButton(btn3, "Cancel", DialogResult.Cancel); - break; - case MessageBoxButtons.AbortRetryIgnore: - SetUpButton(btn3, "Ignore", DialogResult.Ignore); - SetUpButton(btn2, "Retry", DialogResult.Retry); - SetUpButton(btn1, "Abort", DialogResult.Abort, true); - break; - case MessageBoxButtons.YesNoCancel: - SetUpButton(btn3, "Cancel", DialogResult.Cancel); - SetUpButton(btn2, "No", DialogResult.No); - SetUpButton(btn1, "Yes", DialogResult.Yes, true); - break; - case MessageBoxButtons.YesNo: - SetUpButton(btn3, "No", DialogResult.No); - SetUpButton(btn2, "Yes", DialogResult.Yes, true); - break; - case MessageBoxButtons.RetryCancel: - SetUpButton(btn3, "Cancel", DialogResult.Cancel); - SetUpButton(btn2, "Retry", DialogResult.Retry, true); - break; - } - } - - private void SetUpButton(Button button, string text, DialogResult result, bool defaultButton = false) - { - button.Text = text; - button.DialogResult = result; - button.Visible = true; - - if (defaultButton) - button.TabIndex = 0; - } - } -} diff --git a/UpdateLib/UpdateLib/UI/MessageDialog.resx b/UpdateLib/UpdateLib/UI/MessageDialog.resx deleted file mode 100644 index 9fe1da0..0000000 --- a/UpdateLib/UpdateLib/UI/MessageDialog.resx +++ /dev/null @@ -1,306 +0,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 - - - - - AAABAAIAMDAAAAEAIACoJQAAJgAAABAQAAABACAAaAQAAM4lAAAoAAAAMAAAAGAAAAABACAAAAAAAAAk - AAASCwAAEgsAAAAAAAAAAAAA////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8ANJtQDDOYTkgxlEx2MZJLojCQSs0wkEr0MJBK4zCR - SsswkUuyMZJLmTGTTIAylk1fNJtQDP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AACEIy0UgTKaIIM89iuDQv8pgkD/JoI//yWF - QP8liUD/JYdA/yWHQP8mhED/JoI//yiBP/8qg0H/IIM89hSDM5kAhCMs////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wAAfB9RE30xxxt7Nv8kfjz/IYU8/yWP - Q/88oFb/VKxs/2e2ff9yvIf/abZ+/2K0ev9asXL/VK1t/02pZv82mFH/JYZA/yZ/Pf8bezb/En0wxwqD - K1sAgyMG////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8AAIUjFBN/Ma4ZdzT/In06/x6G - Ov9MqGP/iMaZ/6XUsv+cz6r/lMuk/43Hnf+JxJn/hMKU/4DAkv99vo3/ebyL/3a7if90u4f/abd//0+p - Zf8zkE3/JX49/yd8Pv8ggzrTDYsvIf///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8AMZRMiwCEIw7///8A////AP///wD///8A////AP///wD///8A////AP///wAJgClUHX037iF3 - OP8jiT//YrZ6/57Qq/+l07L/mc2n/5DIoP+KxZr/hsOX/4LBk/9+v4//er2M/3a7iP9yuYX/breC/2q1 - fv9ms3v/ZLJ5/2KyeP9hs3f/WrBy/zqYU/8nez7/HXw38wiCKUv///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8ALYZF/x58OO4WhzVpAIUkAv///wD///8A////AP///wD///8AAIQjAxN/ - MaEXci//Hno2/z6eWP+i06//p9Sz/5vNqf+TyaL/jsee/4vFmv+IxJn/hsOW/4PBlf+AwJP/fL6O/3a7 - iv9xuIT/a7Z//2aze/9isXf/Xq90/1qtcP9Wq23/VKps/1Ora/9Colv/J30+/xp1M/0VgjGDAIQjAf// - /wD///8A////AP///wD///8A////AP///wD///8ALIRE/yd3PP8mdjv/HX031AmBKkH///8A////AP// - /wANiy8EH4M7ryFyNv8fgzr/b7uD/6/au/+i0bD/mM2m/5TLo/+QyKD/kcig/5LJof+FwpX/c7mG/2Ox - eP9Tqmr/Uqlo/1uucv9jsnn/aLV+/2q1ff9isXj/XK5x/1arbf9SqWr/Tqdm/0ulZP9Jp2L/QaJd/y2G - Rv8ndTv/III6ug2MLxD///8A////AP///wD///8A////AP///wD///8ALIND/iyJRv87l1b/GG0u/xVt - LP8QeS2zDo4wIBuVPAUfgTqzHm80/yqHQv+e0qv/rNa4/5/PrP+YzKX/l8yl/5jNpv+UyqP/Z7R8/zme - Vf8llEP/KZZG/yuXSP8tmEr/LZhK/y2YSv8sl0n/K5dI/yuWSf9Co13/WK1u/1arbf9PqGf/SqVj/0ak - X/9Colz/P6JZ/z2jWP8ujUn/JnM7/x5/OccAhSQE////AP///wD///8A////AP///wD///8AK4FC/TKI - Sf/y/vT/f8OR/xt9Nv8Zai//JXU8+yuCQ9MdazL/J4dD/6TWsv+q1rb/nM2q/5nNpv+azqj/mM2n/1es - b/8nlET/KpZH/zCZTP8zm0//NJtQ/zSbUP80m1D/NJtQ/zSbUP80m1D/NJtQ/zObT/8xmk3/LphL/z6f - WP9JpWP/R6Vg/0KiXP8+oFj/Op5V/zadUv81n1L/L49K/yVuOf8SfS+W////AP///wD///8A////AP// - /wD///8AKn9B/SyDRf/f8+T/y+fS/8Hjyv9XrG7/FXQw/xNiKP8phkL/p9az/6rWtv+dz6r/nM6p/57Q - q/9+wJH/MplP/yuXSP8xmk7/NJtQ/zScUP81nVH/NZ5R/zagU/82olP/NqNU/zajVP82olP/NqBS/zWe - Uf80nFD/M5tP/zKaTv8zm1D/QKFb/z+hWf86nlX/NZxS/zObT/80nFD/NqBT/yyERP8XaC7/CH0mXf// - /wD///8A////AP///wD///8AKn1A/C6DRf/V7t3/udzD/7vexf/B4sr/oNOu/0OhXP+k1rL/qta2/53P - qv+czqr/otGv/1etb/8mlET/L5lM/zObT/80nFD/NZ1R/zagU/80nVH/MJFK/yuAQ/8lbzn/I2k2/yVu - OP8mdDv/Kn5B/zGVTf82olT/NZ9S/zScUP8zm0//MppO/zufVv83nFL/M5tP/zSbUP80m1D/NZ1R/zWg - Uv8mdT3/GW0w+QmEKy7///8A////AP///wD///8AKXxA+zGCSP/Q7Nj/tNq//7DYu/+v17r/sdi6/67W - uf+m1LP/nc+q/53Oqv+f0K3/Tahm/ymWRv8xmk7/NJtQ/zScUP81n1L/NZ5R/yp8QP8hZDP/Imc1/xlw - MfkOcSq/Am4gmgFrHrEObijIGW0w+iBlNP8lcDr/L49K/zahU/81nVH/NJtQ/zObUP8zm1D/NJtQ/zSb - UP80m1D/NJtQ/zWeUf80nVH/JGw3/xtzM+MOjjAP////AP///wD///8AKXo/+zGBSf/L6tX/sNi7/63W - uP+p1LT/pdKx/6HQrv+dzqr/ns6r/57Oq/9GpF//KpZH/zKaTv80nFD/NZ1R/zahU/8xlEz/Imo2/xdk - LP0Sei2dDYsvQACHJQb///8A////AP///wD///8AAIglEhN/MHYZbzDfIWEz/yuBQv81oVL/NZ5R/zSc - UP80m1D/NJtQ/zSbUP80m1D/NJxQ/zWdUf83pFX/MJFK/yJkNP8ceDW8AIMjAf///wD///8AKHg++jWC - Sf/I6NH/rda4/6nUtP+l0rH/odCu/53Oqv+bzan/otCu/0+nZ/8qlkf/MptP/zSbUP81nlH/NZ9S/yp/ - Qf8gYDL/GnEy5gqELD////8A////AP///wD///8A////AP///wD///8A////AP///wAAiCUHEHQsqBRc - J/8mcjr/NJ1R/zWeUf80m1D/NJtQ/zSbUP80nFH/Np9S/zWhU/8shET/IGMy/xdmLPoReC2BAHwXBP// - /wD///8AJ3c9+jaBSv/D587/qdW1/6XTsv+h0K7/nc6q/5rMqP+ezqv/cLmE/yeVRf8ymk7/NJtQ/zSb - UP81nlH/J3Q7/x9cL/8ndTz9KZtHTv///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AAZ2I3MUYCj9JG45/zWiU/81nVH/NJxQ/zWeUv83olT/MJJL/yNnNf8SWSb/DXApvgCB - ISL///8A////AP///wD///8AJ3U8+jd/S/++5Mj/pdOy/6HRrv+dz6v/mc6n/5zNqP+KxZr/KJVF/zCZ - Tf80m1D/NJtQ/zSbUP81nVH/NqJU/y2JRv8gYDL/E1om/w9wKbUBiiYg////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wAEdSRvEVYj/yt+Qf83o1T/NqJT/zSeUf8mdDv/HVgt/xlq - LusHfSdW////AP///wD///8A////AP///wD///8AJnM7+Th+TP+54sX/odGu/53Pq/+Zzaf/mc2o/5vM - qP80m1D/LphL/zSbUP80m1D/NJtQ/zSbUP80m1D/NZ1R/zagUv82olP/KX1A/x1ZLv8VYCn7EHcsjgCG - JAv///8A////AP///wD///8A////AP///wD///8A////AP///wD///8ADm8osBxVLf8xkkv/LYZF/x9a - Lv8TWyf9EXUslACJJQv///8A////AP///wD///8A////AP///wD///8AJnI7+Dl+S/+04MD/nc+r/5nN - p/+Xzab/nc+r/0ynZP8rl0j/M5tP/zSbUP80m1D/NJtQ/zSbUP80m1D/NJtQ/zScUP82oVP/OalY/y+P - Sf8eWC3/D1Ag/wRzIqgAdAoB////AP///wD///8A////AP///wD///8A////AP///wD///8AAYkmDBdo - LeIdVCv/HFYt/xltMM0Khywu////AP///wD///8A////AP///wD///8A////AABiEiErgkOkJXA6+Dp8 - Sv+x3r3/ms2o/5bMpf+azqj/a7Z//yiVRv8ymk7/NJtQ/zSbUP80m1D/NJtQ/zSbUP80nFD/NZ5R/zei - VP80m0//JGs2/xpQKP8YZy7lB30oUv///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AAiAKC4JYSDnFH4waACIJQH///8A////AP///wD///8A////AP///wAAaBUID3MphBx3 - Nfgqf0HyJW859zp7S/+s3Ln/lsul/5fLpf+Mx5v/JpVF/zCaTf80m1D/NJtQ/zSbUP80m1D/NJtQ/zWd - Uf82oVP/NaFT/yd3Pv8ZTCf/E1km+BF4LYABiSYG////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wAAfhgC////AP///wD///8A////AP///wD///8A////AABp - GlUUdC7kL4BG/yV5O/8pfEDzJG049jp5TP+n2rb/k8qi/5nNqP9JpmL/LZhK/zSbUP80m1D/NJtQ/zSb - UP80nFH/NqBS/zimVv8rhET/G1Eq/w9NIP4NaiasAYsnGP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wAAYxEpB24jvglsJP9fk2//grSQ/yN6PP8oeT70JGs39jl3Sv+j2LH/k8qj/4PCk/8mlET/MppO/zSb - UP80m1D/NJxQ/zWfUv83pVX/MJFL/x5aLf8YSSb/FmYs0guGLDf///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8AAGIQDQxxJpAPcSn8LHtB/5a1nv/a69//OaVX/yR3Ov8ndj30I2o29Tp2S/+f1q//lsuk/0Cg - Wv8umEv/NJtQ/zScUP81nlH/N6NU/zSdUf8jZjX/FUIh/xJaJu8TfjBkAYkmAf///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wAAahxiE3Mt6xdyMf9jmHL/v9fH/9Hs1/+Lx5v/JppG/yZ0PP8mczv2I2k28jt2 - TP+g2K//eL2K/yiVRf8zm0//NZ1R/zahU/83o1P/J3c9/xZFI/8PUCH8DnIpkQGLJwv///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8AAGcTNAlvJcgKbCX/N4FL/6jFr//J6NH/vuLH/8Piy/8xmk7/MJ9O/yZz - O/8lcDn3I2o28j12Tf+i2bL/OJxU/y+aTP82oFL/OKZV/y2GRf8ZTij/C0Ub/wplJLwAhSMi////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AABhERMNciidEHAr/RxzM/94p4X/y+XQ/8Diyf+z277/ttvA/36/ - j/8llEP/NqJT/yVvOf8kbTj3I2o28UF3Uf96xI//KplI/zakVP8xlk3/Hlwv/xZEI/8VYireCH8pR/// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wAAhyQCD3MqbhZ0L/EWci//SYta/7jVwf/I59H/t93C/63Y - uv+t1rf/r9e5/yyYSP8vmUz/N6NU/yRtOP8jajb4I2o38El9Vf9Cr1//MZ1P/yRrN/8WQiH/Elck9RF5 - LXUBiiYD////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AAFrHj8YdTHSG3Qz/yN2Of+Qu5z/zerU/7zf - xf+v2Lr/qtW2/6XTs/+s1bj/ZLJ5/ymWRv8zm1D/N6RU/yNrN/8iZzX5I2o27zBzQf8ngED/F0ck/w5L - Hv0NbCaiAYwnEv///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wAAYhIbDXEpqRJwLP4Vby7/XJtt/8fj - z//B48z/tNu//6vVtv+m07L/odGu/6LRr/+bzqn/JpRD/zCaTf80m1D/N6RV/yNnNv8hYzP5I2o37xdI - JP8LRBv/CWEhygCDIi7///8A////AP///wD///8A////AP///wD///8AAHoVAv///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8AAFcMBRB1K3sYdDD2GnMy/y5/ - Rf+pzrP/yOfQ/7jdwv+u17n/qNS0/6PRsP+ez6v/ms6o/6HQrf9LpmX/LJdJ/zSbUP80m1D/N6VV/yJl - M/8gYDH5JGs37xRfKOkHeiVZ////AP///wD///8A////AP///wD///8A////AP///wALhy1NGY453QqD - Kkv///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wACbR9LHHk23iF5 - Of8aczL/da+F/8zp1P+94Mf/r9m7/6nUtP+l0rH/oNCt/5vNqf+Wy6X/l8yl/3/Akf8mlET/MppO/zSb - UP80m1D/OKVV/yBiMv8fXTD6MI9KbgCIJQj///8A////AP///wD///8A////AP///wD///8AAIEhHhiO - OLAhkj//L5ZK/yGNPvAJgSkg////AP///wD///8A////AP///wD///8A////AP///wD///8A////AABj - EYobdzT/KXw//zOCSP/L6dT/zuzW/7bcwf+q1bb/pdOy/6HQrv+czqn/mMym/5PKov+QyKD/lsqk/zac - Uv8vmUv/NJtQ/zSbUP80m1D/OKZV/x9fMf8eWi77////AP///wD///8A////AP///wD///8A////AACB - IQQZjjl1IZI/9x+NPP8wlEz/Xaxy/yCKPf8giD3MAIMjBv///wD///8A////AP///wD///8A////AP// - /wD///8A////AABDAAQNbyh2GXEx8h1wNP80fUj/mcWl/7jgw/+o1rX/ntCs/5nMp/+UyqP/j8ie/4zG - nP+Nxp3/YrJ4/yqWR/8zm0//NJtQ/zSbUP80m1D/OKZW/x9dMP8dVy37////AP///wD///8A////AP// - /wD///8AC4gtOySUQtMlkkP/E4c0/4fCl////////////y2RSP8jhj7/E30wmP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8AAFsNFQlmI6IQZCf9E2Uq/0uGWv+cy6j/ndOt/5LJ - of+Mxpz/h8SY/4XClf+EwpT/K5dJ/zGaTf80m1D/NJtQ/zSbUP80m1D/OKdW/x5aLv8dVy38////AP// - /wD///8A////AACBIRMZjjmcI5JC/h+NPv9RpGb/8vn1///////8/v3//////9fs3f8UfS//GHwz/xB3 - LJAAhiQC////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wAacTM7IWw19BNg - KP8RViT/f7KO/4rFmv+EwpX/gMGS/4HBlP9LpmT/LZhK/zSbUP80m1D/NJtQ/zSbUP80m1D/OKdW/x5a - L/8dViz8////AP///wD///8AAIEhYyWUQ+4zmE7/MJVM/0aiYP////////////L49P/r9e7/6vTs//X6 - 9v+t1bn/GX00/yF9Ov8deja/AGgcE////wD///8A////AP///wD///8A////AP///wD///8A////AABf - GTEUZSvXGmMt/yNoNf93s4n/jsyf/4LDk/98vo7/e76O/222gf8qlkf/MptP/zSbUP80m1D/NJtQ/zSb - UP80m1D/OKZW/x5cL/8dViz8////AP///wD///8ACoMqjTKXTv8ylk3/M5xQ/x+RPv+UyqP//////+z2 - 7v/j8ef/3+/j/97u4v/m9Or/v+HI/yGBO/8ddjX/GHQx6g1vKIgAYRAe////AP///wD///8A////AAA7 - AAMAXxdBCWEhlRBdJfsUXCn/RoNW/5TOpP+LyJv/f8CR/3m9i/93u4n/crqH/zKaTv8wmk3/NJtQ/zSb - UP80m1D/NJtQ/zSbUP80m1D/OKZW/x5cL/8dViz9////AP///wD///8AAIIiBSOMQMkxkUv/MpZN/y6a - S/8ckDz/u97E//P69P/f7+P/1+vc/9Lp2P/P59b/1ezc/8no0f9RmmT/Emss/xtvMv8Vayv9C2Qi0ABb - F7gAXBWkCWMhuxRkKfUdZTH/Fl4p/x5hMP9xq4D/kc+i/4LDlf96vYz/dbuI/3O6hf9zuYb/PZ9Y/y+Z - TP80m1D/NZ1R/zWeUf81nlH/NJxQ/zSbUP80m1D/OKZW/x5cL/8dViz9////AP///wD///8A////AAZ6 - JyEihz7yLoxI/zKZT/8smUr/G446/6PRsP/o8+r/1OrZ/8rl0f/F4s3/weDK/8TjzP/L6NL/stq+/0+b - ZP8fcDT/Dl8l/xFgJ/8TXyf/EFwl/xdiLP89gU7/bqh9/47Hn/+HyJr/fcCP/3a7if9yuYX/b7iC/262 - gv9Lp2X/LphL/zObT/81nlL/NqNT/yl8P/81oVL/NqJU/zWeUf80nFD/OKZW/x5cLv8dViz9////AP// - /wD///8A////AP///wAFdSNVIIE6/y2JRf80nFH/LppL/x2QPP+EwpX/2+3g/8vm0f+/38f/uNzC/7Ta - vv+y2b3/stm8/7XdwP+44cP/sNu8/5TKov+CvJH/lMej/57Wrv+Tz6T/iciZ/3/BkP95vYz/c7qG/264 - gv9stn//a7Z//0akX/8umEv/M5tP/zWeUv82pFT/JGo2/xdIJf8aTyn/K39B/zekVf82oVP/OKhX/x5c - MP8dViz+////AP///wD///8A////AP///wD///8AEXgtmSuDRP8shkX/NJ1R/zCbTf8jk0L/QqFc/7fc - wf/E4cv/tdu//63XuP+n07P/o9Gw/57Pq/+Zzaf/l8ul/5TLov+Pyp//iMWa/4PClP9+v4//eb2L/3S6 - h/9vuIP/bLaB/2m2ff9ntH3/P6Ba/y6ZS/8zm0//NZ9S/zalVP8kajf/GUwn/x1XLOkbUyr5GEwn/x1X - Lf8vjEj/O7Bb/x9gMv8cViz+////AP///wD///8A////AP///wD///8AAF0OBh17NrEqfED/K4BB/zOb - UP8znVD/KpdI/yKSQv9rt4D/r9i6/7HZu/+k0bD/m86p/5bLpf+RyaD/jcac/4jEmP+DwpT/fr+Q/3q9 - jP92u4j/cbmE/222gP9ptX7/Z7V8/1etb/81m1H/MJlM/zObT/82n1L/N6RV/yJqNf8ZTCf/Dk0g3Qdb - HRkAUBEgAksVtwxEG/4YSyb/I2o2/yBdMP8cViz+////AP///wD///8A////AP///wD///8A////AACH - JAEMbCibGnEy/yl4Pf8ymU7/NZ9S/zCaTf8plkb/I5JB/1mucf+Xy6X/odGu/5fMpv+PyJ//iMWZ/4HA - kv97vo3/druJ/3O5iP9xuIX/breB/2u1f/9brnH/Op1U/y6YSv8xmk7/NJ1R/zaiU/80nVH/IWQz/xlM - J/8QTyDYAFERFP///wD///8A////AABDAkQBRRLXC0cc/xtTKv8cViz/////AP///wD///8A////AP// - /wD///8A////AP///wD///8AAGQaghdrL/4lcjr/L4pI/zWhUv81n1L/MZtO/yuXSf8klEP/MZlO/1Gp - aP9rtn//er6L/3q+jP97vo3/eL6L/2u1f/9YrG//R6Rg/zmeU/8tmEr/MZpN/zScUP81n1L/OKVV/yyG - Rf8aUCn/CkQa/wFGFM0ARAEQ////AP///wD///8A////AP///wD///8AAEkNbg9OH+4cViz/////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AABfF2kWZy36I2o3/yVxOv8wkkv/N6NU/zWf - Uv80nFD/MZpO/y6YS/8qlkj/KJVG/yiVRv8olUb/KZZG/yuXSP8tmEr/MJlM/zKaTv80nFD/NqBS/zel - Vf81n1D/ImY0/xhLJv8MRxz6AEMKhf///wD///8A////AP///wD///8A////AP///wD///8A////AAA/ - AAwhYzOZ////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wAAVAkjCV0ftRRd - J/4gYTL/J3U9/zGVTP82pVT/N6NU/zagUv81nVH/NJxQ/zSbUP80m1D/NJtQ/zScUP81nlH/NqBS/zej - VP84qFb/L49J/yJmNP8ZSSX/GVAp/xBRIdYATA0v////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AABWE0YTWyfWHlsw/x5aLv8fWy//JnE7/y2KSP82oVP/OalX/zioV/84qFb/OKhX/zeo - Vv8zmk//LolG/yh3Pf8dVSz/GEom/wpEGv8AQhHjAEoMgAAYAAL///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wACjSgBAE8PYwRSGrcQUSH1G1Qr/xpQKf8YSyb/GEkm/xpN - J/8bUyr/HVgt/xhKJv8XSSX/GEom/xhNJ/8MRhz9AUoWwABCAVL///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wAndDwEI2o2TyFi - MqUfXTDRHlsv3R5aLucdWC3xHVgt+B5bL+EgXzG+IWMzlCJmNGQjaTYc////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A///AAf// - AAD//wAAf/8AAP/8AAAP/wAA//AAAAf/AAA/4AAAA/8AAA+AAAAA/wAABwAAAAB/AAAAAAAAAD8AAAAA - AAAAPwAAAAAAAAAfAAAAAAAAAA8AAAAAAAAABwAAAAAB4AADAAAAAA/4AAMAAAAAH/4ADwAAAAAH/wA/ - AAAAAAH/gH8AAAAAAP+B/AAAAAAD/8PwAAAAAAf/7+AAAAAAH///gAAAAAB///4AAAAAAP///AAAAAAD - ///wAAAAAA///8AAAAAAP///AAAAAAB///4AAAAAAf//+AAAAAAH9//gAAAAAB/j/8AAAAAAP4H/gAAA - AAD+AP+AAAAAAPwA/+AAAAAA8AA/+AAAAADgAB/wAAAAAOAAB4AAAAAA4AAAAAAAAADwAAAAAAAAAPgA - AAAAAAAA/AAAAAAAAAD8AAAAAAAAAP4AAAAA4AAA/4AAAAH4AAD/wAAAB/wAAP/gAAAP/wAA//gAAB// - AAD//AAA//8AAP//gAP//wAAKAAAABAAAAAgAAAAAQAgAAAAAAAABAAAEgsAABILAAAAAAAAAAAAAP// - /wD///8A////AP///wA0m1AIMpJMbDOTTt0/mlj4Qpta+TuYVPUyk0zDMJFLIv///wD///8A////AP// - /wAvjEhW////AP///wAAbhkgJIU99Hu4jP+q17b/sdq8/6DRrv+PyZ//cbmF/zOPTf4FeCSi////AP// - /wD///8AQpFY/BB3K+4AbRp8LodG/MHgyf+j1LH/abZ+/0KkW/9BpFz/Wa9w/2W0ev9fsXX/NJVP/wZ0 - I83///8A////AGamd/3h9ef/cbCC/8rn0v9+wpD/I5ZD/yaNQf8mgT77J4FA+yeJQv8smUr/R6dh/0Kk - XP8giDz/AG0alP///wBionP91O3b/77fx/9otn7/JZVD/yV7PP4vhUahKZxJChuVPAQLaSU/G3Qz+DOf - Uf81oVL/IIU8/wJoHd7///8AX51w/cbn0P+ZzKf/I5JB/zKdT/8yl03/KHU8+Q1qJkz///8A////AABi - GiYccjP6Kn1B+R54N3j///8ALIVFFlqZa/3B5cr/O59W/y6bS/81n1H/G3Uz/RBtKb4AZwwK////AP// - /wD///8AAGEYJCCIPAsMXCIEKotEpTKDR/hVlGb9fseR/ymcSP8bdjT/DGIi5ABbDSH///8A////AP// - /wD///8A////AP///wARfS5ZU5Zk96zTtv8sg0T8SY5c/SyOSP8hbDb1GmwwVP///wD///8A////AP// - /wD///8A////AABfCSEQdCvjfrCL/9Lr2f9Wsm//Kn5B/SVuOfYabDGZJptFASOXQwgIiCsg////AP// - /wD///8AAF8HCA14KbdUmWf+weDL/7new/+MyJz/JppF/yl4Pv00m1AM////ABqTO2BLpGP4OplV+wB0 - GS7///8A////AA1uJ0A2hUv4nsiq/6vZt/+WzKX/NpxS/zGgT/8nczv9////AAqHLM9IoWD///////3/ - /v8efzb6AGYaTAFeGgkRaykKGHIwmjR3Rv6Mx5z/V65u/yyYSf83pVT/JnI7/f///wAAeR5jDn8s/ozJ - nf/t+PD/zufV/3ywi/9Bh1T9Sodb/XCqf/+Myp7/XrV1/yudSv8pfj//N6ZW/yZyO/3///8A////AAJy - IIgPeyv/QKRb/5jQqP+y3L3/otWx/5DNoP9zvof/TKtk/yycS/8SXCb9B1QbjghYHfAgYjL9////AP// - /wD///8ABGwfoBRwLfshij7/KZxJ/zmkVf85pFf/K5tJ/ymFQf8TWyX4AEgNNP///wD///8AImU0Zv// - /wD///8A////AP///wAlcDoLKXY+mSdyO/Umcjv7JnE7+ydwO+cmbzqHI2k2EP///wD///8A////AP// - /wDwDwAAYAcAAAADAAAAAQAAAAEAAADCAAAA4AAAA/AAAA/AAAAHAAAAQwAAAIAAAACAAAAAwAAAAOAG - AADwDwAA - - - \ No newline at end of file diff --git a/UpdateLib/UpdateLib/UI/UIExtensions.cs b/UpdateLib/UpdateLib/UI/UIExtensions.cs deleted file mode 100644 index 56b18c7..0000000 --- a/UpdateLib/UpdateLib/UI/UIExtensions.cs +++ /dev/null @@ -1,43 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.ComponentModel; - -namespace MatthiWare.UpdateLib.UI -{ - public static class UIExtensions - { - public static void InvokeOnUI(this T control, Action action) where T : ISynchronizeInvoke - { - if (control != null && control.InvokeRequired) - control.Invoke(action, null); - else - action(); - - } - - public static TResult InvokeOnUI(this T control, Func action) where T : ISynchronizeInvoke - { - if (control != null && control.InvokeRequired) - return (TResult)control.Invoke(action, null); - else - return action(); - } - - } -} diff --git a/UpdateLib/UpdateLib/UI/UpdaterForm.Designer.cs b/UpdateLib/UpdateLib/UI/UpdaterForm.Designer.cs deleted file mode 100644 index 81839a8..0000000 --- a/UpdateLib/UpdateLib/UI/UpdaterForm.Designer.cs +++ /dev/null @@ -1,167 +0,0 @@ -namespace MatthiWare.UpdateLib.UI -{ - partial class UpdaterForm - { - /// - /// 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() - { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(UpdaterForm)); - this.pnlSide = new System.Windows.Forms.Panel(); - this.label1 = new System.Windows.Forms.Label(); - this.pnlBottom = new System.Windows.Forms.Panel(); - this.btnPrevious = new System.Windows.Forms.Button(); - this.btnNext = new System.Windows.Forms.Button(); - this.btnCancel = new System.Windows.Forms.Button(); - this.pnlContent = new System.Windows.Forms.Panel(); - this.linkSite = new System.Windows.Forms.LinkLabel(); - this.pnlSide.SuspendLayout(); - this.pnlBottom.SuspendLayout(); - this.SuspendLayout(); - // - // pnlSide - // - this.pnlSide.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(43)))), ((int)(((byte)(129)))), ((int)(((byte)(181))))); - this.pnlSide.Controls.Add(this.label1); - this.pnlSide.Dock = System.Windows.Forms.DockStyle.Left; - this.pnlSide.Location = new System.Drawing.Point(0, 0); - this.pnlSide.Name = "pnlSide"; - this.pnlSide.Size = new System.Drawing.Size(149, 376); - this.pnlSide.TabIndex = 0; - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Font = new System.Drawing.Font("Segoe UI Semibold", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label1.ForeColor = System.Drawing.SystemColors.Window; - this.label1.Location = new System.Drawing.Point(12, 23); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(115, 21); - this.label1.TabIndex = 0; - this.label1.Text = "Update wizard"; - // - // pnlBottom - // - this.pnlBottom.BackColor = System.Drawing.SystemColors.Control; - this.pnlBottom.Controls.Add(this.linkSite); - this.pnlBottom.Controls.Add(this.btnPrevious); - this.pnlBottom.Controls.Add(this.btnNext); - this.pnlBottom.Controls.Add(this.btnCancel); - this.pnlBottom.Dock = System.Windows.Forms.DockStyle.Bottom; - this.pnlBottom.Location = new System.Drawing.Point(149, 329); - this.pnlBottom.Name = "pnlBottom"; - this.pnlBottom.Size = new System.Drawing.Size(536, 47); - this.pnlBottom.TabIndex = 1; - // - // btnPrevious - // - this.btnPrevious.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.btnPrevious.Enabled = false; - this.btnPrevious.Location = new System.Drawing.Point(287, 13); - this.btnPrevious.Name = "btnPrevious"; - this.btnPrevious.Size = new System.Drawing.Size(75, 23); - this.btnPrevious.TabIndex = 1; - this.btnPrevious.Text = "< Previous"; - this.btnPrevious.UseVisualStyleBackColor = true; - this.btnPrevious.Click += new System.EventHandler(this.btnPrevious_Click); - // - // btnNext - // - this.btnNext.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.btnNext.Location = new System.Drawing.Point(368, 13); - this.btnNext.Name = "btnNext"; - this.btnNext.Size = new System.Drawing.Size(75, 23); - this.btnNext.TabIndex = 0; - this.btnNext.Text = "Next >"; - this.btnNext.UseVisualStyleBackColor = true; - this.btnNext.Click += new System.EventHandler(this.btnNext_Click); - // - // btnCancel - // - this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.btnCancel.Location = new System.Drawing.Point(449, 13); - this.btnCancel.Name = "btnCancel"; - this.btnCancel.Size = new System.Drawing.Size(75, 23); - this.btnCancel.TabIndex = 2; - this.btnCancel.Text = "Cancel"; - this.btnCancel.UseVisualStyleBackColor = true; - this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); - // - // pnlContent - // - this.pnlContent.Dock = System.Windows.Forms.DockStyle.Fill; - this.pnlContent.Location = new System.Drawing.Point(149, 0); - this.pnlContent.Name = "pnlContent"; - this.pnlContent.Size = new System.Drawing.Size(536, 329); - this.pnlContent.TabIndex = 2; - // - // linkSite - // - this.linkSite.AutoSize = true; - this.linkSite.Font = new System.Drawing.Font("Segoe UI Semibold", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.linkSite.LinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(43)))), ((int)(((byte)(129)))), ((int)(((byte)(181))))); - this.linkSite.Location = new System.Drawing.Point(6, 17); - this.linkSite.Name = "linkSite"; - this.linkSite.Size = new System.Drawing.Size(126, 15); - this.linkSite.TabIndex = 3; - this.linkSite.TabStop = true; - this.linkSite.Text = "Powered by UpdateLib"; - this.linkSite.VisitedLinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(43)))), ((int)(((byte)(129)))), ((int)(((byte)(181))))); - this.linkSite.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LinkSite_LinkClicked); - // - // UpdaterForm - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.SystemColors.Window; - this.ClientSize = new System.Drawing.Size(685, 376); - this.Controls.Add(this.pnlContent); - this.Controls.Add(this.pnlBottom); - this.Controls.Add(this.pnlSide); - this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.Name = "UpdaterForm"; - this.Text = "Updater"; - this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.UpdaterForm_FormClosing); - this.pnlSide.ResumeLayout(false); - this.pnlSide.PerformLayout(); - this.pnlBottom.ResumeLayout(false); - this.pnlBottom.PerformLayout(); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.Panel pnlSide; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Panel pnlBottom; - private System.Windows.Forms.Button btnPrevious; - private System.Windows.Forms.Button btnNext; - private System.Windows.Forms.Button btnCancel; - private System.Windows.Forms.Panel pnlContent; - private System.Windows.Forms.LinkLabel linkSite; - } -} \ No newline at end of file diff --git a/UpdateLib/UpdateLib/UI/UpdaterForm.cs b/UpdateLib/UpdateLib/UI/UpdaterForm.cs deleted file mode 100644 index 0f76d9e..0000000 --- a/UpdateLib/UpdateLib/UI/UpdaterForm.cs +++ /dev/null @@ -1,258 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.Diagnostics; -using System.Drawing; -using System.Windows.Forms; -using MatthiWare.UpdateLib.Common; -using MatthiWare.UpdateLib.Files; -using MatthiWare.UpdateLib.UI.Components; - -namespace MatthiWare.UpdateLib.UI -{ - public partial class UpdaterForm : Form - { - public UpdateInfo UpdateInfo { get; internal set; } - public string ApplicationName { get; internal set; } - public bool NeedsRestart { get; internal set; } = true; - public bool HasHadErrors { get; internal set; } = false; - public bool UserCancelled { get; internal set; } = false; - - private WizardPageCollection pages; - - public UpdaterForm(UpdateInfo updateInfo, string appName) - { - InitializeComponent(); - - UpdateInfo = updateInfo ?? throw new ArgumentException(nameof(UpdateInfo)); - ApplicationName = string.IsNullOrEmpty(appName) ? throw new ArgumentException(nameof(appName)) : appName; - - pages = new WizardPageCollection(); - AddPage(new IntroPage(this)); - AddPage(new ChangelogPage(this)); - AddPage(new UpdatePage(this)); - AddPage(new FinishPage(this)); - - SetContentPage(pages.FirstPage); - } - - private void SetContentPage(IWizardPage page) - { - page.PageEntered(); - - for (int i = pnlContent.Controls.Count - 1; i >= 0; i--) - { - IWizardPage item = pnlContent.Controls[i] as IWizardPage; - if (item == null) - continue; - - pnlContent.Controls.RemoveAt(i); - } - - pnlContent.Controls.Add(page.Conent); - } - - private void AddPage(IWizardPage page) - { - page.PageUpdate += Page_PageUpdate; - pages.Add(page); - } - - private void Page_PageUpdate(object sender, EventArgs e) - { - - IWizardPage page = (IWizardPage)sender; - OnPageUpdate(page); - } - - delegate void _OnPageUpdate(IWizardPage page); - private void OnPageUpdate(IWizardPage page) - { - this.InvokeOnUI(() => - { - if (page.IsDone && !page.IsBusy) - { - btnNext.Enabled = true; - if (page == pages.CurrentPage) - btnNext.Focus(); - if (page.NeedsExecution) - btnNext.Text = "Next >"; - } - - if (page.HasErrors && page.NeedsRollBack) - { - HasHadErrors = true; - btnNext.Enabled = true; - btnPrevious.Enabled = false; - btnCancel.Enabled = false; - btnNext.Text = "Rollback"; - } - - if (!pages.CurrentPage.HasErrors && pages.CurrentPage.NeedsRollBack && HasHadErrors) - foreach (IWizardPage wp in pages) - wp.UpdateState(); - - if (pages.AllDone()) - btnCancel.Enabled = false; - - }); - } - - private void btnPrevious_Click(object sender, EventArgs e) - { - IWizardPage currentPage = pages.CurrentPage; - IWizardPage page = pages.Previous(); - - if (page == null) - return; - - if (!btnNext.Enabled) - btnNext.Enabled = true; - - if (page.NeedsExecution) - btnNext.Text = "Next >"; - - if (page == pages.FirstPage) - btnPrevious.Enabled = false; - - SetContentPage(page); - } - - private void btnNext_Click(object sender, EventArgs e) - { - if (pages.CurrentPage.HasErrors && pages.CurrentPage.NeedsRollBack) - { - btnNext.Enabled = false; - pages.CurrentPage.Rollback(); - return; - } - - if (pages.CurrentPage.NeedsExecution && !pages.CurrentPage.IsDone) - { - pages.CurrentPage.Execute(); - btnNext.Enabled = false; - return; - } - - if (pages.CurrentPage == pages.LastPage && pages.CurrentPage.IsDone) - { - ExitUpdater(); - return; - } - - IWizardPage page = pages.Next(); - if (page == null) - return; - - if (!btnPrevious.Enabled) - btnPrevious.Enabled = true; - - if (page.NeedsExecution && !page.IsDone) - btnNext.Text = "Update"; - - if (page.NeedsExecution && !page.IsDone && page.IsBusy) - btnNext.Enabled = false; - - if (page.HasErrors && page.NeedsRollBack) - btnNext.Text = "Rollback"; - - if (page == pages.LastPage) - { - btnNext.Text = "Finish"; - btnCancel.Enabled = false; - } - - - SetContentPage(page); - - } - - private void ExitUpdater() - { - Updater.Instance.GetCache2().Save(); - - if (NeedsRestart) - { - Updater.Instance.RestartApp(); - } - else - { - pages.Clear(); - FinishPage page = new FinishPage(this); - page.UpdateState(); - pages.Add(page); - SetContentPage(page); - btnPrevious.Enabled = false; - btnCancel.Enabled = false; - Close(); - } - } - - private void btnCancel_Click(object sender, EventArgs e) - { - Cancel(); - } - - private void Cancel() - { - bool cancelled = MessageDialog.Show( - this, - "Cancel", - "Cancel updating?", - "Press Yes to cancel the updating process.\nPress No to keep updating.", - SystemIcons.Exclamation) == DialogResult.Yes; - - if (cancelled) - UserCancelled = true; - - if (!cancelled) - return; - - foreach (IWizardPage page in pages) - { - page.Cancel(); - page.UpdateState(); - } - - pages.CurrentPage = pages.LastPage; - SetContentPage(pages.CurrentPage); - - btnNext.Text = "Finish"; - btnPrevious.Enabled = true; - - OnPageUpdate(pages.CurrentPage); - - } - - private void UpdaterForm_FormClosing(object sender, FormClosingEventArgs e) - { - if (pages.AllDone()) - return; - - Cancel(); - - if (e.CloseReason == CloseReason.UserClosing || e.CloseReason == CloseReason.None) - e.Cancel = true; - } - - private void LinkSite_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) - { - Process.Start("https://github.com/MatthiWare/UpdateLib"); - } - } -} diff --git a/UpdateLib/UpdateLib/UI/UpdaterForm.resx b/UpdateLib/UpdateLib/UI/UpdaterForm.resx deleted file mode 100644 index 9fe1da0..0000000 --- a/UpdateLib/UpdateLib/UI/UpdaterForm.resx +++ /dev/null @@ -1,306 +0,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 - - - - - AAABAAIAMDAAAAEAIACoJQAAJgAAABAQAAABACAAaAQAAM4lAAAoAAAAMAAAAGAAAAABACAAAAAAAAAk - AAASCwAAEgsAAAAAAAAAAAAA////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8ANJtQDDOYTkgxlEx2MZJLojCQSs0wkEr0MJBK4zCR - SsswkUuyMZJLmTGTTIAylk1fNJtQDP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AACEIy0UgTKaIIM89iuDQv8pgkD/JoI//yWF - QP8liUD/JYdA/yWHQP8mhED/JoI//yiBP/8qg0H/IIM89hSDM5kAhCMs////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wAAfB9RE30xxxt7Nv8kfjz/IYU8/yWP - Q/88oFb/VKxs/2e2ff9yvIf/abZ+/2K0ev9asXL/VK1t/02pZv82mFH/JYZA/yZ/Pf8bezb/En0wxwqD - K1sAgyMG////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8AAIUjFBN/Ma4ZdzT/In06/x6G - Ov9MqGP/iMaZ/6XUsv+cz6r/lMuk/43Hnf+JxJn/hMKU/4DAkv99vo3/ebyL/3a7if90u4f/abd//0+p - Zf8zkE3/JX49/yd8Pv8ggzrTDYsvIf///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8AMZRMiwCEIw7///8A////AP///wD///8A////AP///wD///8A////AP///wAJgClUHX037iF3 - OP8jiT//YrZ6/57Qq/+l07L/mc2n/5DIoP+KxZr/hsOX/4LBk/9+v4//er2M/3a7iP9yuYX/breC/2q1 - fv9ms3v/ZLJ5/2KyeP9hs3f/WrBy/zqYU/8nez7/HXw38wiCKUv///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8ALYZF/x58OO4WhzVpAIUkAv///wD///8A////AP///wD///8AAIQjAxN/ - MaEXci//Hno2/z6eWP+i06//p9Sz/5vNqf+TyaL/jsee/4vFmv+IxJn/hsOW/4PBlf+AwJP/fL6O/3a7 - iv9xuIT/a7Z//2aze/9isXf/Xq90/1qtcP9Wq23/VKps/1Ora/9Colv/J30+/xp1M/0VgjGDAIQjAf// - /wD///8A////AP///wD///8A////AP///wD///8ALIRE/yd3PP8mdjv/HX031AmBKkH///8A////AP// - /wANiy8EH4M7ryFyNv8fgzr/b7uD/6/au/+i0bD/mM2m/5TLo/+QyKD/kcig/5LJof+FwpX/c7mG/2Ox - eP9Tqmr/Uqlo/1uucv9jsnn/aLV+/2q1ff9isXj/XK5x/1arbf9SqWr/Tqdm/0ulZP9Jp2L/QaJd/y2G - Rv8ndTv/III6ug2MLxD///8A////AP///wD///8A////AP///wD///8ALIND/iyJRv87l1b/GG0u/xVt - LP8QeS2zDo4wIBuVPAUfgTqzHm80/yqHQv+e0qv/rNa4/5/PrP+YzKX/l8yl/5jNpv+UyqP/Z7R8/zme - Vf8llEP/KZZG/yuXSP8tmEr/LZhK/y2YSv8sl0n/K5dI/yuWSf9Co13/WK1u/1arbf9PqGf/SqVj/0ak - X/9Colz/P6JZ/z2jWP8ujUn/JnM7/x5/OccAhSQE////AP///wD///8A////AP///wD///8AK4FC/TKI - Sf/y/vT/f8OR/xt9Nv8Zai//JXU8+yuCQ9MdazL/J4dD/6TWsv+q1rb/nM2q/5nNpv+azqj/mM2n/1es - b/8nlET/KpZH/zCZTP8zm0//NJtQ/zSbUP80m1D/NJtQ/zSbUP80m1D/NJtQ/zObT/8xmk3/LphL/z6f - WP9JpWP/R6Vg/0KiXP8+oFj/Op5V/zadUv81n1L/L49K/yVuOf8SfS+W////AP///wD///8A////AP// - /wD///8AKn9B/SyDRf/f8+T/y+fS/8Hjyv9XrG7/FXQw/xNiKP8phkL/p9az/6rWtv+dz6r/nM6p/57Q - q/9+wJH/MplP/yuXSP8xmk7/NJtQ/zScUP81nVH/NZ5R/zagU/82olP/NqNU/zajVP82olP/NqBS/zWe - Uf80nFD/M5tP/zKaTv8zm1D/QKFb/z+hWf86nlX/NZxS/zObT/80nFD/NqBT/yyERP8XaC7/CH0mXf// - /wD///8A////AP///wD///8AKn1A/C6DRf/V7t3/udzD/7vexf/B4sr/oNOu/0OhXP+k1rL/qta2/53P - qv+czqr/otGv/1etb/8mlET/L5lM/zObT/80nFD/NZ1R/zagU/80nVH/MJFK/yuAQ/8lbzn/I2k2/yVu - OP8mdDv/Kn5B/zGVTf82olT/NZ9S/zScUP8zm0//MppO/zufVv83nFL/M5tP/zSbUP80m1D/NZ1R/zWg - Uv8mdT3/GW0w+QmEKy7///8A////AP///wD///8AKXxA+zGCSP/Q7Nj/tNq//7DYu/+v17r/sdi6/67W - uf+m1LP/nc+q/53Oqv+f0K3/Tahm/ymWRv8xmk7/NJtQ/zScUP81n1L/NZ5R/yp8QP8hZDP/Imc1/xlw - MfkOcSq/Am4gmgFrHrEObijIGW0w+iBlNP8lcDr/L49K/zahU/81nVH/NJtQ/zObUP8zm1D/NJtQ/zSb - UP80m1D/NJtQ/zWeUf80nVH/JGw3/xtzM+MOjjAP////AP///wD///8AKXo/+zGBSf/L6tX/sNi7/63W - uP+p1LT/pdKx/6HQrv+dzqr/ns6r/57Oq/9GpF//KpZH/zKaTv80nFD/NZ1R/zahU/8xlEz/Imo2/xdk - LP0Sei2dDYsvQACHJQb///8A////AP///wD///8AAIglEhN/MHYZbzDfIWEz/yuBQv81oVL/NZ5R/zSc - UP80m1D/NJtQ/zSbUP80m1D/NJxQ/zWdUf83pFX/MJFK/yJkNP8ceDW8AIMjAf///wD///8AKHg++jWC - Sf/I6NH/rda4/6nUtP+l0rH/odCu/53Oqv+bzan/otCu/0+nZ/8qlkf/MptP/zSbUP81nlH/NZ9S/yp/ - Qf8gYDL/GnEy5gqELD////8A////AP///wD///8A////AP///wD///8A////AP///wAAiCUHEHQsqBRc - J/8mcjr/NJ1R/zWeUf80m1D/NJtQ/zSbUP80nFH/Np9S/zWhU/8shET/IGMy/xdmLPoReC2BAHwXBP// - /wD///8AJ3c9+jaBSv/D587/qdW1/6XTsv+h0K7/nc6q/5rMqP+ezqv/cLmE/yeVRf8ymk7/NJtQ/zSb - UP81nlH/J3Q7/x9cL/8ndTz9KZtHTv///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AAZ2I3MUYCj9JG45/zWiU/81nVH/NJxQ/zWeUv83olT/MJJL/yNnNf8SWSb/DXApvgCB - ISL///8A////AP///wD///8AJ3U8+jd/S/++5Mj/pdOy/6HRrv+dz6v/mc6n/5zNqP+KxZr/KJVF/zCZ - Tf80m1D/NJtQ/zSbUP81nVH/NqJU/y2JRv8gYDL/E1om/w9wKbUBiiYg////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wAEdSRvEVYj/yt+Qf83o1T/NqJT/zSeUf8mdDv/HVgt/xlq - LusHfSdW////AP///wD///8A////AP///wD///8AJnM7+Th+TP+54sX/odGu/53Pq/+Zzaf/mc2o/5vM - qP80m1D/LphL/zSbUP80m1D/NJtQ/zSbUP80m1D/NZ1R/zagUv82olP/KX1A/x1ZLv8VYCn7EHcsjgCG - JAv///8A////AP///wD///8A////AP///wD///8A////AP///wD///8ADm8osBxVLf8xkkv/LYZF/x9a - Lv8TWyf9EXUslACJJQv///8A////AP///wD///8A////AP///wD///8AJnI7+Dl+S/+04MD/nc+r/5nN - p/+Xzab/nc+r/0ynZP8rl0j/M5tP/zSbUP80m1D/NJtQ/zSbUP80m1D/NJtQ/zScUP82oVP/OalY/y+P - Sf8eWC3/D1Ag/wRzIqgAdAoB////AP///wD///8A////AP///wD///8A////AP///wD///8AAYkmDBdo - LeIdVCv/HFYt/xltMM0Khywu////AP///wD///8A////AP///wD///8A////AABiEiErgkOkJXA6+Dp8 - Sv+x3r3/ms2o/5bMpf+azqj/a7Z//yiVRv8ymk7/NJtQ/zSbUP80m1D/NJtQ/zSbUP80nFD/NZ5R/zei - VP80m0//JGs2/xpQKP8YZy7lB30oUv///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AAiAKC4JYSDnFH4waACIJQH///8A////AP///wD///8A////AP///wAAaBUID3MphBx3 - Nfgqf0HyJW859zp7S/+s3Ln/lsul/5fLpf+Mx5v/JpVF/zCaTf80m1D/NJtQ/zSbUP80m1D/NJtQ/zWd - Uf82oVP/NaFT/yd3Pv8ZTCf/E1km+BF4LYABiSYG////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wAAfhgC////AP///wD///8A////AP///wD///8A////AABp - GlUUdC7kL4BG/yV5O/8pfEDzJG049jp5TP+n2rb/k8qi/5nNqP9JpmL/LZhK/zSbUP80m1D/NJtQ/zSb - UP80nFH/NqBS/zimVv8rhET/G1Eq/w9NIP4NaiasAYsnGP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wAAYxEpB24jvglsJP9fk2//grSQ/yN6PP8oeT70JGs39jl3Sv+j2LH/k8qj/4PCk/8mlET/MppO/zSb - UP80m1D/NJxQ/zWfUv83pVX/MJFL/x5aLf8YSSb/FmYs0guGLDf///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8AAGIQDQxxJpAPcSn8LHtB/5a1nv/a69//OaVX/yR3Ov8ndj30I2o29Tp2S/+f1q//lsuk/0Cg - Wv8umEv/NJtQ/zScUP81nlH/N6NU/zSdUf8jZjX/FUIh/xJaJu8TfjBkAYkmAf///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wAAahxiE3Mt6xdyMf9jmHL/v9fH/9Hs1/+Lx5v/JppG/yZ0PP8mczv2I2k28jt2 - TP+g2K//eL2K/yiVRf8zm0//NZ1R/zahU/83o1P/J3c9/xZFI/8PUCH8DnIpkQGLJwv///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8AAGcTNAlvJcgKbCX/N4FL/6jFr//J6NH/vuLH/8Piy/8xmk7/MJ9O/yZz - O/8lcDn3I2o28j12Tf+i2bL/OJxU/y+aTP82oFL/OKZV/y2GRf8ZTij/C0Ub/wplJLwAhSMi////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AABhERMNciidEHAr/RxzM/94p4X/y+XQ/8Diyf+z277/ttvA/36/ - j/8llEP/NqJT/yVvOf8kbTj3I2o28UF3Uf96xI//KplI/zakVP8xlk3/Hlwv/xZEI/8VYireCH8pR/// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wAAhyQCD3MqbhZ0L/EWci//SYta/7jVwf/I59H/t93C/63Y - uv+t1rf/r9e5/yyYSP8vmUz/N6NU/yRtOP8jajb4I2o38El9Vf9Cr1//MZ1P/yRrN/8WQiH/Elck9RF5 - LXUBiiYD////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AAFrHj8YdTHSG3Qz/yN2Of+Qu5z/zerU/7zf - xf+v2Lr/qtW2/6XTs/+s1bj/ZLJ5/ymWRv8zm1D/N6RU/yNrN/8iZzX5I2o27zBzQf8ngED/F0ck/w5L - Hv0NbCaiAYwnEv///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wAAYhIbDXEpqRJwLP4Vby7/XJtt/8fj - z//B48z/tNu//6vVtv+m07L/odGu/6LRr/+bzqn/JpRD/zCaTf80m1D/N6RV/yNnNv8hYzP5I2o37xdI - JP8LRBv/CWEhygCDIi7///8A////AP///wD///8A////AP///wD///8AAHoVAv///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8AAFcMBRB1K3sYdDD2GnMy/y5/ - Rf+pzrP/yOfQ/7jdwv+u17n/qNS0/6PRsP+ez6v/ms6o/6HQrf9LpmX/LJdJ/zSbUP80m1D/N6VV/yJl - M/8gYDH5JGs37xRfKOkHeiVZ////AP///wD///8A////AP///wD///8A////AP///wALhy1NGY453QqD - Kkv///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wACbR9LHHk23iF5 - Of8aczL/da+F/8zp1P+94Mf/r9m7/6nUtP+l0rH/oNCt/5vNqf+Wy6X/l8yl/3/Akf8mlET/MppO/zSb - UP80m1D/OKVV/yBiMv8fXTD6MI9KbgCIJQj///8A////AP///wD///8A////AP///wD///8AAIEhHhiO - OLAhkj//L5ZK/yGNPvAJgSkg////AP///wD///8A////AP///wD///8A////AP///wD///8A////AABj - EYobdzT/KXw//zOCSP/L6dT/zuzW/7bcwf+q1bb/pdOy/6HQrv+czqn/mMym/5PKov+QyKD/lsqk/zac - Uv8vmUv/NJtQ/zSbUP80m1D/OKZV/x9fMf8eWi77////AP///wD///8A////AP///wD///8A////AACB - IQQZjjl1IZI/9x+NPP8wlEz/Xaxy/yCKPf8giD3MAIMjBv///wD///8A////AP///wD///8A////AP// - /wD///8A////AABDAAQNbyh2GXEx8h1wNP80fUj/mcWl/7jgw/+o1rX/ntCs/5nMp/+UyqP/j8ie/4zG - nP+Nxp3/YrJ4/yqWR/8zm0//NJtQ/zSbUP80m1D/OKZW/x9dMP8dVy37////AP///wD///8A////AP// - /wD///8AC4gtOySUQtMlkkP/E4c0/4fCl////////////y2RSP8jhj7/E30wmP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8AAFsNFQlmI6IQZCf9E2Uq/0uGWv+cy6j/ndOt/5LJ - of+Mxpz/h8SY/4XClf+EwpT/K5dJ/zGaTf80m1D/NJtQ/zSbUP80m1D/OKdW/x5aLv8dVy38////AP// - /wD///8A////AACBIRMZjjmcI5JC/h+NPv9RpGb/8vn1///////8/v3//////9fs3f8UfS//GHwz/xB3 - LJAAhiQC////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wAacTM7IWw19BNg - KP8RViT/f7KO/4rFmv+EwpX/gMGS/4HBlP9LpmT/LZhK/zSbUP80m1D/NJtQ/zSbUP80m1D/OKdW/x5a - L/8dViz8////AP///wD///8AAIEhYyWUQ+4zmE7/MJVM/0aiYP////////////L49P/r9e7/6vTs//X6 - 9v+t1bn/GX00/yF9Ov8deja/AGgcE////wD///8A////AP///wD///8A////AP///wD///8A////AABf - GTEUZSvXGmMt/yNoNf93s4n/jsyf/4LDk/98vo7/e76O/222gf8qlkf/MptP/zSbUP80m1D/NJtQ/zSb - UP80m1D/OKZW/x5cL/8dViz8////AP///wD///8ACoMqjTKXTv8ylk3/M5xQ/x+RPv+UyqP//////+z2 - 7v/j8ef/3+/j/97u4v/m9Or/v+HI/yGBO/8ddjX/GHQx6g1vKIgAYRAe////AP///wD///8A////AAA7 - AAMAXxdBCWEhlRBdJfsUXCn/RoNW/5TOpP+LyJv/f8CR/3m9i/93u4n/crqH/zKaTv8wmk3/NJtQ/zSb - UP80m1D/NJtQ/zSbUP80m1D/OKZW/x5cL/8dViz9////AP///wD///8AAIIiBSOMQMkxkUv/MpZN/y6a - S/8ckDz/u97E//P69P/f7+P/1+vc/9Lp2P/P59b/1ezc/8no0f9RmmT/Emss/xtvMv8Vayv9C2Qi0ABb - F7gAXBWkCWMhuxRkKfUdZTH/Fl4p/x5hMP9xq4D/kc+i/4LDlf96vYz/dbuI/3O6hf9zuYb/PZ9Y/y+Z - TP80m1D/NZ1R/zWeUf81nlH/NJxQ/zSbUP80m1D/OKZW/x5cL/8dViz9////AP///wD///8A////AAZ6 - JyEihz7yLoxI/zKZT/8smUr/G446/6PRsP/o8+r/1OrZ/8rl0f/F4s3/weDK/8TjzP/L6NL/stq+/0+b - ZP8fcDT/Dl8l/xFgJ/8TXyf/EFwl/xdiLP89gU7/bqh9/47Hn/+HyJr/fcCP/3a7if9yuYX/b7iC/262 - gv9Lp2X/LphL/zObT/81nlL/NqNT/yl8P/81oVL/NqJU/zWeUf80nFD/OKZW/x5cLv8dViz9////AP// - /wD///8A////AP///wAFdSNVIIE6/y2JRf80nFH/LppL/x2QPP+EwpX/2+3g/8vm0f+/38f/uNzC/7Ta - vv+y2b3/stm8/7XdwP+44cP/sNu8/5TKov+CvJH/lMej/57Wrv+Tz6T/iciZ/3/BkP95vYz/c7qG/264 - gv9stn//a7Z//0akX/8umEv/M5tP/zWeUv82pFT/JGo2/xdIJf8aTyn/K39B/zekVf82oVP/OKhX/x5c - MP8dViz+////AP///wD///8A////AP///wD///8AEXgtmSuDRP8shkX/NJ1R/zCbTf8jk0L/QqFc/7fc - wf/E4cv/tdu//63XuP+n07P/o9Gw/57Pq/+Zzaf/l8ul/5TLov+Pyp//iMWa/4PClP9+v4//eb2L/3S6 - h/9vuIP/bLaB/2m2ff9ntH3/P6Ba/y6ZS/8zm0//NZ9S/zalVP8kajf/GUwn/x1XLOkbUyr5GEwn/x1X - Lf8vjEj/O7Bb/x9gMv8cViz+////AP///wD///8A////AP///wD///8AAF0OBh17NrEqfED/K4BB/zOb - UP8znVD/KpdI/yKSQv9rt4D/r9i6/7HZu/+k0bD/m86p/5bLpf+RyaD/jcac/4jEmP+DwpT/fr+Q/3q9 - jP92u4j/cbmE/222gP9ptX7/Z7V8/1etb/81m1H/MJlM/zObT/82n1L/N6RV/yJqNf8ZTCf/Dk0g3Qdb - HRkAUBEgAksVtwxEG/4YSyb/I2o2/yBdMP8cViz+////AP///wD///8A////AP///wD///8A////AACH - JAEMbCibGnEy/yl4Pf8ymU7/NZ9S/zCaTf8plkb/I5JB/1mucf+Xy6X/odGu/5fMpv+PyJ//iMWZ/4HA - kv97vo3/druJ/3O5iP9xuIX/breB/2u1f/9brnH/Op1U/y6YSv8xmk7/NJ1R/zaiU/80nVH/IWQz/xlM - J/8QTyDYAFERFP///wD///8A////AABDAkQBRRLXC0cc/xtTKv8cViz/////AP///wD///8A////AP// - /wD///8A////AP///wD///8AAGQaghdrL/4lcjr/L4pI/zWhUv81n1L/MZtO/yuXSf8klEP/MZlO/1Gp - aP9rtn//er6L/3q+jP97vo3/eL6L/2u1f/9YrG//R6Rg/zmeU/8tmEr/MZpN/zScUP81n1L/OKVV/yyG - Rf8aUCn/CkQa/wFGFM0ARAEQ////AP///wD///8A////AP///wD///8AAEkNbg9OH+4cViz/////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AABfF2kWZy36I2o3/yVxOv8wkkv/N6NU/zWf - Uv80nFD/MZpO/y6YS/8qlkj/KJVG/yiVRv8olUb/KZZG/yuXSP8tmEr/MJlM/zKaTv80nFD/NqBS/zel - Vf81n1D/ImY0/xhLJv8MRxz6AEMKhf///wD///8A////AP///wD///8A////AP///wD///8A////AAA/ - AAwhYzOZ////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wAAVAkjCV0ftRRd - J/4gYTL/J3U9/zGVTP82pVT/N6NU/zagUv81nVH/NJxQ/zSbUP80m1D/NJtQ/zScUP81nlH/NqBS/zej - VP84qFb/L49J/yJmNP8ZSSX/GVAp/xBRIdYATA0v////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AABWE0YTWyfWHlsw/x5aLv8fWy//JnE7/y2KSP82oVP/OalX/zioV/84qFb/OKhX/zeo - Vv8zmk//LolG/yh3Pf8dVSz/GEom/wpEGv8AQhHjAEoMgAAYAAL///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wACjSgBAE8PYwRSGrcQUSH1G1Qr/xpQKf8YSyb/GEkm/xpN - J/8bUyr/HVgt/xhKJv8XSSX/GEom/xhNJ/8MRhz9AUoWwABCAVL///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wAndDwEI2o2TyFi - MqUfXTDRHlsv3R5aLucdWC3xHVgt+B5bL+EgXzG+IWMzlCJmNGQjaTYc////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A///AAf// - AAD//wAAf/8AAP/8AAAP/wAA//AAAAf/AAA/4AAAA/8AAA+AAAAA/wAABwAAAAB/AAAAAAAAAD8AAAAA - AAAAPwAAAAAAAAAfAAAAAAAAAA8AAAAAAAAABwAAAAAB4AADAAAAAA/4AAMAAAAAH/4ADwAAAAAH/wA/ - AAAAAAH/gH8AAAAAAP+B/AAAAAAD/8PwAAAAAAf/7+AAAAAAH///gAAAAAB///4AAAAAAP///AAAAAAD - ///wAAAAAA///8AAAAAAP///AAAAAAB///4AAAAAAf//+AAAAAAH9//gAAAAAB/j/8AAAAAAP4H/gAAA - AAD+AP+AAAAAAPwA/+AAAAAA8AA/+AAAAADgAB/wAAAAAOAAB4AAAAAA4AAAAAAAAADwAAAAAAAAAPgA - AAAAAAAA/AAAAAAAAAD8AAAAAAAAAP4AAAAA4AAA/4AAAAH4AAD/wAAAB/wAAP/gAAAP/wAA//gAAB// - AAD//AAA//8AAP//gAP//wAAKAAAABAAAAAgAAAAAQAgAAAAAAAABAAAEgsAABILAAAAAAAAAAAAAP// - /wD///8A////AP///wA0m1AIMpJMbDOTTt0/mlj4Qpta+TuYVPUyk0zDMJFLIv///wD///8A////AP// - /wAvjEhW////AP///wAAbhkgJIU99Hu4jP+q17b/sdq8/6DRrv+PyZ//cbmF/zOPTf4FeCSi////AP// - /wD///8AQpFY/BB3K+4AbRp8LodG/MHgyf+j1LH/abZ+/0KkW/9BpFz/Wa9w/2W0ev9fsXX/NJVP/wZ0 - I83///8A////AGamd/3h9ef/cbCC/8rn0v9+wpD/I5ZD/yaNQf8mgT77J4FA+yeJQv8smUr/R6dh/0Kk - XP8giDz/AG0alP///wBionP91O3b/77fx/9otn7/JZVD/yV7PP4vhUahKZxJChuVPAQLaSU/G3Qz+DOf - Uf81oVL/IIU8/wJoHd7///8AX51w/cbn0P+ZzKf/I5JB/zKdT/8yl03/KHU8+Q1qJkz///8A////AABi - GiYccjP6Kn1B+R54N3j///8ALIVFFlqZa/3B5cr/O59W/y6bS/81n1H/G3Uz/RBtKb4AZwwK////AP// - /wD///8AAGEYJCCIPAsMXCIEKotEpTKDR/hVlGb9fseR/ymcSP8bdjT/DGIi5ABbDSH///8A////AP// - /wD///8A////AP///wARfS5ZU5Zk96zTtv8sg0T8SY5c/SyOSP8hbDb1GmwwVP///wD///8A////AP// - /wD///8A////AABfCSEQdCvjfrCL/9Lr2f9Wsm//Kn5B/SVuOfYabDGZJptFASOXQwgIiCsg////AP// - /wD///8AAF8HCA14KbdUmWf+weDL/7new/+MyJz/JppF/yl4Pv00m1AM////ABqTO2BLpGP4OplV+wB0 - GS7///8A////AA1uJ0A2hUv4nsiq/6vZt/+WzKX/NpxS/zGgT/8nczv9////AAqHLM9IoWD///////3/ - /v8efzb6AGYaTAFeGgkRaykKGHIwmjR3Rv6Mx5z/V65u/yyYSf83pVT/JnI7/f///wAAeR5jDn8s/ozJ - nf/t+PD/zufV/3ywi/9Bh1T9Sodb/XCqf/+Myp7/XrV1/yudSv8pfj//N6ZW/yZyO/3///8A////AAJy - IIgPeyv/QKRb/5jQqP+y3L3/otWx/5DNoP9zvof/TKtk/yycS/8SXCb9B1QbjghYHfAgYjL9////AP// - /wD///8ABGwfoBRwLfshij7/KZxJ/zmkVf85pFf/K5tJ/ymFQf8TWyX4AEgNNP///wD///8AImU0Zv// - /wD///8A////AP///wAlcDoLKXY+mSdyO/Umcjv7JnE7+ydwO+cmbzqHI2k2EP///wD///8A////AP// - /wDwDwAAYAcAAAADAAAAAQAAAAEAAADCAAAA4AAAA/AAAA/AAAAHAAAAQwAAAIAAAACAAAAAwAAAAOAG - AADwDwAA - - - \ No newline at end of file diff --git a/UpdateLib/UpdateLib/UI/WizardPageCollection.cs b/UpdateLib/UpdateLib/UI/WizardPageCollection.cs deleted file mode 100644 index c676ef0..0000000 --- a/UpdateLib/UpdateLib/UI/WizardPageCollection.cs +++ /dev/null @@ -1,178 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; - -namespace MatthiWare.UpdateLib.UI -{ - public class WizardPageCollection : IList - { - private List store; - - private int index = 0; - - public IWizardPage CurrentPage - { - get - { - return this[index]; - } - set - { - index = store.IndexOf(value); - } - } - - public IWizardPage FirstPage { get { return this.First(); } } - - public IWizardPage LastPage { get { return this.Last(); } } - - - - public WizardPageCollection() { store = new List(5); } - - public void Cancel() - { - - } - - public IWizardPage Next() - { - if (CurrentPage == LastPage) - return null; - - if (CurrentPage.IsBusy || !CurrentPage.IsDone) - return null; - - index++; - return CurrentPage; - } - - public IWizardPage Previous() - { - if (CurrentPage == FirstPage) - return null; - - //if (CurrentPage.IsBusy || !CurrentPage.IsDone) - // return null; - - index--; - return CurrentPage; - } - - public bool AllDone() - { - foreach (IWizardPage page in store) - { - if (!page.IsDone || page.HasErrors) - return false; - } - return true; - } - - #region IList Implementation - - public int Count - { - get - { - return store.Count; - } - } - - public bool IsReadOnly - { - get - { - return false; - } - } - - public IWizardPage this[int index] - { - get - { - return store[index]; - } - - set - { - store[index] = value; - } - } - - public int IndexOf(IWizardPage item) - { - return store.IndexOf(item); - } - - public void Insert(int index, IWizardPage item) - { - store.Insert(index, item); - } - - public void RemoveAt(int index) - { - store.RemoveAt(index); - } - - public void Add(IWizardPage item) - { - if (item == null) - throw new ArgumentNullException("item"); - - item.Conent.Dock = System.Windows.Forms.DockStyle.Fill; - store.Add(item); - } - - public void Clear() - { - index = 0; - store.Clear(); - } - - public bool Contains(IWizardPage item) - { - return store.Contains(item); - } - - public void CopyTo(IWizardPage[] array, int arrayIndex) - { - store.CopyTo(array, arrayIndex); - } - - public bool Remove(IWizardPage item) - { - return store.Remove(item); - } - - public IEnumerator GetEnumerator() - { - return store.GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return store.GetEnumerator(); - } - - #endregion - } -} diff --git a/UpdateLib/UpdateLib/UpdateLib.csproj b/UpdateLib/UpdateLib/UpdateLib.csproj index f04610e..084d41f 100644 --- a/UpdateLib/UpdateLib/UpdateLib.csproj +++ b/UpdateLib/UpdateLib/UpdateLib.csproj @@ -1,256 +1,10 @@ - - - + - Debug - AnyCPU - {4394BE57-95E2-45B1-A968-1404B0590B35} - Library - Properties + netstandard2.0 MatthiWare.UpdateLib - UpdateLib - v3.5 - 512 - - + false - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - Auto - - - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false - - - updater.ico - - - - - - - - - - - - - - Properties\SharedAssemblyInfo.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - UserControl - - - UpdaterControl.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - True - True - Resources.resx - - - - - - - - UserControl - - - ChangelogPage.cs - - - UserControl - - - FinishPage.cs - - - UserControl - - - IntroPage.cs - - - UserControl - - - RollbackPage.cs - - - UserControl - - - UpdatePage.cs - - - - Form - - - MessageDialog.cs - - - - Form - - - UpdaterForm.cs - - - - - - - - - - - - - - - - - - - - - - - - - - UpdaterControl.cs - - - ResXFileCodeGenerator - Resources.Designer.cs - - - ChangelogPage.cs - - - FinishPage.cs - - - IntroPage.cs - - - RollbackPage.cs - - - UpdatePage.cs - - - MessageDialog.cs - - - UpdaterForm.cs - + - - - \ No newline at end of file diff --git a/UpdateLib/UpdateLib/Updater.cs b/UpdateLib/UpdateLib/Updater.cs index da5cf9d..bd0c539 100644 --- a/UpdateLib/UpdateLib/Updater.cs +++ b/UpdateLib/UpdateLib/Updater.cs @@ -24,21 +24,13 @@ using System; using System.Collections.Generic; -using System.ComponentModel; using System.Diagnostics; -using System.Drawing; using System.Linq; using System.Reflection; using System.Security; -using System.Windows.Forms; using MatthiWare.UpdateLib.Common; -using MatthiWare.UpdateLib.Common.Exceptions; using MatthiWare.UpdateLib.Files; -using MatthiWare.UpdateLib.Logging; -using MatthiWare.UpdateLib.Security; -using MatthiWare.UpdateLib.Tasks; -using MatthiWare.UpdateLib.UI; using MatthiWare.UpdateLib.Utils; namespace MatthiWare.UpdateLib @@ -74,27 +66,8 @@ public static Updater Instance private const string m_argWait = "wait"; private const string m_rollback = "rollback"; private Lazy m_lazyPathVarConv = new Lazy(() => new PathVariableConverter()); - private Lazy m_lazyLogger = new Lazy(() => new Logger()); private InstallationMode m_installationMode = InstallationMode.Shared; - private LoadCacheTask m_loadCacheTask; - - private static Lazy m_lazyProductName = new Lazy(() => - { - AssemblyProductAttribute attr = Assembly.GetEntryAssembly()?.GetCustomAttributes(typeof(AssemblyProductAttribute), true).FirstOrDefault() as AssemblyProductAttribute; - - //AssemblyProductAttribute attr = Attribute.GetCustomAttribute(Assembly.GetEntryAssembly(), ) as AssemblyProductAttribute; - return attr?.Product ?? m_strUpdateLib; - }); - - private static Lazy m_lazyUpdaterName = new Lazy(() => - { - AssemblyProductAttribute attr = Assembly.GetAssembly(typeof(Updater))?.GetCustomAttributes(typeof(AssemblyProductAttribute), true).FirstOrDefault() as AssemblyProductAttribute; - - //AssemblyProductAttribute attr = Attribute.GetCustomAttribute(), typeof(AssemblyProductAttribute)) as AssemblyProductAttribute; - return attr?.Product ?? m_strUpdateLib; - }); - #endregion #region Events @@ -102,16 +75,12 @@ public static Updater Instance /// /// Check for updates completed event. /// - public event EventHandler CheckForUpdatesCompleted; + //public event EventHandler CheckForUpdatesCompleted; #endregion #region Properties - internal static string ProductName => m_lazyProductName; - - internal static string UpdaterName => m_lazyUpdaterName; - /// /// Gets the command line parser. Use this to add additional command line arguments that need to be parsed. /// @@ -123,11 +92,6 @@ public static Updater Instance /// If you want to specify an unsafe connection you should enable public IList UpdateURLs { get; } = new List(); - /// - /// Gets the logger for the application. - /// - public ILogger Logger => m_lazyLogger.Value; - /// /// Gets or sets the Updater Installation mode /// @@ -139,7 +103,6 @@ public InstallationMode InstallationMode if (m_installationMode != value) { m_installationMode = value; - IOUtils.ReinitializeAppData(); } } } @@ -171,7 +134,6 @@ public InstallationMode InstallationMode public PathVariableConverter Converter { get { return m_lazyPathVarConv.Value; } - private set { m_lazyPathVarConv.Value = value; } } /// @@ -180,15 +142,15 @@ public PathVariableConverter Converter /// public bool AllowUnsafeConnection { get; set; } = false; - /// - /// Gets the clean up task - /// - public CleanUpTask CleanUpTask { get; private set; } + ///// + ///// Gets the clean up task + ///// + //public CleanUpTask CleanUpTask { get; private set; } - /// - /// Gets the update cache task - /// - public UpdateCacheTask UpdateCacheTask { get; private set; } + ///// + ///// Gets the update cache task + ///// + //public UpdateCacheTask UpdateCacheTask { get; private set; } @@ -233,18 +195,6 @@ public Updater ConfigureAllowUnsafeConnections(bool allow) return this; } - /// - /// Configures the logger - /// - /// Action to perform on the logger - /// - public Updater ConfigureLogger(Action action) - { - action(Logger); - - return this; - } - /// /// Configures the command line parser /// @@ -341,7 +291,7 @@ public void Initialize() IsInitialized = true; - if (StartUpdating) CheckForUpdates(); + //if (StartUpdating) CheckForUpdates(); } /// @@ -349,9 +299,7 @@ public void Initialize() /// private void StartInitializationTasks() { - CleanUpTask = new CleanUpTask("%appdir%").ConfigureAwait(false).Start(); - UpdateCacheTask = new UpdateCacheTask().ConfigureAwait(false).Start(); - m_loadCacheTask = new LoadCacheTask().ConfigureAwait(false).Start(); + } /// @@ -366,174 +314,11 @@ private void WaitForProcessToExit(int pid) process?.WaitForExit(); } - /// - /// Starting the update process - /// - /// Whether or not there is an update available and the latest version - public CheckForUpdatesTask.CheckForUpdatesResult CheckForUpdates() - => CheckForUpdatesAsync().AwaitTask().Result; - - /// - /// Starting the update process - /// - /// The owner window - /// Whether or not there is an update available and the latest version - public CheckForUpdatesTask.CheckForUpdatesResult CheckForUpdates(IWin32Window owner) - => CheckForUpdatesAsync(owner).AwaitTask().Result; - - /// - /// Start the update process asynchronously - /// - /// The update checker task. - public CheckForUpdatesTask CheckForUpdatesAsync() - => CheckForUpdatesAsync(null); - - /// - /// Start the update process asynchronously - /// - /// The owner window - /// The update checker task. - public CheckForUpdatesTask CheckForUpdatesAsync(IWin32Window owner) - { - if (!IsInitialized) throw new InvalidOperationException("The updater needs to be initialized first"); - if (UpdateURLs.Count == 0) throw new ArgumentException("No uri's specified", nameof(UpdateURLs)); - - var urls = UpdateURLs.Where(u => !AllowUnsafeConnection || (AllowUnsafeConnection && u.StartsWith(Uri.UriSchemeHttps))); - - if (AllowUnsafeConnection && urls.Count() == 0) - throw new SecurityException("Using unsafe connections to update from is not allowed"); - - var version = GetCache().CurrentVersion; - - CheckForUpdatesTask task = new CheckForUpdatesTask(urls.ToList(), version); - task.TaskCompleted += (o, e) => - { - bool error = e.Error != null; - bool cancelled = e.Cancelled; - bool update = task.Result.UpdateAvailable; - bool adminReq = task.Result.AdminRightsNeeded; - - CheckForUpdatesCompleted?.Invoke(task, new CheckForUpdatesCompletedEventArgs(task.Result, e)); - - if (!update || cancelled || error) - { - if (error) - HandleException(owner, e.Error); - else if (cancelled) - HandleUserCancelled(owner); - else if (!update) - HandleNoUpdate(owner, task.Result.Version); - - return; - } - - DialogResult result = DialogResult.Yes; - - if (!UpdateSilently && !StartUpdating) - result = MessageDialog.Show( - owner, - "Update available", - $"Version {task.Result.Version} available", - "Update now?\nPress yes to update or no to cancel.", - SystemIcons.Question); - - if (result != DialogResult.Yes) - return; - - if (((!StartUpdating && NeedsRestartBeforeUpdate) || (adminReq && !PermissionUtil.IsProcessElevated)) - && !RestartApp(owner, true, UpdateSilently, true, adminReq)) - return; - - if (UpdateSilently) - UpdateWithoutGUI(task.Result.UpdateInfo, task.Result.DownloadURLs); - else - { - UpdaterForm updateForm = new UpdaterForm(task.Result.UpdateInfo, task.Result.ApplicationName); - updateForm.ShowDialog(owner); - } - }; - - return task.Start(); - } - - private void HandleException(IWin32Window owner, Exception e) - { - if (UpdateSilently) - return; - - if (e is NoInternetException) - MessageDialog.Show( - owner, - $"{ProductName} Updater", - "Error while updating", - "Unable to connect to the update server\nPlease check your internet connection and try again!", - SystemIcons.Error, - MessageBoxButtons.OK); - else if (e is InvalidUpdateServerException) - MessageDialog.Show( - owner, - $"{ProductName} Updater", - "Error while updating", - "No valid update server available\nPlease contact the software vendor!", - SystemIcons.Error, - MessageBoxButtons.OK); - else if (e is Win32Exception) - MessageDialog.Show( - owner, - $"{ProductName} Updater", - "Update cancelled", - "Update got cancelled by the user!", - SystemIcons.Warning, - MessageBoxButtons.OK); - else - MessageDialog.Show( - owner, - $"{ProductName} Updater", - "Error while updating", - "Check the log files for more information!", - SystemIcons.Error, - MessageBoxButtons.OK); - } - - private void HandleNoUpdate(IWin32Window owner, UpdateVersion latest) - { - Logger.Info(nameof(Updater), nameof(CheckForUpdatesAsync), "No update available"); - - if (!UpdateSilently) - MessageDialog.Show( - owner, - $"{ProductName} Updater", - "No Update available", - $"You already have the latest version {latest}", - SystemIcons.Information, - MessageBoxButtons.OK); - } - - private void HandleUserCancelled(IWin32Window owner) - { - Logger.Info(nameof(Updater), nameof(CheckForUpdatesAsync), "Update cancalled"); - - if (!UpdateSilently) - MessageDialog.Show( - owner, - $"{ProductName} Updater", - "Cancelled", - "Update got cancelled", - SystemIcons.Warning, - MessageBoxButtons.OK); - } - - /// - /// Gets the cached index of the current application - /// - /// The of the current application - public HashCacheFile GetCache2() => UpdateCacheTask.AwaitTask().Result; - /// /// Gets the cache of the updater /// /// The loaded of the current application - public CacheFile GetCache() => m_loadCacheTask.AwaitTask().Result; + //public CacheFile GetCache() => m_loadCacheTask.AwaitTask().Result; /// /// Updates without user interaction @@ -541,30 +326,36 @@ private void HandleUserCancelled(IWin32Window owner) /// The update specifications file private void UpdateWithoutGUI(UpdateInfo updateInfo, IList urls) { - var downloadManager = new DownloadManager(updateInfo, urls); + //var downloadManager = new DownloadManager(updateInfo, urls); - downloadManager.Completed += (o, e) => - { - GetCache2().Save(); - RestartApp(); - }; + //downloadManager.Completed += (o, e) => + //{ + // //GetCache2().Save(); + // RestartApp(); + //}; - downloadManager.Download(); + //downloadManager.Download(); } - internal bool RestartApp(IWin32Window owner = null, bool update = false, bool silent = false, bool waitForPid = true, bool asAdmin = false) + internal bool RestartApp(bool update = false, bool silent = false, bool waitForPidExit = true, bool asAdmin = false) { - Logger.Debug(nameof(Updater), nameof(RestartApp), $"Restarting app: [update={update}; silent={silent}; waitForPid={waitForPid}; asAdmin={asAdmin}]"); + //Logger.Debug(nameof(Updater), nameof(RestartApp), $"Restarting app: [update={update}; silent={silent}; waitForPidExit={waitForPidExit}; asAdmin={asAdmin}]"); + + var args = new List(Environment.GetCommandLineArgs()); - List args = new List(Environment.GetCommandLineArgs()); + var cmdUpdate = $"{CommandLine.ParameterPrefix}{m_argUpdate}"; + var cmdSilent = $"{CommandLine.ParameterPrefix}{m_argUpdateSilent}"; + var cmdWait = $"{CommandLine.ParameterPrefix}{m_argWait}"; for (int i = 0; i < args.Count; i++) { - if ((!update && args[i] == CommandLine.ParameterPrefix + m_argUpdate) || (!silent && args[i] == CommandLine.ParameterPrefix + m_argUpdateSilent)) + var carg = args[i]; + + if ((!update && carg == cmdUpdate) || (!silent && carg == cmdSilent)) { args[i] = string.Empty; } - else if (args[i] == CommandLine.ParameterPrefix + m_argWait) + else if (carg == cmdWait) { args[i] = string.Empty; if (i + 1 < args.Count) @@ -572,17 +363,17 @@ internal bool RestartApp(IWin32Window owner = null, bool update = false, bool si } } - if (waitForPid && !args.Contains(CommandLine.ParameterPrefix + m_argWait)) + if (waitForPidExit && !args.Contains(cmdWait)) { - args.Add(CommandLine.ParameterPrefix + m_argWait); + args.Add(cmdWait); args.Add(Process.GetCurrentProcess().Id.ToString()); } - if (update && !args.Contains(CommandLine.ParameterPrefix + m_argUpdate)) - args.Add(CommandLine.ParameterPrefix + m_argUpdate); + if (update && !args.Contains(cmdUpdate)) + args.Add(cmdUpdate); - if (silent && !args.Contains(CommandLine.ParameterPrefix + m_argUpdateSilent)) - args.Add(CommandLine.ParameterPrefix + m_argUpdateSilent); + if (silent && !args.Contains(cmdSilent)) + args.Add(cmdSilent); string arguments = args.NotEmpty().Distinct().AppendAll(" "); @@ -595,15 +386,14 @@ internal bool RestartApp(IWin32Window owner = null, bool update = false, bool si try { - Process proc = Process.Start(startInfo); + Process.Start(startInfo); + // gracefully exit the current process Environment.Exit(0); } catch (Exception e) { - Logger.Error(nameof(Updater), nameof(RestartApp), e); - - HandleException(owner, e); + // Logger.Error(nameof(Updater), nameof(RestartApp), e); return false; } diff --git a/UpdateLib/UpdateLib/UpdaterControl.bmp b/UpdateLib/UpdateLib/UpdaterControl.bmp deleted file mode 100644 index b40cc5a9a10e131119577e06603ce1ab0d57c371..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 822 zcmZ?rHDhJ~12Z700mK4O%*Y@C76%bW_#hZ2@E-|$`}uA0>2>idioEA1dCgA@Uy{?l zd+PnSkCBx8-+ui7gnR121^+oIMcZ2^o?O^=czV^|p4{z?k!$kpriINpwj8d-d16HL zyxb+n*M-c>n0;<#)1fJ$t8*L|M%yijbXgqdyFAr>NrKt5fcnk75G|=o%huo6owvSW z;l*{yn=6fG`x#F5(eH4#>y*vZ_)Q(-+@v$UflJY5N|xg&ty)ZUav>$ypn(a{>9D7pL>3F#olhiS$;rs zjHdb8GzT2KejH-^=O163+Cpqv12&)A1r&Mx`EB%!?B3&Z&E^CF6$6n@opbkwslb4O zs0We{UOxuv`t|46>_f}!I)lQeWQ4EDGo2f#)#Q{ut>p3Br*M^U#@-u8vX)fMI=)Q1 z+1aN*PPfb9{ zAyZN(9hyJu?26uFa~u~%1AV7nYz>qx-_;qsGW*M~Z>Jt#jF_K&>G5@-;P;>3XY5+! z+!oq+U{dtDB4AJh)vFbO)UUs?Q)iM#--&tWo?qR1Yk$g;QvV4FK7DZ+D=I7Zbth~r zGnpHx)9egV4>ljDrDfYBoqqSQHMx^cE}VIGdDqcd)q8t^>BoOXI#97jiOtmYb9`ze z<&zA7iXmX??)f_PP6pF`Y!-yOFHLk_9BVc|NWa&^wAgL;nf(wo8;@;+ss>XJUOuXt b-{Mdks9j>OTk7cB5It$_%#U9_BC7!aEC2c3 diff --git a/UpdateLib/UpdateLib/Utils/IOUtils.cs b/UpdateLib/UpdateLib/Utils/IOUtils.cs deleted file mode 100644 index 1298990..0000000 --- a/UpdateLib/UpdateLib/Utils/IOUtils.cs +++ /dev/null @@ -1,161 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.IO; -using System.Text; - -using MatthiWare.UpdateLib.Common; - -namespace MatthiWare.UpdateLib.Utils -{ - public static class IOUtils - { - private static Lazy m_getAppDataPath = new Lazy(GetAppDataPath); - private static Lazy m_getCachePath = new Lazy(() => $"{AppDataPath}\\Cache"); - private static Lazy m_getLogPath = new Lazy(() => $"{AppDataPath}\\Log"); - private static Lazy m_getTempPath = new Lazy(() => $"{AppDataPath}\\Temp"); - - internal static void ReinitializeAppData() => m_getAppDataPath.Reset(); - - public static string AppDataPath => m_getAppDataPath; - public static string CachePath => m_getCachePath; - public static string LogPath => m_getLogPath; - public static string TempPath => m_getTempPath; - - internal static string GetRemoteBasePath(string url) - { - if (string.IsNullOrEmpty(url)) throw new ArgumentNullException(nameof(url)); - - const char slash = '/'; - const char backslash = '\\'; - - StringBuilder builder = new StringBuilder(); - - foreach (var s in url.Split(slash, backslash).SkipLast(1)) - { - builder.Append(s); - builder.Append(slash); - } - - return builder.ToString(); - } - - private static string GetAppDataPath() - { - string path = GetPathPrefix(); - string updaterName = Updater.UpdaterName; - string productName = Updater.ProductName; - - return $@"{path}\{productName}\{updaterName}"; - } - - private static string GetPathPrefix() - { - switch (Updater.Instance.InstallationMode) - { - case InstallationMode.Local: - return Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); - case InstallationMode.Shared: - default: - return Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); - } - } - - internal static byte[] CheckedReadBytes(this Stream stream, int size) - { - byte[] ret = new byte[size]; - int index = 0; - - while (index < size) - { - int read = stream.Read(ret, index, size - index); - - if (read == 0) - throw new EndOfStreamException(); - - index += read; - } - - return ret; - } - - internal static void CheckedReadBytes(this Stream stream, byte[] buffer, int offset, int length) - { - int index = offset; - int size = offset + length; - - while (index < size) - { - int read = stream.Read(buffer, index, size); - - if (read == 0) - throw new EndOfStreamException(); - - index += read; - } - } - - internal static byte CheckedReadByte(this Stream stream) - { - int ret = stream.ReadByte(); - - if (ret == -1) - throw new IOException("Unable to read byte from stream"); - - return (byte)ret; - } - - internal static int ReadBigEndian7BitEncodedInt(this Stream stream) - { - int ret = 0; - - for (int i = 0; i < 5; i++) - { - int b = stream.ReadByte(); - if (b == -1) - throw new EndOfStreamException(); - - ret = (ret << 7) | (b & 0x7f); - if ((b & 0x80) == 0) - return ret; - } - - throw new IOException("Invalid 7-bit encoded integer in stream"); - } - - internal static void Copy(Stream source, Stream dest, byte[] buffer) - { - if (source == null) throw new ArgumentNullException(nameof(source)); - if (dest == null) throw new ArgumentNullException(nameof(dest)); - if (buffer == null) throw new ArgumentNullException(nameof(buffer)); - - bool copying = true; - - while (copying) - { - int bytesRead = source.Read(buffer, 0, buffer.Length); - copying = bytesRead > 0; - - if (copying) - dest.Write(buffer, 0, bytesRead); - else - dest.Flush(); - } - } - } -} diff --git a/UpdateLib/UpdateLib/Utils/Lazy.cs b/UpdateLib/UpdateLib/Utils/Lazy.cs deleted file mode 100644 index 9caa64c..0000000 --- a/UpdateLib/UpdateLib/Utils/Lazy.cs +++ /dev/null @@ -1,84 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; - -namespace MatthiWare.UpdateLib.Utils -{ - /// - /// Threadsafe lazy initialization - /// - /// The return type - public class Lazy - { - private readonly Func m_initFunction; - - private readonly object sync = new object(); - private bool m_initialized = false; - - private T m_storedValue = default(T); - - /// - /// Gets the value and initializes once. - /// - public T Value - { - get - { - if (!m_initialized) - lock (sync) - if (!m_initialized) - { - m_storedValue = m_initFunction(); - m_initialized = true; - } - - return m_storedValue; - } - set - { - lock (sync) - { - m_initialized = true; - m_storedValue = value; - } - } - } - - /// - /// Resets the lazy function - /// - public void Reset() - { - lock (sync) - m_initialized = false; - } - - /// - /// Makes a new instance of an lazy initializer - /// - /// The lazy initialization function - public Lazy(Func initFunction) - { - m_initFunction = initFunction; - } - - public static implicit operator T(Lazy self) - => self.Value; - - } -} diff --git a/UpdateLib/UpdateLib/Utils/NetworkUtils.cs b/UpdateLib/UpdateLib/Utils/NetworkUtils.cs deleted file mode 100644 index b4dc6a7..0000000 --- a/UpdateLib/UpdateLib/Utils/NetworkUtils.cs +++ /dev/null @@ -1,31 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using MatthiWare.UpdateLib.Win32; - -namespace MatthiWare.UpdateLib.Utils -{ - public static class NetworkUtils - { - public static bool HasConnection() - { - int desc; - return NativeMethods.InternetGetConnectedState(out desc, 0); - } - - } -} diff --git a/UpdateLib/UpdateLib/Utils/RegistryHelper.cs b/UpdateLib/UpdateLib/Utils/RegistryHelper.cs deleted file mode 100644 index 37bf802..0000000 --- a/UpdateLib/UpdateLib/Utils/RegistryHelper.cs +++ /dev/null @@ -1,160 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using MatthiWare.UpdateLib.Common; -using MatthiWare.UpdateLib.Tasks; -using Microsoft.Win32; -using System; -using System.Linq; -using System.Security.AccessControl; - -namespace MatthiWare.UpdateLib.Utils -{ - public static class RegistryHelper - { - - public static RegistryKey GetOrMakeKey(RegistryKeyEntry key) - { - if (key == null) throw new ArgumentNullException(nameof(key)); - - string pathToKeyRoot = key.Parent.DestinationLocation; - - return GetOrMakeKey(pathToKeyRoot); - } - - public static RegistryKey GetOrMakeKey(string pathToKeyRoot) - { - if (string.IsNullOrEmpty(pathToKeyRoot)) throw new ArgumentNullException(nameof(pathToKeyRoot)); - - string pathToKey = pathToKeyRoot.Split(char.Parse(@"\")).Skip(1).AppendAll(@"\"); - - return OpenSubKey(GetRootKey(pathToKeyRoot), pathToKey); - } - - private static RegistryKey GetRootKey(string pathToKeyRoot) - { - if (pathToKeyRoot.StartsWith("HKEY_LOCAL_MACHINE")) - return Registry.LocalMachine; - else if (pathToKeyRoot.StartsWith("HKEY_CURRENT_USER")) - return Registry.CurrentUser; - else if (pathToKeyRoot.StartsWith("HKEY_CLASSES_ROOT")) - return Registry.ClassesRoot; - else if (pathToKeyRoot.StartsWith("HKEY_USERS")) - return Registry.Users; - else if (pathToKeyRoot.StartsWith("HKEY_CURRENT_CONFIG")) - return Registry.CurrentConfig; - else if (pathToKeyRoot.StartsWith("HKEY_PERFORMANCE_DATA")) - return Registry.PerformanceData; - else if (pathToKeyRoot.StartsWith("HKEY_DYN_DATA")) - return Registry.DynData; - else - return null; - } - - private static RegistryKey OpenSubKey(RegistryKey key, string path) - { - if (key == null) - return null; - - RegistryKey reg = key?.OpenSubKey(path, RegistryKeyPermissionCheck.ReadWriteSubTree, RegistryRights.FullControl); - - if (reg != null) - return reg; - - key.CreateSubKey(path, RegistryKeyPermissionCheck.ReadWriteSubTree); - - return OpenSubKey(key, path); - } - - internal static void InternalOpenSubKey(string root, string keyName) - { - RegistryKey key = GetRootKey(root); - - foreach (string item in root.Split(char.Parse(@"\")).Skip(1).NotEmpty()) - { - RegistryKey tmp = key?.OpenSubKey(item, RegistryKeyPermissionCheck.ReadWriteSubTree, RegistryRights.FullControl); - key?.Close(); - - key = tmp; - } - - key?.Close(); - } - - public static bool IsSame(RegistryKeyEntry key) - { - if (key == null) - return false; - - string path = key.Parent.DestinationLocation; - - try - { - object value = Registry.GetValue(path, key.Name, new NullObject()); - - return key.Value.Equals(value); - - } - catch (Exception e) - { - Updater.Instance.Logger.Error(nameof(RegistryHelper), nameof(IsSame), e); - } - - return false; - } - - public static bool Exists(RegistryKeyEntry key, out object value) - { - value = null; - - if (key == null) - return false; - - string path = key.Parent.DestinationLocation; - - try - { - value = Registry.GetValue(path, key.Name, null); - - return value != null; - } - catch (Exception e) - { - Updater.Instance.Logger.Error(nameof(RegistryHelper), nameof(Exists), e); - } - - return false; - } - - public static void Update(RegistryKeyEntry logicalKey, UpdateRegistryTask.RollbackData rollback) - { - if (logicalKey == null) throw new ArgumentNullException(nameof(logicalKey)); - - RegistryKey key = GetOrMakeKey(logicalKey); - - if (key?.GetValueNames().Contains(logicalKey.Name) ?? false) - rollback.type = key.GetValueKind(logicalKey.Name); - - key.SetValue(logicalKey.Name, logicalKey.Value, logicalKey.Type); - } - - /// - /// We do nothing with this - /// - private class NullObject { } - } -} diff --git a/UpdateLib/UpdateLib/Win32/NativeMethods.cs b/UpdateLib/UpdateLib/Win32/NativeMethods.cs deleted file mode 100644 index 5e7ba9f..0000000 --- a/UpdateLib/UpdateLib/Win32/NativeMethods.cs +++ /dev/null @@ -1,28 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System.Runtime.InteropServices; - -namespace MatthiWare.UpdateLib.Win32 -{ - internal static class NativeMethods - { - [DllImport("wininet.dll")] - internal static extern bool InternetGetConnectedState(out int connDescription, int reservedValue); - - } -} diff --git a/UpdateLib/UpdateLib/updater.ico b/UpdateLib/UpdateLib/updater.ico deleted file mode 100644 index c952e49470813cd4e96fa2bcf0bc3e004851c040..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10806 zcmb_i2Urx>79Na=6+uCzw`F%(SYVeby{JgFBKDww*pOZNR>X?2Ym5bZ zPojos@_aEqV~iRs@V|2h)`wW)OWg0fduL~7=KlBGb5HrtaGVm?hLg!S>J7L`A;*b0 zj#E`_`aQ8N$DN~dCUlN2;l@&9*YO`?j_cN`sWqM8H~^od*%S@zY@OfVTb}EmC|~AR zCR^frmf90)cV$a`Yh_FQw$u3n`EvhstGs|q$Z~#WmgNaa zraMHLZV+a>LpYaOPE!-jYC3O{;Re$z53uXiv#bl~e(66M|L@+*CF>7TOOc<@o@oc; zRA(4wJ43j*H=I`oA#ig9ChSf@?EV}~+MSA!oii}9Iu?OjrXpZNIPCHVK{%V{ljZ_; zf43CbiH=!jqqr==7k?Me$KJ7h z<@uI|AB%-uNBTOS*09UR+|wal5~!PE|Ije07X)+N5VCs)N-u1}y35;9aJB+VPOiqh z?pPyHXLpV;^19Rfa_;N->|X&mo!5K9+~9BP&Sm%aMF=5#gVQn3`FbvOA5(9#Wlz zFRS7)a!WLVHcds~#t01AGzFezqaaRkg;s)fL-$O17LBX)E<7#INoVzeILR5JL?@7J zuXM;T^=SD&t!G>PET<~NSUc!vIU;Ib7OKA6hq8;?kbibP>B?GO?n_Db%TBF9_R$rH z+dCVf)zdI!<75opFcG7+#v+vDJ&|NTc~=TT=)cihV|eU?H%vzVig5U?3xiKZ2t3Nh zzxmOc%t;uCTzY|gH`7@Bmc}gtfa=z;q+Qe*qIE6(xDLM_J${% zx=C01@aN3(eBilu42ExstQ`)Eg+36)IYBSY;RNYL z+t#=hzs)i{8?5H|;Bn&-A)>5cMh+p+Q5ZWN#0 zNV>irh36^>dj*DVj)FM14@~p=K~~@o>!JZ5+y36h{+Aa9z#`uduB(Q_hp_isHOE z4Qy)ccs1do|7_?wHV-Sh&zk1yzGf8M){Nk>+ZGRQk^x=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tG5U$}VZ)a9wLI>cVliS!Uf7?TFYksltIsQ+MWY*}i@aeNVfR!k zLKfKa+Lp&$a0f%xc(c2y+velauiqkQdlaktH_&?&&$J@s1)`$9N`jTW+qa)%X7J{H z?b<6(lk5pBn9z8nt`>W5AH#x^#l&^@rP#@}f%J`kUr%ef(^$Xq(0a#$p)a|3&DUI+ za-`VZF59oZ^yEft`gRXr$70-xeDwf`8KGaE3`@SYFu!l7{j(k5?|^=K0c6Y%uV-m)Ad5Tq)8hWoGQV8>L20Uy{ky3 zd3xjoHu&a@YKY#Lh6Sff@#U@rn3ecKlIjL~%2gHjv-!4(HJGC^(+uvUv-uY)vHj)& zlwGaHlC!H3cQ6P3o5CP1_CvSPqK0;X+Kbu`*L_4>)f;(A+X(&D>e1#e4d=PidiubD zVpfOpVK6K5fh605YL~)#&Rf}rjmMhNc$;v=v7)ECUnfbTYk@e{=_%oRN&fexINIr+ zD9SO1?E71>*CVo-W0^f=wp6LP9i_gGPLXj^IZXD3e)gu8-rNpTU-t#sF1q)>+DCmT From c45d3406ad193f49a79d06d022413b929d3adfbe Mon Sep 17 00:00:00 2001 From: Matthias Beerens Date: Thu, 16 Aug 2018 17:24:56 +0200 Subject: [PATCH 33/40] Revert "Update to .NET Standard 2.0" This reverts commit d003df58a4f00cb8c5d4b7b47723cd661990e0f6. --- UpdateLib/TestApp/TestApp.csproj | 92 +- .../Data/FilesPage/GenFile.cs | 68 ++ .../Data/FilesPage/GenFolder.cs | 83 ++ .../Data/FilesPage/GenReg.cs | 115 ++ .../Data/FilesPage/IGenItem.cs | 34 + .../Data/ListViewFolder.cs | 39 + .../Data/ListViewGenItem.cs | 45 + .../Data/TreeViewFolderNode.cs | 38 + .../UpdateLib.Generator/Files/ProjectFile.cs | 36 + .../UpdateLib.Generator/Generator_logo.ico | Bin 0 -> 167188 bytes .../UpdateLib.Generator/MainForm.Designer.cs | 264 +++++ UpdateLib/UpdateLib.Generator/MainForm.cs | 206 ++++ UpdateLib/UpdateLib.Generator/MainForm.resx | 202 ++++ UpdateLib/UpdateLib.Generator/Program.cs | 6 + .../Properties/Resources.Designer.cs | 163 +++ .../Properties/Resources.resx | 151 +++ .../Properties/Settings.Designer.cs | 26 + .../Properties/Settings.settings | 7 + .../Resources/Registry Editor_16px.png | Bin 0 -> 342 bytes .../Resources/Registry Editor_32px.png | Bin 0 -> 569 bytes .../UpdateLib.Generator/Resources/cross.png | Bin 0 -> 912 bytes .../Resources/folder_transparent_16px.png | Bin 0 -> 436 bytes .../UpdateLib.Generator/Resources/gears.png | Bin 0 -> 446 bytes .../Resources/image_transparent_16px.png | Bin 0 -> 484 bytes .../UpdateLib.Generator/Resources/loading.gif | Bin 0 -> 98823 bytes .../Resources/loading_gear.gif | Bin 0 -> 73023 bytes .../Resources/project_16px.png | Bin 0 -> 244 bytes .../Resources/reg_bin_16px.png | Bin 0 -> 345 bytes .../Resources/reg_string_16px.png | Bin 0 -> 343 bytes .../Tasks/LoadDirectoryTask.cs | 104 ++ .../Tasks/UpdateGeneratorTask.cs | 158 +++ .../UpdateLib.Generator/UI/ElipseComponent.cs | 135 +++ .../UpdateLib.Generator/UI/FlatButton.cs | 205 ++++ .../UpdateLib.Generator/UI/GradientPanel.cs | 134 +++ .../UpdateLib.Generator/UI/HoverPictureBox.cs | 104 ++ .../UI/InputDialog.Designer.cs | 138 +++ .../UpdateLib.Generator/UI/InputDialog.cs | 108 ++ .../UpdateLib.Generator/UI/InputDialog.resx | 306 +++++ .../UI/LoaderControl.Designer.cs | 64 + .../UpdateLib.Generator/UI/LoaderControl.cs | 144 +++ .../UpdateLib.Generator/UI/LoaderControl.resx | 126 ++ .../UpdateLib.Generator/UI/MoveablePanel.cs | 71 ++ .../UI/Pages/BuilderPage.Designer.cs | 133 +++ .../UI/Pages/BuilderPage.cs | 155 +++ .../UI/Pages/BuilderPage.resx | 123 ++ .../UI/Pages/FilesPage.Designer.cs | 232 ++++ .../UpdateLib.Generator/UI/Pages/FilesPage.cs | 310 +++++ .../UI/Pages/FilesPage.resx | 132 +++ .../UI/Pages/InformationPage.Designer.cs | 113 ++ .../UI/Pages/InformationPage.cs | 59 + .../UI/Pages/InformationPage.resx | 120 ++ .../UI/Pages/PageControlBase.cs | 79 ++ .../UI/Pages/PageControlBase.resx | 120 ++ .../UI/Pages/RegistryPage.Designer.cs | 255 ++++ .../UI/Pages/RegistryPage.cs | 256 ++++ .../UI/Pages/RegistryPage.resx | 177 +++ .../UpdateLib.Generator.csproj | 193 ++- .../UpdateLib.Tests/UpdateLib.Tests.csproj | 115 +- UpdateLib/UpdateLib.Tests/packages.config | 15 + UpdateLib/UpdateLib.sln | 10 +- UpdateLib/UpdateLib/Common/DirectoryEntry.cs | 10 + UpdateLib/UpdateLib/Common/HashCacheEntry.cs | 4 +- .../UpdateLib/Common/RegistryKeyEntry.cs | 52 + UpdateLib/UpdateLib/Common/UpdateVersion.cs | 32 +- UpdateLib/UpdateLib/Common/WorkerScheduler.cs | 122 ++ .../UpdateLib/Compression/Checksum/Adler32.cs | 209 ++++ .../UpdateLib/Compression/Checksum/Crc32.cs | 217 ++++ .../Compression/Checksum/IChecksum.cs | 91 ++ .../Compression/Deflaters/Deflater.cs | 464 ++++++++ .../Deflaters/DeflaterConstants.cs | 181 +++ .../Compression/Deflaters/DeflaterEngine.cs | 850 +++++++++++++ .../Compression/Deflaters/DeflaterHuffman.cs | 894 ++++++++++++++ .../Compression/Deflaters/DeflaterPending.cs | 53 + .../Compression/Deflaters/Inflater.cs | 857 +++++++++++++ .../Deflaters/InflaterDynHeader.cs | 207 ++++ .../Deflaters/InflaterHuffmanTree.cs | 257 ++++ .../Compression/Deflaters/PendingBuffer.cs | 258 ++++ UpdateLib/UpdateLib/Compression/GZip/GZip.cs | 62 + .../Compression/GZip/GZipConstants.cs | 86 ++ .../Compression/GZip/GZipException.cs | 51 + .../Compression/GZip/GZipInputStream.cs | 382 ++++++ .../Compression/GZip/GZipOutputStream.cs | 258 ++++ .../UpdateLib/Compression/PatchBuilder.cs | 23 + UpdateLib/UpdateLib/Compression/Patcher.cs | 37 + .../Streams/DeflaterOutputStream.cs | 388 ++++++ .../Streams/InflaterInputStream.cs | 642 ++++++++++ .../Compression/Streams/OutputWindow.cs | 233 ++++ .../Compression/Streams/StreamManipulator.cs | 282 +++++ .../Compression/VCDiff/AddressCache.cs | 81 ++ .../UpdateLib/Compression/VCDiff/CodeTable.cs | 111 ++ .../Compression/VCDiff/Instruction.cs | 36 + .../Compression/VCDiff/VCDiffDecoder.cs | 198 ++++ .../VCDiff/VCDiffFormatException.cs | 35 + UpdateLib/UpdateLib/Compression/Zip/Zip.cs | 22 + .../UpdateLib/Compression/Zip/ZipConstants.cs | 470 ++++++++ .../UpdateLib/Compression/Zip/ZipEntry.cs | 1056 +++++++++++++++++ .../UpdateLib/Compression/Zip/ZipException.cs | 51 + .../UpdateLib/Compression/Zip/ZipExtraData.cs | 970 +++++++++++++++ .../UpdateLib/Compression/Zip/ZipFile.cs | 566 +++++++++ .../Compression/Zip/ZipHelperStream.cs | 618 ++++++++++ .../Compression/Zip/ZipInputStream.cs | 608 ++++++++++ .../Compression/Zip/ZipOutputStream.cs | 735 ++++++++++++ .../Controls/UpdaterControl.Designer.cs | 49 + .../UpdateLib/Controls/UpdaterControl.cs | 288 +++++ .../UpdateLib/Controls/UpdaterControl.resx | 120 ++ UpdateLib/UpdateLib/Files/CacheFile.cs | 6 +- UpdateLib/UpdateLib/Files/HashCacheFile.cs | 4 +- .../UpdateLib/Files/UpdateCatalogFile.cs | 5 +- .../UpdateLib/Files/UpdateMetadataFile.cs | 5 +- UpdateLib/UpdateLib/Logging/ILogWriter.cs | 28 + UpdateLib/UpdateLib/Logging/ILogger.cs | 35 + UpdateLib/UpdateLib/Logging/Logger.cs | 68 ++ .../Logging/Writers/ConsoleLogWriter.cs | 32 + .../Logging/Writers/FileLogWriter.cs | 72 ++ .../Properties/Resources.Designer.cs | 133 +++ UpdateLib/UpdateLib/Properties/Resources.resx | 142 +++ .../UpdateLib/Resources/project_16px.png | Bin 0 -> 244 bytes UpdateLib/UpdateLib/Resources/status_done.png | Bin 0 -> 454 bytes .../UpdateLib/Resources/status_download.png | Bin 0 -> 493 bytes .../UpdateLib/Resources/status_error.png | Bin 0 -> 912 bytes UpdateLib/UpdateLib/Resources/status_info.png | Bin 0 -> 617 bytes .../UpdateLib/Resources/status_update.png | Bin 0 -> 3169 bytes .../UpdateLib/Resources/status_warning.png | Bin 0 -> 502 bytes .../UpdateLib/Resources/status_working.png | Bin 0 -> 1600 bytes .../UpdateLib/Security/PermissionUtil.cs | 133 +++ UpdateLib/UpdateLib/Tasks/AsyncTask.cs | 436 +++++++ UpdateLib/UpdateLib/Tasks/AsyncTaskFactory.cs | 105 ++ .../Tasks/CheckForUpdatedItemsTask.cs | 107 ++ .../CheckForUpdatesCompletedEventArgs.cs | 49 + .../UpdateLib/Tasks/CheckForUpdatesTask.cs | 134 +++ .../Tasks/CheckRequiredPrivilegesTask.cs | 92 ++ UpdateLib/UpdateLib/Tasks/CleanUpTask.cs | 60 + UpdateLib/UpdateLib/Tasks/DownloadManager.cs | 118 ++ UpdateLib/UpdateLib/Tasks/DownloadTask.cs | 85 ++ UpdateLib/UpdateLib/Tasks/LoadCacheTask.cs | 38 + UpdateLib/UpdateLib/Tasks/UpdatableTask.cs | 49 + UpdateLib/UpdateLib/Tasks/UpdateCacheTask.cs | 125 ++ .../UpdateLib/Tasks/UpdateRegistryTask.cs | 138 +++ .../UI/Components/ChangelogPage.Designer.cs | 83 ++ .../UpdateLib/UI/Components/ChangelogPage.cs | 127 ++ .../UI/Components/ChangelogPage.resx | 235 ++++ .../UI/Components/FinishPage.Designer.cs | 97 ++ .../UpdateLib/UI/Components/FinishPage.cs | 170 +++ .../UpdateLib/UI/Components/FinishPage.resx | 131 ++ .../UI/Components/IntroPage.Designer.cs | 77 ++ .../UpdateLib/UI/Components/IntroPage.cs | 138 +++ .../UpdateLib/UI/Components/IntroPage.resx | 129 ++ .../UI/Components/RollbackPage.Designer.cs | 142 +++ .../UpdateLib/UI/Components/RollbackPage.cs | 12 + .../UpdateLib/UI/Components/RollbackPage.resx | 123 ++ .../UI/Components/UpdatePage.Designer.cs | 142 +++ .../UpdateLib/UI/Components/UpdatePage.cs | 374 ++++++ .../UpdateLib/UI/Components/UpdatePage.resx | 123 ++ UpdateLib/UpdateLib/UI/IWizardPage.cs | 41 + .../UpdateLib/UI/MessageDialog.Designer.cs | 152 +++ UpdateLib/UpdateLib/UI/MessageDialog.cs | 119 ++ UpdateLib/UpdateLib/UI/MessageDialog.resx | 306 +++++ UpdateLib/UpdateLib/UI/UIExtensions.cs | 43 + .../UpdateLib/UI/UpdaterForm.Designer.cs | 167 +++ UpdateLib/UpdateLib/UI/UpdaterForm.cs | 258 ++++ UpdateLib/UpdateLib/UI/UpdaterForm.resx | 306 +++++ .../UpdateLib/UI/WizardPageCollection.cs | 178 +++ UpdateLib/UpdateLib/UpdateLib.csproj | 254 +++- UpdateLib/UpdateLib/Updater.cs | 288 ++++- UpdateLib/UpdateLib/UpdaterControl.bmp | Bin 0 -> 822 bytes UpdateLib/UpdateLib/Utils/IOUtils.cs | 161 +++ UpdateLib/UpdateLib/Utils/Lazy.cs | 84 ++ UpdateLib/UpdateLib/Utils/NetworkUtils.cs | 31 + UpdateLib/UpdateLib/Utils/RegistryHelper.cs | 160 +++ UpdateLib/UpdateLib/Win32/NativeMethods.cs | 28 + UpdateLib/UpdateLib/updater.ico | Bin 0 -> 10806 bytes 171 files changed, 25949 insertions(+), 114 deletions(-) create mode 100644 UpdateLib/UpdateLib.Generator/Data/FilesPage/GenFile.cs create mode 100644 UpdateLib/UpdateLib.Generator/Data/FilesPage/GenFolder.cs create mode 100644 UpdateLib/UpdateLib.Generator/Data/FilesPage/GenReg.cs create mode 100644 UpdateLib/UpdateLib.Generator/Data/FilesPage/IGenItem.cs create mode 100644 UpdateLib/UpdateLib.Generator/Data/ListViewFolder.cs create mode 100644 UpdateLib/UpdateLib.Generator/Data/ListViewGenItem.cs create mode 100644 UpdateLib/UpdateLib.Generator/Data/TreeViewFolderNode.cs create mode 100644 UpdateLib/UpdateLib.Generator/Files/ProjectFile.cs create mode 100644 UpdateLib/UpdateLib.Generator/Generator_logo.ico create mode 100644 UpdateLib/UpdateLib.Generator/MainForm.Designer.cs create mode 100644 UpdateLib/UpdateLib.Generator/MainForm.cs create mode 100644 UpdateLib/UpdateLib.Generator/MainForm.resx create mode 100644 UpdateLib/UpdateLib.Generator/Properties/Resources.Designer.cs create mode 100644 UpdateLib/UpdateLib.Generator/Properties/Resources.resx create mode 100644 UpdateLib/UpdateLib.Generator/Properties/Settings.Designer.cs create mode 100644 UpdateLib/UpdateLib.Generator/Properties/Settings.settings create mode 100644 UpdateLib/UpdateLib.Generator/Resources/Registry Editor_16px.png create mode 100644 UpdateLib/UpdateLib.Generator/Resources/Registry Editor_32px.png create mode 100644 UpdateLib/UpdateLib.Generator/Resources/cross.png create mode 100644 UpdateLib/UpdateLib.Generator/Resources/folder_transparent_16px.png create mode 100644 UpdateLib/UpdateLib.Generator/Resources/gears.png create mode 100644 UpdateLib/UpdateLib.Generator/Resources/image_transparent_16px.png create mode 100644 UpdateLib/UpdateLib.Generator/Resources/loading.gif create mode 100644 UpdateLib/UpdateLib.Generator/Resources/loading_gear.gif create mode 100644 UpdateLib/UpdateLib.Generator/Resources/project_16px.png create mode 100644 UpdateLib/UpdateLib.Generator/Resources/reg_bin_16px.png create mode 100644 UpdateLib/UpdateLib.Generator/Resources/reg_string_16px.png create mode 100644 UpdateLib/UpdateLib.Generator/Tasks/LoadDirectoryTask.cs create mode 100644 UpdateLib/UpdateLib.Generator/Tasks/UpdateGeneratorTask.cs create mode 100644 UpdateLib/UpdateLib.Generator/UI/ElipseComponent.cs create mode 100644 UpdateLib/UpdateLib.Generator/UI/FlatButton.cs create mode 100644 UpdateLib/UpdateLib.Generator/UI/GradientPanel.cs create mode 100644 UpdateLib/UpdateLib.Generator/UI/HoverPictureBox.cs create mode 100644 UpdateLib/UpdateLib.Generator/UI/InputDialog.Designer.cs create mode 100644 UpdateLib/UpdateLib.Generator/UI/InputDialog.cs create mode 100644 UpdateLib/UpdateLib.Generator/UI/InputDialog.resx create mode 100644 UpdateLib/UpdateLib.Generator/UI/LoaderControl.Designer.cs create mode 100644 UpdateLib/UpdateLib.Generator/UI/LoaderControl.cs create mode 100644 UpdateLib/UpdateLib.Generator/UI/LoaderControl.resx create mode 100644 UpdateLib/UpdateLib.Generator/UI/MoveablePanel.cs create mode 100644 UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.Designer.cs create mode 100644 UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.cs create mode 100644 UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.resx create mode 100644 UpdateLib/UpdateLib.Generator/UI/Pages/FilesPage.Designer.cs create mode 100644 UpdateLib/UpdateLib.Generator/UI/Pages/FilesPage.cs create mode 100644 UpdateLib/UpdateLib.Generator/UI/Pages/FilesPage.resx create mode 100644 UpdateLib/UpdateLib.Generator/UI/Pages/InformationPage.Designer.cs create mode 100644 UpdateLib/UpdateLib.Generator/UI/Pages/InformationPage.cs create mode 100644 UpdateLib/UpdateLib.Generator/UI/Pages/InformationPage.resx create mode 100644 UpdateLib/UpdateLib.Generator/UI/Pages/PageControlBase.cs create mode 100644 UpdateLib/UpdateLib.Generator/UI/Pages/PageControlBase.resx create mode 100644 UpdateLib/UpdateLib.Generator/UI/Pages/RegistryPage.Designer.cs create mode 100644 UpdateLib/UpdateLib.Generator/UI/Pages/RegistryPage.cs create mode 100644 UpdateLib/UpdateLib.Generator/UI/Pages/RegistryPage.resx create mode 100644 UpdateLib/UpdateLib.Tests/packages.config create mode 100644 UpdateLib/UpdateLib/Common/RegistryKeyEntry.cs create mode 100644 UpdateLib/UpdateLib/Common/WorkerScheduler.cs create mode 100644 UpdateLib/UpdateLib/Compression/Checksum/Adler32.cs create mode 100644 UpdateLib/UpdateLib/Compression/Checksum/Crc32.cs create mode 100644 UpdateLib/UpdateLib/Compression/Checksum/IChecksum.cs create mode 100644 UpdateLib/UpdateLib/Compression/Deflaters/Deflater.cs create mode 100644 UpdateLib/UpdateLib/Compression/Deflaters/DeflaterConstants.cs create mode 100644 UpdateLib/UpdateLib/Compression/Deflaters/DeflaterEngine.cs create mode 100644 UpdateLib/UpdateLib/Compression/Deflaters/DeflaterHuffman.cs create mode 100644 UpdateLib/UpdateLib/Compression/Deflaters/DeflaterPending.cs create mode 100644 UpdateLib/UpdateLib/Compression/Deflaters/Inflater.cs create mode 100644 UpdateLib/UpdateLib/Compression/Deflaters/InflaterDynHeader.cs create mode 100644 UpdateLib/UpdateLib/Compression/Deflaters/InflaterHuffmanTree.cs create mode 100644 UpdateLib/UpdateLib/Compression/Deflaters/PendingBuffer.cs create mode 100644 UpdateLib/UpdateLib/Compression/GZip/GZip.cs create mode 100644 UpdateLib/UpdateLib/Compression/GZip/GZipConstants.cs create mode 100644 UpdateLib/UpdateLib/Compression/GZip/GZipException.cs create mode 100644 UpdateLib/UpdateLib/Compression/GZip/GZipInputStream.cs create mode 100644 UpdateLib/UpdateLib/Compression/GZip/GZipOutputStream.cs create mode 100644 UpdateLib/UpdateLib/Compression/PatchBuilder.cs create mode 100644 UpdateLib/UpdateLib/Compression/Patcher.cs create mode 100644 UpdateLib/UpdateLib/Compression/Streams/DeflaterOutputStream.cs create mode 100644 UpdateLib/UpdateLib/Compression/Streams/InflaterInputStream.cs create mode 100644 UpdateLib/UpdateLib/Compression/Streams/OutputWindow.cs create mode 100644 UpdateLib/UpdateLib/Compression/Streams/StreamManipulator.cs create mode 100644 UpdateLib/UpdateLib/Compression/VCDiff/AddressCache.cs create mode 100644 UpdateLib/UpdateLib/Compression/VCDiff/CodeTable.cs create mode 100644 UpdateLib/UpdateLib/Compression/VCDiff/Instruction.cs create mode 100644 UpdateLib/UpdateLib/Compression/VCDiff/VCDiffDecoder.cs create mode 100644 UpdateLib/UpdateLib/Compression/VCDiff/VCDiffFormatException.cs create mode 100644 UpdateLib/UpdateLib/Compression/Zip/Zip.cs create mode 100644 UpdateLib/UpdateLib/Compression/Zip/ZipConstants.cs create mode 100644 UpdateLib/UpdateLib/Compression/Zip/ZipEntry.cs create mode 100644 UpdateLib/UpdateLib/Compression/Zip/ZipException.cs create mode 100644 UpdateLib/UpdateLib/Compression/Zip/ZipExtraData.cs create mode 100644 UpdateLib/UpdateLib/Compression/Zip/ZipFile.cs create mode 100644 UpdateLib/UpdateLib/Compression/Zip/ZipHelperStream.cs create mode 100644 UpdateLib/UpdateLib/Compression/Zip/ZipInputStream.cs create mode 100644 UpdateLib/UpdateLib/Compression/Zip/ZipOutputStream.cs create mode 100644 UpdateLib/UpdateLib/Controls/UpdaterControl.Designer.cs create mode 100644 UpdateLib/UpdateLib/Controls/UpdaterControl.cs create mode 100644 UpdateLib/UpdateLib/Controls/UpdaterControl.resx create mode 100644 UpdateLib/UpdateLib/Logging/ILogWriter.cs create mode 100644 UpdateLib/UpdateLib/Logging/ILogger.cs create mode 100644 UpdateLib/UpdateLib/Logging/Logger.cs create mode 100644 UpdateLib/UpdateLib/Logging/Writers/ConsoleLogWriter.cs create mode 100644 UpdateLib/UpdateLib/Logging/Writers/FileLogWriter.cs create mode 100644 UpdateLib/UpdateLib/Properties/Resources.Designer.cs create mode 100644 UpdateLib/UpdateLib/Properties/Resources.resx create mode 100644 UpdateLib/UpdateLib/Resources/project_16px.png create mode 100644 UpdateLib/UpdateLib/Resources/status_done.png create mode 100644 UpdateLib/UpdateLib/Resources/status_download.png create mode 100644 UpdateLib/UpdateLib/Resources/status_error.png create mode 100644 UpdateLib/UpdateLib/Resources/status_info.png create mode 100644 UpdateLib/UpdateLib/Resources/status_update.png create mode 100644 UpdateLib/UpdateLib/Resources/status_warning.png create mode 100644 UpdateLib/UpdateLib/Resources/status_working.png create mode 100644 UpdateLib/UpdateLib/Security/PermissionUtil.cs create mode 100644 UpdateLib/UpdateLib/Tasks/AsyncTask.cs create mode 100644 UpdateLib/UpdateLib/Tasks/AsyncTaskFactory.cs create mode 100644 UpdateLib/UpdateLib/Tasks/CheckForUpdatedItemsTask.cs create mode 100644 UpdateLib/UpdateLib/Tasks/CheckForUpdatesCompletedEventArgs.cs create mode 100644 UpdateLib/UpdateLib/Tasks/CheckForUpdatesTask.cs create mode 100644 UpdateLib/UpdateLib/Tasks/CheckRequiredPrivilegesTask.cs create mode 100644 UpdateLib/UpdateLib/Tasks/CleanUpTask.cs create mode 100644 UpdateLib/UpdateLib/Tasks/DownloadManager.cs create mode 100644 UpdateLib/UpdateLib/Tasks/DownloadTask.cs create mode 100644 UpdateLib/UpdateLib/Tasks/LoadCacheTask.cs create mode 100644 UpdateLib/UpdateLib/Tasks/UpdatableTask.cs create mode 100644 UpdateLib/UpdateLib/Tasks/UpdateCacheTask.cs create mode 100644 UpdateLib/UpdateLib/Tasks/UpdateRegistryTask.cs create mode 100644 UpdateLib/UpdateLib/UI/Components/ChangelogPage.Designer.cs create mode 100644 UpdateLib/UpdateLib/UI/Components/ChangelogPage.cs create mode 100644 UpdateLib/UpdateLib/UI/Components/ChangelogPage.resx create mode 100644 UpdateLib/UpdateLib/UI/Components/FinishPage.Designer.cs create mode 100644 UpdateLib/UpdateLib/UI/Components/FinishPage.cs create mode 100644 UpdateLib/UpdateLib/UI/Components/FinishPage.resx create mode 100644 UpdateLib/UpdateLib/UI/Components/IntroPage.Designer.cs create mode 100644 UpdateLib/UpdateLib/UI/Components/IntroPage.cs create mode 100644 UpdateLib/UpdateLib/UI/Components/IntroPage.resx create mode 100644 UpdateLib/UpdateLib/UI/Components/RollbackPage.Designer.cs create mode 100644 UpdateLib/UpdateLib/UI/Components/RollbackPage.cs create mode 100644 UpdateLib/UpdateLib/UI/Components/RollbackPage.resx create mode 100644 UpdateLib/UpdateLib/UI/Components/UpdatePage.Designer.cs create mode 100644 UpdateLib/UpdateLib/UI/Components/UpdatePage.cs create mode 100644 UpdateLib/UpdateLib/UI/Components/UpdatePage.resx create mode 100644 UpdateLib/UpdateLib/UI/IWizardPage.cs create mode 100644 UpdateLib/UpdateLib/UI/MessageDialog.Designer.cs create mode 100644 UpdateLib/UpdateLib/UI/MessageDialog.cs create mode 100644 UpdateLib/UpdateLib/UI/MessageDialog.resx create mode 100644 UpdateLib/UpdateLib/UI/UIExtensions.cs create mode 100644 UpdateLib/UpdateLib/UI/UpdaterForm.Designer.cs create mode 100644 UpdateLib/UpdateLib/UI/UpdaterForm.cs create mode 100644 UpdateLib/UpdateLib/UI/UpdaterForm.resx create mode 100644 UpdateLib/UpdateLib/UI/WizardPageCollection.cs create mode 100644 UpdateLib/UpdateLib/UpdaterControl.bmp create mode 100644 UpdateLib/UpdateLib/Utils/IOUtils.cs create mode 100644 UpdateLib/UpdateLib/Utils/Lazy.cs create mode 100644 UpdateLib/UpdateLib/Utils/NetworkUtils.cs create mode 100644 UpdateLib/UpdateLib/Utils/RegistryHelper.cs create mode 100644 UpdateLib/UpdateLib/Win32/NativeMethods.cs create mode 100644 UpdateLib/UpdateLib/updater.ico diff --git a/UpdateLib/TestApp/TestApp.csproj b/UpdateLib/TestApp/TestApp.csproj index 914012b..7ebd714 100644 --- a/UpdateLib/TestApp/TestApp.csproj +++ b/UpdateLib/TestApp/TestApp.csproj @@ -1,49 +1,82 @@ - + + + - net472 + Debug + AnyCPU + {7C3C0345-6D01-40A6-9F01-60D8D6451FB1} WinExe - false + Properties + TestApp + TestApp + v3.5 + 512 + AnyCPU + true full - bin\$(Configuration)\ + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 Auto - + + + AnyCPU pdbonly - bin\$(Configuration)\ + true + bin\Release\ + TRACE + prompt + 4 + - {7C3C0345-6D01-40A6-9F01-60D8D6451FB1} TestApp.Program + + app.manifest - - - + + + + + + - - + + Properties\SharedAssemblyInfo.cs + + Form - + Form1.cs - + + + + + Form1.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + True Resources.resx - - True - Settings.settings - True - Designer @@ -51,6 +84,19 @@ SettingsSingleFileGenerator Settings.Designer.cs + + True + Settings.settings + True + + + + + {4394be57-95e2-45b1-a968-1404b0590b35} + UpdateLib + + + Always @@ -61,4 +107,12 @@ Always + + \ No newline at end of file diff --git a/UpdateLib/UpdateLib.Generator/Data/FilesPage/GenFile.cs b/UpdateLib/UpdateLib.Generator/Data/FilesPage/GenFile.cs new file mode 100644 index 0000000..14edd17 --- /dev/null +++ b/UpdateLib/UpdateLib.Generator/Data/FilesPage/GenFile.cs @@ -0,0 +1,68 @@ +/* UpdateLib - .Net auto update library + * Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using System; +using System.IO; + +namespace MatthiWare.UpdateLib.Generator.Data.FilesPage +{ + public class GenFile : IGenItem + { + public event EventHandler Changed; + + private FileInfo m_fileInfo; + public FileInfo FileInfo + { + get { return m_fileInfo; } + set { m_fileInfo = value; Changed?.Invoke(this, EventArgs.Empty); } + } + + public string Name { get { return FileInfo?.Name ?? string.Empty; } set { Changed?.Invoke(this, EventArgs.Empty); } } + public string RealPath { get { return FileInfo?.FullName ?? string.Empty; } } + public string Extension { get { return FileInfo?.Extension ?? string.Empty; } } + public string Size { get { return ConvertBytesToSizeString(FileInfo?.Length ?? 0); } } + + public GenFolder Parent { get; set; } + + public ListViewGenItem View { get; set; } + + public GenFile(FileInfo file) + { + FileInfo = file; + + View = new ListViewGenItem(this); + } + + private static string ConvertBytesToSizeString(long size) + { + size = Math.Max(0, size); + + double kb = Math.Ceiling(size / 1024.0); + + return $"{kb.ToString("N0")} kB"; + } + + public string[] GetListViewItems() + { + return new string[] { Name, "File", FileInfo.LastWriteTime.ToString(), Size }; + } + public string GetListViewImageKey() + { + return Extension; + } + } +} diff --git a/UpdateLib/UpdateLib.Generator/Data/FilesPage/GenFolder.cs b/UpdateLib/UpdateLib.Generator/Data/FilesPage/GenFolder.cs new file mode 100644 index 0000000..63ebf75 --- /dev/null +++ b/UpdateLib/UpdateLib.Generator/Data/FilesPage/GenFolder.cs @@ -0,0 +1,83 @@ +/* UpdateLib - .Net auto update library + * Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using System.Collections.Generic; +using System.Linq; +using System.Windows.Forms; + +namespace MatthiWare.UpdateLib.Generator.Data.FilesPage +{ + public class GenFolder + { + public string Name { get; set; } + public string PathVariable { get; set; } + public List Items { get; private set; } = new List(); + public List Directories { get; private set; } = new List(); + public GenFolder ParentFolder { get; set; } + public bool IsRoot { get { return ParentFolder == null; } } + public bool ProtectedFolder { get; set; } = false; + + public ListViewFolder FolderListView { get; set; } + public TreeViewFolderNode FolderTreeView { get; set; } + + public int Count + { + get + { + return Items.Count + Directories.Sum(d => d.Count); + } + } + + public GenFolder(string name, ContextMenuStrip menu) + { + Name = name; + + FolderListView = new ListViewFolder(name, this); + FolderTreeView = new TreeViewFolderNode(name, this); + + FolderTreeView.ContextMenuStrip = menu; + + } + + public void Add(IGenItem item) + { + item.Parent = this; + Items.Add(item); + } + + public void Add(GenFolder folder) + { + folder.ParentFolder = this; + Directories.Add(folder); + FolderTreeView.Nodes.Add(folder.FolderTreeView); + } + + public void Remove(IGenItem item) + { + Items.Remove(item); + item.View.Remove(); + } + + public void Remove(GenFolder folder) + { + Directories.Remove(folder); + FolderTreeView.Nodes.Remove(folder.FolderTreeView); + folder.FolderListView.Remove(); + } + + } +} diff --git a/UpdateLib/UpdateLib.Generator/Data/FilesPage/GenReg.cs b/UpdateLib/UpdateLib.Generator/Data/FilesPage/GenReg.cs new file mode 100644 index 0000000..a41064d --- /dev/null +++ b/UpdateLib/UpdateLib.Generator/Data/FilesPage/GenReg.cs @@ -0,0 +1,115 @@ +/* UpdateLib - .Net auto update library + * Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using Microsoft.Win32; +using System; + +namespace MatthiWare.UpdateLib.Generator.Data.FilesPage +{ + public class GenReg : IGenItem + { + public event EventHandler Changed; + + private RegistryValueKind m_type; + public RegistryValueKind Type + { + get { return m_type; } + set + { + m_type = value; + Changed?.Invoke(this, EventArgs.Empty); + } + } + + private string m_name; + public string Name + { + get { return m_name; } + set + { + m_name = value; + Changed?.Invoke(this, EventArgs.Empty); + } + } + + private object m_value; + public object Value + { + get { return m_value; } + set + { + m_value = value; + Changed?.Invoke(this, EventArgs.Empty); + } + } + + public GenFolder Parent { get; set; } + public ListViewGenItem View { get; set; } + + public GenReg(string name, RegistryValueKind kind = RegistryValueKind.String) + { + Name = name; + Type = kind; + + View = new ListViewGenItem(this); + } + + public string[] GetListViewItems() + { + return new string[] { Name, GetTypeName(), Value?.ToString() ?? string.Empty }; + } + + private string GetTypeName() + { + switch (Type) + { + case RegistryValueKind.ExpandString: + return "REG_EXPANDED_SZ"; + case RegistryValueKind.MultiString: + return "REG_MULTI_SZ"; + case RegistryValueKind.Binary: + return "REG_BINARY"; + case RegistryValueKind.DWord: + return "REG_DWORD"; + case RegistryValueKind.QWord: + return "REG_QWORD"; + case RegistryValueKind.String: + case RegistryValueKind.Unknown: + default: + return "REG_SZ"; + } + } + + public string GetListViewImageKey() + { + switch (Type) + { + case RegistryValueKind.String: + case RegistryValueKind.ExpandString: + case RegistryValueKind.MultiString: + return "REG_SZ"; + case RegistryValueKind.Binary: + case RegistryValueKind.DWord: + case RegistryValueKind.QWord: + case RegistryValueKind.Unknown: + default: + return "REG_BIN"; + } + } + + } +} diff --git a/UpdateLib/UpdateLib.Generator/Data/FilesPage/IGenItem.cs b/UpdateLib/UpdateLib.Generator/Data/FilesPage/IGenItem.cs new file mode 100644 index 0000000..5ad1db5 --- /dev/null +++ b/UpdateLib/UpdateLib.Generator/Data/FilesPage/IGenItem.cs @@ -0,0 +1,34 @@ +/* UpdateLib - .Net auto update library + * Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using System; + +namespace MatthiWare.UpdateLib.Generator.Data.FilesPage +{ + public interface IGenItem + { + event EventHandler Changed; + + string Name { get; set; } + GenFolder Parent { get; set; } + ListViewGenItem View { get; set; } + + string[] GetListViewItems(); + string GetListViewImageKey(); + + } +} diff --git a/UpdateLib/UpdateLib.Generator/Data/ListViewFolder.cs b/UpdateLib/UpdateLib.Generator/Data/ListViewFolder.cs new file mode 100644 index 0000000..8acfcd9 --- /dev/null +++ b/UpdateLib/UpdateLib.Generator/Data/ListViewFolder.cs @@ -0,0 +1,39 @@ +/* UpdateLib - .Net auto update library + * Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using MatthiWare.UpdateLib.Generator.Data.FilesPage; +using System.Windows.Forms; + +namespace MatthiWare.UpdateLib.Generator.Data +{ + public class ListViewFolder : ListViewItem + { + internal const string FOLDER_KEY = "folderimagekey"; + + public GenFolder Folder { get; set; } + + private ListViewFolder(string[] items, string imageKey) + : base(items, imageKey) + { } + + public ListViewFolder(string folderName, GenFolder folder) + : this(new string[] { folderName, "Folder", string.Empty, string.Empty }, FOLDER_KEY) + { + Folder = folder; + } + } +} diff --git a/UpdateLib/UpdateLib.Generator/Data/ListViewGenItem.cs b/UpdateLib/UpdateLib.Generator/Data/ListViewGenItem.cs new file mode 100644 index 0000000..dc4d66f --- /dev/null +++ b/UpdateLib/UpdateLib.Generator/Data/ListViewGenItem.cs @@ -0,0 +1,45 @@ +/* UpdateLib - .Net auto update library + * Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using MatthiWare.UpdateLib.Generator.Data.FilesPage; +using System; +using System.Windows.Forms; + +namespace MatthiWare.UpdateLib.Generator.Data +{ + public class ListViewGenItem : ListViewItem + { + public IGenItem Item { get; set; } + + public ListViewGenItem(IGenItem item) + : base(item.GetListViewItems(), item.GetListViewImageKey()) + { + Item = item; + Item.Changed += Item_Changed; + } + + private void Item_Changed(object sender, EventArgs e) + { + string[] items = Item.GetListViewItems(); + + for (int i = 0; i < items.Length; i++) + SubItems[i].Text = items[i]; + + ImageKey = Item.GetListViewImageKey(); + } + } +} diff --git a/UpdateLib/UpdateLib.Generator/Data/TreeViewFolderNode.cs b/UpdateLib/UpdateLib.Generator/Data/TreeViewFolderNode.cs new file mode 100644 index 0000000..fbfdfa6 --- /dev/null +++ b/UpdateLib/UpdateLib.Generator/Data/TreeViewFolderNode.cs @@ -0,0 +1,38 @@ +using MatthiWare.UpdateLib.Generator.Data.FilesPage; +/* UpdateLib - .Net auto update library + * Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using System.Windows.Forms; + +namespace MatthiWare.UpdateLib.Generator.Data +{ + public class TreeViewFolderNode : TreeNode + { + internal const string FOLDER_KEY = "folderimagekey"; + + public GenFolder Folder { get; set; } + + public TreeViewFolderNode(string folderName, GenFolder folder, string imageKey = FOLDER_KEY) + { + Text = folderName; + ImageKey = imageKey; + SelectedImageKey = imageKey; + Folder = folder; + } + + } +} diff --git a/UpdateLib/UpdateLib.Generator/Files/ProjectFile.cs b/UpdateLib/UpdateLib.Generator/Files/ProjectFile.cs new file mode 100644 index 0000000..5ef1c4c --- /dev/null +++ b/UpdateLib/UpdateLib.Generator/Files/ProjectFile.cs @@ -0,0 +1,36 @@ +/* UpdateLib - .Net auto update library + * Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using System; + +namespace MatthiWare.UpdateLib.Generator.Files +{ + [Serializable] + public class ProjectFile + { + + #region General Info + #endregion + + #region Files + #endregion + + #region Registry + #endregion + + } +} diff --git a/UpdateLib/UpdateLib.Generator/Generator_logo.ico b/UpdateLib/UpdateLib.Generator/Generator_logo.ico new file mode 100644 index 0000000000000000000000000000000000000000..e51a99254ab13f7ed8d310bb5b58ffa05f5dff2b GIT binary patch literal 167188 zcmcG$byyVd_dh(l)Y1q@r%Fjncc~~UqKJ|L79i58)Gn=vprW9(AgI&=(zSpRlF~{o z(jhD%EdAU|==<~i{rz|y=9<~rotaaw6ZaV*2nJC@gnuxI2O9E#pdPS~MD8C8B4E&G z&%A)c# zo`dsr5R__kcnr=XAn4+KIK;xTe?F8Pf>xXlj}cGjHKFWQj%jc}Y^8BY z1A=lRD7P%ZH6U`wb4D%@L{m%ngVj5HxC22RF6U2cT=Ts7JD$Yw`j6F+DzEf z(pOBi@S*m!J9Ww{PDz9(1N%GLKjFDQ#Z;-7nLVX{4`_d`Hr6 zXNxvQ+U9D|_Y`g0r>s(GroGu_O`cv}eqVi~6Qy>-tMs?No_ycs!1PVcwkOlU2)Z^{ zeVRDxs`=c^Ra8ZiNY2fQpNrF-=`VfpBOwNJZQW008kQ&9 zTo`v0`*vMgUkY4y=2CeSwLIuCJU&q6r#9IducT1qFx+Z6Qch|)66doz_v2OlGtMSu zM=WNgC00%#pKglf$dQqnQrM-{jP2LSfyk@(XU+RI@-xo+xQ|D8FaG-4)0<;%zBwLk zp1r%$d08$p(Qjuxt;W2*DOy}XZ3jPkX>}9py}P|8XT&pb2j%#Zq$a$~V`0d`(lMT- z+Mq|qRNiM}M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uXV<(QY zwZ3zAFTusjm)M!C)Q=SQAMZUZSkGhrZvOg%wGC7^zxEa7_K~Qq`WnCTfOLQhKmT9N z+CqEGI`wK*t;W_DjZKUU^z|D3TBBLzAE{$(*`{?X^OkirTIl{>A6q7ol{NjKqt#eb zy*jp5qPFd=+qQ0Hrq + /// 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.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); + this.SidebarPanel = new System.Windows.Forms.Panel(); + this.ContentPanel = new System.Windows.Forms.Panel(); + this.btnTabBuild = new MatthiWare.UpdateLib.Generator.UI.FlatButton(); + this.btnTabRegistry = new MatthiWare.UpdateLib.Generator.UI.FlatButton(); + this.btnTabFiles = new MatthiWare.UpdateLib.Generator.UI.FlatButton(); + this.btnTabInformation = new MatthiWare.UpdateLib.Generator.UI.FlatButton(); + this.HeaderPanel = new MatthiWare.UpdateLib.Generator.UI.MoveablePanel(); + this.pbMinimize = new MatthiWare.UpdateLib.Generator.UI.HoverPictureBox(); + this.pbMaximize = new MatthiWare.UpdateLib.Generator.UI.HoverPictureBox(); + this.pbClose = new MatthiWare.UpdateLib.Generator.UI.HoverPictureBox(); + this.pbIcon = new System.Windows.Forms.PictureBox(); + this.lblTitle = new System.Windows.Forms.Label(); + this.elipseComponent1 = new MatthiWare.UpdateLib.Generator.UI.ElipseComponent(this.components); + this.SidebarPanel.SuspendLayout(); + this.HeaderPanel.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pbMinimize)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pbMaximize)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pbClose)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pbIcon)).BeginInit(); + this.SuspendLayout(); + // + // SidebarPanel + // + this.SidebarPanel.BackColor = System.Drawing.Color.DarkGray; + this.SidebarPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.SidebarPanel.Controls.Add(this.btnTabBuild); + this.SidebarPanel.Controls.Add(this.btnTabRegistry); + this.SidebarPanel.Controls.Add(this.btnTabFiles); + this.SidebarPanel.Controls.Add(this.btnTabInformation); + this.SidebarPanel.Dock = System.Windows.Forms.DockStyle.Left; + this.SidebarPanel.Location = new System.Drawing.Point(0, 33); + this.SidebarPanel.Name = "SidebarPanel"; + this.SidebarPanel.Size = new System.Drawing.Size(233, 505); + this.SidebarPanel.TabIndex = 1; + // + // ContentPanel + // + this.ContentPanel.AutoScroll = true; + this.ContentPanel.BackColor = System.Drawing.SystemColors.Control; + this.ContentPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.ContentPanel.Dock = System.Windows.Forms.DockStyle.Fill; + this.ContentPanel.Location = new System.Drawing.Point(233, 33); + this.ContentPanel.Name = "ContentPanel"; + this.ContentPanel.Size = new System.Drawing.Size(806, 505); + this.ContentPanel.TabIndex = 2; + // + // btnTabBuild + // + this.btnTabBuild.ActiveItem = false; + this.btnTabBuild.BackHoverColor = System.Drawing.Color.LightGray; + this.btnTabBuild.BackSelectedColor = System.Drawing.Color.DimGray; + this.btnTabBuild.Dock = System.Windows.Forms.DockStyle.Top; + this.btnTabBuild.Font = new System.Drawing.Font("Century Gothic", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.btnTabBuild.InfoImage = ((System.Drawing.Image)(resources.GetObject("btnTabBuild.InfoImage"))); + this.btnTabBuild.Location = new System.Drawing.Point(0, 189); + this.btnTabBuild.Name = "btnTabBuild"; + this.btnTabBuild.Size = new System.Drawing.Size(231, 63); + this.btnTabBuild.TabIndex = 3; + this.btnTabBuild.Text = "Build"; + this.btnTabBuild.Click += new System.EventHandler(this.btnTabBuild_Click); + // + // btnTabRegistry + // + this.btnTabRegistry.ActiveItem = false; + this.btnTabRegistry.BackHoverColor = System.Drawing.Color.LightGray; + this.btnTabRegistry.BackSelectedColor = System.Drawing.Color.DimGray; + this.btnTabRegistry.Dock = System.Windows.Forms.DockStyle.Top; + this.btnTabRegistry.Font = new System.Drawing.Font("Century Gothic", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.btnTabRegistry.InfoImage = global::MatthiWare.UpdateLib.Generator.Properties.Resources.Registry_Editor_32px; + this.btnTabRegistry.Location = new System.Drawing.Point(0, 126); + this.btnTabRegistry.Name = "btnTabRegistry"; + this.btnTabRegistry.Size = new System.Drawing.Size(231, 63); + this.btnTabRegistry.TabIndex = 2; + this.btnTabRegistry.Text = "Registry"; + this.btnTabRegistry.Click += new System.EventHandler(this.btnTabRegistry_Click); + // + // btnTabFiles + // + this.btnTabFiles.ActiveItem = false; + this.btnTabFiles.BackHoverColor = System.Drawing.Color.LightGray; + this.btnTabFiles.BackSelectedColor = System.Drawing.Color.DimGray; + this.btnTabFiles.Dock = System.Windows.Forms.DockStyle.Top; + this.btnTabFiles.Font = new System.Drawing.Font("Century Gothic", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.btnTabFiles.InfoImage = ((System.Drawing.Image)(resources.GetObject("btnTabFiles.InfoImage"))); + this.btnTabFiles.Location = new System.Drawing.Point(0, 63); + this.btnTabFiles.Name = "btnTabFiles"; + this.btnTabFiles.Size = new System.Drawing.Size(231, 63); + this.btnTabFiles.TabIndex = 1; + this.btnTabFiles.Text = "Files"; + this.btnTabFiles.Click += new System.EventHandler(this.flatButton2_Click); + // + // btnTabInformation + // + this.btnTabInformation.ActiveItem = false; + this.btnTabInformation.BackHoverColor = System.Drawing.Color.LightGray; + this.btnTabInformation.BackSelectedColor = System.Drawing.Color.DimGray; + this.btnTabInformation.Dock = System.Windows.Forms.DockStyle.Top; + this.btnTabInformation.Font = new System.Drawing.Font("Century Gothic", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.btnTabInformation.InfoImage = ((System.Drawing.Image)(resources.GetObject("btnTabInformation.InfoImage"))); + this.btnTabInformation.Location = new System.Drawing.Point(0, 0); + this.btnTabInformation.Name = "btnTabInformation"; + this.btnTabInformation.Size = new System.Drawing.Size(231, 63); + this.btnTabInformation.TabIndex = 0; + this.btnTabInformation.Text = "Update Information"; + this.btnTabInformation.Click += new System.EventHandler(this.flatButton1_Click); + // + // HeaderPanel + // + this.HeaderPanel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(78)))), ((int)(((byte)(99)))), ((int)(((byte)(133))))); + this.HeaderPanel.Controls.Add(this.pbMinimize); + this.HeaderPanel.Controls.Add(this.pbMaximize); + this.HeaderPanel.Controls.Add(this.pbClose); + this.HeaderPanel.Controls.Add(this.pbIcon); + this.HeaderPanel.Controls.Add(this.lblTitle); + this.HeaderPanel.Dock = System.Windows.Forms.DockStyle.Top; + this.HeaderPanel.Location = new System.Drawing.Point(0, 0); + this.HeaderPanel.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.HeaderPanel.Name = "HeaderPanel"; + this.HeaderPanel.ParentForm = this; + this.HeaderPanel.Size = new System.Drawing.Size(1039, 33); + this.HeaderPanel.TabIndex = 1; + // + // pbMinimize + // + this.pbMinimize.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.pbMinimize.Image = ((System.Drawing.Image)(resources.GetObject("pbMinimize.Image"))); + this.pbMinimize.Location = new System.Drawing.Point(965, 5); + this.pbMinimize.Name = "pbMinimize"; + this.pbMinimize.Size = new System.Drawing.Size(24, 24); + this.pbMinimize.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pbMinimize.TabIndex = 4; + this.pbMinimize.TabStop = false; + this.pbMinimize.Click += new System.EventHandler(this.pbMinimize_Click); + // + // pbMaximize + // + this.pbMaximize.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.pbMaximize.BackColor = System.Drawing.Color.Transparent; + this.pbMaximize.Image = ((System.Drawing.Image)(resources.GetObject("pbMaximize.Image"))); + this.pbMaximize.Location = new System.Drawing.Point(988, 5); + this.pbMaximize.Name = "pbMaximize"; + this.pbMaximize.Size = new System.Drawing.Size(24, 24); + this.pbMaximize.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pbMaximize.TabIndex = 3; + this.pbMaximize.TabStop = false; + this.pbMaximize.Click += new System.EventHandler(this.pbMaximize_Click); + // + // pbClose + // + this.pbClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.pbClose.Image = ((System.Drawing.Image)(resources.GetObject("pbClose.Image"))); + this.pbClose.Location = new System.Drawing.Point(1011, 5); + this.pbClose.Name = "pbClose"; + this.pbClose.Size = new System.Drawing.Size(24, 24); + this.pbClose.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pbClose.TabIndex = 2; + this.pbClose.TabStop = false; + this.pbClose.Click += new System.EventHandler(this.pbClose_Click); + // + // pbIcon + // + this.pbIcon.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pbIcon.BackgroundImage"))); + this.pbIcon.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.pbIcon.Location = new System.Drawing.Point(5, 5); + this.pbIcon.Name = "pbIcon"; + this.pbIcon.Size = new System.Drawing.Size(24, 24); + this.pbIcon.TabIndex = 1; + this.pbIcon.TabStop = false; + // + // lblTitle + // + this.lblTitle.AutoSize = true; + this.lblTitle.BackColor = System.Drawing.Color.Transparent; + this.lblTitle.Font = new System.Drawing.Font("Century Gothic", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblTitle.ForeColor = System.Drawing.Color.WhiteSmoke; + this.lblTitle.Location = new System.Drawing.Point(31, 6); + this.lblTitle.Name = "lblTitle"; + this.lblTitle.Size = new System.Drawing.Size(157, 21); + this.lblTitle.TabIndex = 0; + this.lblTitle.Text = "Update Generator"; + // + // elipseComponent1 + // + this.elipseComponent1.Control = this; + this.elipseComponent1.Radius = 5; + // + // TestForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.AutoSize = true; + this.BackColor = System.Drawing.SystemColors.ControlLight; + this.ClientSize = new System.Drawing.Size(1039, 538); + this.Controls.Add(this.ContentPanel); + this.Controls.Add(this.SidebarPanel); + this.Controls.Add(this.HeaderPanel); + this.DoubleBuffered = true; + this.Font = new System.Drawing.Font("Century Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; + this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.Name = "TestForm"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "TestForm"; + this.Click += new System.EventHandler(this.TestForm_Click); + this.SidebarPanel.ResumeLayout(false); + this.HeaderPanel.ResumeLayout(false); + this.HeaderPanel.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pbMinimize)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pbMaximize)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pbClose)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pbIcon)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private UI.ElipseComponent elipseComponent1; + private System.Windows.Forms.Label lblTitle; + private System.Windows.Forms.Panel SidebarPanel; + private UI.MoveablePanel HeaderPanel; + private System.Windows.Forms.PictureBox pbIcon; + private UI.HoverPictureBox pbClose; + private UI.HoverPictureBox pbMinimize; + private UI.HoverPictureBox pbMaximize; + private UI.FlatButton btnTabInformation; + private UI.FlatButton btnTabFiles; + private UI.FlatButton btnTabBuild; + internal System.Windows.Forms.Panel ContentPanel; + private UI.FlatButton btnTabRegistry; + } +} \ No newline at end of file diff --git a/UpdateLib/UpdateLib.Generator/MainForm.cs b/UpdateLib/UpdateLib.Generator/MainForm.cs new file mode 100644 index 0000000..5e39ca6 --- /dev/null +++ b/UpdateLib/UpdateLib.Generator/MainForm.cs @@ -0,0 +1,206 @@ +/* UpdateLib - .Net auto update library + * Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using System; +using System.Collections.Generic; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Windows.Forms; + +using MatthiWare.UpdateLib.Generator.UI; +using MatthiWare.UpdateLib.Generator.UI.Pages; +using MatthiWare.UpdateLib.Tasks; +using MatthiWare.UpdateLib.UI; + +namespace MatthiWare.UpdateLib.Generator +{ + public partial class MainForm : Form + { + private Dictionary pageCache; + private AsyncTask loadTask; + private bool shouldShowNewPage = false; + + public MainForm() + { + InitializeComponent(); + + pageCache = new Dictionary(); + + LoadPagesTask().Start(); + } + + public bool TryGetPage(string key, out PageControlBase page) => pageCache.TryGetValue(key, out page); + + private AsyncTask LoadPagesTask() + { + if (loadTask == null) + { + LoaderControl.Show(ContentPanel); + + Action loadAction = new Action(() => + { + var pageType = typeof(PageControlBase); + var types = AppDomain.CurrentDomain.GetAssemblies() + .SelectMany(asm => asm.GetTypes()) + .Where(type => pageType.IsAssignableFrom(type) && !type.IsAbstract && type.IsClass && pageType != type); + + foreach (Type type in types) + { + var name = type.Name; + + PageControlBase page = Activator.CreateInstance(type) as PageControlBase; + page.TestForm = this; + + pageCache.Add(name, page); + } + }); + + loadTask = AsyncTaskFactory.From(loadAction, null); + + loadTask.TaskCompleted += (o, e) => + { + LoaderControl.Hide(ContentPanel); + + btnTabInformation.PerformClick(); + }; + } + + return loadTask; + } + + private void TestForm_Click(object sender, EventArgs e) + { + WindowState = (WindowState == FormWindowState.Maximized) ? FormWindowState.Normal : FormWindowState.Maximized; + } + + private void pbMinimize_Click(object sender, EventArgs e) + { + WindowState = FormWindowState.Minimized; + } + + private void pbMaximize_Click(object sender, EventArgs e) + { + MaximumSize = Screen.FromControl(this).WorkingArea.Size; + WindowState = (WindowState == FormWindowState.Normal ? FormWindowState.Maximized : FormWindowState.Normal); + } + + private void pbClose_Click(object sender, EventArgs e) => Close(); + + private void flatButton1_Click(object sender, EventArgs e) => LoadPage(nameof(InformationPage)); + + private void flatButton2_Click(object sender, EventArgs e) => LoadPage(nameof(FilesPage)); + + private bool LoadPage(string pageName) + { + loadTask.AwaitTask(); + + bool success = TryGetPage(pageName, out PageControlBase page); + + if (success) + { + shouldShowNewPage = true; + + if (page.IsPageInitialized) + { + AddControlToContentPanel(page); + } + else + { + AddControlToContentPanel(null); + + LoaderControl.Show(ContentPanel); + + page.InitializePage((o, e) => + { + LoaderControl.Hide(ContentPanel); + + if (e.Cancelled) + { + ShowMessageBox( + "Page Load", + "Task cancelled", + "The loading of the page got cancelled.", + SystemIcons.Warning, + MessageBoxButtons.OK); + + return; + } + + if (e.Error != null) + { + ShowMessageBox( + "Page Load", + "Error occured when loading the page", + "Check the log files for more information!", + SystemIcons.Error, + MessageBoxButtons.OK); + + return; + } + + AddControlToContentPanel(page); + }); + } + } + + return success; + } + + private void ShowMessageBox(string title, string header, string desc, Icon icon, MessageBoxButtons buttons = MessageBoxButtons.YesNo) + { + MessageDialog.Show( + this, + title, + header, + desc, + icon, + buttons); + } + + private void AddControlToContentPanel(Control toAdd) + { + if (!shouldShowNewPage) + return; + + ContentPanel.SuspendLayout(); + + ContentPanel.Controls.Clear(); + + if (toAdd != null) + { + toAdd.Dock = DockStyle.Fill; + ContentPanel.Controls.Add(toAdd); + + shouldShowNewPage = false; + } + + ContentPanel.ResumeLayout(); + + } + + private void btnTabBuild_Click(object sender, EventArgs e) + { + LoadPage(nameof(BuilderPage)); + } + + private void btnTabRegistry_Click(object sender, EventArgs e) + { + LoadPage(nameof(RegistryPage)); + } + } +} diff --git a/UpdateLib/UpdateLib.Generator/MainForm.resx b/UpdateLib/UpdateLib.Generator/MainForm.resx new file mode 100644 index 0000000..f6759bb --- /dev/null +++ b/UpdateLib/UpdateLib.Generator/MainForm.resx @@ -0,0 +1,202 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAfpJREFUWEft + 1ctLFVEAx/GJjB5UZGkPopAWYYG1cO+/oP4BbiMkLagEV27qP+gPyb3to8iKSlFX4kIUNTUz6KXf7zgH + LsPcuo8zBHF/8GFmzpw758ycx01a+d9yAt0Hp2mu4vDBafm5hc/4lF4lySHMYAnXLSg7bVjFd2xmfmEZ + pX6F27CBCdjgXo5lIziCHkRNJ77BN/+dnT/ARVzGY/zED6xjA8cRLb2YhY37tsPI5ym8ZyecEzcQNY69 + b6mjFuTSBTvgXCglf+vAFdiBlfQqcm5iDs58GxlCPk/gPYdpEs6bhuODFOKEcmLJ8m04D47hFMb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Hp6LPC+gCwx/wpfyAV1K + 7CADj3ANN/BUdh005woZJm+7gtxd8mTMDTJslqcPLMNdnydjtpBhfAUsQXnmzuUV8Lb84Bgo5W4OXeCf + cID3Is9uv+Gk6MeuNacWKjWnFeReQAfq2QwZLgP1bE4UiAKTFfgG6cDWfnRaQa396AwFuBUY0oxaWM0g + +JGU3jM+gGF3vCP8AAAAAElFTkSuQmCC + + + + + iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABGdBTUEAALGPC/xhBQAAAHhJREFUSEtj + GAUkgffv3wt8/vzZgRIMMgNqHCYAKfj69et/SjDIDKhxmABmwbdv3wpgLiIWg/QQbQFeRTgAUXpHLRi1 + AC8YgRZ8//7dDsQmBgPVO5FjgTyQ3UAMBqpVJNkCqBDRgCQLaF7YUYLxWkDzCmcUYAIGBgDTAbB9WZmz + lgAAAABJRU5ErkJggg== + + + + + iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABGdBTUEAALGPC/xhBQAAAN9JREFUSEvt + VTkOwjAQzA/gBRQ8hOs/CERDm5Jn8MK4sBO7g11pLY20TrSO24w08ioz40mR2N2GKjjn9jHGcwuHYdjJ + dhre+9s4jr8WUslJttPIBdM0PWi+1pAyL3PBomkGpiyaUkpHequPheytLqD5wrOF7F1dwKvICujBrMga + aMrhEMKX1r5E0doKLGwq4FVkBfRgVmQNNGFYZAX0YFZkDTRhWGQF9GBWZA005bCFqwqIB/pK3hayt7pA + HplRVUC//52MxeN4jpR5mgtauFjAFw6VFI9jKxcvnA0aXfcH9fiuLoI2qioAAAAASUVORK5CYII= + + + + + iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABGdBTUEAALGPC/xhBQAAATNJREFUSEvt + lc1qwkAUhVO79ocudOOzVPR9SqWbbtNi60YUXLizLvs6voHbQkhCyN8yPXc4EUJimMxs/eDg3Js75zhR + EudOJ8IwHOV5PrNREARD2tWJ43iRpmlhI4Q8065OGZBl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OQZtNvH4Xevhz12/klJ4pCZ9c657uPZfx09E7Vh + k9C1Za496+8XZ2lqdqVJyyA1920415Syoe4xFtOUOs0t19TIXg4s8QXdDoCNtJ7XcJwCD+A36BpR16B+ + hc/g0ejNNsIIKSqVv+0vKJgA+u+XAAAAAElFTkSuQmCC + + + + 17, 17 + + \ No newline at end of file diff --git a/UpdateLib/UpdateLib.Generator/Program.cs b/UpdateLib/UpdateLib.Generator/Program.cs index 90aba91..5b2e883 100644 --- a/UpdateLib/UpdateLib.Generator/Program.cs +++ b/UpdateLib/UpdateLib.Generator/Program.cs @@ -15,7 +15,9 @@ * along with this program. If not, see . */ +using MatthiWare.UpdateLib.Logging.Writers; using System; +using System.Windows.Forms; namespace MatthiWare.UpdateLib.Generator { @@ -27,7 +29,11 @@ static class Program [STAThread] static void Main() { + Updater.Instance.ConfigureLogger((logger) => logger.Writers.Add(new ConsoleLogWriter())); + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new MainForm()); } } } diff --git a/UpdateLib/UpdateLib.Generator/Properties/Resources.Designer.cs b/UpdateLib/UpdateLib.Generator/Properties/Resources.Designer.cs new file mode 100644 index 0000000..017ea70 --- /dev/null +++ b/UpdateLib/UpdateLib.Generator/Properties/Resources.Designer.cs @@ -0,0 +1,163 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace MatthiWare.UpdateLib.Generator.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // 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")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MatthiWare.UpdateLib.Generator.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap cross { + get { + object obj = ResourceManager.GetObject("cross", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap folder_transparent_16px { + get { + object obj = ResourceManager.GetObject("folder_transparent_16px", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap gears { + get { + object obj = ResourceManager.GetObject("gears", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap image_transparent_16px { + get { + object obj = ResourceManager.GetObject("image_transparent_16px", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap loading { + get { + object obj = ResourceManager.GetObject("loading", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap loading_gear { + get { + object obj = ResourceManager.GetObject("loading_gear", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap project_16px { + get { + object obj = ResourceManager.GetObject("project_16px", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap reg_bin_16px { + get { + object obj = ResourceManager.GetObject("reg_bin_16px", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap reg_string_16px { + get { + object obj = ResourceManager.GetObject("reg_string_16px", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Registry_Editor_32px { + get { + object obj = ResourceManager.GetObject("Registry_Editor_32px", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } +} diff --git a/UpdateLib/UpdateLib.Generator/Properties/Resources.resx b/UpdateLib/UpdateLib.Generator/Properties/Resources.resx new file mode 100644 index 0000000..d5f13cd --- /dev/null +++ b/UpdateLib/UpdateLib.Generator/Properties/Resources.resx @@ -0,0 +1,151 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + ..\Resources\loading.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\gears.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\folder_transparent_16px.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\loading_gear.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\image_transparent_16px.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\cross.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\project_16px.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\reg_bin_16px.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\reg_string_16px.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Registry Editor_32px.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/UpdateLib/UpdateLib.Generator/Properties/Settings.Designer.cs b/UpdateLib/UpdateLib.Generator/Properties/Settings.Designer.cs new file mode 100644 index 0000000..58bfc72 --- /dev/null +++ b/UpdateLib/UpdateLib.Generator/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace MatthiWare.UpdateLib.Generator.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } +} diff --git a/UpdateLib/UpdateLib.Generator/Properties/Settings.settings b/UpdateLib/UpdateLib.Generator/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/UpdateLib/UpdateLib.Generator/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/UpdateLib/UpdateLib.Generator/Resources/Registry Editor_16px.png b/UpdateLib/UpdateLib.Generator/Resources/Registry Editor_16px.png new file mode 100644 index 0000000000000000000000000000000000000000..c98ba682f74a8e9c8487807d821aef264c2c6b28 GIT binary patch literal 342 zcmV-c0jd6pP)PyvU_Y<%c87Lrim6W#2nvX>?$Dh;E70U8Kj{E_-zb1@$9=JXjNf o7WG={9qT3VE+sk7%#nYmFYQ)1@8QzLGynhq07*qoM6N<$f(Yu9{Qv*} literal 0 HcmV?d00001 diff --git a/UpdateLib/UpdateLib.Generator/Resources/Registry Editor_32px.png b/UpdateLib/UpdateLib.Generator/Resources/Registry Editor_32px.png new file mode 100644 index 0000000000000000000000000000000000000000..edcd6f81df4b24e5a6ed481944d57df3a520f616 GIT binary patch literal 569 zcmV-90>=G`P)+l@zRsA7^Z*T#1ScWL;JYrAf_=w3lI0X;+ON{w2xzf+W^~yY9@)x+d z-`pD*p#B&_(Ay%`z+6Z(SxaVAO_msRBO~dRx_KUg{&*vrlV-A(%&3|?WAF^lVGvX= zj}7pEAB|{En#o!+@+JU%h(+8S{dPQdyfaRJQpV7Zv`HqiICaKtv|krnC}prUtE zbiEL9IBib74=h-JCyu~%y~h}X2T)0Mri75mS~MQ=n1C8w*JBL-Jnj8S{uy3DDLE|Z zkhP@VP5E0)`~Ekgx$IF-K_NL%hIG>n3TG#YuVEg3gWf8!kZdkP+_XQ0;6JH9#2$#+ zCUL(v#6q%J(q?OE<;}2Y&nD5|2_d}Xp?6G-9%*YiAZeGiwDNXYv`0MfEA=8+e<2o@ z1CkC{ODpdwi|=3u>`fUBB|hn3)x3}MrePlrpaz9i_0V)K9@a%N0HqW+N{8;^rTaAH zzFm`X-$mPBpqBHEz3!Z)!gk)?O&hfR2AbZcQ*>^i9XD_ZM=9n!IB_Zn00000NkvXX Hu0mjf-ev*> literal 0 HcmV?d00001 diff --git a/UpdateLib/UpdateLib.Generator/Resources/cross.png b/UpdateLib/UpdateLib.Generator/Resources/cross.png new file mode 100644 index 0000000000000000000000000000000000000000..ecbd604965bfe5179caa0a005a97cfa6b9b50ec3 GIT binary patch literal 912 zcmV;B18@9^P)F7{`yK0V=d$TiSY2XvE5`aId!oK9m-MmRoAuWLY}N5MwluX_%m)ya;H~7!;I9 zG#XvV68B;6$+FCC*{98z=%#Lx857Y)5ap#HZE3wNwKaWw(wJy``6d6HJkNQ4Ip^F< z9yB(t`p;q+xx0Duy>krXVI-1V@*c*G#+>Pzn!ZJ=)%z{O41KOtD$2#;738+nI{cuk zOPCoRhR1Gq_yo%yZ_dw`yeS7wCh0?)ttZgi8;*^Pz*1XVdE25 z@WkT*|KK3_+S``~H*Gp8OH0ck$e3QAD>xjUr(IpogrOmb_V+`wvlITWs+u#2L`~!i zh8dXJy?c57;6a${?S=5MV=&#?8g$e2(a&;nD12H6ba#iAupjH|gQVLHV@_vuTVCGf zOhRm=AUk{2QJwD8?9QFh;DH0M(9r>rLx*6psmXuK;kZ86(lQf6dAX+tVE=x&ZMR2k zGTBcAWsH;%L@5%aoiug!b%725>NnCoQ+NL8!SIgoXx)yIje!+S-UyrTQ5a z9+OGlLeZ(w9Pw`5Iv;X6!EZ7_u%rZ*C<+9X3a%6t1?uGT?{KablTO~pKvh-24VJwT zl*?g3B!YQDAczTPXTz5?Jx;0B+sKE&54GC2efz*8it_oeT*L%kt@C0r+@AFHAxNmc{?bBW zA^2X&36v-F`gjw|{=%(aziXtj^5QJVMQ^32!>_o171w)ZW$~}A*3lBBavc$P-oKcZ zmb!Kf~7%YUK#JLUb-F~iUVn3qRN6?|&E~v6?Dnr_ zc|Po^sQ4RY7dm3{7L{6U!H+!ujkm5Y-pR86=1QfXVq2El?60m~SC7|GWMzGlYJLD) mQIXC?)7>hGWEYllg1iLx?{j!Py0k6;0000Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D02y>eSaefwW^{L9 za%BK;VQFr3E^cLXAT%y8E-^DS16z6k00AUPL_t(IPmPjEPQySDMRPgE7{QV&u;m5_ zF$n|$Ay5zq1SbiEc}k9e@o0yj*wJwhO>@_~uANUkS_1-fG& z_%~dmRU0L6z(ku;s(D%CELnZgN^*fV%mvfju&4jLE#Z>UH%*g`(=1 eou)P?7^Oev)Ia1+K1=NY00009<7rA literal 0 HcmV?d00001 diff --git a/UpdateLib/UpdateLib.Generator/Resources/gears.png b/UpdateLib/UpdateLib.Generator/Resources/gears.png new file mode 100644 index 0000000000000000000000000000000000000000..f0fc2163923b7f72feecd3763e3299697cb1d607 GIT binary patch literal 446 zcmV;v0YUzWP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D02y>eSaefwW^{L9 za%BK;VQFr3E^cLXAT%y8E-^DS16z6k00AyZL_t(IPnFZlD@0KM$MK88U?rhurHE`u zv6F>{HU9v4`~@~j7Iyvs{t*9(4N53QA@5g_*Y|txoN3Cv)16;^ntRSY=bq<8b!M#m zJBr5SF@M_dh6DVdAGuS)CC;&qecWIfxzdVzEXAcLn#3=PaVaGem`WbwOye7S=)(^D zz$z-~h8t7B1zypG2Dsi?e87%cKqun#;0nihL}>JmLp);$+Ze|dI#5XyP7yjf`cqZ; z4(-T{Q?ZkcchLerx>>IKL@!b^2am*tFR*in>pz3PWB+}1Wd&==W35EdAKB+m%5=Nk#{d8T07*qoM6N<$f}{hu^8f$< literal 0 HcmV?d00001 diff --git a/UpdateLib/UpdateLib.Generator/Resources/image_transparent_16px.png b/UpdateLib/UpdateLib.Generator/Resources/image_transparent_16px.png new file mode 100644 index 0000000000000000000000000000000000000000..3e26c140daf90a9e7a06563ad80f28f2b47ab3ab GIT binary patch literal 484 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1qucLCF%=h?3y^w370~qEv>0#LT=By}Z;C1rt33 zJwsy?=IAP*sUe;&jv*HQy^~KCH93g5{{5`tS9l=7p&^d*Z|5&ya=4MV{l~2w0T#w41|ulGz@!e6#qw(q#|wAG=GlQ=V;A3P$V(&;!yrQlE#{unI)He z{7zQ+mIRxb2O=C5uU*N`clr;EeR%a-C*s#&sK}^*t-SAD+Y3W%$;1naKW{V ztb+*_B94(+a$Kvv?h-4oeQN)M{ruHgK-SL07@>1B7bk7MX>jdKw(-pN`Ejet8MW;H XtaX0-T$L#t7zqrXu6{1-oD!M<*f7VI literal 0 HcmV?d00001 diff --git a/UpdateLib/UpdateLib.Generator/Resources/loading.gif b/UpdateLib/UpdateLib.Generator/Resources/loading.gif new file mode 100644 index 0000000000000000000000000000000000000000..62d8e4e54726c2634af80e1396191c15e645941c GIT binary patch literal 98823 zcmafaby!=^vv&eX2<{LdKnN~{;9A_>-L25#ZlwwC?of(rTbyF0!L2RQLZQW7S_-rj zsO9B*-}}4rKKFU={&RNs%}e{mu;xc)8N^>19&BJRx*j=uu8 za*E4-i(5Ox-EG88?&GBEaeA$|uh+P`W!!CH!x8JNnVP658LEj0qVRzL0N}REQqK^f z>J;R3dzDiN^K)`};1+~%cDv{4a~Juw{}mG9>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;ETdh5qEt z#t@#MAhaptcKn|KV~TU*0-#ytX&iLkgjp>yy(KONWeTCQMYbEqE?Sn9Cs7BYS>}^i zYbcs=%Y$pzQ(;P>M$!Hf0f!Yx>SV<@Kp4$0j;Q zJcTNjRoh&Gr!8Rzn>f-bVK)c(+{s$#P9?y_rXmee&r<=@NNy~qE)`PGcA6QO2M5gp z9$lJGRj`@^+4d66adbc>I&-bd6cRw1m@!*_mZXNI5KFVg7(|)`kfNvp#1LhEF;3TP z1rRPt($hhi9N3**vt}#OB~%$k*R3EU88}V=MUkZcr445`W~AKW@w_=zJ+p7HxjzwG zj~wIgY0Rn$hleXiH&oyNm(?#$@@d*i5tp6H1Ap9ZsX!_`tzw~Rnw=9YMGMT5vC1_q z%7NdAwBgKIRjs5cqho6`O>5?D>NN87=s4)C?kO#C(9Gmw+N>`8r4fEWGhnhv4^3wa z>|vV?aKk3WJXfbkMf*IrU=UucVQb3;vhT!mDsAkYtsR#N^!u%CZ}O@7;H7be+|4#! zuAH43GBrf-zZEisGugN~YhSCvIA)s!4;$LbqEQ|h$9|jJ7T9M7e-4yQad6S_C1deO hQ7LIj8Z*0sTks~3^G#ggFoQMY8783ce{zh%{{bQyG4%id literal 0 HcmV?d00001 diff --git a/UpdateLib/UpdateLib.Generator/Resources/loading_gear.gif b/UpdateLib/UpdateLib.Generator/Resources/loading_gear.gif new file mode 100644 index 0000000000000000000000000000000000000000..fef4ec0a9d9b1cda3d973b603e57ef3ecfeb78d9 GIT binary patch literal 73023 zcmd?xbx<2>yEgg?PzX|jyIb+nqNRcacXtTxR@^-ySa5fD_X4H36}J|5cc-wvtkwOl zz0Y^{dC&f2pZ(38d!7k1A<2K4$#1Ufe#9lk`1ry7Px_x+KlyW>K7IP^*|X=*pCch5 zAtNKBprE{X@d6bU6%7py005w)qhnxTU}9ooVPU;|`4Sr&8wdpA;Nalm;^N`q;p5{I z5D*X&5)u&+5fc-WkdTm)l9G{;k&}~CP*6}(Qc_V-QBzaX(9qD*($dkF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*0hd-|#KGyjgIhEhUsl(Q(xYA`sPMAq(y)^zxAn#JBcYOR*)EBOE{T%Z~GZP!x>c z67(0;npGF{V2n>;d`N0X*_n?Qo!Oc)?QW&V`0lX}YNFN^5$WAsepodI}G;xVk-j4*I`}?Nh zORs_~URv~vhd~sz?xrM=jay<> z&oIm&-*;XyvS8>|DCkTV>-3g*+{>G+Hu4Qx^pzK=Ecbmz8fa$GvvM((h3{2vrzScj ne6YkBBmG^ObBJOoVX}!XuvvRWLHOYLga7;bzu&-r^$q+t0||%G literal 0 HcmV?d00001 diff --git a/UpdateLib/UpdateLib.Generator/Resources/project_16px.png b/UpdateLib/UpdateLib.Generator/Resources/project_16px.png new file mode 100644 index 0000000000000000000000000000000000000000..25fe53638760c704f3418e4eba29e18e92140f68 GIT binary patch literal 244 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt^DJzX3_ zECi1R9uz!ez!SXSuz`?|aJkI32EiFCPGtH%*&WB%=Uy77a@+GCY;=hC=^8;`1(tCCNR6^{wxE0GE#x_SCe{z$LSF+fzdfRu-U6Hl+s_Qzw p3#OlR-?k~z0#LT=By}Z;C1rt33 zJwr2>%=KS^icWgEIEGmGFP(In_mBaPgR$UggUG(f#haH{Zg2_YpYo@Z*Kclvg6On) zPvYlScU*{iuI!;%%<0IH%wy7)6novqH&|KlvyHQ%jDm)uM^n=jp(3kzt=j$~0Re@T zO?4lm<&w`_PyOl75W;Ah(Ww7%)+d1(4&sg+{{&R(IZI^Uh~JuXz2UoDCD*CPAMPps zJ`@qhdd{+?ZLy_rM2h@2%k`D~tX?a98qP#n^Kd<|6jIsrE$$)vubZ0#LT=By}Z;C1rt33 zJwr2>%=KS^ijI4_IEGmG&zpLrt8GgcaP0X$U4W^aQ!Hbxu)@sZcLq8q@)t2oEY5FJ(w~ri#LeNsamHJxjVJXy i?!GDdhj|j~Tsy{xvCsOg)Ej|bV(@hJb6Mw<&;$VMH+)0@ literal 0 HcmV?d00001 diff --git a/UpdateLib/UpdateLib.Generator/Tasks/LoadDirectoryTask.cs b/UpdateLib/UpdateLib.Generator/Tasks/LoadDirectoryTask.cs new file mode 100644 index 0000000..2177efb --- /dev/null +++ b/UpdateLib/UpdateLib.Generator/Tasks/LoadDirectoryTask.cs @@ -0,0 +1,104 @@ +/* UpdateLib - .Net auto update library + * Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using System; +using System.Drawing; +using System.IO; +using System.Windows.Forms; + +using MatthiWare.UpdateLib.Tasks; +using MatthiWare.UpdateLib.UI; + +namespace MatthiWare.UpdateLib.Generator.Tasks +{ + public class LoadDirectoryTask : AsyncTask + { + public ListView ItemsListView { get; set; } + public ImageList IconList { get; set; } + public DirectoryInfo DirectoryPath { get; set; } + + public LoadDirectoryTask(ListView lv, ImageList iconCache, DirectoryInfo dirPath) + { + ItemsListView = lv ?? throw new ArgumentNullException(nameof(lv)); + IconList = iconCache ?? throw new ArgumentNullException(nameof(iconCache)); + DirectoryPath = dirPath ?? throw new ArgumentNullException(nameof(dirPath)); + + if (!DirectoryPath.Exists) throw new DirectoryNotFoundException($"The directory '{dirPath.FullName}' was not found."); + } + + protected override void DoWork() + { + BeginUpdate(); + + Clear(); + + foreach (DirectoryInfo subDir in DirectoryPath.GetDirectories()) + { + ListViewItem item = new ListViewItem(new string[] { subDir.Name, subDir.LastWriteTimeUtc.ToString(), subDir.FullName }); + item.Tag = subDir; + item.ImageKey = "folder"; + + AddItem(item); + } + + foreach (FileInfo file in DirectoryPath.GetFiles()) + { + ListViewItem item = new ListViewItem(new string[] { file.Name, file.LastWriteTimeUtc.ToString(), file.FullName }); + item.Tag = file; + + if (!IconList.Images.ContainsKey(file.Extension)) + IconList.Images.Add(file.Extension, Icon.ExtractAssociatedIcon(file.FullName)); + + item.ImageKey = file.Extension; + + AddItem(item); + } + + SetColumnAutoSize(0); + SetColumnAutoSize(1); + SetColumnAutoSize(2); + + EndUpdate(); + + } + + private void SetColumnAutoSize(int clmn) + { + ItemsListView.InvokeOnUI(() => ItemsListView.Columns[clmn].Width = -1); + } + + private void EndUpdate() + { + ItemsListView.InvokeOnUI(() => ItemsListView.EndUpdate()); + } + + private void BeginUpdate() + { + ItemsListView.InvokeOnUI(() => ItemsListView.BeginUpdate()); + } + + private void Clear() + { + ItemsListView.InvokeOnUI(() => ItemsListView.Items.Clear()); + } + + private void AddItem(ListViewItem item) + { + ItemsListView.InvokeOnUI(() => ItemsListView.Items.Add(item)); + } + } +} diff --git a/UpdateLib/UpdateLib.Generator/Tasks/UpdateGeneratorTask.cs b/UpdateLib/UpdateLib.Generator/Tasks/UpdateGeneratorTask.cs new file mode 100644 index 0000000..5b1e3b7 --- /dev/null +++ b/UpdateLib/UpdateLib.Generator/Tasks/UpdateGeneratorTask.cs @@ -0,0 +1,158 @@ +/* UpdateLib - .Net auto update library + * Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading; + +using MatthiWare.UpdateLib.Common; +using MatthiWare.UpdateLib.Files; +using MatthiWare.UpdateLib.Generator.Data.FilesPage; +using MatthiWare.UpdateLib.Generator.UI.Pages; +using MatthiWare.UpdateLib.Security; +using MatthiWare.UpdateLib.Tasks; + +namespace MatthiWare.UpdateLib.Generator.Tasks +{ + public class UpdateGeneratorTask : AsyncTask + { + private delegate void AddDirRecursiveDelegate(GenFolder dir, DirectoryEntry entry); + + private GenFolder baseDir; + + private int total; + private int done = 0; + + private InformationPage infoPage; + + private IList registryFolders; + + public UpdateGeneratorTask(GenFolder dir, InformationPage info, IList registry) + { + baseDir = dir ?? throw new ArgumentNullException("dir", "The directory cannot be null"); + registryFolders = registry; + + total = dir.Count + registry.Sum(g => g.Count); + + infoPage = info; + + base.Result = new UpdateLib.Files.UpdateInfo(); + } + + protected override void DoWork() + { + foreach (GenFolder subfolder in baseDir.Directories) + { + if (subfolder.Count == 0) + return; + + DirectoryEntry entry = new DirectoryEntry(string.IsNullOrEmpty(subfolder.PathVariable) ? subfolder.Name : subfolder.PathVariable); + + Result.Folders.Add(entry); + + AddDirRecursive(subfolder, entry); + } + + Enqueue(new Action(AddRegistryItems), null); + + // Result.ApplicationName = infoPage.ApplicationName; + Result.Version = infoPage.Version; + } + + private void AddRegistryItems() + { + foreach (GenFolder registry in registryFolders) + { + if (registry.Count == 0) + continue; + + DirectoryEntry dir = new DirectoryEntry(registry.Name); + + Result.Registry.Add(dir); + + AddRegistryRecursive(registry, dir); + } + } + + private void AddRegistryRecursive(GenFolder dir, DirectoryEntry entry) + { + List keys = dir.Items; + foreach (GenReg key in keys) + { + entry.Add(new RegistryKeyEntry(key.Name, key.Type, key.Value)); + + Interlocked.Increment(ref done); + } + + if (keys.Count > 0) + OnTaskProgressChanged(done, total); + + IEnumerable dirsLeft = dir.Directories.Where(g => g.Count > 0); + int left = dirsLeft.Count(); + + foreach (GenFolder subDir in dirsLeft) + { + DirectoryEntry dirEntry = new DirectoryEntry(subDir.Name); + entry.Add(dirEntry); + + left--; + + if (left == 0) + AddRegistryRecursive(subDir, dirEntry); + else + Enqueue(new Action(AddRegistryRecursive), subDir, dirEntry); + } + + } + + private void AddDirRecursive(GenFolder dir, DirectoryEntry entry) + { + List files = dir.Items; + foreach (GenFile genFile in files) + { + System.IO.FileInfo fi = genFile.FileInfo; + FileEntry newEntry = new FileEntry(fi.Name); + newEntry.Hash = HashUtil.GetHash(fi.FullName); + + entry.Add(newEntry); + + Interlocked.Increment(ref done); + } + + if (files.Count > 0) + OnTaskProgressChanged(done, total); + + IEnumerable dirsLeft = dir.Directories.Where(g => g.Count > 0); + int left = dirsLeft.Count(); + + foreach (GenFolder subDir in dirsLeft) + { + DirectoryEntry dirEntry = new DirectoryEntry(string.IsNullOrEmpty(subDir.PathVariable) ? subDir.Name : subDir.PathVariable); + entry.Add(dirEntry); + + left--; + + if (left == 0) + AddDirRecursive(subDir, dirEntry); + else + Enqueue(new Action(AddDirRecursive), subDir, dirEntry); + } + } + } +} diff --git a/UpdateLib/UpdateLib.Generator/UI/ElipseComponent.cs b/UpdateLib/UpdateLib.Generator/UI/ElipseComponent.cs new file mode 100644 index 0000000..938db33 --- /dev/null +++ b/UpdateLib/UpdateLib.Generator/UI/ElipseComponent.cs @@ -0,0 +1,135 @@ +/* UpdateLib - .Net auto update library + * Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using System; +using System.ComponentModel; +using System.ComponentModel.Design; +using System.Drawing; +using System.Runtime.InteropServices; +using System.Windows.Forms; + +namespace MatthiWare.UpdateLib.Generator.UI +{ + public class ElipseComponent : Component + { + #region PInvoke CreateRoundRectRgn + + [DllImport("gdi32.dll", EntryPoint = "CreateRoundRectRgn")] + private static extern IntPtr CreateRoundRectRgn(int x, int y, int width, int height, int curveX, int curveY); + + private static void MakeRound(Form form, int elipse) + { + if (form == null) + return; + + form.FormBorderStyle = FormBorderStyle.None; + Region region = Region.FromHrgn(CreateRoundRectRgn(0, 0, form.Width, form.Height, elipse, elipse)); + form.Region = region; + } + + #endregion + + private int m_radius; + + public int Radius + { + get { return m_radius; } + set + { + m_radius = value; + ApplyRadius(); + } + } + + private ContainerControl m_control; + + public ContainerControl Control + { + get { return m_control; } + set + { + if (m_control != null && m_control is Form) + { + m_control.Resize -= M_control_Resize; + } + + m_control = value; + + m_control.Resize += M_control_Resize; + + ApplyRadius(); + } + } + + private void M_control_Resize(object sender, EventArgs e) + { + ApplyRadius(); + } + + public ElipseComponent() + { + m_radius = 5; + } + + public ElipseComponent(IContainer container) + : this() + { + container.Add(this); + } + + public void ApplyRadius() + { + if (Control == null) + return; + + if (!(Control is Form)) + return; + + MakeRound(Control as Form, Radius); + } + + public override ISite Site + { + get + { + return base.Site; + } + + set + { + base.Site = value; + + if (value == null) + return; + + IComponent rootComponent; + Type serviceType = typeof(IDesignerHost); + IDesignerHost service = Site.GetService(serviceType) as IDesignerHost; + + if (service == null) + return; + + rootComponent = service.RootComponent; + + if (!(rootComponent is ContainerControl)) + return; + + Control = rootComponent as ContainerControl; + } + } + } +} diff --git a/UpdateLib/UpdateLib.Generator/UI/FlatButton.cs b/UpdateLib/UpdateLib.Generator/UI/FlatButton.cs new file mode 100644 index 0000000..5f10eba --- /dev/null +++ b/UpdateLib/UpdateLib.Generator/UI/FlatButton.cs @@ -0,0 +1,205 @@ +/* UpdateLib - .Net auto update library + * Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using System; +using System.ComponentModel; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Drawing.Text; +using System.Windows.Forms; + +namespace MatthiWare.UpdateLib.Generator.UI +{ + [DefaultEvent(nameof(Click))] + public class FlatButton : Control + { + private const float PADDING_WIDTH = 0.0625f; + private const float PADDING_HEIGHT = 0.25f; + private const float IMG_SIZE_WIDTH = 0.125f; + private const float IMG_SIZE_HEIGHT = 0.5f; + private const float TEXT_SIZE_WIDTH = 1f - (PADDING_WIDTH * 3) - IMG_SIZE_WIDTH; + private const float TEXT_SIZE_HEIGHT = 1f - (PADDING_HEIGHT * 2); + + private bool mouseInside = false; + + private Bitmap buffer; + + private bool m_activeItem; + + private Color m_backColor; + + public bool ActiveItem + { + get { return m_activeItem; } + set { m_activeItem = value; UpdateBackgroundColor(); } + } + + private Color m_hoveColor; + + public Color BackHoverColor + { + get { return m_hoveColor; } + set { m_hoveColor = value; } + } + + private Color m_selectedColor; + + public Color BackSelectedColor + { + get { return m_selectedColor; } + set { m_selectedColor = value; } + } + + private Image m_infoImage; + + public Image InfoImage + { + get { return m_infoImage; } + set + { + m_infoImage = value; + + Rectangle rect = new Rectangle( + (int)(Width * PADDING_WIDTH), + (int)(Height * PADDING_HEIGHT), + (int)(Width * IMG_SIZE_WIDTH), + (int)(Height * IMG_SIZE_HEIGHT)); + + Invalidate(rect); + } + } + + + public FlatButton() + : base() + { + SetStyle(ControlStyles.AllPaintingInWmPaint + | ControlStyles.UserPaint + | ControlStyles.ResizeRedraw + | ControlStyles.OptimizedDoubleBuffer + | ControlStyles.SupportsTransparentBackColor, true); + + DoubleBuffered = true; + } + + public void PerformClick() + { + OnClick(EventArgs.Empty); + } + + protected override void OnClick(EventArgs e) + { + ActiveItem = true; + + foreach (Control c in Parent.Controls) + { + FlatButton button = c as FlatButton; + + if (button == null || button == this) + continue; + + button.ActiveItem = false; + } + + base.OnClick(e); + } + + protected override void OnMouseEnter(EventArgs e) + { + base.OnMouseEnter(e); + + if (!mouseInside) + { + mouseInside = true; + UpdateBackgroundColor(); + } + } + + protected override void OnMouseLeave(EventArgs e) + { + base.OnMouseLeave(e); + + if (mouseInside) + { + mouseInside = false; + UpdateBackgroundColor(); + } + } + + private void UpdateBackgroundColor() + { + m_backColor = (m_activeItem ? m_selectedColor : BackColor); + m_backColor = (mouseInside ? m_hoveColor : m_backColor); + + + Invalidate(); + } + + protected override void OnResize(EventArgs e) + { + base.OnResize(e); + + buffer = new Bitmap(Width, Height); + } + + protected override void OnPaint(PaintEventArgs e) + { + Rectangle rect = new Rectangle(0, 0, Width, Height); + + buffer = buffer ?? new Bitmap(Width, Height); + + using (Graphics g = Graphics.FromImage(buffer)) + { + g.SmoothingMode = SmoothingMode.HighQuality; + g.PixelOffsetMode = PixelOffsetMode.HighQuality; + g.TextRenderingHint = TextRenderingHint.ClearTypeGridFit; + + g.Clear(Color.White); + + g.FillRectangle(new SolidBrush(m_backColor), rect); + + float imgSize = Math.Min(Width * IMG_SIZE_WIDTH, Height * IMG_SIZE_HEIGHT); + + RectangleF imgRect = new RectangleF( + Width * PADDING_WIDTH, + Height * PADDING_HEIGHT, + imgSize, + imgSize); + + if (InfoImage != null) + g.DrawImage(InfoImage, imgRect); + + SizeF textSize = g.MeasureString(Text, Font, (int)(Width * TEXT_SIZE_WIDTH)); + + float offsetX = ((Width * PADDING_WIDTH) * 2) + imgRect.Width; + float offsetY = imgRect.Y; + + float availableTextWidth = Width - offsetX - (Width * PADDING_WIDTH); + float availableTextHeight = Height - (offsetY * 2); + + float x = offsetX + (availableTextWidth / 2) - (textSize.Width / 2); + float y = offsetY + (availableTextHeight / 2) - (textSize.Height / 2); + + g.DrawString(Text, Font, new SolidBrush(ForeColor), x, y); + + base.OnPaint(e); + e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic; + e.Graphics.DrawImageUnscaled(buffer, 0, 0); + } + } + } +} diff --git a/UpdateLib/UpdateLib.Generator/UI/GradientPanel.cs b/UpdateLib/UpdateLib.Generator/UI/GradientPanel.cs new file mode 100644 index 0000000..c74349a --- /dev/null +++ b/UpdateLib/UpdateLib.Generator/UI/GradientPanel.cs @@ -0,0 +1,134 @@ +/* UpdateLib - .Net auto update library + * Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using System; +using System.Drawing; +using System.Windows.Forms; + +namespace MatthiWare.UpdateLib.Generator.UI +{ + public class GradientPanel : Panel + { + + public GradientPanel() + : base() + { + + } + + private int m_quality = 100; + + public int Quality + { + get { return m_quality; } + set { m_quality = value; SetGradient(); } + } + + + private Color m_gradientTopRight = SystemColors.Control; + + public Color GradientTopRight + { + get { return m_gradientTopRight; } + set { m_gradientTopRight = value; SetGradient(); } + } + + private Color m_gradientTopLeft = SystemColors.Control; + + public Color GradientTopLeft + { + get { return m_gradientTopLeft; } + set { m_gradientTopLeft = value; SetGradient(); } + } + + private Color m_gradientBottomLeft = SystemColors.Control; + + public Color GradientBottomLeft + { + get { return m_gradientBottomLeft; } + set { m_gradientBottomLeft = value; SetGradient(); } + } + + private Color m_gradientBottomRight = SystemColors.Control; + + public Color GradientBottomRight + { + get { return m_gradientBottomRight; } + set { m_gradientBottomRight = value; SetGradient(); } + } + + protected override void OnResize(EventArgs eventargs) + { + base.OnResize(eventargs); + + SetGradient(); + } + + private void SetGradient() + { + Bitmap buffer = new Bitmap(Quality, Quality); + for (int x = 0; x < Quality; x++) + { + int percentX = (int)(((double)x / Width) * 100); + + Color c1 = GetColorScale(percentX, GradientTopLeft, GradientTopRight); + + for (int y = 0; y < Quality; y++) + { + int percentY = (int)(((double)y / Height) * 100); + + Color c2 = GetColorScale(percentY, GradientTopLeft, GradientTopRight); + + buffer.SetPixel(x, y, DiffuseColors(c1, c2)); + } + } + + if (BackgroundImageLayout != ImageLayout.Stretch) + BackgroundImageLayout = ImageLayout.Stretch; + + SuspendLayout(); + + BackgroundImage = buffer; + + ResumeLayout(true); + } + + private Color GetColorScale(int percentage, Color start, Color end) + { + byte red = GetByte(percentage, start.R, end.R); + byte green = GetByte(percentage, start.G, end.G); + byte blue = GetByte(percentage, start.B, end.B); + + return Color.FromArgb(red, green, blue); + } + + private byte GetByte(int percentage, byte begin, byte end) + { + return (byte)(Math.Round((begin + ((end - begin) * percentage) * 0.01), 0)); + } + + private Color DiffuseColors(Color a, Color b) + { + int red = (a.R + b.R) / 2; + int green = (a.G + b.G) / 2; + int blue = (a.B + b.B) / 2; + return Color.FromArgb(red, green, blue); + } + + + } +} diff --git a/UpdateLib/UpdateLib.Generator/UI/HoverPictureBox.cs b/UpdateLib/UpdateLib.Generator/UI/HoverPictureBox.cs new file mode 100644 index 0000000..08cfd31 --- /dev/null +++ b/UpdateLib/UpdateLib.Generator/UI/HoverPictureBox.cs @@ -0,0 +1,104 @@ +/* UpdateLib - .Net auto update library + * Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using System; +using System.Drawing; +using System.Windows.Forms; + +namespace MatthiWare.UpdateLib.Generator.UI +{ + public class HoverPictureBox : PictureBox + { + private int alpha = 255; + private bool mouseInBox = false; + private bool mouseDown = false; + + protected override void OnMouseEnter(EventArgs e) + { + base.OnMouseEnter(e); + + if (!mouseInBox) + { + mouseInBox = true; + SwitchBackgroundColor(); + } + } + + private void SwitchBackgroundColor() + { + alpha = (mouseInBox ? 100 : 0); + alpha = (mouseDown ? 150 : alpha); + BackColor = Color.FromArgb(alpha, Color.WhiteSmoke); + } + + protected override void OnMouseHover(EventArgs e) + { + base.OnMouseHover(e); + + if (!mouseInBox) + { + mouseInBox = true; + SwitchBackgroundColor(); + } + } + + protected override void OnMouseLeave(EventArgs e) + { + base.OnMouseLeave(e); + + if (mouseInBox) + { + mouseInBox = false; + SwitchBackgroundColor(); + } + } + + protected override void OnMouseMove(MouseEventArgs e) + { + base.OnMouseMove(e); + + if (!mouseInBox) + { + mouseInBox = true; + SwitchBackgroundColor(); + } + } + + protected override void OnMouseDown(MouseEventArgs e) + { + base.OnMouseDown(e); + + if (!mouseDown) + { + mouseDown = true; + SwitchBackgroundColor(); + } + } + + protected override void OnMouseUp(MouseEventArgs e) + { + base.OnMouseUp(e); + + if (mouseDown) + { + mouseDown = false; + SwitchBackgroundColor(); + } + } + + } +} diff --git a/UpdateLib/UpdateLib.Generator/UI/InputDialog.Designer.cs b/UpdateLib/UpdateLib.Generator/UI/InputDialog.Designer.cs new file mode 100644 index 0000000..709c5a0 --- /dev/null +++ b/UpdateLib/UpdateLib.Generator/UI/InputDialog.Designer.cs @@ -0,0 +1,138 @@ +namespace MatthiWare.UpdateLib.Generator.UI +{ + partial class InputDialog + { + /// + /// 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() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(InputDialog)); + this.panel1 = new System.Windows.Forms.Panel(); + this.btn2 = new System.Windows.Forms.Button(); + this.btn1 = new System.Windows.Forms.Button(); + this.btn3 = new System.Windows.Forms.Button(); + this.lblHeader = new System.Windows.Forms.Label(); + this.txtInput = new System.Windows.Forms.TextBox(); + this.panel1.SuspendLayout(); + this.SuspendLayout(); + // + // panel1 + // + this.panel1.BackColor = System.Drawing.SystemColors.Control; + this.panel1.Controls.Add(this.btn2); + this.panel1.Controls.Add(this.btn1); + this.panel1.Controls.Add(this.btn3); + this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom; + this.panel1.Location = new System.Drawing.Point(0, 100); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(401, 46); + this.panel1.TabIndex = 0; + // + // btn2 + // + this.btn2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btn2.Location = new System.Drawing.Point(227, 11); + this.btn2.Name = "btn2"; + this.btn2.Size = new System.Drawing.Size(75, 23); + this.btn2.TabIndex = 2; + this.btn2.UseVisualStyleBackColor = true; + this.btn2.Visible = false; + // + // btn1 + // + this.btn1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btn1.Location = new System.Drawing.Point(146, 11); + this.btn1.Name = "btn1"; + this.btn1.Size = new System.Drawing.Size(75, 23); + this.btn1.TabIndex = 1; + this.btn1.UseVisualStyleBackColor = true; + this.btn1.Visible = false; + // + // btn3 + // + this.btn3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btn3.Location = new System.Drawing.Point(308, 11); + this.btn3.Name = "btn3"; + this.btn3.Size = new System.Drawing.Size(75, 23); + this.btn3.TabIndex = 3; + this.btn3.UseVisualStyleBackColor = true; + this.btn3.Visible = false; + // + // lblHeader + // + this.lblHeader.AutoSize = true; + this.lblHeader.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblHeader.ForeColor = System.Drawing.Color.MidnightBlue; + this.lblHeader.Location = new System.Drawing.Point(12, 9); + this.lblHeader.Name = "lblHeader"; + this.lblHeader.Size = new System.Drawing.Size(212, 25); + this.lblHeader.TabIndex = 2; + this.lblHeader.Text = "Version 1.0.0.0 available"; + // + // txtInput + // + this.txtInput.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.txtInput.Location = new System.Drawing.Point(17, 52); + this.txtInput.Name = "txtInput"; + this.txtInput.Size = new System.Drawing.Size(366, 22); + this.txtInput.TabIndex = 0; + this.txtInput.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtInput_KeyDown); + // + // InputDialog + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.AutoSize = true; + this.BackColor = System.Drawing.SystemColors.Window; + this.ClientSize = new System.Drawing.Size(401, 146); + this.Controls.Add(this.txtInput); + this.Controls.Add(this.lblHeader); + this.Controls.Add(this.panel1); + 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.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "InputDialog"; + this.ShowIcon = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Message Dialog"; + this.panel1.ResumeLayout(false); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.Button btn3; + private System.Windows.Forms.Label lblHeader; + private System.Windows.Forms.Button btn1; + private System.Windows.Forms.Button btn2; + private System.Windows.Forms.TextBox txtInput; + } +} \ No newline at end of file diff --git a/UpdateLib/UpdateLib.Generator/UI/InputDialog.cs b/UpdateLib/UpdateLib.Generator/UI/InputDialog.cs new file mode 100644 index 0000000..9610f66 --- /dev/null +++ b/UpdateLib/UpdateLib.Generator/UI/InputDialog.cs @@ -0,0 +1,108 @@ +/* UpdateLib - .Net auto update library + * Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using System.Windows.Forms; + +namespace MatthiWare.UpdateLib.Generator.UI +{ + public partial class InputDialog : Form + { + public string Header + { + get { return this.lblHeader.Text; } + set { this.lblHeader.Text = value; } + } + + public string Input + { + get { return this.txtInput.Text; } + set { this.txtInput.Text = value; } + } + + public InputDialog() + { + InitializeComponent(); + } + + public InputDialog(string title, string header, MessageBoxButtons buttons = MessageBoxButtons.YesNo) + : this() + { + Header = header; + Text = title; + + SetUpButtons(buttons); + + txtInput.Focus(); + } + + private void SetUpButtons(MessageBoxButtons buttons) + { + switch (buttons) + { + case MessageBoxButtons.OK: + default: + SetUpButton(btn3, "OK", DialogResult.OK, true); + break; + case MessageBoxButtons.OKCancel: + SetUpButton(btn2, "OK", DialogResult.OK, true); + SetUpButton(btn3, "Cancel", DialogResult.Cancel); + break; + case MessageBoxButtons.AbortRetryIgnore: + SetUpButton(btn3, "Ignore", DialogResult.Ignore); + SetUpButton(btn2, "Retry", DialogResult.Retry); + SetUpButton(btn1, "Abort", DialogResult.Abort, true); + break; + case MessageBoxButtons.YesNoCancel: + SetUpButton(btn3, "Cancel", DialogResult.Cancel); + SetUpButton(btn2, "No", DialogResult.No); + SetUpButton(btn1, "Yes", DialogResult.Yes, true); + break; + case MessageBoxButtons.YesNo: + SetUpButton(btn3, "No", DialogResult.No); + SetUpButton(btn2, "Yes", DialogResult.Yes, true); + break; + case MessageBoxButtons.RetryCancel: + SetUpButton(btn3, "Cancel", DialogResult.Cancel); + SetUpButton(btn2, "Retry", DialogResult.Retry, true); + break; + } + } + + private void SetUpButton(Button button, string text, DialogResult result, bool defaultButton = false) + { + button.Text = text; + button.DialogResult = result; + button.Visible = true; + + if (defaultButton) + button.TabIndex = 0; + } + + private void txtInput_KeyDown(object sender, KeyEventArgs e) + { + if (e.KeyCode == Keys.Enter) + { + if (btn1.Visible) + btn1.PerformClick(); + else if (btn2.Visible) + btn2.PerformClick(); + else if (btn3.Visible) + btn3.PerformClick(); + } + } + } +} diff --git a/UpdateLib/UpdateLib.Generator/UI/InputDialog.resx b/UpdateLib/UpdateLib.Generator/UI/InputDialog.resx new file mode 100644 index 0000000..9fe1da0 --- /dev/null +++ b/UpdateLib/UpdateLib.Generator/UI/InputDialog.resx @@ -0,0 +1,306 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + AAABAAIAMDAAAAEAIACoJQAAJgAAABAQAAABACAAaAQAAM4lAAAoAAAAMAAAAGAAAAABACAAAAAAAAAk + AAASCwAAEgsAAAAAAAAAAAAA////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8ANJtQDDOYTkgxlEx2MZJLojCQSs0wkEr0MJBK4zCR + SsswkUuyMZJLmTGTTIAylk1fNJtQDP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AACEIy0UgTKaIIM89iuDQv8pgkD/JoI//yWF + QP8liUD/JYdA/yWHQP8mhED/JoI//yiBP/8qg0H/IIM89hSDM5kAhCMs////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wAAfB9RE30xxxt7Nv8kfjz/IYU8/yWP + Q/88oFb/VKxs/2e2ff9yvIf/abZ+/2K0ev9asXL/VK1t/02pZv82mFH/JYZA/yZ/Pf8bezb/En0wxwqD + K1sAgyMG////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8AAIUjFBN/Ma4ZdzT/In06/x6G + Ov9MqGP/iMaZ/6XUsv+cz6r/lMuk/43Hnf+JxJn/hMKU/4DAkv99vo3/ebyL/3a7if90u4f/abd//0+p + Zf8zkE3/JX49/yd8Pv8ggzrTDYsvIf///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8AMZRMiwCEIw7///8A////AP///wD///8A////AP///wD///8A////AP///wAJgClUHX037iF3 + OP8jiT//YrZ6/57Qq/+l07L/mc2n/5DIoP+KxZr/hsOX/4LBk/9+v4//er2M/3a7iP9yuYX/breC/2q1 + fv9ms3v/ZLJ5/2KyeP9hs3f/WrBy/zqYU/8nez7/HXw38wiCKUv///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8ALYZF/x58OO4WhzVpAIUkAv///wD///8A////AP///wD///8AAIQjAxN/ + MaEXci//Hno2/z6eWP+i06//p9Sz/5vNqf+TyaL/jsee/4vFmv+IxJn/hsOW/4PBlf+AwJP/fL6O/3a7 + iv9xuIT/a7Z//2aze/9isXf/Xq90/1qtcP9Wq23/VKps/1Ora/9Colv/J30+/xp1M/0VgjGDAIQjAf// + /wD///8A////AP///wD///8A////AP///wD///8ALIRE/yd3PP8mdjv/HX031AmBKkH///8A////AP// + /wANiy8EH4M7ryFyNv8fgzr/b7uD/6/au/+i0bD/mM2m/5TLo/+QyKD/kcig/5LJof+FwpX/c7mG/2Ox + eP9Tqmr/Uqlo/1uucv9jsnn/aLV+/2q1ff9isXj/XK5x/1arbf9SqWr/Tqdm/0ulZP9Jp2L/QaJd/y2G + Rv8ndTv/III6ug2MLxD///8A////AP///wD///8A////AP///wD///8ALIND/iyJRv87l1b/GG0u/xVt + LP8QeS2zDo4wIBuVPAUfgTqzHm80/yqHQv+e0qv/rNa4/5/PrP+YzKX/l8yl/5jNpv+UyqP/Z7R8/zme + Vf8llEP/KZZG/yuXSP8tmEr/LZhK/y2YSv8sl0n/K5dI/yuWSf9Co13/WK1u/1arbf9PqGf/SqVj/0ak + X/9Colz/P6JZ/z2jWP8ujUn/JnM7/x5/OccAhSQE////AP///wD///8A////AP///wD///8AK4FC/TKI + Sf/y/vT/f8OR/xt9Nv8Zai//JXU8+yuCQ9MdazL/J4dD/6TWsv+q1rb/nM2q/5nNpv+azqj/mM2n/1es + b/8nlET/KpZH/zCZTP8zm0//NJtQ/zSbUP80m1D/NJtQ/zSbUP80m1D/NJtQ/zObT/8xmk3/LphL/z6f + WP9JpWP/R6Vg/0KiXP8+oFj/Op5V/zadUv81n1L/L49K/yVuOf8SfS+W////AP///wD///8A////AP// + /wD///8AKn9B/SyDRf/f8+T/y+fS/8Hjyv9XrG7/FXQw/xNiKP8phkL/p9az/6rWtv+dz6r/nM6p/57Q + q/9+wJH/MplP/yuXSP8xmk7/NJtQ/zScUP81nVH/NZ5R/zagU/82olP/NqNU/zajVP82olP/NqBS/zWe + Uf80nFD/M5tP/zKaTv8zm1D/QKFb/z+hWf86nlX/NZxS/zObT/80nFD/NqBT/yyERP8XaC7/CH0mXf// + /wD///8A////AP///wD///8AKn1A/C6DRf/V7t3/udzD/7vexf/B4sr/oNOu/0OhXP+k1rL/qta2/53P + qv+czqr/otGv/1etb/8mlET/L5lM/zObT/80nFD/NZ1R/zagU/80nVH/MJFK/yuAQ/8lbzn/I2k2/yVu + OP8mdDv/Kn5B/zGVTf82olT/NZ9S/zScUP8zm0//MppO/zufVv83nFL/M5tP/zSbUP80m1D/NZ1R/zWg + Uv8mdT3/GW0w+QmEKy7///8A////AP///wD///8AKXxA+zGCSP/Q7Nj/tNq//7DYu/+v17r/sdi6/67W + uf+m1LP/nc+q/53Oqv+f0K3/Tahm/ymWRv8xmk7/NJtQ/zScUP81n1L/NZ5R/yp8QP8hZDP/Imc1/xlw + MfkOcSq/Am4gmgFrHrEObijIGW0w+iBlNP8lcDr/L49K/zahU/81nVH/NJtQ/zObUP8zm1D/NJtQ/zSb + UP80m1D/NJtQ/zWeUf80nVH/JGw3/xtzM+MOjjAP////AP///wD///8AKXo/+zGBSf/L6tX/sNi7/63W + uP+p1LT/pdKx/6HQrv+dzqr/ns6r/57Oq/9GpF//KpZH/zKaTv80nFD/NZ1R/zahU/8xlEz/Imo2/xdk + LP0Sei2dDYsvQACHJQb///8A////AP///wD///8AAIglEhN/MHYZbzDfIWEz/yuBQv81oVL/NZ5R/zSc + UP80m1D/NJtQ/zSbUP80m1D/NJxQ/zWdUf83pFX/MJFK/yJkNP8ceDW8AIMjAf///wD///8AKHg++jWC + Sf/I6NH/rda4/6nUtP+l0rH/odCu/53Oqv+bzan/otCu/0+nZ/8qlkf/MptP/zSbUP81nlH/NZ9S/yp/ + Qf8gYDL/GnEy5gqELD////8A////AP///wD///8A////AP///wD///8A////AP///wAAiCUHEHQsqBRc + J/8mcjr/NJ1R/zWeUf80m1D/NJtQ/zSbUP80nFH/Np9S/zWhU/8shET/IGMy/xdmLPoReC2BAHwXBP// + /wD///8AJ3c9+jaBSv/D587/qdW1/6XTsv+h0K7/nc6q/5rMqP+ezqv/cLmE/yeVRf8ymk7/NJtQ/zSb + UP81nlH/J3Q7/x9cL/8ndTz9KZtHTv///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AAZ2I3MUYCj9JG45/zWiU/81nVH/NJxQ/zWeUv83olT/MJJL/yNnNf8SWSb/DXApvgCB + ISL///8A////AP///wD///8AJ3U8+jd/S/++5Mj/pdOy/6HRrv+dz6v/mc6n/5zNqP+KxZr/KJVF/zCZ + Tf80m1D/NJtQ/zSbUP81nVH/NqJU/y2JRv8gYDL/E1om/w9wKbUBiiYg////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wAEdSRvEVYj/yt+Qf83o1T/NqJT/zSeUf8mdDv/HVgt/xlq + LusHfSdW////AP///wD///8A////AP///wD///8AJnM7+Th+TP+54sX/odGu/53Pq/+Zzaf/mc2o/5vM + qP80m1D/LphL/zSbUP80m1D/NJtQ/zSbUP80m1D/NZ1R/zagUv82olP/KX1A/x1ZLv8VYCn7EHcsjgCG + JAv///8A////AP///wD///8A////AP///wD///8A////AP///wD///8ADm8osBxVLf8xkkv/LYZF/x9a + Lv8TWyf9EXUslACJJQv///8A////AP///wD///8A////AP///wD///8AJnI7+Dl+S/+04MD/nc+r/5nN + p/+Xzab/nc+r/0ynZP8rl0j/M5tP/zSbUP80m1D/NJtQ/zSbUP80m1D/NJtQ/zScUP82oVP/OalY/y+P + Sf8eWC3/D1Ag/wRzIqgAdAoB////AP///wD///8A////AP///wD///8A////AP///wD///8AAYkmDBdo + LeIdVCv/HFYt/xltMM0Khywu////AP///wD///8A////AP///wD///8A////AABiEiErgkOkJXA6+Dp8 + Sv+x3r3/ms2o/5bMpf+azqj/a7Z//yiVRv8ymk7/NJtQ/zSbUP80m1D/NJtQ/zSbUP80nFD/NZ5R/zei + VP80m0//JGs2/xpQKP8YZy7lB30oUv///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AAiAKC4JYSDnFH4waACIJQH///8A////AP///wD///8A////AP///wAAaBUID3MphBx3 + Nfgqf0HyJW859zp7S/+s3Ln/lsul/5fLpf+Mx5v/JpVF/zCaTf80m1D/NJtQ/zSbUP80m1D/NJtQ/zWd + Uf82oVP/NaFT/yd3Pv8ZTCf/E1km+BF4LYABiSYG////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wAAfhgC////AP///wD///8A////AP///wD///8A////AABp + GlUUdC7kL4BG/yV5O/8pfEDzJG049jp5TP+n2rb/k8qi/5nNqP9JpmL/LZhK/zSbUP80m1D/NJtQ/zSb + UP80nFH/NqBS/zimVv8rhET/G1Eq/w9NIP4NaiasAYsnGP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wAAYxEpB24jvglsJP9fk2//grSQ/yN6PP8oeT70JGs39jl3Sv+j2LH/k8qj/4PCk/8mlET/MppO/zSb + UP80m1D/NJxQ/zWfUv83pVX/MJFL/x5aLf8YSSb/FmYs0guGLDf///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8AAGIQDQxxJpAPcSn8LHtB/5a1nv/a69//OaVX/yR3Ov8ndj30I2o29Tp2S/+f1q//lsuk/0Cg + Wv8umEv/NJtQ/zScUP81nlH/N6NU/zSdUf8jZjX/FUIh/xJaJu8TfjBkAYkmAf///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wAAahxiE3Mt6xdyMf9jmHL/v9fH/9Hs1/+Lx5v/JppG/yZ0PP8mczv2I2k28jt2 + TP+g2K//eL2K/yiVRf8zm0//NZ1R/zahU/83o1P/J3c9/xZFI/8PUCH8DnIpkQGLJwv///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8AAGcTNAlvJcgKbCX/N4FL/6jFr//J6NH/vuLH/8Piy/8xmk7/MJ9O/yZz + O/8lcDn3I2o28j12Tf+i2bL/OJxU/y+aTP82oFL/OKZV/y2GRf8ZTij/C0Ub/wplJLwAhSMi////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AABhERMNciidEHAr/RxzM/94p4X/y+XQ/8Diyf+z277/ttvA/36/ + j/8llEP/NqJT/yVvOf8kbTj3I2o28UF3Uf96xI//KplI/zakVP8xlk3/Hlwv/xZEI/8VYireCH8pR/// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wAAhyQCD3MqbhZ0L/EWci//SYta/7jVwf/I59H/t93C/63Y + uv+t1rf/r9e5/yyYSP8vmUz/N6NU/yRtOP8jajb4I2o38El9Vf9Cr1//MZ1P/yRrN/8WQiH/Elck9RF5 + LXUBiiYD////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AAFrHj8YdTHSG3Qz/yN2Of+Qu5z/zerU/7zf + xf+v2Lr/qtW2/6XTs/+s1bj/ZLJ5/ymWRv8zm1D/N6RU/yNrN/8iZzX5I2o27zBzQf8ngED/F0ck/w5L + Hv0NbCaiAYwnEv///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wAAYhIbDXEpqRJwLP4Vby7/XJtt/8fj + z//B48z/tNu//6vVtv+m07L/odGu/6LRr/+bzqn/JpRD/zCaTf80m1D/N6RV/yNnNv8hYzP5I2o37xdI + JP8LRBv/CWEhygCDIi7///8A////AP///wD///8A////AP///wD///8AAHoVAv///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8AAFcMBRB1K3sYdDD2GnMy/y5/ + Rf+pzrP/yOfQ/7jdwv+u17n/qNS0/6PRsP+ez6v/ms6o/6HQrf9LpmX/LJdJ/zSbUP80m1D/N6VV/yJl + M/8gYDH5JGs37xRfKOkHeiVZ////AP///wD///8A////AP///wD///8A////AP///wALhy1NGY453QqD + Kkv///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wACbR9LHHk23iF5 + Of8aczL/da+F/8zp1P+94Mf/r9m7/6nUtP+l0rH/oNCt/5vNqf+Wy6X/l8yl/3/Akf8mlET/MppO/zSb + UP80m1D/OKVV/yBiMv8fXTD6MI9KbgCIJQj///8A////AP///wD///8A////AP///wD///8AAIEhHhiO + OLAhkj//L5ZK/yGNPvAJgSkg////AP///wD///8A////AP///wD///8A////AP///wD///8A////AABj + EYobdzT/KXw//zOCSP/L6dT/zuzW/7bcwf+q1bb/pdOy/6HQrv+czqn/mMym/5PKov+QyKD/lsqk/zac + Uv8vmUv/NJtQ/zSbUP80m1D/OKZV/x9fMf8eWi77////AP///wD///8A////AP///wD///8A////AACB + IQQZjjl1IZI/9x+NPP8wlEz/Xaxy/yCKPf8giD3MAIMjBv///wD///8A////AP///wD///8A////AP// + /wD///8A////AABDAAQNbyh2GXEx8h1wNP80fUj/mcWl/7jgw/+o1rX/ntCs/5nMp/+UyqP/j8ie/4zG + nP+Nxp3/YrJ4/yqWR/8zm0//NJtQ/zSbUP80m1D/OKZW/x9dMP8dVy37////AP///wD///8A////AP// + /wD///8AC4gtOySUQtMlkkP/E4c0/4fCl////////////y2RSP8jhj7/E30wmP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8AAFsNFQlmI6IQZCf9E2Uq/0uGWv+cy6j/ndOt/5LJ + of+Mxpz/h8SY/4XClf+EwpT/K5dJ/zGaTf80m1D/NJtQ/zSbUP80m1D/OKdW/x5aLv8dVy38////AP// + /wD///8A////AACBIRMZjjmcI5JC/h+NPv9RpGb/8vn1///////8/v3//////9fs3f8UfS//GHwz/xB3 + LJAAhiQC////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wAacTM7IWw19BNg + KP8RViT/f7KO/4rFmv+EwpX/gMGS/4HBlP9LpmT/LZhK/zSbUP80m1D/NJtQ/zSbUP80m1D/OKdW/x5a + L/8dViz8////AP///wD///8AAIEhYyWUQ+4zmE7/MJVM/0aiYP////////////L49P/r9e7/6vTs//X6 + 9v+t1bn/GX00/yF9Ov8deja/AGgcE////wD///8A////AP///wD///8A////AP///wD///8A////AABf + GTEUZSvXGmMt/yNoNf93s4n/jsyf/4LDk/98vo7/e76O/222gf8qlkf/MptP/zSbUP80m1D/NJtQ/zSb + UP80m1D/OKZW/x5cL/8dViz8////AP///wD///8ACoMqjTKXTv8ylk3/M5xQ/x+RPv+UyqP//////+z2 + 7v/j8ef/3+/j/97u4v/m9Or/v+HI/yGBO/8ddjX/GHQx6g1vKIgAYRAe////AP///wD///8A////AAA7 + AAMAXxdBCWEhlRBdJfsUXCn/RoNW/5TOpP+LyJv/f8CR/3m9i/93u4n/crqH/zKaTv8wmk3/NJtQ/zSb + UP80m1D/NJtQ/zSbUP80m1D/OKZW/x5cL/8dViz9////AP///wD///8AAIIiBSOMQMkxkUv/MpZN/y6a + S/8ckDz/u97E//P69P/f7+P/1+vc/9Lp2P/P59b/1ezc/8no0f9RmmT/Emss/xtvMv8Vayv9C2Qi0ABb + F7gAXBWkCWMhuxRkKfUdZTH/Fl4p/x5hMP9xq4D/kc+i/4LDlf96vYz/dbuI/3O6hf9zuYb/PZ9Y/y+Z + TP80m1D/NZ1R/zWeUf81nlH/NJxQ/zSbUP80m1D/OKZW/x5cL/8dViz9////AP///wD///8A////AAZ6 + JyEihz7yLoxI/zKZT/8smUr/G446/6PRsP/o8+r/1OrZ/8rl0f/F4s3/weDK/8TjzP/L6NL/stq+/0+b + ZP8fcDT/Dl8l/xFgJ/8TXyf/EFwl/xdiLP89gU7/bqh9/47Hn/+HyJr/fcCP/3a7if9yuYX/b7iC/262 + gv9Lp2X/LphL/zObT/81nlL/NqNT/yl8P/81oVL/NqJU/zWeUf80nFD/OKZW/x5cLv8dViz9////AP// + /wD///8A////AP///wAFdSNVIIE6/y2JRf80nFH/LppL/x2QPP+EwpX/2+3g/8vm0f+/38f/uNzC/7Ta + vv+y2b3/stm8/7XdwP+44cP/sNu8/5TKov+CvJH/lMej/57Wrv+Tz6T/iciZ/3/BkP95vYz/c7qG/264 + gv9stn//a7Z//0akX/8umEv/M5tP/zWeUv82pFT/JGo2/xdIJf8aTyn/K39B/zekVf82oVP/OKhX/x5c + MP8dViz+////AP///wD///8A////AP///wD///8AEXgtmSuDRP8shkX/NJ1R/zCbTf8jk0L/QqFc/7fc + wf/E4cv/tdu//63XuP+n07P/o9Gw/57Pq/+Zzaf/l8ul/5TLov+Pyp//iMWa/4PClP9+v4//eb2L/3S6 + h/9vuIP/bLaB/2m2ff9ntH3/P6Ba/y6ZS/8zm0//NZ9S/zalVP8kajf/GUwn/x1XLOkbUyr5GEwn/x1X + Lf8vjEj/O7Bb/x9gMv8cViz+////AP///wD///8A////AP///wD///8AAF0OBh17NrEqfED/K4BB/zOb + UP8znVD/KpdI/yKSQv9rt4D/r9i6/7HZu/+k0bD/m86p/5bLpf+RyaD/jcac/4jEmP+DwpT/fr+Q/3q9 + jP92u4j/cbmE/222gP9ptX7/Z7V8/1etb/81m1H/MJlM/zObT/82n1L/N6RV/yJqNf8ZTCf/Dk0g3Qdb + HRkAUBEgAksVtwxEG/4YSyb/I2o2/yBdMP8cViz+////AP///wD///8A////AP///wD///8A////AACH + JAEMbCibGnEy/yl4Pf8ymU7/NZ9S/zCaTf8plkb/I5JB/1mucf+Xy6X/odGu/5fMpv+PyJ//iMWZ/4HA + kv97vo3/druJ/3O5iP9xuIX/breB/2u1f/9brnH/Op1U/y6YSv8xmk7/NJ1R/zaiU/80nVH/IWQz/xlM + J/8QTyDYAFERFP///wD///8A////AABDAkQBRRLXC0cc/xtTKv8cViz/////AP///wD///8A////AP// + /wD///8A////AP///wD///8AAGQaghdrL/4lcjr/L4pI/zWhUv81n1L/MZtO/yuXSf8klEP/MZlO/1Gp + aP9rtn//er6L/3q+jP97vo3/eL6L/2u1f/9YrG//R6Rg/zmeU/8tmEr/MZpN/zScUP81n1L/OKVV/yyG + Rf8aUCn/CkQa/wFGFM0ARAEQ////AP///wD///8A////AP///wD///8AAEkNbg9OH+4cViz/////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AABfF2kWZy36I2o3/yVxOv8wkkv/N6NU/zWf + Uv80nFD/MZpO/y6YS/8qlkj/KJVG/yiVRv8olUb/KZZG/yuXSP8tmEr/MJlM/zKaTv80nFD/NqBS/zel + Vf81n1D/ImY0/xhLJv8MRxz6AEMKhf///wD///8A////AP///wD///8A////AP///wD///8A////AAA/ + AAwhYzOZ////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wAAVAkjCV0ftRRd + J/4gYTL/J3U9/zGVTP82pVT/N6NU/zagUv81nVH/NJxQ/zSbUP80m1D/NJtQ/zScUP81nlH/NqBS/zej + VP84qFb/L49J/yJmNP8ZSSX/GVAp/xBRIdYATA0v////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AABWE0YTWyfWHlsw/x5aLv8fWy//JnE7/y2KSP82oVP/OalX/zioV/84qFb/OKhX/zeo + Vv8zmk//LolG/yh3Pf8dVSz/GEom/wpEGv8AQhHjAEoMgAAYAAL///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wACjSgBAE8PYwRSGrcQUSH1G1Qr/xpQKf8YSyb/GEkm/xpN + J/8bUyr/HVgt/xhKJv8XSSX/GEom/xhNJ/8MRhz9AUoWwABCAVL///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wAndDwEI2o2TyFi + MqUfXTDRHlsv3R5aLucdWC3xHVgt+B5bL+EgXzG+IWMzlCJmNGQjaTYc////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A///AAf// + AAD//wAAf/8AAP/8AAAP/wAA//AAAAf/AAA/4AAAA/8AAA+AAAAA/wAABwAAAAB/AAAAAAAAAD8AAAAA + AAAAPwAAAAAAAAAfAAAAAAAAAA8AAAAAAAAABwAAAAAB4AADAAAAAA/4AAMAAAAAH/4ADwAAAAAH/wA/ + AAAAAAH/gH8AAAAAAP+B/AAAAAAD/8PwAAAAAAf/7+AAAAAAH///gAAAAAB///4AAAAAAP///AAAAAAD + ///wAAAAAA///8AAAAAAP///AAAAAAB///4AAAAAAf//+AAAAAAH9//gAAAAAB/j/8AAAAAAP4H/gAAA + AAD+AP+AAAAAAPwA/+AAAAAA8AA/+AAAAADgAB/wAAAAAOAAB4AAAAAA4AAAAAAAAADwAAAAAAAAAPgA + AAAAAAAA/AAAAAAAAAD8AAAAAAAAAP4AAAAA4AAA/4AAAAH4AAD/wAAAB/wAAP/gAAAP/wAA//gAAB// + AAD//AAA//8AAP//gAP//wAAKAAAABAAAAAgAAAAAQAgAAAAAAAABAAAEgsAABILAAAAAAAAAAAAAP// + /wD///8A////AP///wA0m1AIMpJMbDOTTt0/mlj4Qpta+TuYVPUyk0zDMJFLIv///wD///8A////AP// + /wAvjEhW////AP///wAAbhkgJIU99Hu4jP+q17b/sdq8/6DRrv+PyZ//cbmF/zOPTf4FeCSi////AP// + /wD///8AQpFY/BB3K+4AbRp8LodG/MHgyf+j1LH/abZ+/0KkW/9BpFz/Wa9w/2W0ev9fsXX/NJVP/wZ0 + I83///8A////AGamd/3h9ef/cbCC/8rn0v9+wpD/I5ZD/yaNQf8mgT77J4FA+yeJQv8smUr/R6dh/0Kk + XP8giDz/AG0alP///wBionP91O3b/77fx/9otn7/JZVD/yV7PP4vhUahKZxJChuVPAQLaSU/G3Qz+DOf + Uf81oVL/IIU8/wJoHd7///8AX51w/cbn0P+ZzKf/I5JB/zKdT/8yl03/KHU8+Q1qJkz///8A////AABi + GiYccjP6Kn1B+R54N3j///8ALIVFFlqZa/3B5cr/O59W/y6bS/81n1H/G3Uz/RBtKb4AZwwK////AP// + /wD///8AAGEYJCCIPAsMXCIEKotEpTKDR/hVlGb9fseR/ymcSP8bdjT/DGIi5ABbDSH///8A////AP// + /wD///8A////AP///wARfS5ZU5Zk96zTtv8sg0T8SY5c/SyOSP8hbDb1GmwwVP///wD///8A////AP// + /wD///8A////AABfCSEQdCvjfrCL/9Lr2f9Wsm//Kn5B/SVuOfYabDGZJptFASOXQwgIiCsg////AP// + /wD///8AAF8HCA14KbdUmWf+weDL/7new/+MyJz/JppF/yl4Pv00m1AM////ABqTO2BLpGP4OplV+wB0 + GS7///8A////AA1uJ0A2hUv4nsiq/6vZt/+WzKX/NpxS/zGgT/8nczv9////AAqHLM9IoWD///////3/ + /v8efzb6AGYaTAFeGgkRaykKGHIwmjR3Rv6Mx5z/V65u/yyYSf83pVT/JnI7/f///wAAeR5jDn8s/ozJ + nf/t+PD/zufV/3ywi/9Bh1T9Sodb/XCqf/+Myp7/XrV1/yudSv8pfj//N6ZW/yZyO/3///8A////AAJy + IIgPeyv/QKRb/5jQqP+y3L3/otWx/5DNoP9zvof/TKtk/yycS/8SXCb9B1QbjghYHfAgYjL9////AP// + /wD///8ABGwfoBRwLfshij7/KZxJ/zmkVf85pFf/K5tJ/ymFQf8TWyX4AEgNNP///wD///8AImU0Zv// + /wD///8A////AP///wAlcDoLKXY+mSdyO/Umcjv7JnE7+ydwO+cmbzqHI2k2EP///wD///8A////AP// + /wDwDwAAYAcAAAADAAAAAQAAAAEAAADCAAAA4AAAA/AAAA/AAAAHAAAAQwAAAIAAAACAAAAAwAAAAOAG + AADwDwAA + + + \ No newline at end of file diff --git a/UpdateLib/UpdateLib.Generator/UI/LoaderControl.Designer.cs b/UpdateLib/UpdateLib.Generator/UI/LoaderControl.Designer.cs new file mode 100644 index 0000000..6b90a43 --- /dev/null +++ b/UpdateLib/UpdateLib.Generator/UI/LoaderControl.Designer.cs @@ -0,0 +1,64 @@ +namespace MatthiWare.UpdateLib.Generator.UI +{ + partial class LoaderControl + { + /// + /// 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 Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.pbLoader = new System.Windows.Forms.PictureBox(); + ((System.ComponentModel.ISupportInitialize)(this.pbLoader)).BeginInit(); + this.SuspendLayout(); + // + // pbLoader + // + this.pbLoader.Anchor = System.Windows.Forms.AnchorStyles.None; + this.pbLoader.BackColor = System.Drawing.Color.Transparent; + this.pbLoader.Image = global::MatthiWare.UpdateLib.Generator.Properties.Resources.loading_gear; + this.pbLoader.Location = new System.Drawing.Point(0, 0); + this.pbLoader.Name = "pbLoader"; + this.pbLoader.Size = new System.Drawing.Size(150, 150); + this.pbLoader.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; + this.pbLoader.TabIndex = 0; + this.pbLoader.TabStop = false; + // + // LoaderControl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(249)))), ((int)(((byte)(249)))), ((int)(((byte)(249))))); + this.Controls.Add(this.pbLoader); + this.MinimumSize = new System.Drawing.Size(150, 150); + this.Name = "LoaderControl"; + ((System.ComponentModel.ISupportInitialize)(this.pbLoader)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.PictureBox pbLoader; + } +} diff --git a/UpdateLib/UpdateLib.Generator/UI/LoaderControl.cs b/UpdateLib/UpdateLib.Generator/UI/LoaderControl.cs new file mode 100644 index 0000000..8cbf791 --- /dev/null +++ b/UpdateLib/UpdateLib.Generator/UI/LoaderControl.cs @@ -0,0 +1,144 @@ +/* UpdateLib - .Net auto update library + * Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Windows.Forms; +using MatthiWare.UpdateLib.UI; + +namespace MatthiWare.UpdateLib.Generator.UI +{ + public partial class LoaderControl : UserControl + { + private static Dictionary loaders = new Dictionary(); + + private const int WS_EX_TRANSPARENT = 0x20; + + private int m_opacity = 100; + + public int Opacity + { + get + { + return m_opacity; + } + set + { + m_opacity = value; + + if (m_opacity > 100) + m_opacity = 100; + + if (m_opacity < 0) + m_opacity = 1; + + var alpha = (m_opacity * 255) / 100; + BackColor = Color.FromArgb(alpha, BackColor); + Invalidate(); + } + } + + + public LoaderControl() + { + InitializeComponent(); + + SetStyle(ControlStyles.SupportsTransparentBackColor, true); + //SetStyle(ControlStyles.Opaque, true); + DoubleBuffered = true; + } + + protected override CreateParams CreateParams + { + get + { + CreateParams cp = base.CreateParams; + cp.ExStyle |= WS_EX_TRANSPARENT; + return cp; + } + } + + public static void Show(Control parent) + { + if (parent == null) + return; + + if (!loaders.ContainsKey(parent)) + loaders.Add(parent, new LoaderControl()); + + loaders[parent].ShowLoader(parent); + } + + public void ShowLoader(Control parent) + { + Parent.InvokeOnUI(() => + { + parent.SuspendLayout(); + + Opacity = 100; + + Size = parent.Size; + //parent.Size = Size; + Location = new Point(0, 0); + + parent.Resize += ParentResize; + + parent.Controls.Add(this); + + BringToFront(); + + parent.ResumeLayout(); + }); + } + + private void ParentResize(object sender, EventArgs e) + { + Control parent = sender as Control; + + if (parent == null) + return; + + Size = parent.Size; + } + + public static void Hide(Control parent) + { + if (parent == null) + return; + + if (!loaders.ContainsKey(parent)) + return; + + loaders[parent].HideLoader(parent); + } + + public void HideLoader(Control parent) + { + Parent.InvokeOnUI(() => + { + parent.SuspendLayout(); + + parent.Resize -= ParentResize; + + parent.Controls.Remove(this); + + parent.ResumeLayout(); + }); + } + } +} diff --git a/UpdateLib/UpdateLib.Generator/UI/LoaderControl.resx b/UpdateLib/UpdateLib.Generator/UI/LoaderControl.resx new file mode 100644 index 0000000..750e8d2 --- /dev/null +++ b/UpdateLib/UpdateLib.Generator/UI/LoaderControl.resx @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + True + + + True + + \ No newline at end of file diff --git a/UpdateLib/UpdateLib.Generator/UI/MoveablePanel.cs b/UpdateLib/UpdateLib.Generator/UI/MoveablePanel.cs new file mode 100644 index 0000000..5e57ec8 --- /dev/null +++ b/UpdateLib/UpdateLib.Generator/UI/MoveablePanel.cs @@ -0,0 +1,71 @@ +/* UpdateLib - .Net auto update library + * Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using System; +using System.Runtime.InteropServices; +using System.Windows.Forms; + +namespace MatthiWare.UpdateLib.Generator.UI +{ + public class MoveablePanel : Panel + { + public Form ParentForm { get; set; } + + private const int WM_NCLBUTTONDOWN = 0xA1; + private const int HT_CAPTION = 0x2; + + [DllImport("user32.dll")] + private static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam); + + [DllImport("user32.dll")] + private static extern bool ReleaseCapture(); + + protected override void OnMouseMove(MouseEventArgs e) + { + base.OnMouseMove(e); + + MoveParentForm(this, e); + } + + private void MoveParentForm(object sender, MouseEventArgs e) + { + if (ParentForm != null) + { + ReleaseCapture(); + SendMessage(this.ParentForm.Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0); + } + } + + protected override void OnControlAdded(ControlEventArgs e) + { + base.OnControlAdded(e); + + if (typeof(HoverPictureBox) == e.Control.GetType()) + return; + + e.Control.MouseMove += MoveParentForm; + } + + protected override void OnControlRemoved(ControlEventArgs e) + { + base.OnControlRemoved(e); + + e.Control.MouseMove -= MoveParentForm; + } + + } +} diff --git a/UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.Designer.cs b/UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.Designer.cs new file mode 100644 index 0000000..1a33f59 --- /dev/null +++ b/UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.Designer.cs @@ -0,0 +1,133 @@ +namespace MatthiWare.UpdateLib.Generator.UI.Pages +{ + partial class BuilderPage + { + /// + /// 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 Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.btnBuild = new System.Windows.Forms.Button(); + this.lblProgress = new System.Windows.Forms.Label(); + this.pbProgress = new System.Windows.Forms.ProgressBar(); + this.lblStatus = new System.Windows.Forms.Label(); + this.saveFileDialog = new System.Windows.Forms.SaveFileDialog(); + this.SuspendLayout(); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Font = new System.Drawing.Font("Century Gothic", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label1.Location = new System.Drawing.Point(14, 16); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(143, 20); + this.label1.TabIndex = 1; + this.label1.Text = "Update generator"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(15, 59); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(121, 17); + this.label2.TabIndex = 2; + this.label2.Text = "Make new version: "; + // + // btnBuild + // + this.btnBuild.Location = new System.Drawing.Point(142, 56); + this.btnBuild.Name = "btnBuild"; + this.btnBuild.Size = new System.Drawing.Size(75, 23); + this.btnBuild.TabIndex = 3; + this.btnBuild.Text = "Build"; + this.btnBuild.UseVisualStyleBackColor = true; + this.btnBuild.Click += new System.EventHandler(this.btnBuild_Click); + // + // lblProgress + // + this.lblProgress.AutoSize = true; + this.lblProgress.Location = new System.Drawing.Point(139, 100); + this.lblProgress.Name = "lblProgress"; + this.lblProgress.Size = new System.Drawing.Size(79, 17); + this.lblProgress.TabIndex = 4; + this.lblProgress.Text = "Progress: 0%"; + // + // pbProgress + // + this.pbProgress.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.pbProgress.Location = new System.Drawing.Point(17, 139); + this.pbProgress.Name = "pbProgress"; + this.pbProgress.Size = new System.Drawing.Size(593, 23); + this.pbProgress.TabIndex = 5; + // + // lblStatus + // + this.lblStatus.AutoSize = true; + this.lblStatus.Location = new System.Drawing.Point(14, 100); + this.lblStatus.Name = "lblStatus"; + this.lblStatus.Size = new System.Drawing.Size(104, 17); + this.lblStatus.TabIndex = 6; + this.lblStatus.Text = "Status: Waiting.."; + // + // saveFileDialog + // + this.saveFileDialog.FileName = "updatefile"; + this.saveFileDialog.Filter = "Update files (.xml)|*.xml"; + this.saveFileDialog.Title = "Save location"; + // + // BuilderPage + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.lblStatus); + this.Controls.Add(this.pbProgress); + this.Controls.Add(this.lblProgress); + this.Controls.Add(this.btnBuild); + this.Controls.Add(this.label2); + this.Controls.Add(this.label1); + this.DoubleBuffered = true; + this.Font = new System.Drawing.Font("Century Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.MinimumSize = new System.Drawing.Size(239, 104); + this.Name = "BuilderPage"; + this.Size = new System.Drawing.Size(629, 182); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Button btnBuild; + private System.Windows.Forms.Label lblProgress; + private System.Windows.Forms.ProgressBar pbProgress; + private System.Windows.Forms.Label lblStatus; + private System.Windows.Forms.SaveFileDialog saveFileDialog; + } +} diff --git a/UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.cs b/UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.cs new file mode 100644 index 0000000..8f19624 --- /dev/null +++ b/UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.cs @@ -0,0 +1,155 @@ +/* UpdateLib - .Net auto update library + * Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Drawing; +using System.IO; +using System.Windows.Forms; + +using MatthiWare.UpdateLib.Generator.Tasks; +using MatthiWare.UpdateLib.UI; + +namespace MatthiWare.UpdateLib.Generator.UI.Pages +{ + public partial class BuilderPage : PageControlBase + { + private FilesPage filesPage; + private InformationPage infoPage; + private RegistryPage registryPage; + + public BuilderPage() + { + InitializeComponent(); + } + + protected override void OnPageInitialize() + { + saveFileDialog.InitialDirectory = new DirectoryInfo("./Output").FullName; + + PageControlBase page; + if (!TestForm.TryGetPage(nameof(FilesPage), out page)) + { + throw new KeyNotFoundException($"Unable to get {nameof(FilesPage)}"); + } + + filesPage = page as FilesPage; + + if (!TestForm.TryGetPage(nameof(InformationPage), out page)) + { + throw new KeyNotFoundException($"Unable to get {nameof(InformationPage)}"); + } + + infoPage = page as InformationPage; + + if (!TestForm.TryGetPage(nameof(RegistryPage), out page)) + { + throw new KeyNotFoundException($"Unable to get {nameof(RegistryPage)}"); + } + + registryPage = page as RegistryPage; + + if (!filesPage.IsPageInitialized) + filesPage.InitializePage(null); + + if (!infoPage.IsPageInitialized) + infoPage.InitializePage(null); + + if (!registryPage.IsPageInitialized) + registryPage.InitializePage(null); + } + + private void btnBuild_Click(object sender, EventArgs e) + { + if (saveFileDialog.ShowDialog(ParentForm) != DialogResult.OK) + return; + + pbProgress.Value = 0; + lblProgress.Text = "Progress: 0%"; + + Build(saveFileDialog.OpenFile()); + } + + Stopwatch sw = new Stopwatch(); + + private UpdateGeneratorTask Build(Stream s) + { + var task = new UpdateGeneratorTask(filesPage.Root, infoPage, registryPage.Folders); + + btnBuild.Enabled = false; + + task.TaskProgressChanged += (o, e) => + { + lblProgress.Text = $"Progress: {e.ProgressPercentage}%"; + pbProgress.Value = e.ProgressPercentage; + + }; + + task.TaskCompleted += (o, e) => + { + sw.Stop(); + + Updater.Instance.Logger.Debug(nameof(BuilderPage), nameof(Build), $"File generation completed in {sw.ElapsedMilliseconds} ms."); + + btnBuild.Enabled = true; + + if (e.Cancelled) + { + lblStatus.Text = $"Status: Cancelled"; + return; + } + + if (e.Error != null) + { + lblStatus.Text = $"Status: Error"; + + MessageDialog.Show( + ParentForm, + "Builder", + "Build error", + "Check the logs for more information", + SystemIcons.Error, + MessageBoxButtons.OK); + + return; + } + + using (s) + task.Result.Save(s); + + lblStatus.Text = $"Status: Completed"; + + MessageDialog.Show( + ParentForm, + "Builder", + "Build completed", + "The update file has been succesfully generated!\n" + + $"File generation completed in {sw.ElapsedMilliseconds} ms.", + SystemIcons.Information, + MessageBoxButtons.OK); + }; + + lblStatus.Text = "Status: Building.."; + + sw.Reset(); + sw.Start(); + + return task.Start(); + } + } +} diff --git a/UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.resx b/UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.resx new file mode 100644 index 0000000..ff68a6a --- /dev/null +++ b/UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + 17, 17 + + \ No newline at end of file diff --git a/UpdateLib/UpdateLib.Generator/UI/Pages/FilesPage.Designer.cs b/UpdateLib/UpdateLib.Generator/UI/Pages/FilesPage.Designer.cs new file mode 100644 index 0000000..b5cbc01 --- /dev/null +++ b/UpdateLib/UpdateLib.Generator/UI/Pages/FilesPage.Designer.cs @@ -0,0 +1,232 @@ +namespace MatthiWare.UpdateLib.Generator.UI.Pages +{ + partial class FilesPage + { + /// + /// 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 Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.label1 = new System.Windows.Forms.Label(); + this.tvFolders = new System.Windows.Forms.TreeView(); + this.ilIcons = new System.Windows.Forms.ImageList(this.components); + this.contextMenuRightClick = new System.Windows.Forms.ContextMenuStrip(this.components); + this.menuAddFiles = new System.Windows.Forms.ToolStripMenuItem(); + this.menuAddFolder = new System.Windows.Forms.ToolStripMenuItem(); + this.newFolderToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.existingFolderToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); + this.deleteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.lvFiles = new System.Windows.Forms.ListView(); + this.clmnName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.clmnDate = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.clmnType = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.clmnSize = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.folderBrowserDialog = new System.Windows.Forms.FolderBrowserDialog(); + this.openFileDialog = new System.Windows.Forms.OpenFileDialog(); + this.contextMenuRightClick.SuspendLayout(); + this.SuspendLayout(); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Font = new System.Drawing.Font("Century Gothic", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label1.Location = new System.Drawing.Point(14, 16); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(128, 20); + this.label1.TabIndex = 1; + this.label1.Text = " Files and folders"; + // + // tvFolders + // + this.tvFolders.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left))); + this.tvFolders.ImageIndex = 0; + this.tvFolders.ImageList = this.ilIcons; + this.tvFolders.Location = new System.Drawing.Point(18, 53); + this.tvFolders.Name = "tvFolders"; + this.tvFolders.SelectedImageIndex = 0; + this.tvFolders.Size = new System.Drawing.Size(191, 332); + this.tvFolders.TabIndex = 2; + this.tvFolders.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.tvFolders_NodeMouseClick); + // + // ilIcons + // + this.ilIcons.ColorDepth = System.Windows.Forms.ColorDepth.Depth32Bit; + this.ilIcons.ImageSize = new System.Drawing.Size(16, 16); + this.ilIcons.TransparentColor = System.Drawing.Color.Transparent; + // + // contextMenuRightClick + // + this.contextMenuRightClick.Font = new System.Drawing.Font("Century Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.contextMenuRightClick.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.menuAddFiles, + this.menuAddFolder, + this.toolStripSeparator1, + this.deleteToolStripMenuItem}); + this.contextMenuRightClick.Name = "menuTV"; + this.contextMenuRightClick.Size = new System.Drawing.Size(142, 76); + // + // menuAddFiles + // + this.menuAddFiles.Image = global::MatthiWare.UpdateLib.Generator.Properties.Resources.image_transparent_16px; + this.menuAddFiles.Name = "menuAddFiles"; + this.menuAddFiles.Size = new System.Drawing.Size(141, 22); + this.menuAddFiles.Text = "Add File(s)"; + this.menuAddFiles.Click += new System.EventHandler(this.menuAddFiles_Click); + // + // menuAddFolder + // + this.menuAddFolder.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.newFolderToolStripMenuItem, + this.existingFolderToolStripMenuItem}); + this.menuAddFolder.Image = global::MatthiWare.UpdateLib.Generator.Properties.Resources.folder_transparent_16px; + this.menuAddFolder.Name = "menuAddFolder"; + this.menuAddFolder.Size = new System.Drawing.Size(141, 22); + this.menuAddFolder.Text = "Add Folder"; + // + // newFolderToolStripMenuItem + // + this.newFolderToolStripMenuItem.Name = "newFolderToolStripMenuItem"; + this.newFolderToolStripMenuItem.Size = new System.Drawing.Size(159, 22); + this.newFolderToolStripMenuItem.Text = "New Folder"; + this.newFolderToolStripMenuItem.Click += new System.EventHandler(this.newFolderToolStripMenuItem_Click); + // + // existingFolderToolStripMenuItem + // + this.existingFolderToolStripMenuItem.Name = "existingFolderToolStripMenuItem"; + this.existingFolderToolStripMenuItem.Size = new System.Drawing.Size(159, 22); + this.existingFolderToolStripMenuItem.Text = "Existing Folder"; + this.existingFolderToolStripMenuItem.Click += new System.EventHandler(this.existingFolderToolStripMenuItem_Click); + // + // toolStripSeparator1 + // + this.toolStripSeparator1.Name = "toolStripSeparator1"; + this.toolStripSeparator1.Size = new System.Drawing.Size(138, 6); + // + // deleteToolStripMenuItem + // + this.deleteToolStripMenuItem.Enabled = false; + this.deleteToolStripMenuItem.Image = global::MatthiWare.UpdateLib.Generator.Properties.Resources.cross; + this.deleteToolStripMenuItem.Name = "deleteToolStripMenuItem"; + this.deleteToolStripMenuItem.Size = new System.Drawing.Size(141, 22); + this.deleteToolStripMenuItem.Text = "Delete"; + this.deleteToolStripMenuItem.Click += new System.EventHandler(this.deleteToolStripMenuItem_Click); + // + // lvFiles + // + this.lvFiles.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.lvFiles.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.clmnName, + this.clmnType, + this.clmnDate, + this.clmnSize}); + this.lvFiles.ContextMenuStrip = this.contextMenuRightClick; + this.lvFiles.FullRowSelect = true; + this.lvFiles.Location = new System.Drawing.Point(215, 53); + this.lvFiles.MultiSelect = false; + this.lvFiles.Name = "lvFiles"; + this.lvFiles.Size = new System.Drawing.Size(577, 332); + this.lvFiles.SmallImageList = this.ilIcons; + this.lvFiles.TabIndex = 3; + this.lvFiles.UseCompatibleStateImageBehavior = false; + this.lvFiles.View = System.Windows.Forms.View.Details; + this.lvFiles.SelectedIndexChanged += new System.EventHandler(this.lvFiles_SelectedIndexChanged); + this.lvFiles.DoubleClick += new System.EventHandler(this.lvFiles_DoubleClick); + // + // clmnName + // + this.clmnName.Text = "Name"; + this.clmnName.Width = 109; + // + // clmnDate + // + this.clmnDate.DisplayIndex = 1; + this.clmnDate.Text = "Last Modified"; + this.clmnDate.Width = 147; + // + // clmnType + // + this.clmnType.DisplayIndex = 2; + this.clmnType.Text = "Type"; + this.clmnType.Width = 93; + // + // clmnSize + // + this.clmnSize.Text = "Size"; + this.clmnSize.Width = 71; + // + // folderBrowserDialog + // + this.folderBrowserDialog.ShowNewFolderButton = false; + // + // openFileDialog + // + this.openFileDialog.Multiselect = true; + this.openFileDialog.ReadOnlyChecked = true; + this.openFileDialog.Title = "Add files to be included in the updater"; + // + // FilesPage + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.lvFiles); + this.Controls.Add(this.tvFolders); + this.Controls.Add(this.label1); + this.DoubleBuffered = true; + this.Font = new System.Drawing.Font("Century Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.MinimumSize = new System.Drawing.Size(589, 233); + this.Name = "FilesPage"; + this.Size = new System.Drawing.Size(810, 403); + this.contextMenuRightClick.ResumeLayout(false); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TreeView tvFolders; + private System.Windows.Forms.ListView lvFiles; + private System.Windows.Forms.ColumnHeader clmnName; + private System.Windows.Forms.ColumnHeader clmnDate; + private System.Windows.Forms.ColumnHeader clmnType; + private System.Windows.Forms.ColumnHeader clmnSize; + private System.Windows.Forms.ImageList ilIcons; + private System.Windows.Forms.ContextMenuStrip contextMenuRightClick; + private System.Windows.Forms.ToolStripMenuItem menuAddFiles; + private System.Windows.Forms.ToolStripMenuItem menuAddFolder; + private System.Windows.Forms.ToolStripMenuItem newFolderToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem existingFolderToolStripMenuItem; + private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog; + private System.Windows.Forms.OpenFileDialog openFileDialog; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; + private System.Windows.Forms.ToolStripMenuItem deleteToolStripMenuItem; + } +} diff --git a/UpdateLib/UpdateLib.Generator/UI/Pages/FilesPage.cs b/UpdateLib/UpdateLib.Generator/UI/Pages/FilesPage.cs new file mode 100644 index 0000000..526cbba --- /dev/null +++ b/UpdateLib/UpdateLib.Generator/UI/Pages/FilesPage.cs @@ -0,0 +1,310 @@ +/* UpdateLib - .Net auto update library + * Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Windows.Forms; +using MatthiWare.UpdateLib.Tasks; +using MatthiWare.UpdateLib.Generator.Data; +using System.IO; +using MatthiWare.UpdateLib.UI; +using MatthiWare.UpdateLib.Generator.Data.FilesPage; + +namespace MatthiWare.UpdateLib.Generator.UI.Pages +{ + public partial class FilesPage : PageControlBase + { + private const string PROJECT_IMAGE_KEY = "project_key"; + + public GenFolder Root { get; set; } + + private GenFile _selectedFile; + private GenFile SelectedFile + { + get { return _selectedFile; } + set + { + _selectedFile = value; + if (value != null && !deleteToolStripMenuItem.Enabled) + deleteToolStripMenuItem.Enabled = true; + } + } + private GenFolder _selectedFolder; + private GenFolder SelectedFolder + { + get { return _selectedFolder; } + set + { + _selectedFolder = value; + if (value != null && !deleteToolStripMenuItem.Enabled) + deleteToolStripMenuItem.Enabled = true; + } + } + + public FilesPage() + { + InitializeComponent(); + } + + protected override void OnPageInitialize() + { + SuspendLayout(); + + ilIcons.Images.Add(TreeViewFolderNode.FOLDER_KEY, Properties.Resources.folder_transparent_16px); + ilIcons.Images.Add(PROJECT_IMAGE_KEY, Properties.Resources.project_16px); + + Root = new GenFolder("Update Project", contextMenuRightClick); + Root.ProtectedFolder = true; + Root.FolderTreeView.SelectedImageKey = PROJECT_IMAGE_KEY; + Root.FolderTreeView.ImageKey = PROJECT_IMAGE_KEY; + + GenFolder appFolder = new GenFolder("Application Folder", contextMenuRightClick); + appFolder.ProtectedFolder = true; + appFolder.PathVariable = "%appdir%"; + + Root.Add(appFolder); + + tvFolders.Nodes.Add(Root.FolderTreeView); + + folderBrowserDialog.Description = "Please select the folder to import"; + + UpdateSelectedFolder(Root); + + ResumeLayout(); + } + + private void menuAddFiles_Click(object sender, EventArgs e) + { + if (openFileDialog.ShowDialog(ParentForm) != DialogResult.OK) + return; + + if (SelectedFolder == Root) + return; + + AddExistingFileAsync(openFileDialog.FileNames.Select(file => new FileInfo(file))); + } + + private void existingFolderToolStripMenuItem_Click(object sender, EventArgs e) + { + if (folderBrowserDialog.ShowDialog(ParentForm) != DialogResult.OK) + return; + + if (SelectedFolder == Root) + return; + + AddExistingFolderAsync(new DirectoryInfo(folderBrowserDialog.SelectedPath)); + } + + private AsyncTask AddExistingFolderAsync(DirectoryInfo dir) + { + ShowLoader(); + + AsyncTask task = AsyncTaskFactory.From(new Action(() => + { + this.InvokeOnUI(() => SuspendLayout()); + + AddExistingFolder(dir, SelectedFolder, true); + + this.InvokeOnUI(() => + { + Root.FolderTreeView.Expand(); + ResumeLayout(); + }); + }), null); + + task.TaskCompleted += (o, e) => { HideLoader(); }; + + return task.Start(); + } + + private void AddExistingFolder(DirectoryInfo dir, GenFolder parentFolder, bool addToUI = false) + { + GenFolder folder = new GenFolder(dir.Name, contextMenuRightClick); + + if (addToUI) + this.InvokeOnUI(() => lvFiles.Items.Add(folder.FolderListView)); + + foreach (DirectoryInfo subDir in dir.GetDirectories()) + AddExistingFolder(subDir, folder); + + foreach (FileInfo f in dir.GetFiles()) + AddExistingFile(f, folder); + + this.InvokeOnUI(() => parentFolder.Add(folder)); + } + + private AsyncTask AddExistingFileAsync(IEnumerable files) + { + return AsyncTaskFactory.StartNew(new Action(() => + { + GenFolder s = SelectedFolder; + + foreach (FileInfo file in files) + AddExistingFile(file, s, true); + + }), null); + } + + private void AddExistingFile(FileInfo f, GenFolder folder, bool addToUI = false) + { + GenFile file = new GenFile(f); + + EnsureExtensionIconExists(f); + + folder.Add(file); + + if (addToUI) + this.InvokeOnUI(() => lvFiles.Items.Add(file.View)); + + } + + private void EnsureExtensionIconExists(FileInfo file) + { + if (ilIcons.Images.ContainsKey(file.Extension)) + return; + + Icon extensionIcon = Icon.ExtractAssociatedIcon(file.FullName); + + this.InvokeOnUI(() => ilIcons.Images.Add(file.Extension, extensionIcon)); + } + + private void UpdateSelectedFolder(GenFolder folder) + { + if (folder == null || folder == SelectedFolder) + return; + + SelectedFolder = folder; + SelectedFile = null; + + if (SelectedFolder == Root) + { + deleteToolStripMenuItem.Enabled = false; + menuAddFiles.Enabled = false; + menuAddFolder.Enabled = false; + } + else + { + menuAddFiles.Enabled = true; + menuAddFolder.Enabled = true; + } + + lvFiles.SuspendLayout(); + + lvFiles.Items.Clear(); + + foreach (GenFolder subFolder in folder.Directories) + lvFiles.Items.Add(subFolder.FolderListView); + + foreach (GenFile subFile in folder.Items) + lvFiles.Items.Add(subFile.View); + + lvFiles.ResumeLayout(); + + tvFolders.SelectedNode = folder.FolderTreeView; + folder.FolderTreeView.Expand(); + } + + private void lvFiles_DoubleClick(object sender, EventArgs e) + { + if (lvFiles.SelectedItems.Count == 0) + return; + + ListViewFolder item = lvFiles.SelectedItems[0] as ListViewFolder; + if (item == null) + return; + + UpdateSelectedFolder(item?.Folder); + + } + + private void newFolderToolStripMenuItem_Click(object sender, EventArgs e) + { + if (SelectedFolder == null || SelectedFolder == Root) + return; + + InputDialog inputDlg = new InputDialog("New folder", "Please enter the folder name: ", MessageBoxButtons.OKCancel); + + if (inputDlg.ShowDialog(ParentForm) != DialogResult.OK && SelectedFolder != null) + return; + + var name = inputDlg.Input; + + GenFolder folder = new GenFolder(name, contextMenuRightClick); + + this.InvokeOnUI(() => + { + SelectedFolder.Add(folder); + lvFiles.Items.Add(folder.FolderListView); + }); + } + + private void lvFiles_SelectedIndexChanged(object sender, EventArgs e) + { + if (lvFiles.SelectedItems.Count == 0) + return; + + ListViewItem item = lvFiles.SelectedItems[0]; + + if (item == null) + return; + + if (item is ListViewGenItem) + SelectedFile = (item as ListViewGenItem).Item as GenFile; + else if (item is ListViewFolder) + SelectedFolder = (item as ListViewFolder).Folder; + } + + private void deleteToolStripMenuItem_Click(object sender, EventArgs e) + { + SuspendLayout(); + + deleteToolStripMenuItem.Enabled = false; + + if (SelectedFile != null) + { + SelectedFile.Parent.Remove(SelectedFile); + SelectedFile = null; + } + else if (SelectedFolder != null && SelectedFolder != Root && !SelectedFolder.ProtectedFolder) + { + SelectedFolder.ParentFolder.Remove(SelectedFolder); + + lvFiles.Items.Clear(); + + GenFolder temp = SelectedFolder; + + UpdateSelectedFolder(SelectedFolder.ParentFolder); + + temp = null; + } + ResumeLayout(); + } + + private void tvFolders_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) + { + TreeViewFolderNode node = e.Node as TreeViewFolderNode; + + if (node == null) + return; + + UpdateSelectedFolder(node?.Folder); + } + } +} diff --git a/UpdateLib/UpdateLib.Generator/UI/Pages/FilesPage.resx b/UpdateLib/UpdateLib.Generator/UI/Pages/FilesPage.resx new file mode 100644 index 0000000..11876ac --- /dev/null +++ b/UpdateLib/UpdateLib.Generator/UI/Pages/FilesPage.resx @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + 17, 17 + + + 103, 17 + + + 281, 17 + + + 444, 17 + + \ No newline at end of file diff --git a/UpdateLib/UpdateLib.Generator/UI/Pages/InformationPage.Designer.cs b/UpdateLib/UpdateLib.Generator/UI/Pages/InformationPage.Designer.cs new file mode 100644 index 0000000..4b10891 --- /dev/null +++ b/UpdateLib/UpdateLib.Generator/UI/Pages/InformationPage.Designer.cs @@ -0,0 +1,113 @@ +namespace MatthiWare.UpdateLib.Generator.UI.Pages +{ + partial class InformationPage + { + /// + /// 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 Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.txtAppName = new System.Windows.Forms.TextBox(); + this.label3 = new System.Windows.Forms.Label(); + this.txtAppVersion = new System.Windows.Forms.TextBox(); + this.SuspendLayout(); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Font = new System.Drawing.Font("Century Gothic", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label1.Location = new System.Drawing.Point(14, 16); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(153, 20); + this.label1.TabIndex = 0; + this.label1.Text = "Update Information"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(15, 59); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(121, 17); + this.label2.TabIndex = 1; + this.label2.Text = "Application name: "; + // + // txtAppName + // + this.txtAppName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.txtAppName.Location = new System.Drawing.Point(160, 56); + this.txtAppName.Name = "txtAppName"; + this.txtAppName.Size = new System.Drawing.Size(212, 22); + this.txtAppName.TabIndex = 3; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(15, 97); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(130, 17); + this.label3.TabIndex = 4; + this.label3.Text = "Application version: "; + // + // txtAppVersion + // + this.txtAppVersion.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.txtAppVersion.Location = new System.Drawing.Point(160, 94); + this.txtAppVersion.Name = "txtAppVersion"; + this.txtAppVersion.Size = new System.Drawing.Size(212, 22); + this.txtAppVersion.TabIndex = 5; + // + // InformationPage + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.SystemColors.Control; + this.Controls.Add(this.txtAppVersion); + this.Controls.Add(this.label3); + this.Controls.Add(this.txtAppName); + this.Controls.Add(this.label2); + this.Controls.Add(this.label1); + this.DoubleBuffered = true; + this.Font = new System.Drawing.Font("Century Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.MinimumSize = new System.Drawing.Size(396, 144); + this.Name = "InformationPage"; + this.Size = new System.Drawing.Size(396, 144); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.TextBox txtAppName; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.TextBox txtAppVersion; + } +} diff --git a/UpdateLib/UpdateLib.Generator/UI/Pages/InformationPage.cs b/UpdateLib/UpdateLib.Generator/UI/Pages/InformationPage.cs new file mode 100644 index 0000000..c501c01 --- /dev/null +++ b/UpdateLib/UpdateLib.Generator/UI/Pages/InformationPage.cs @@ -0,0 +1,59 @@ +/* UpdateLib - .Net auto update library + * Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using MatthiWare.UpdateLib.Common; + +namespace MatthiWare.UpdateLib.Generator.UI.Pages +{ + public partial class InformationPage : PageControlBase + { + + public string ApplicationName + { + get + { + return txtAppName.Text; + } + set + { + txtAppName.Text = value; + } + } + + public UpdateVersion Version + { + get + { + return new UpdateVersion(txtAppVersion.Text); + } + set + { + txtAppVersion.Text = value.ToString(); + } + } + + public InformationPage() + { + InitializeComponent(); + } + + protected override void OnPageInitialize() + { + + } + } +} diff --git a/UpdateLib/UpdateLib.Generator/UI/Pages/InformationPage.resx b/UpdateLib/UpdateLib.Generator/UI/Pages/InformationPage.resx new file mode 100644 index 0000000..7080a7d --- /dev/null +++ b/UpdateLib/UpdateLib.Generator/UI/Pages/InformationPage.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/UpdateLib/UpdateLib.Generator/UI/Pages/PageControlBase.cs b/UpdateLib/UpdateLib.Generator/UI/Pages/PageControlBase.cs new file mode 100644 index 0000000..2d47e51 --- /dev/null +++ b/UpdateLib/UpdateLib.Generator/UI/Pages/PageControlBase.cs @@ -0,0 +1,79 @@ +/* UpdateLib - .Net auto update library + * Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using MatthiWare.UpdateLib.Tasks; +using System; +using System.ComponentModel; +using System.Windows.Forms; + +namespace MatthiWare.UpdateLib.Generator.UI.Pages +{ + public class PageControlBase : UserControl + { + internal MainForm TestForm { get; set; } + + public PageControlBase() + { + + } + + public void ShowLoader() + { + LoaderControl.Show(TestForm?.ContentPanel); + } + + public void HideLoader() + { + LoaderControl.Hide(TestForm?.ContentPanel); + } + + public bool IsPageInitialized { get; private set; } = false; + + private AsyncTask taskInitialize; + + public AsyncTask InitializePage(EventHandler callBack) + { + if (IsPageInitialized || (taskInitialize != null && taskInitialize.IsRunning)) + return taskInitialize; + + taskInitialize = AsyncTaskFactory.From(new Action(OnPageInitialize), null); + + taskInitialize.TaskCompleted += (o, e) => + { + IsPageInitialized = !e.Cancelled && e.Error == null; + + callBack?.Invoke(this, e); + }; + + return taskInitialize.Start(); + } + + protected virtual void OnPageInitialize() { } + + private void InitializeComponent() + { + this.SuspendLayout(); + // + // PageControlBase + // + this.DoubleBuffered = true; + this.Name = "PageControlBase"; + this.ResumeLayout(false); + + } + } +} diff --git a/UpdateLib/UpdateLib.Generator/UI/Pages/PageControlBase.resx b/UpdateLib/UpdateLib.Generator/UI/Pages/PageControlBase.resx new file mode 100644 index 0000000..7080a7d --- /dev/null +++ b/UpdateLib/UpdateLib.Generator/UI/Pages/PageControlBase.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/UpdateLib/UpdateLib.Generator/UI/Pages/RegistryPage.Designer.cs b/UpdateLib/UpdateLib.Generator/UI/Pages/RegistryPage.Designer.cs new file mode 100644 index 0000000..33f3ba0 --- /dev/null +++ b/UpdateLib/UpdateLib.Generator/UI/Pages/RegistryPage.Designer.cs @@ -0,0 +1,255 @@ +namespace MatthiWare.UpdateLib.Generator.UI.Pages +{ + partial class RegistryPage + { + /// + /// 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 Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RegistryPage)); + this.label1 = new System.Windows.Forms.Label(); + this.tvFolders = new System.Windows.Forms.TreeView(); + this.ilIcons = new System.Windows.Forms.ImageList(this.components); + this.contextMenuRightClick = new System.Windows.Forms.ContextMenuStrip(this.components); + this.menuAddFiles = new System.Windows.Forms.ToolStripMenuItem(); + this.menuAddFolder = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); + this.deleteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.lvRegistry = new System.Windows.Forms.ListView(); + this.clmnName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.clmnType = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.clmnValue = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.stringValueToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.binaryValueToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.dWORDValueToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.qWORDValueToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.multiStringValueToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.expandableStringValueToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.contextMenuRightClick.SuspendLayout(); + this.SuspendLayout(); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Font = new System.Drawing.Font("Century Gothic", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label1.Location = new System.Drawing.Point(14, 16); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(65, 20); + this.label1.TabIndex = 1; + this.label1.Text = "Registry"; + // + // tvFolders + // + this.tvFolders.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left))); + this.tvFolders.ImageIndex = 0; + this.tvFolders.ImageList = this.ilIcons; + this.tvFolders.Location = new System.Drawing.Point(18, 53); + this.tvFolders.Name = "tvFolders"; + this.tvFolders.SelectedImageIndex = 0; + this.tvFolders.Size = new System.Drawing.Size(191, 332); + this.tvFolders.TabIndex = 2; + this.tvFolders.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.tvFolders_NodeMouseClick); + // + // ilIcons + // + this.ilIcons.ColorDepth = System.Windows.Forms.ColorDepth.Depth32Bit; + this.ilIcons.ImageSize = new System.Drawing.Size(16, 16); + this.ilIcons.TransparentColor = System.Drawing.Color.Transparent; + // + // contextMenuRightClick + // + this.contextMenuRightClick.Font = new System.Drawing.Font("Century Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.contextMenuRightClick.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.menuAddFiles, + this.menuAddFolder, + this.toolStripSeparator1, + this.deleteToolStripMenuItem}); + this.contextMenuRightClick.Name = "menuTV"; + this.contextMenuRightClick.Size = new System.Drawing.Size(153, 98); + // + // menuAddFiles + // + this.menuAddFiles.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.stringValueToolStripMenuItem, + this.binaryValueToolStripMenuItem, + this.dWORDValueToolStripMenuItem, + this.qWORDValueToolStripMenuItem, + this.multiStringValueToolStripMenuItem, + this.expandableStringValueToolStripMenuItem}); + this.menuAddFiles.Image = global::MatthiWare.UpdateLib.Generator.Properties.Resources.image_transparent_16px; + this.menuAddFiles.Name = "menuAddFiles"; + this.menuAddFiles.Size = new System.Drawing.Size(152, 22); + this.menuAddFiles.Text = "Add Value"; + // + // menuAddFolder + // + this.menuAddFolder.Image = global::MatthiWare.UpdateLib.Generator.Properties.Resources.folder_transparent_16px; + this.menuAddFolder.Name = "menuAddFolder"; + this.menuAddFolder.Size = new System.Drawing.Size(152, 22); + this.menuAddFolder.Text = "Add Key"; + this.menuAddFolder.Click += new System.EventHandler(this.menuAddFolder_Click); + // + // toolStripSeparator1 + // + this.toolStripSeparator1.Name = "toolStripSeparator1"; + this.toolStripSeparator1.Size = new System.Drawing.Size(149, 6); + // + // deleteToolStripMenuItem + // + this.deleteToolStripMenuItem.Enabled = false; + this.deleteToolStripMenuItem.Image = global::MatthiWare.UpdateLib.Generator.Properties.Resources.cross; + this.deleteToolStripMenuItem.Name = "deleteToolStripMenuItem"; + this.deleteToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.deleteToolStripMenuItem.Text = "Delete"; + this.deleteToolStripMenuItem.Click += new System.EventHandler(this.deleteToolStripMenuItem_Click); + // + // lvRegistry + // + this.lvRegistry.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.lvRegistry.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.clmnName, + this.clmnType, + this.clmnValue}); + this.lvRegistry.ContextMenuStrip = this.contextMenuRightClick; + this.lvRegistry.FullRowSelect = true; + this.lvRegistry.Location = new System.Drawing.Point(215, 53); + this.lvRegistry.MultiSelect = false; + this.lvRegistry.Name = "lvRegistry"; + this.lvRegistry.Size = new System.Drawing.Size(577, 332); + this.lvRegistry.SmallImageList = this.ilIcons; + this.lvRegistry.TabIndex = 3; + this.lvRegistry.UseCompatibleStateImageBehavior = false; + this.lvRegistry.View = System.Windows.Forms.View.Details; + this.lvRegistry.SelectedIndexChanged += new System.EventHandler(this.lvFiles_SelectedIndexChanged); + this.lvRegistry.DoubleClick += new System.EventHandler(this.lvFiles_DoubleClick); + // + // clmnName + // + this.clmnName.Text = "Name"; + this.clmnName.Width = 150; + // + // clmnType + // + this.clmnType.Text = "Type"; + this.clmnType.Width = 93; + // + // clmnValue + // + this.clmnValue.Text = "Value"; + this.clmnValue.Width = 250; + // + // stringValueToolStripMenuItem + // + this.stringValueToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("stringValueToolStripMenuItem.Image"))); + this.stringValueToolStripMenuItem.Name = "stringValueToolStripMenuItem"; + this.stringValueToolStripMenuItem.Size = new System.Drawing.Size(221, 22); + this.stringValueToolStripMenuItem.Text = "String Value"; + this.stringValueToolStripMenuItem.Click += new System.EventHandler(this.stringValueToolStripMenuItem_Click); + // + // binaryValueToolStripMenuItem + // + this.binaryValueToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("binaryValueToolStripMenuItem.Image"))); + this.binaryValueToolStripMenuItem.Name = "binaryValueToolStripMenuItem"; + this.binaryValueToolStripMenuItem.Size = new System.Drawing.Size(221, 22); + this.binaryValueToolStripMenuItem.Text = "Binary Value"; + this.binaryValueToolStripMenuItem.Click += new System.EventHandler(this.binaryValueToolStripMenuItem_Click); + // + // dWORDValueToolStripMenuItem + // + this.dWORDValueToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("dWORDValueToolStripMenuItem.Image"))); + this.dWORDValueToolStripMenuItem.Name = "dWORDValueToolStripMenuItem"; + this.dWORDValueToolStripMenuItem.Size = new System.Drawing.Size(221, 22); + this.dWORDValueToolStripMenuItem.Text = "DWORD (32-bit) Value"; + this.dWORDValueToolStripMenuItem.Click += new System.EventHandler(this.dWORDValueToolStripMenuItem_Click); + // + // qWORDValueToolStripMenuItem + // + this.qWORDValueToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("qWORDValueToolStripMenuItem.Image"))); + this.qWORDValueToolStripMenuItem.Name = "qWORDValueToolStripMenuItem"; + this.qWORDValueToolStripMenuItem.Size = new System.Drawing.Size(221, 22); + this.qWORDValueToolStripMenuItem.Text = "QWORD (64-bit) Value"; + this.qWORDValueToolStripMenuItem.Click += new System.EventHandler(this.qWORDValueToolStripMenuItem_Click); + // + // multiStringValueToolStripMenuItem + // + this.multiStringValueToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("multiStringValueToolStripMenuItem.Image"))); + this.multiStringValueToolStripMenuItem.Name = "multiStringValueToolStripMenuItem"; + this.multiStringValueToolStripMenuItem.Size = new System.Drawing.Size(221, 22); + this.multiStringValueToolStripMenuItem.Text = "Multi String Value"; + this.multiStringValueToolStripMenuItem.Click += new System.EventHandler(this.multiStringValueToolStripMenuItem_Click); + // + // expandableStringValueToolStripMenuItem + // + this.expandableStringValueToolStripMenuItem.Image = global::MatthiWare.UpdateLib.Generator.Properties.Resources.reg_string_16px; + this.expandableStringValueToolStripMenuItem.Name = "expandableStringValueToolStripMenuItem"; + this.expandableStringValueToolStripMenuItem.Size = new System.Drawing.Size(221, 22); + this.expandableStringValueToolStripMenuItem.Text = "Expandable String Value"; + this.expandableStringValueToolStripMenuItem.Click += new System.EventHandler(this.expandableStringValueToolStripMenuItem_Click); + // + // RegistryPage + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.lvRegistry); + this.Controls.Add(this.tvFolders); + this.Controls.Add(this.label1); + this.DoubleBuffered = true; + this.Font = new System.Drawing.Font("Century Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.MinimumSize = new System.Drawing.Size(589, 233); + this.Name = "RegistryPage"; + this.Size = new System.Drawing.Size(810, 403); + this.contextMenuRightClick.ResumeLayout(false); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TreeView tvFolders; + private System.Windows.Forms.ListView lvRegistry; + private System.Windows.Forms.ColumnHeader clmnName; + private System.Windows.Forms.ColumnHeader clmnType; + private System.Windows.Forms.ColumnHeader clmnValue; + private System.Windows.Forms.ImageList ilIcons; + private System.Windows.Forms.ContextMenuStrip contextMenuRightClick; + private System.Windows.Forms.ToolStripMenuItem menuAddFiles; + private System.Windows.Forms.ToolStripMenuItem menuAddFolder; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; + private System.Windows.Forms.ToolStripMenuItem deleteToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem stringValueToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem binaryValueToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem dWORDValueToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem qWORDValueToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem multiStringValueToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem expandableStringValueToolStripMenuItem; + } +} diff --git a/UpdateLib/UpdateLib.Generator/UI/Pages/RegistryPage.cs b/UpdateLib/UpdateLib.Generator/UI/Pages/RegistryPage.cs new file mode 100644 index 0000000..8aae329 --- /dev/null +++ b/UpdateLib/UpdateLib.Generator/UI/Pages/RegistryPage.cs @@ -0,0 +1,256 @@ +/* UpdateLib - .Net auto update library + * Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using System; +using System.Collections.Generic; +using System.Windows.Forms; +using MatthiWare.UpdateLib.Generator.Data; +using MatthiWare.UpdateLib.UI; +using MatthiWare.UpdateLib.Generator.Data.FilesPage; +using Microsoft.Win32; + +namespace MatthiWare.UpdateLib.Generator.UI.Pages +{ + public partial class RegistryPage : PageControlBase + { + private const string PROJECT_IMAGE_KEY = "project_key"; + + private GenReg m_selectedRegEntry; + private GenReg SelectedRegEntry + { + get { return m_selectedRegEntry; } + set + { + m_selectedRegEntry = value; + if (value != null && !deleteToolStripMenuItem.Enabled) + deleteToolStripMenuItem.Enabled = true; + } + } + private GenFolder _selectedFolder; + private GenFolder SelectedFolder + { + get { return _selectedFolder; } + set + { + _selectedFolder = value; + if (value != null && !deleteToolStripMenuItem.Enabled) + deleteToolStripMenuItem.Enabled = true; + } + } + + public IList Folders { get; set; } + + public RegistryPage() + { + InitializeComponent(); + } + + protected override void OnPageInitialize() + { + SuspendLayout(); + + Folders = new List(); + + ilIcons.Images.Add("REG_BIN", Properties.Resources.reg_bin_16px); + ilIcons.Images.Add("REG_SZ", Properties.Resources.reg_string_16px); + ilIcons.Images.Add(TreeViewFolderNode.FOLDER_KEY, Properties.Resources.folder_transparent_16px); + + GenFolder hkey_classes_root = new GenFolder("HKEY_CLASSES_ROOT", contextMenuRightClick); + GenFolder hkey_current_user = new GenFolder("HKEY_CURRENT_USER", contextMenuRightClick); + GenFolder hkey_local_machine = new GenFolder("HKEY_LOCAL_MACHINE", contextMenuRightClick); + GenFolder hkey_users = new GenFolder("HKEY_USERS", contextMenuRightClick); + GenFolder hkey_current_config = new GenFolder("HKEY_CURRENT_CONFIG", contextMenuRightClick); + + tvFolders.Nodes.Add(hkey_classes_root.FolderTreeView); + tvFolders.Nodes.Add(hkey_current_user.FolderTreeView); + tvFolders.Nodes.Add(hkey_local_machine.FolderTreeView); + tvFolders.Nodes.Add(hkey_users.FolderTreeView); + tvFolders.Nodes.Add(hkey_current_config.FolderTreeView); + + Folders.Add(hkey_classes_root); + Folders.Add(hkey_current_user); + Folders.Add(hkey_local_machine); + Folders.Add(hkey_users); + Folders.Add(hkey_current_config); + + UpdateSelectedFolder(hkey_classes_root); + + ResumeLayout(); + } + + private void UpdateSelectedFolder(GenFolder folder) + { + if (folder == null || folder == SelectedFolder) + return; + + SelectedFolder = folder; + SelectedRegEntry = null; + + if (SelectedFolder.IsRoot) + deleteToolStripMenuItem.Enabled = false; + + lvRegistry.SuspendLayout(); + + lvRegistry.Items.Clear(); + + foreach (GenFolder subFolder in folder.Directories) + lvRegistry.Items.Add(subFolder.FolderListView); + + foreach (IGenItem subFile in folder.Items) + lvRegistry.Items.Add(subFile.View); + + lvRegistry.ResumeLayout(); + + tvFolders.SelectedNode = folder.FolderTreeView; + folder.FolderTreeView.Expand(); + } + + private void lvFiles_DoubleClick(object sender, EventArgs e) + { + if (lvRegistry.SelectedItems.Count == 0) + return; + + ListViewFolder item = lvRegistry.SelectedItems[0] as ListViewFolder; + if (item == null) + return; + + UpdateSelectedFolder(item?.Folder); + + } + + private void lvFiles_SelectedIndexChanged(object sender, EventArgs e) + { + if (lvRegistry.SelectedItems.Count == 0) + return; + + ListViewItem item = lvRegistry.SelectedItems[0]; + + if (item == null) + return; + + if (item is ListViewGenItem) + SelectedRegEntry = (item as ListViewGenItem).Item as GenReg; + else if (item is ListViewFolder) + SelectedFolder = (item as ListViewFolder).Folder; + } + + private void deleteToolStripMenuItem_Click(object sender, EventArgs e) + { + SuspendLayout(); + + deleteToolStripMenuItem.Enabled = false; + + if (SelectedRegEntry != null) + { + SelectedRegEntry.Parent.Remove(SelectedRegEntry); + lvRegistry.Items.Remove(SelectedRegEntry.View); + SelectedRegEntry = null; + } + else if (SelectedFolder != null && !SelectedFolder.IsRoot) + { + SelectedFolder.ParentFolder.Remove(SelectedFolder); + + lvRegistry.Items.Clear(); + + GenFolder temp = SelectedFolder; + + UpdateSelectedFolder(SelectedFolder.ParentFolder); + + temp = null; + } + + ResumeLayout(); + } + + private void tvFolders_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) + { + TreeViewFolderNode node = e.Node as TreeViewFolderNode; + + if (node == null) + return; + + UpdateSelectedFolder(node?.Folder); + } + + private void menuAddFolder_Click(object sender, EventArgs e) + { + if (SelectedFolder == null) + return; + + InputDialog inputDlg = new InputDialog("New folder", "Please enter the folder name: ", MessageBoxButtons.OKCancel); + + if (inputDlg.ShowDialog(ParentForm) != DialogResult.OK && SelectedFolder != null) + return; + + var name = inputDlg.Input; + + GenFolder folder = new GenFolder(name, contextMenuRightClick); + + this.InvokeOnUI(() => + { + SelectedFolder.Add(folder); + SelectedFolder.FolderTreeView.Expand(); + lvRegistry.Items.Add(folder.FolderListView); + }); + } + + private void stringValueToolStripMenuItem_Click(object sender, EventArgs e) + { + MakeNewEntry(RegistryValueKind.String); + } + + private void binaryValueToolStripMenuItem_Click(object sender, EventArgs e) + { + MakeNewEntry(RegistryValueKind.Binary); + } + + private void dWORDValueToolStripMenuItem_Click(object sender, EventArgs e) + { + MakeNewEntry(RegistryValueKind.DWord); + } + + private void qWORDValueToolStripMenuItem_Click(object sender, EventArgs e) + { + MakeNewEntry(RegistryValueKind.QWord); + } + + private void multiStringValueToolStripMenuItem_Click(object sender, EventArgs e) + { + MakeNewEntry(RegistryValueKind.MultiString); + } + + private void expandableStringValueToolStripMenuItem_Click(object sender, EventArgs e) + { + MakeNewEntry(RegistryValueKind.ExpandString); + } + + private void MakeNewEntry(RegistryValueKind type) + { + if (SelectedFolder == null) + return; + + GenReg item = new GenReg("New Item", type); + item.Value = "Test"; + + this.InvokeOnUI(() => + { + SelectedFolder.Add(item); + lvRegistry.Items.Add(item.View); + }); + } + } +} diff --git a/UpdateLib/UpdateLib.Generator/UI/Pages/RegistryPage.resx b/UpdateLib/UpdateLib.Generator/UI/Pages/RegistryPage.resx new file mode 100644 index 0000000..a8e58e9 --- /dev/null +++ b/UpdateLib/UpdateLib.Generator/UI/Pages/RegistryPage.resx @@ -0,0 +1,177 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + 17, 17 + + + 103, 17 + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wwAADsMBx2+oZAAAABl0RVh0U29mdHdhc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QBNWiBL/Ga8hCYQBdBCP4QJH8JdB3sF9qc + 14D3HnkKyuPw3iH7wlheBc45hIajORNYZB+2Oa95DwVKqUyAzFo7DArgORIksvZe4Qf62ZsAgL/gH0Dd + z7bthnwU/KI9oPIDaOlC7DAsnWYAAAAASUVORK5CYII= + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wwAADsMBx2+oZAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xNkRpr/UAAADJSURBVDhPpZLL + DcIwDEAzEcswWY5Zo7OkObBEUQ+U/IkNTp2AIBWWnuRfn3uI0FrnI0gpcwlBCGMMNIZiXdc8TVMjEfM8 + QzEcICghSIKClBJyOl8qfY9yEBAgqYJ+8VseY8zXZflPAFQBNWiBL/Ga8hCYQBdBCP4QJH8JdB3sF9qc + 14D3HnkKyuPw3iH7wlheBc45hIajORNYZB+2Oa95DwVKqUyAzFo7DArgORIksvZe4Qf62ZsAgL/gH0Dd + z7bthnwU/KI9oPIDaOlC7DAsnWYAAAAASUVORK5CYII= + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wwAADsMBx2+oZAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xNkRpr/UAAADHSURBVDhPnZNN + DoMgEIU5US/Tk7nkGp4FXPQSNi5q+VHKjH04jZKqL/kSeEw+NqCMMekMTdOkHAVU13VUHMowDKlt2x+J + stbS5nBIkKMgYcE8z1Ue9xuDkACQ5LQAefb9VoBhYq9DP00TUwQoAIZr6xiFwGRBjIHBwDq4dnKNi74C + Ux2srUMIzCLIjyMEXw4lez11oAi895cQAncJFmitEyCZc+4wLMhvogCRc2+GIi+QZ8RGQODHAdrLM5KM + 44vZFfwDkgWdPgHhXeaPOieBAAAAAElFTkSuQmCC + + + \ No newline at end of file diff --git a/UpdateLib/UpdateLib.Generator/UpdateLib.Generator.csproj b/UpdateLib/UpdateLib.Generator/UpdateLib.Generator.csproj index 697f5f2..d890be0 100644 --- a/UpdateLib/UpdateLib.Generator/UpdateLib.Generator.csproj +++ b/UpdateLib/UpdateLib.Generator/UpdateLib.Generator.csproj @@ -1,27 +1,200 @@ - + + + - netcoreapp2.1 + Debug + AnyCPU + {5194FF71-49F6-4ADB-9B0E-4BEB418DC6F3} + WinExe + Properties MatthiWare.UpdateLib.Generator - Exe - false + UpdateLib.Generator + v3.5 + 512 + AnyCPU + true full - bin\$(Configuration)\ + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + AnyCPU pdbonly - bin\$(Configuration)\ + true + bin\Release\ + TRACE + prompt + 4 + + + Generator_logo.ico - {5194FF71-49F6-4ADB-9B0E-4BEB418DC6F3} - MatthiWare.UpdateLib.Generator MatthiWare.UpdateLib.Generator.Program - + + + + + + + + + + + + + Properties\SharedAssemblyInfo.cs + + + + + + + + + + + + + + + Form + + + MainForm.cs + + + Component + + + Component + + + Component + + + Component + + + UserControl + + + LoaderControl.cs + + + Form + + + InputDialog.cs + + + Component + + + UserControl + + + BuilderPage.cs + + + UserControl + + + RegistryPage.cs + + + UserControl + + + FilesPage.cs + + + UserControl + + + InformationPage.cs + + + UserControl + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + True + + + MainForm.cs + + + LoaderControl.cs + + + InputDialog.cs + + + BuilderPage.cs + + + RegistryPage.cs + + + FilesPage.cs + + + InformationPage.cs + + + PageControlBase.cs + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + {4394be57-95e2-45b1-a968-1404b0590b35} + UpdateLib + - + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/UpdateLib/UpdateLib.Tests/UpdateLib.Tests.csproj b/UpdateLib/UpdateLib.Tests/UpdateLib.Tests.csproj index 6ee2945..1a6d8ce 100644 --- a/UpdateLib/UpdateLib.Tests/UpdateLib.Tests.csproj +++ b/UpdateLib/UpdateLib.Tests/UpdateLib.Tests.csproj @@ -1,40 +1,107 @@ - + + + - netcoreapp2.1 - false + Debug + AnyCPU + {C47B8CC3-ABAB-4F56-8CA2-1323F902D1C3} + Library + Properties + UpdateLib.Tests + UpdateLib.Tests + v4.5 + 512 + + true full - bin\$(Configuration)\ + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + false pdbonly - bin\$(Configuration)\ - - - {C47B8CC3-ABAB-4F56-8CA2-1323F902D1C3} + true + bin\Release\ + TRACE + prompt + 4 + false - + + ..\packages\Castle.Core.4.0.0\lib\net45\Castle.Core.dll + True + + + ..\packages\Moq.4.7.1\lib\net45\Moq.dll + True + + + ..\packages\NUnit.3.6.1\lib\net45\nunit.framework.dll + True + + + + + + + + - - - all - - - - - - - - - - - + + Properties\SharedAssemblyInfo.cs + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + {4394be57-95e2-45b1-a968-1404b0590b35} + UpdateLib + + + + + + \ No newline at end of file diff --git a/UpdateLib/UpdateLib.Tests/packages.config b/UpdateLib/UpdateLib.Tests/packages.config new file mode 100644 index 0000000..9f7b212 --- /dev/null +++ b/UpdateLib/UpdateLib.Tests/packages.config @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/UpdateLib/UpdateLib.sln b/UpdateLib/UpdateLib.sln index 4ffaddb..2957dee 100644 --- a/UpdateLib/UpdateLib.sln +++ b/UpdateLib/UpdateLib.sln @@ -3,21 +3,21 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.27130.2010 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UpdateLib", "UpdateLib\UpdateLib.csproj", "{4394BE57-95E2-45B1-A968-1404B0590B35}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UpdateLib", "UpdateLib\UpdateLib.csproj", "{4394BE57-95E2-45B1-A968-1404B0590B35}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestApp", "TestApp\TestApp.csproj", "{7C3C0345-6D01-40A6-9F01-60D8D6451FB1}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestApp", "TestApp\TestApp.csproj", "{7C3C0345-6D01-40A6-9F01-60D8D6451FB1}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{4FDF7C41-4B30-4153-A06A-6DE8989B4EFF}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UpdateLib.Tests", "UpdateLib.Tests\UpdateLib.Tests.csproj", "{C47B8CC3-ABAB-4F56-8CA2-1323F902D1C3}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UpdateLib.Tests", "UpdateLib.Tests\UpdateLib.Tests.csproj", "{C47B8CC3-ABAB-4F56-8CA2-1323F902D1C3}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UpdateLib.Generator", "UpdateLib.Generator\UpdateLib.Generator.csproj", "{5194FF71-49F6-4ADB-9B0E-4BEB418DC6F3}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{CDD5CD43-2D33-4654-8680-2352806AE394}" ProjectSection(SolutionItems) = preProject .shared\SharedAssemblyInfo.cs = .shared\SharedAssemblyInfo.cs EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UpdateLib.Generator", "UpdateLib.Generator\UpdateLib.Generator.csproj", "{5194FF71-49F6-4ADB-9B0E-4BEB418DC6F3}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU diff --git a/UpdateLib/UpdateLib/Common/DirectoryEntry.cs b/UpdateLib/UpdateLib/Common/DirectoryEntry.cs index 4fd8787..598698e 100644 --- a/UpdateLib/UpdateLib/Common/DirectoryEntry.cs +++ b/UpdateLib/UpdateLib/Common/DirectoryEntry.cs @@ -17,8 +17,10 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using System.Text; +using System.Xml.Serialization; using MatthiWare.UpdateLib.Common.Abstraction; @@ -35,6 +37,8 @@ public class DirectoryEntry /// /// Gets or sets the name of the directory. /// + [XmlAttribute] + [DebuggerDisplay("{DestinationLocation}")] public string Name { get; set; } /// @@ -45,18 +49,23 @@ public class DirectoryEntry /// /// Gets the list of subdirectories. /// + [XmlArray("Directories"), XmlArrayItem("Directory")] public List Directories { get; set; } = new List(); /// /// Gets the list of files in this directory. /// + [XmlElement(typeof(FileEntry))] + [XmlElement(typeof(RegistryKeyEntry))] public List Items { get; set; } = new List(); /// /// Gets or Sets the Parent of this Directory /// + [XmlIgnore] public DirectoryEntry Parent { get; set; } + [XmlIgnore] public string SourceLocation { get @@ -74,6 +83,7 @@ public string SourceLocation } } + [XmlIgnore] public string DestinationLocation { get diff --git a/UpdateLib/UpdateLib/Common/HashCacheEntry.cs b/UpdateLib/UpdateLib/Common/HashCacheEntry.cs index 0de28ff..4c4405c 100644 --- a/UpdateLib/UpdateLib/Common/HashCacheEntry.cs +++ b/UpdateLib/UpdateLib/Common/HashCacheEntry.cs @@ -63,14 +63,14 @@ public void Recalculate(string hash = "") Hash = string.IsNullOrEmpty(hash) ? HashUtil.GetHash(FilePath) : hash; Ticks = tick; - //Updater.Instance.Logger.Debug(nameof(HashCacheEntry), nameof(Recalculate), $"Recalculated Time: {DateTime.FromBinary(Ticks).ToString()} Name: {FilePath} Hash: {Hash}"); + Updater.Instance.Logger.Debug(nameof(HashCacheEntry), nameof(Recalculate), $"Recalculated Time: {DateTime.FromBinary(Ticks).ToString()} Name: {FilePath} Hash: {Hash}"); } catch (Exception ex) // file might no longer exist or is in use { Hash = string.Empty; Ticks = -1; - //Updater.Instance.Logger.Error(nameof(HashCacheEntry), nameof(Recalculate), ex); + Updater.Instance.Logger.Error(nameof(HashCacheEntry), nameof(Recalculate), ex); } } diff --git a/UpdateLib/UpdateLib/Common/RegistryKeyEntry.cs b/UpdateLib/UpdateLib/Common/RegistryKeyEntry.cs new file mode 100644 index 0000000..69994a0 --- /dev/null +++ b/UpdateLib/UpdateLib/Common/RegistryKeyEntry.cs @@ -0,0 +1,52 @@ +/* UpdateLib - .Net auto update library + * Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using MatthiWare.UpdateLib.Common.Abstraction; +using Microsoft.Win32; +using System; +using System.Diagnostics; +using System.Xml.Serialization; + +namespace MatthiWare.UpdateLib.Common +{ + [Serializable] + [DebuggerDisplay("RegistryKeyEntry: {DestinationLocation}")] + public class RegistryKeyEntry : EntryBase + { + /// + /// The type of registry key + /// + [XmlAttribute] + public RegistryValueKind Type { get; set; } + + /// + /// The value of the key + /// + public object Value { get; set; } = "Test"; + + public RegistryKeyEntry() + : this(string.Empty, RegistryValueKind.String, null) + { } + + public RegistryKeyEntry(string name, RegistryValueKind type, object value) + { + Name = name; + Type = type; + Value = value; + } + } +} diff --git a/UpdateLib/UpdateLib/Common/UpdateVersion.cs b/UpdateLib/UpdateLib/Common/UpdateVersion.cs index 922b356..6bd3008 100644 --- a/UpdateLib/UpdateLib/Common/UpdateVersion.cs +++ b/UpdateLib/UpdateLib/Common/UpdateVersion.cs @@ -28,6 +28,7 @@ namespace MatthiWare.UpdateLib.Common /// Support for version label's and serializable. /// Partially based on Semantic Versioning /// + [Serializable] [DebuggerDisplay("[UpdateVersion {Value}]")] public class UpdateVersion : IComparable, IComparable, IEquatable { @@ -46,14 +47,38 @@ public class UpdateVersion : IComparable, IComparable, IEquatable #region Properties + [XmlIgnore] public int Major => m_major; + [XmlIgnore] public int Minor => m_minor; + [XmlIgnore] public int Patch => m_patch; + [XmlIgnore] public VersionLabel Label => m_label; + [XmlText] + [XmlElement(typeof(string))] + [EditorBrowsable(EditorBrowsableState.Never), Browsable(false)] + public string Value + { + get { return ToString(); } + set + { + UpdateVersion version; + + if (!TryParse(value, out version)) + throw new ArgumentException(nameof(value), "Unable to parse input string"); + + m_major = version.m_major; + m_minor = version.m_minor; + m_patch = version.m_patch; + m_label = version.m_label; + } + } + #endregion #region Constructor @@ -88,7 +113,9 @@ public UpdateVersion(int major, int minor, int patch, VersionLabel label) public UpdateVersion(string input) { - if (!TryParse(input, out UpdateVersion version)) + UpdateVersion version; + + if (!TryParse(input, out version)) throw new ArgumentException(nameof(input), "Unable to parse input string"); m_major = version.m_major; @@ -171,6 +198,7 @@ private string LabelToString() return BETA_STRING; case VersionLabel.RC: return RC_STRING; + case VersionLabel.None: default: return string.Empty; } @@ -260,6 +288,6 @@ public static implicit operator UpdateVersion(string value) => new UpdateVersion(value); public static implicit operator string(UpdateVersion version) - => version.ToString(); + => version.Value; } } diff --git a/UpdateLib/UpdateLib/Common/WorkerScheduler.cs b/UpdateLib/UpdateLib/Common/WorkerScheduler.cs new file mode 100644 index 0000000..62ff183 --- /dev/null +++ b/UpdateLib/UpdateLib/Common/WorkerScheduler.cs @@ -0,0 +1,122 @@ +/* UpdateLib - .Net auto update library + * Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using MatthiWare.UpdateLib.Tasks; +using MatthiWare.UpdateLib.Threading; +using System; +using System.Threading; + +namespace MatthiWare.UpdateLib.Common +{ + internal class WorkerScheduler + { + + #region Singleton + private static volatile WorkerScheduler instance = null; + private static readonly object synclock = new object(); + + /// + /// Gets a thread safe instance of + /// + public static WorkerScheduler Instance + { + get + { + if (instance == null) + lock (synclock) + if (instance == null) + instance = new WorkerScheduler(); + + return instance; + } + } + #endregion + + #region Fields + + private readonly long MAX_WORKERS; + private readonly ConcurrentQueue m_taskQueue; + private readonly AtomicInteger m_currentWorkerCount; + private readonly AsyncTask m_dispatcherTask; + private readonly ManualResetEvent m_waitForAvailableWorker; + private readonly object sync = new object(); + + public const long MIN_WORKERS = 8; + + #endregion + + private WorkerScheduler() + { + MAX_WORKERS = Math.Max(Environment.ProcessorCount, MIN_WORKERS); + m_taskQueue = new ConcurrentQueue(); + m_dispatcherTask = AsyncTaskFactory.From(new Action(Dispatcher), null); + m_waitForAvailableWorker = new ManualResetEvent(true); + m_currentWorkerCount = new AtomicInteger(); + } + + public void Schedule(AsyncTask task) + { + Enqueue(task); + + lock (synclock) + if (!m_dispatcherTask.IsRunning) + m_dispatcherTask.Start(); + } + + private void Dispatcher() + { + AsyncTask task = null; + while (m_taskQueue.TryDequeue(out task)) + { + lock (sync) + { + if (task.IsCompleted || task.IsCancelled || task.HasErrors) + continue; + + SetupTask(task); + + if (m_currentWorkerCount.Value >= MAX_WORKERS) + m_waitForAvailableWorker.Reset(); + + m_waitForAvailableWorker.WaitOne(); + + Updater.Instance.Logger.Debug(nameof(WorkerScheduler), nameof(Dispatcher), $"Current worker count: {m_currentWorkerCount.Increment()} | Current queue count: {m_taskQueue.Count}"); + + task.ConfigureAwait(false).Start(); + } + } + } + + private void SetupTask(AsyncTask task) + { + task.TaskCompleted += (o, e) => + { + + if (m_currentWorkerCount.Decrement() < MAX_WORKERS) + m_waitForAvailableWorker.Set(); + + Updater.Instance.Logger.Debug(nameof(WorkerScheduler), nameof(Dispatcher), $"Current worker count: {m_currentWorkerCount}"); + }; + } + + private void Enqueue(AsyncTask task) + { + m_taskQueue.Enqueue(task); + } + + } +} diff --git a/UpdateLib/UpdateLib/Compression/Checksum/Adler32.cs b/UpdateLib/UpdateLib/Compression/Checksum/Adler32.cs new file mode 100644 index 0000000..4fa0d86 --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/Checksum/Adler32.cs @@ -0,0 +1,209 @@ +/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +/* Copyright © 2000-2016 SharpZipLib Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +using System; + +namespace MatthiWare.UpdateLib.Compression.Checksum +{ + /// + /// Computes Adler32 checksum for a stream of data. An Adler32 + /// checksum is not as reliable as a CRC32 checksum, but a lot faster to + /// compute. + /// + /// The specification for Adler32 may be found in RFC 1950. + /// ZLIB Compressed Data Format Specification version 3.3) + /// + /// + /// From that document: + /// + /// "ADLER32 (Adler-32 checksum) + /// This contains a checksum value of the uncompressed data + /// (excluding any dictionary data) computed according to Adler-32 + /// algorithm. This algorithm is a 32-bit extension and improvement + /// of the Fletcher algorithm, used in the ITU-T X.224 / ISO 8073 + /// standard. + /// + /// Adler-32 is composed of two sums accumulated per byte: s1 is + /// the sum of all bytes, s2 is the sum of all s1 values. Both sums + /// are done modulo 65521. s1 is initialized to 1, s2 to zero. The + /// Adler-32 checksum is stored as s2*65536 + s1 in most- + /// significant-byte first (network) order." + /// + /// "8.2. The Adler-32 algorithm + /// + /// The Adler-32 algorithm is much faster than the CRC32 algorithm yet + /// still provides an extremely low probability of undetected errors. + /// + /// The modulo on unsigned long accumulators can be delayed for 5552 + /// bytes, so the modulo operation time is negligible. If the bytes + /// are a, b, c, the second sum is 3a + 2b + c + 3, and so is position + /// and order sensitive, unlike the first sum, which is just a + /// checksum. That 65521 is prime is important to avoid a possible + /// large class of two-byte errors that leave the check unchanged. + /// (The Fletcher checksum uses 255, which is not prime and which also + /// makes the Fletcher check insensitive to single byte changes 0 - + /// 255.) + /// + /// The sum s1 is initialized to 1 instead of zero to make the length + /// of the sequence part of s2, so that the length does not have to be + /// checked separately. (Any sequence of zeroes has a Fletcher + /// checksum of zero.)" + /// + public sealed class Adler32 : IChecksum + { + #region Instance Fields + /// + /// largest prime smaller than 65536 + /// + readonly static uint BASE = 65521; + + /// + /// The CRC data checksum so far. + /// + uint checkValue; + #endregion + + /// + /// Initialise a default instance of + /// + public Adler32() + { + Reset(); + } + + /// + /// Resets the Adler32 data checksum as if no update was ever called. + /// + public void Reset() + { + checkValue = 1; + } + + /// + /// Returns the Adler32 data checksum computed so far. + /// + public long Value + { + get + { + return checkValue; + } + } + + /// + /// Updates the checksum with the byte b. + /// + /// + /// The data value to add. The high byte of the int is ignored. + /// + public void Update(int bval) + { + // We could make a length 1 byte array and call update again, but I + // would rather not have that overhead + uint s1 = checkValue & 0xFFFF; + uint s2 = checkValue >> 16; + + s1 = (s1 + ((uint)bval & 0xFF)) % BASE; + s2 = (s1 + s2) % BASE; + + checkValue = (s2 << 16) + s1; + } + + /// + /// Updates the Adler32 data checksum with the bytes taken from + /// a block of data. + /// + /// Contains the data to update the checksum with. + public void Update(byte[] buffer) + { + if (buffer == null) + throw new ArgumentNullException(nameof(buffer)); + + Update(buffer, 0, buffer.Length); + } + + /// + /// Update Adler32 data checksum based on a portion of a block of data + /// + /// Contains the data to update the CRC with. + /// The offset into the buffer where the data starts + /// The number of data bytes to update the CRC with. + public void Update(byte[] buffer, int offset, int count) + { + if (buffer == null) + throw new ArgumentNullException(nameof(buffer)); + + if (offset < 0) + throw new ArgumentOutOfRangeException(nameof(offset), "cannot be less than zero"); + + if (offset >= buffer.Length) + throw new ArgumentOutOfRangeException(nameof(offset), "not a valid index into buffer"); + + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count), "cannot be less than zero"); + + if (offset + count > buffer.Length) + throw new ArgumentOutOfRangeException(nameof(count), "exceeds buffer size"); + + //(By Per Bothner) + uint s1 = checkValue & 0xFFFF; + uint s2 = checkValue >> 16; + + while (count > 0) + { + // We can defer the modulo operation: + // s1 maximally grows from 65521 to 65521 + 255 * 3800 + // s2 maximally grows by 3800 * median(s1) = 2090079800 < 2^31 + int n = 3800; + + if (n > count) + n = count; + + count -= n; + + while (--n >= 0) + { + s1 = s1 + (uint)(buffer[offset++] & 0xff); + s2 = s2 + s1; + } + + s1 %= BASE; + s2 %= BASE; + } + + checkValue = (s2 << 16) | s1; + } + } +} diff --git a/UpdateLib/UpdateLib/Compression/Checksum/Crc32.cs b/UpdateLib/UpdateLib/Compression/Checksum/Crc32.cs new file mode 100644 index 0000000..f3d70b8 --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/Checksum/Crc32.cs @@ -0,0 +1,217 @@ +/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +/* Copyright © 2000-2016 SharpZipLib Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +using System; + +namespace MatthiWare.UpdateLib.Compression.Checksum +{ + /// + /// CRC-32 with reversed data and unreversed output + /// + /// + /// Generate a table for a byte-wise 32-bit CRC calculation on the polynomial: + /// x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x^1+x^0. + /// + /// Polynomials over GF(2) are represented in binary, one bit per coefficient, + /// with the lowest powers in the most significant bit. Then adding polynomials + /// is just exclusive-or, and multiplying a polynomial by x is a right shift by + /// one. If we call the above polynomial p, and represent a byte as the + /// polynomial q, also with the lowest power in the most significant bit (so the + /// byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p, + /// where a mod b means the remainder after dividing a by b. + /// + /// This calculation is done using the shift-register method of multiplying and + /// taking the remainder. The register is initialized to zero, and for each + /// incoming bit, x^32 is added mod p to the register if the bit is a one (where + /// x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by + /// x (which is shifting right by one and adding x^32 mod p if the bit shifted + /// out is a one). We start with the highest power (least significant bit) of + /// q and repeat for all eight bits of q. + /// + /// The table is simply the CRC of all possible eight bit values. This is all + /// the information needed to generate CRC's on data a byte at a time for all + /// combinations of CRC register values and incoming bytes. + /// + public sealed class Crc32 : IChecksum + { + #region Instance Fields + readonly static uint crcInit = 0xFFFFFFFF; + readonly static uint crcXor = 0xFFFFFFFF; + + readonly static uint[] crcTable = { + 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, + 0x706AF48F, 0xE963A535, 0x9E6495A3, 0x0EDB8832, 0x79DCB8A4, + 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, + 0x90BF1D91, 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, + 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, 0x136C9856, + 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9, + 0xFA0F3D63, 0x8D080DF5, 0x3B6E20C8, 0x4C69105E, 0xD56041E4, + 0xA2677172, 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, + 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, + 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, 0x26D930AC, 0x51DE003A, + 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, + 0xB8BDA50F, 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, + 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, 0x76DC4190, + 0x01DB7106, 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F, + 0x9FBFE4A5, 0xE8B8D433, 0x7807C9A2, 0x0F00F934, 0x9609A88E, + 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01, + 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, 0x6C0695ED, + 0x1B01A57B, 0x8208F4C1, 0xF50FC457, 0x65B0D9C6, 0x12B7E950, + 0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, + 0xFBD44C65, 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, + 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, 0x4369E96A, + 0x346ED9FC, 0xAD678846, 0xDA60B8D0, 0x44042D73, 0x33031DE5, + 0xAA0A4C5F, 0xDD0D7CC9, 0x5005713C, 0x270241AA, 0xBE0B1010, + 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F, + 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, + 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD, 0xEDB88320, 0x9ABFB3B6, + 0x03B6E20C, 0x74B1D29A, 0xEAD54739, 0x9DD277AF, 0x04DB2615, + 0x73DC1683, 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, + 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, 0xF00F9344, + 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB, + 0x196C3671, 0x6E6B06E7, 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, + 0x67DD4ACC, 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, + 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, + 0xA6BC5767, 0x3FB506DD, 0x48B2364B, 0xD80D2BDA, 0xAF0A1B4C, + 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, + 0x4669BE79, 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, + 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, 0xC5BA3BBE, + 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31, + 0x2CD99E8B, 0x5BDEAE1D, 0x9B64C2B0, 0xEC63F226, 0x756AA39C, + 0x026D930A, 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713, + 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, 0x92D28E9B, + 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, 0x86D3D2D4, 0xF1D4E242, + 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, + 0x18B74777, 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, + 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, 0xA00AE278, + 0xD70DD2EE, 0x4E048354, 0x3903B3C2, 0xA7672661, 0xD06016F7, + 0x4969474D, 0x3E6E77DB, 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, + 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, + 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, + 0xCDD70693, 0x54DE5729, 0x23D967BF, 0xB3667A2E, 0xC4614AB8, + 0x5D681B02, 0x2A6F2B94, 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, + 0x2D02EF8D + }; + + /// + /// The CRC data checksum so far. + /// + uint checkValue; + #endregion + + internal static uint ComputeCrc32(uint oldCrc, byte bval) => crcTable[(oldCrc ^ bval) & 0xFF] ^ (oldCrc >> 8); + + + /// + /// Initialise a default instance of + /// + public Crc32() + { + Reset(); + } + + /// + /// Resets the CRC data checksum as if no update was ever called. + /// + public void Reset() + { + checkValue = crcInit; + } + + /// + /// Returns the CRC data checksum computed so far. + /// + /// Reversed Out = false + public long Value + { + get + { + return checkValue ^ crcXor; + } + } + + /// + /// Updates the checksum with the int bval. + /// + /// + /// the byte is taken as the lower 8 bits of bval + /// + /// Reversed Data = true + public void Update(int bval) + { + checkValue = unchecked(crcTable[(checkValue ^ bval) & 0xFF] ^ (checkValue >> 8)); + } + + /// + /// Updates the CRC data checksum with the bytes taken from + /// a block of data. + /// + /// Contains the data to update the CRC with. + public void Update(byte[] buffer) + { + if (buffer == null) + throw new ArgumentNullException(nameof(buffer)); + + Update(buffer, 0, buffer.Length); + } + + /// + /// Update CRC data checksum based on a portion of a block of data + /// + /// Contains the data to update the CRC with. + /// The offset into the buffer where the data starts + /// The number of data bytes to update the CRC with. + public void Update(byte[] buffer, int offset, int count) + { + if (buffer == null) + throw new ArgumentNullException(nameof(buffer)); + + if (offset < 0) + throw new ArgumentOutOfRangeException(nameof(offset), "cannot be less than zero"); + + if (offset >= buffer.Length) + throw new ArgumentOutOfRangeException(nameof(offset), "not a valid index into buffer"); + + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count), "cannot be less than zero"); + + if (offset + count > buffer.Length) + throw new ArgumentOutOfRangeException(nameof(count), "exceeds buffer size"); + + for (int i = 0; i < count; ++i) + Update(buffer[offset++]); + } + } +} diff --git a/UpdateLib/UpdateLib/Compression/Checksum/IChecksum.cs b/UpdateLib/UpdateLib/Compression/Checksum/IChecksum.cs new file mode 100644 index 0000000..087ef98 --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/Checksum/IChecksum.cs @@ -0,0 +1,91 @@ +/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +/* Copyright © 2000-2016 SharpZipLib Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + + +namespace MatthiWare.UpdateLib.Compression.Checksum +{ + /// + /// Interface to compute a data checksum used by checked input/output streams. + /// A data checksum can be updated by one byte or with a byte array. After each + /// update the value of the current checksum can be returned by calling + /// getValue. The complete checksum object can also be reset + /// so it can be used again with new data. + /// + public interface IChecksum + { + /// + /// Resets the data checksum as if no update was ever called. + /// + void Reset(); + + /// + /// Returns the data checksum computed so far. + /// + long Value + { + get; + } + + /// + /// Adds one byte to the data checksum. + /// + /// + /// the data value to add. The high byte of the int is ignored. + /// + void Update(int bval); + + /// + /// Updates the data checksum with the bytes taken from the array. + /// + /// + /// buffer an array of bytes + /// + void Update(byte[] buffer); + + /// + /// Adds the byte array to the data checksum. + /// + /// + /// The buffer which contains the data + /// + /// + /// The offset in the buffer where the data starts + /// + /// + /// the number of data bytes to add. + /// + void Update(byte[] buffer, int offset, int count); + } +} diff --git a/UpdateLib/UpdateLib/Compression/Deflaters/Deflater.cs b/UpdateLib/UpdateLib/Compression/Deflaters/Deflater.cs new file mode 100644 index 0000000..17feee8 --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/Deflaters/Deflater.cs @@ -0,0 +1,464 @@ +/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +/* Copyright © 2000-2016 SharpZipLib Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +using System; + +namespace MatthiWare.UpdateLib.Compression.Deflaters +{ + /// + /// This is the Deflater class. The deflater class compresses input + /// with the deflate algorithm described in RFC 1951. It has several + /// compression levels and three different strategies described below. + /// + /// This class is not thread safe. This is inherent in the API, due + /// to the split of deflate and setInput. + /// + /// author of the original java version : Jochen Hoenicke + /// + public class Deflater + { + #region Public Constants + /// + /// The best and slowest compression level. This tries to find very + /// long and distant string repetitions. + /// + public const int BEST_COMPRESSION = 9; + + /// + /// The worst but fastest compression level. + /// + public const int BEST_SPEED = 1; + + /// + /// The default compression level. + /// + public const int DEFAULT_COMPRESSION = -1; + + /// + /// This level won't compress at all but output uncompressed blocks. + /// + public const int NO_COMPRESSION = 0; + + /// + /// The compression method. This is the only method supported so far. + /// There is no need to use this constant at all. + /// + public const int DEFLATED = 8; + #endregion + #region Local Constants + private const int IS_SETDICT = 0x01; + private const int IS_FLUSHING = 0x04; + private const int IS_FINISHING = 0x08; + + private const int INIT_STATE = 0x00; + private const int SETDICT_STATE = 0x01; + // private static int INIT_FINISHING_STATE = 0x08; + // private static int SETDICT_FINISHING_STATE = 0x09; + private const int BUSY_STATE = 0x10; + private const int FLUSHING_STATE = 0x14; + private const int FINISHING_STATE = 0x1c; + private const int FINISHED_STATE = 0x1e; + private const int CLOSED_STATE = 0x7f; + #endregion + #region Constructors + /// + /// Creates a new deflater with default compression level. + /// + public Deflater() : this(DEFAULT_COMPRESSION, false) + { + + } + + /// + /// Creates a new deflater with given compression level. + /// + /// + /// the compression level, a value between NO_COMPRESSION + /// and BEST_COMPRESSION. + /// + /// + /// true, if we should suppress the Zlib/RFC1950 header at the + /// beginning and the adler checksum at the end of the output. This is + /// useful for the GZIP/PKZIP formats. + /// + /// if lvl is out of range. + public Deflater(int level, bool noZlibHeaderOrFooter_) + { + if (level == DEFAULT_COMPRESSION) + level = 6; + else if (level < NO_COMPRESSION || level > BEST_COMPRESSION) + throw new ArgumentOutOfRangeException(nameof(level)); + + pending = new DeflaterPending(); + engine = new DeflaterEngine(pending); + noZlibHeaderOrFooter = noZlibHeaderOrFooter_; + SetStrategy(DeflateStrategy.Default); + SetLevel(level); + Reset(); + } + #endregion + + /// + /// Resets the deflater. The deflater acts afterwards as if it was + /// just created with the same compression level and strategy as it + /// had before. + /// + public void Reset() + { + state = (noZlibHeaderOrFooter ? BUSY_STATE : INIT_STATE); + totalOut = 0; + pending.Reset(); + engine.Reset(); + } + + /// + /// Gets the number of input bytes processed so far. + /// + public long TotalIn + { + get + { + return engine.TotalIn; + } + } + + /// + /// Gets the number of output bytes so far. + /// + public long TotalOut + { + get + { + return totalOut; + } + } + + /// + /// Flushes the current input block. Further calls to deflate() will + /// produce enough output to inflate everything in the current input + /// block. This is not part of Sun's JDK so I have made it package + /// private. It is used by DeflaterOutputStream to implement + /// flush(). + /// + public void Flush() + { + state |= IS_FLUSHING; + } + + /// + /// Finishes the deflater with the current input block. It is an error + /// to give more input after this method was called. This method must + /// be called to force all bytes to be flushed. + /// + public void Finish() + { + state |= (IS_FLUSHING | IS_FINISHING); + } + + /// + /// Returns true if the stream was finished and no more output bytes + /// are available. + /// + public bool IsFinished + { + get + { + return (state == FINISHED_STATE) && pending.IsFlushed; + } + } + + /// + /// Returns true, if the input buffer is empty. + /// You should then call setInput(). + /// NOTE: This method can also return true when the stream + /// was finished. + /// + public bool IsNeedingInput + { + get + { + return engine.NeedsInput(); + } + } + + /// + /// Sets the data which should be compressed next. This should be + /// only called when needsInput indicates that more input is needed. + /// The given byte array should not be changed, before needsInput() returns + /// true again. + /// + /// + /// the buffer containing the input data. + /// + /// + /// the start of the data. + /// + /// + /// the number of data bytes of input. + /// + /// + /// if the buffer was Finish()ed or if previous input is still pending. + /// + public void SetInput(byte[] input, int offset, int count) + { + if ((state & IS_FINISHING) != 0) + { + throw new InvalidOperationException("Finish() already called"); + } + engine.SetInput(input, offset, count); + } + + /// + /// Sets the compression level. There is no guarantee of the exact + /// position of the change, but if you call this when needsInput is + /// true the change of compression level will occur somewhere near + /// before the end of the so far given input. + /// + /// + /// the new compression level. + /// + public void SetLevel(int level) + { + if (level == DEFAULT_COMPRESSION) + level = 6; + else if (level < NO_COMPRESSION || level > BEST_COMPRESSION) + throw new ArgumentOutOfRangeException(nameof(level)); + + if (this.level != level) + { + this.level = level; + engine.SetLevel(level); + } + } + + /// + /// Get current compression level + /// + /// Returns the current compression level + public int GetLevel() => level; + + /// + /// Sets the compression strategy. Strategy is one of + /// DEFAULT_STRATEGY, HUFFMAN_ONLY and FILTERED. For the exact + /// position where the strategy is changed, the same as for + /// SetLevel() applies. + /// + /// + /// The new compression strategy. + /// + public void SetStrategy(DeflateStrategy strategy) + { + engine.Strategy = strategy; + } + + /// + /// Deflates the current input block to the given array. + /// + /// + /// Buffer to store the compressed data. + /// + /// + /// Offset into the output array. + /// + /// + /// The maximum number of bytes that may be stored. + /// + /// + /// The number of compressed bytes added to the output, or 0 if either + /// needsInput() or finished() returns true or length is zero. + /// + /// + /// If Finish() was previously called. + /// + /// + /// If offset or length don't match the array length. + /// + public int Deflate(byte[] output, int offset, int length) + { + int origLength = length; + + if (state == CLOSED_STATE) + throw new InvalidOperationException("Deflater closed"); + + if (state < BUSY_STATE) + { + // output header + int header = (DEFLATED + + ((DeflaterConstants.MAX_WBITS - 8) << 4)) << 8; + + int level_flags = (level - 1) >> 1; + + if (level_flags < 0 || level_flags > 3) + level_flags = 3; + + header |= level_flags << 6; + + if ((state & IS_SETDICT) != 0) + header |= DeflaterConstants.PRESET_DICT; // Dictionary was set + + header += 31 - (header % 31); + + pending.WriteShortMSB(header); + + if ((state & IS_SETDICT) != 0) + { + int chksum = engine.Adler; + engine.ResetAdler(); + pending.WriteShortMSB(chksum >> 16); + pending.WriteShortMSB(chksum & 0xffff); + } + + state = BUSY_STATE | (state & (IS_FLUSHING | IS_FINISHING)); + } + + for (;;) + { + int count = pending.Flush(output, offset, length); + offset += count; + totalOut += count; + length -= count; + + if (length == 0 || state == FINISHED_STATE) + break; + + if (!engine.Deflate((state & IS_FLUSHING) != 0, (state & IS_FINISHING) != 0)) + { + switch (state) + { + case BUSY_STATE: + // We need more input now + return origLength - length; + + case FLUSHING_STATE: + if (level != NO_COMPRESSION) + { + /* We have to supply some lookahead. 8 bit lookahead + * is needed by the zlib inflater, and we must fill + * the next byte, so that all bits are flushed. + */ + int neededbits = 8 + ((-pending.BitCount) & 7); + while (neededbits > 0) + { + /* write a static tree block consisting solely of + * an EOF: + */ + pending.WriteBits(2, 10); + neededbits -= 10; + } + } + + state = BUSY_STATE; + break; + case FINISHING_STATE: + pending.AlignToByte(); + + // Compressed data is complete. Write footer information if required. + if (!noZlibHeaderOrFooter) + { + int adler = engine.Adler; + pending.WriteShortMSB(adler >> 16); + pending.WriteShortMSB(adler & 0xffff); + } + + state = FINISHED_STATE; + break; + } + } + } + return origLength - length; + } + + /// + /// Sets the dictionary which should be used in the deflate process. + /// The dictionary is a byte array containing strings that are + /// likely to occur in the data which should be compressed. The + /// dictionary is not stored in the compressed output, only a + /// checksum. To decompress the output you need to supply the same + /// dictionary again. + /// + /// + /// The dictionary data + /// + /// + /// The index where dictionary information commences. + /// + /// + /// The number of bytes in the dictionary. + /// + /// + /// If SetInput () or Deflate() were already called or another dictionary was already set. + /// + public void SetDictionary(byte[] dictionary, int index, int count) + { + if (state != INIT_STATE) + throw new InvalidOperationException(); + + state = SETDICT_STATE; + engine.SetDictionary(dictionary, index, count); + } + + #region Instance Fields + /// + /// Compression level. + /// + int level; + + /// + /// If true no Zlib/RFC1950 headers or footers are generated + /// + bool noZlibHeaderOrFooter; + + /// + /// The current state. + /// + int state; + + /// + /// The total bytes of output written. + /// + long totalOut; + + /// + /// The pending output. + /// + DeflaterPending pending; + + /// + /// The deflater engine. + /// + DeflaterEngine engine; + #endregion + } +} diff --git a/UpdateLib/UpdateLib/Compression/Deflaters/DeflaterConstants.cs b/UpdateLib/UpdateLib/Compression/Deflaters/DeflaterConstants.cs new file mode 100644 index 0000000..965c189 --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/Deflaters/DeflaterConstants.cs @@ -0,0 +1,181 @@ +/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +/* Copyright © 2000-2016 SharpZipLib Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +using System; + +namespace MatthiWare.UpdateLib.Compression.Deflaters +{ + /// + /// This class contains constants used for deflation. + /// + public static class DeflaterConstants + { + /// + /// Set to true to enable debugging + /// + public const bool DEBUGGING = false; + + /// + /// Written to Zip file to identify a stored block + /// + public const int STORED_BLOCK = 0; + + /// + /// Identifies static tree in Zip file + /// + public const int STATIC_TREES = 1; + + /// + /// Identifies dynamic tree in Zip file + /// + public const int DYN_TREES = 2; + + /// + /// Header flag indicating a preset dictionary for deflation + /// + public const int PRESET_DICT = 0x20; + + /// + /// Sets internal buffer sizes for Huffman encoding + /// + public const int DEFAULT_MEM_LEVEL = 8; + + /// + /// Internal compression engine constant + /// + public const int MAX_MATCH = 258; + + /// + /// Internal compression engine constant + /// + public const int MIN_MATCH = 3; + + /// + /// Internal compression engine constant + /// + public const int MAX_WBITS = 15; + + /// + /// Internal compression engine constant + /// + public const int WSIZE = 1 << MAX_WBITS; + + /// + /// Internal compression engine constant + /// + public const int WMASK = WSIZE - 1; + + /// + /// Internal compression engine constant + /// + public const int HASH_BITS = DEFAULT_MEM_LEVEL + 7; + + /// + /// Internal compression engine constant + /// + public const int HASH_SIZE = 1 << HASH_BITS; + + /// + /// Internal compression engine constant + /// + public const int HASH_MASK = HASH_SIZE - 1; + + /// + /// Internal compression engine constant + /// + public const int HASH_SHIFT = (HASH_BITS + MIN_MATCH - 1) / MIN_MATCH; + + /// + /// Internal compression engine constant + /// + public const int MIN_LOOKAHEAD = MAX_MATCH + MIN_MATCH + 1; + + /// + /// Internal compression engine constant + /// + public const int MAX_DIST = WSIZE - MIN_LOOKAHEAD; + + /// + /// Internal compression engine constant + /// + public const int PENDING_BUF_SIZE = 1 << (DEFAULT_MEM_LEVEL + 8); + + /// + /// Internal compression engine constant + /// + public static int MAX_BLOCK_SIZE = Math.Min(65535, PENDING_BUF_SIZE - 5); + + /// + /// Internal compression engine constant + /// + public const int DEFLATE_STORED = 0; + + /// + /// Internal compression engine constant + /// + public const int DEFLATE_FAST = 1; + + /// + /// Internal compression engine constant + /// + public const int DEFLATE_SLOW = 2; + + /// + /// Internal compression engine constant + /// + public static int[] GOOD_LENGTH = { 0, 4, 4, 4, 4, 8, 8, 8, 32, 32 }; + + /// + /// Internal compression engine constant + /// + public static int[] MAX_LAZY = { 0, 4, 5, 6, 4, 16, 16, 32, 128, 258 }; + + /// + /// Internal compression engine constant + /// + public static int[] NICE_LENGTH = { 0, 8, 16, 32, 16, 32, 128, 128, 258, 258 }; + + /// + /// Internal compression engine constant + /// + public static int[] MAX_CHAIN = { 0, 4, 8, 32, 16, 32, 128, 256, 1024, 4096 }; + + /// + /// Internal compression engine constant + /// + public static int[] COMPR_FUNC = { 0, 1, 1, 1, 1, 2, 2, 2, 2, 2 }; + + } +} diff --git a/UpdateLib/UpdateLib/Compression/Deflaters/DeflaterEngine.cs b/UpdateLib/UpdateLib/Compression/Deflaters/DeflaterEngine.cs new file mode 100644 index 0000000..63f5010 --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/Deflaters/DeflaterEngine.cs @@ -0,0 +1,850 @@ +/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +/* Copyright © 2000-2016 SharpZipLib Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +using MatthiWare.UpdateLib.Compression.Checksum; +using System; + +namespace MatthiWare.UpdateLib.Compression.Deflaters +{ + /// + /// Strategies for deflater + /// + public enum DeflateStrategy + { + /// + /// The default strategy + /// + Default = 0, + + /// + /// This strategy will only allow longer string repetitions. It is + /// useful for random data with a small character set. + /// + Filtered = 1, + + + /// + /// This strategy will not look for string repetitions at all. It + /// only encodes with Huffman trees (which means, that more common + /// characters get a smaller encoding. + /// + HuffmanOnly = 2 + } + + // DEFLATE ALGORITHM: + // + // The uncompressed stream is inserted into the window array. When + // the window array is full the first half is thrown away and the + // second half is copied to the beginning. + // + // The head array is a hash table. Three characters build a hash value + // and they the value points to the corresponding index in window of + // the last string with this hash. The prev array implements a + // linked list of matches with the same hash: prev[index & WMASK] points + // to the previous index with the same hash. + // + + + /// + /// Low level compression engine for deflate algorithm which uses a 32K sliding window + /// with secondary compression from Huffman/Shannon-Fano codes. + /// + public class DeflaterEngine + { + #region Constants + const int TooFar = 4096; + #endregion + + #region Constructors + /// + /// Construct instance with pending buffer + /// + /// + /// Pending buffer to use + /// > + public DeflaterEngine(DeflaterPending pending) + { + this.pending = pending; + huffman = new DeflaterHuffman(pending); + checksum = new Adler32(); + + window = new byte[2 * DeflaterConstants.WSIZE]; + head = new short[DeflaterConstants.HASH_SIZE]; + prev = new short[DeflaterConstants.WSIZE]; + + // We start at index 1, to avoid an implementation deficiency, that + // we cannot build a repeat pattern at index 0. + blockStart = strstart = 1; + } + + #endregion + + /// + /// Deflate drives actual compression of data + /// + /// True to flush input buffers + /// Finish deflation with the current input. + /// Returns true if progress has been made. + public bool Deflate(bool flush, bool finish) + { + bool progress; + do + { + FillWindow(); + bool canFlush = flush && (inputOff == inputEnd); + + switch (compressionFunction) + { + case DeflaterConstants.DEFLATE_STORED: + progress = DeflateStored(canFlush, finish); + break; + case DeflaterConstants.DEFLATE_FAST: + progress = DeflateFast(canFlush, finish); + break; + case DeflaterConstants.DEFLATE_SLOW: + progress = DeflateSlow(canFlush, finish); + break; + default: + throw new InvalidOperationException("unknown compressionFunction"); + } + } while (pending.IsFlushed && progress); // repeat while we have no pending output and progress was made + return progress; + } + + /// + /// Sets input data to be deflated. Should only be called when NeedsInput() + /// returns true + /// + /// The buffer containing input data. + /// The offset of the first byte of data. + /// The number of bytes of data to use as input. + public void SetInput(byte[] buffer, int offset, int count) + { + if (buffer == null) + throw new ArgumentNullException(nameof(buffer)); + + if (offset < 0) + throw new ArgumentOutOfRangeException(nameof(offset)); + + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + if (inputOff < inputEnd) + throw new InvalidOperationException("Old input was not completely processed"); + + int end = offset + count; + + /* We want to throw an ArrayIndexOutOfBoundsException early. The + * check is very tricky: it also handles integer wrap around. + */ + if ((offset > end) || (end > buffer.Length)) + throw new ArgumentOutOfRangeException(nameof(count)); + + inputBuf = buffer; + inputOff = offset; + inputEnd = end; + } + + /// + /// Determines if more input is needed. + /// + /// Return true if input is needed via SetInput + public bool NeedsInput() => (inputEnd == inputOff); + + /// + /// Set compression dictionary + /// + /// The buffer containing the dictionary data + /// The offset in the buffer for the first byte of data + /// The length of the dictionary data. + public void SetDictionary(byte[] buffer, int offset, int length) + { + checksum.Update(buffer, offset, length); + if (length < DeflaterConstants.MIN_MATCH) + return; + + if (length > DeflaterConstants.MAX_DIST) + { + offset += length - DeflaterConstants.MAX_DIST; + length = DeflaterConstants.MAX_DIST; + } + + Array.Copy(buffer, offset, window, strstart, length); + + UpdateHash(); + --length; + + while (--length > 0) + { + InsertString(); + strstart++; + } + + strstart += 2; + blockStart = strstart; + } + + /// + /// Reset internal state + /// + public void Reset() + { + huffman.Reset(); + checksum.Reset(); + blockStart = strstart = 1; + lookahead = 0; + totalIn = 0; + prevAvailable = false; + matchLen = DeflaterConstants.MIN_MATCH - 1; + + for (int i = 0; i < DeflaterConstants.HASH_SIZE; i++) + head[i] = 0; + + for (int i = 0; i < DeflaterConstants.WSIZE; i++) + prev[i] = 0; + } + + /// + /// Reset Adler checksum + /// + public void ResetAdler() => checksum.Reset(); + + /// + /// Get current value of Adler checksum + /// + public int Adler + { + get + { + return unchecked((int)checksum.Value); + } + } + + /// + /// Total data processed + /// + public long TotalIn + { + get + { + return totalIn; + } + } + + /// + /// Get/set the deflate strategy + /// + public DeflateStrategy Strategy + { + get + { + return strategy; + } + set + { + strategy = value; + } + } + + /// + /// Set the deflate level (0-9) + /// + /// The value to set the level to. + public void SetLevel(int level) + { + if ((level < 0) || (level > 9)) + throw new ArgumentOutOfRangeException(nameof(level)); + + goodLength = DeflaterConstants.GOOD_LENGTH[level]; + max_lazy = DeflaterConstants.MAX_LAZY[level]; + niceLength = DeflaterConstants.NICE_LENGTH[level]; + max_chain = DeflaterConstants.MAX_CHAIN[level]; + + if (DeflaterConstants.COMPR_FUNC[level] != compressionFunction) + { + switch (compressionFunction) + { + case DeflaterConstants.DEFLATE_STORED: + if (strstart > blockStart) + { + huffman.FlushStoredBlock(window, blockStart, + strstart - blockStart, false); + blockStart = strstart; + } + + UpdateHash(); + break; + + case DeflaterConstants.DEFLATE_FAST: + if (strstart > blockStart) + { + huffman.FlushBlock(window, blockStart, strstart - blockStart, + false); + blockStart = strstart; + } + break; + + case DeflaterConstants.DEFLATE_SLOW: + if (prevAvailable) + huffman.TallyLit(window[strstart - 1] & 0xff); + + if (strstart > blockStart) + { + huffman.FlushBlock(window, blockStart, strstart - blockStart, false); + blockStart = strstart; + } + + prevAvailable = false; + matchLen = DeflaterConstants.MIN_MATCH - 1; + break; + } + + compressionFunction = DeflaterConstants.COMPR_FUNC[level]; + } + } + + /// + /// Fill the window + /// + public void FillWindow() + { + /* If the window is almost full and there is insufficient lookahead, + * move the upper half to the lower one to make room in the upper half. + */ + if (strstart >= DeflaterConstants.WSIZE + DeflaterConstants.MAX_DIST) + SlideWindow(); + + /* If there is not enough lookahead, but still some input left, + * read in the input + */ + if (lookahead < DeflaterConstants.MIN_LOOKAHEAD && inputOff < inputEnd) + { + int more = 2 * DeflaterConstants.WSIZE - lookahead - strstart; + + if (more > inputEnd - inputOff) + more = inputEnd - inputOff; + + Array.Copy(inputBuf, inputOff, window, strstart + lookahead, more); + checksum.Update(inputBuf, inputOff, more); + + inputOff += more; + totalIn += more; + lookahead += more; + } + + if (lookahead >= DeflaterConstants.MIN_MATCH) + UpdateHash(); + } + + void UpdateHash() + { + /* + if (DEBUGGING) { + Console.WriteLine("updateHash: "+strstart); + } + */ + ins_h = (window[strstart] << DeflaterConstants.HASH_SHIFT) ^ window[strstart + 1]; + } + + /// + /// Inserts the current string in the head hash and returns the previous + /// value for this hash. + /// + /// The previous hash value + int InsertString() + { + short match; + int hash = ((ins_h << DeflaterConstants.HASH_SHIFT) ^ window[strstart + (DeflaterConstants.MIN_MATCH - 1)]) & DeflaterConstants.HASH_MASK; + + prev[strstart & DeflaterConstants.WMASK] = match = head[hash]; + head[hash] = unchecked((short)strstart); + ins_h = hash; + + return match & 0xffff; + } + + void SlideWindow() + { + Array.Copy(window, DeflaterConstants.WSIZE, window, 0, DeflaterConstants.WSIZE); + matchStart -= DeflaterConstants.WSIZE; + strstart -= DeflaterConstants.WSIZE; + blockStart -= DeflaterConstants.WSIZE; + + // Slide the hash table (could be avoided with 32 bit values + // at the expense of memory usage). + for (int i = 0; i < DeflaterConstants.HASH_SIZE; ++i) + { + int m = head[i] & 0xffff; + head[i] = (short)(m >= DeflaterConstants.WSIZE ? (m - DeflaterConstants.WSIZE) : 0); + } + + // Slide the prev table. + for (int i = 0; i < DeflaterConstants.WSIZE; i++) + { + int m = prev[i] & 0xffff; + prev[i] = (short)(m >= DeflaterConstants.WSIZE ? (m - DeflaterConstants.WSIZE) : 0); + } + } + + /// + /// Find the best (longest) string in the window matching the + /// string starting at strstart. + /// + /// Preconditions: + /// + /// strstart + DeflaterConstants.MAX_MATCH <= window.length. + /// + /// + /// True if a match greater than the minimum length is found + bool FindLongestMatch(int curMatch) + { + int match; + int scan = strstart; + // scanMax is the highest position that we can look at + int scanMax = scan + Math.Min(DeflaterConstants.MAX_MATCH, lookahead) - 1; + int limit = Math.Max(scan - DeflaterConstants.MAX_DIST, 0); + + byte[] window = this.window; + short[] prev = this.prev; + int chainLength = this.max_chain; + int niceLength = Math.Min(this.niceLength, lookahead); + + matchLen = Math.Max(matchLen, DeflaterConstants.MIN_MATCH - 1); + + if (scan + matchLen > scanMax) return false; + + byte scan_end1 = window[scan + matchLen - 1]; + byte scan_end = window[scan + matchLen]; + + // Do not waste too much time if we already have a good match: + if (matchLen >= this.goodLength) chainLength >>= 2; + + do + { + match = curMatch; + scan = strstart; + + if (window[match + matchLen] != scan_end + || window[match + matchLen - 1] != scan_end1 + || window[match] != window[scan] + || window[++match] != window[++scan]) + continue; + + // scan is set to strstart+1 and the comparison passed, so + // scanMax - scan is the maximum number of bytes we can compare. + // below we compare 8 bytes at a time, so first we compare + // (scanMax - scan) % 8 bytes, so the remainder is a multiple of 8 + + switch ((scanMax - scan) % 8) + { + case 1: + if (window[++scan] == window[++match]) break; + break; + case 2: + if (window[++scan] == window[++match] + && window[++scan] == window[++match]) break; + break; + case 3: + if (window[++scan] == window[++match] + && window[++scan] == window[++match] + && window[++scan] == window[++match]) break; + break; + case 4: + if (window[++scan] == window[++match] + && window[++scan] == window[++match] + && window[++scan] == window[++match] + && window[++scan] == window[++match]) break; + break; + case 5: + if (window[++scan] == window[++match] + && window[++scan] == window[++match] + && window[++scan] == window[++match] + && window[++scan] == window[++match] + && window[++scan] == window[++match]) break; + break; + case 6: + if (window[++scan] == window[++match] + && window[++scan] == window[++match] + && window[++scan] == window[++match] + && window[++scan] == window[++match] + && window[++scan] == window[++match] + && window[++scan] == window[++match]) break; + break; + case 7: + if (window[++scan] == window[++match] + && window[++scan] == window[++match] + && window[++scan] == window[++match] + && window[++scan] == window[++match] + && window[++scan] == window[++match] + && window[++scan] == window[++match] + && window[++scan] == window[++match]) break; + break; + } + + if (window[scan] == window[match]) + { + /* We check for insufficient lookahead only every 8th comparison; + * the 256th check will be made at strstart + 258 unless lookahead is + * exhausted first. + */ + do + { + if (scan == scanMax) + { + ++scan; // advance to first position not matched + ++match; + + break; + } + } + while (window[++scan] == window[++match] + && window[++scan] == window[++match] + && window[++scan] == window[++match] + && window[++scan] == window[++match] + && window[++scan] == window[++match] + && window[++scan] == window[++match] + && window[++scan] == window[++match] + && window[++scan] == window[++match]); + } + + if (scan - strstart > matchLen) + { + matchStart = curMatch; + matchLen = scan - strstart; + + if (matchLen >= niceLength) + break; + + scan_end1 = window[scan - 1]; + scan_end = window[scan]; + } + } while ((curMatch = (prev[curMatch & DeflaterConstants.WMASK] & 0xffff)) > limit && 0 != --chainLength); + + return matchLen >= DeflaterConstants.MIN_MATCH; + } + + bool DeflateStored(bool flush, bool finish) + { + if (!flush && (lookahead == 0)) + return false; + + strstart += lookahead; + lookahead = 0; + + int storedLength = strstart - blockStart; + + if ((storedLength >= DeflaterConstants.MAX_BLOCK_SIZE) || // Block is full + (blockStart < DeflaterConstants.WSIZE && storedLength >= DeflaterConstants.MAX_DIST) || // Block may move out of window + flush) + { + bool lastBlock = finish; + if (storedLength > DeflaterConstants.MAX_BLOCK_SIZE) + { + storedLength = DeflaterConstants.MAX_BLOCK_SIZE; + lastBlock = false; + } + + huffman.FlushStoredBlock(window, blockStart, storedLength, lastBlock); + blockStart += storedLength; + return !lastBlock; + } + + return true; + } + + bool DeflateFast(bool flush, bool finish) + { + if (lookahead < DeflaterConstants.MIN_LOOKAHEAD && !flush) + return false; + + while (lookahead >= DeflaterConstants.MIN_LOOKAHEAD || flush) + { + if (lookahead == 0) + { + // We are flushing everything + huffman.FlushBlock(window, blockStart, strstart - blockStart, finish); + blockStart = strstart; + return false; + } + + if (strstart > 2 * DeflaterConstants.WSIZE - DeflaterConstants.MIN_LOOKAHEAD) + { + /* slide window, as FindLongestMatch needs this. + * This should only happen when flushing and the window + * is almost full. + */ + SlideWindow(); + } + + int hashHead; + if (lookahead >= DeflaterConstants.MIN_MATCH && + (hashHead = InsertString()) != 0 && + strategy != DeflateStrategy.HuffmanOnly && + strstart - hashHead <= DeflaterConstants.MAX_DIST && + FindLongestMatch(hashHead)) + { + // longestMatch sets matchStart and matchLen + + bool full = huffman.TallyDist(strstart - matchStart, matchLen); + + lookahead -= matchLen; + if (matchLen <= max_lazy && lookahead >= DeflaterConstants.MIN_MATCH) + { + while (--matchLen > 0) + { + ++strstart; + InsertString(); + } + + ++strstart; + } + else + { + strstart += matchLen; + + if (lookahead >= DeflaterConstants.MIN_MATCH - 1) + UpdateHash(); + } + matchLen = DeflaterConstants.MIN_MATCH - 1; + + if (!full) + continue; + } + else + { + // No match found + huffman.TallyLit(window[strstart] & 0xff); + + ++strstart; + --lookahead; + } + + if (huffman.IsFull()) + { + bool lastBlock = finish && (lookahead == 0); + + huffman.FlushBlock(window, blockStart, strstart - blockStart, lastBlock); + blockStart = strstart; + + return !lastBlock; + } + } + return true; + } + + bool DeflateSlow(bool flush, bool finish) + { + if (lookahead < DeflaterConstants.MIN_LOOKAHEAD && !flush) + return false; + + while (lookahead >= DeflaterConstants.MIN_LOOKAHEAD || flush) + { + if (lookahead == 0) + { + if (prevAvailable) + huffman.TallyLit(window[strstart - 1] & 0xff); + + prevAvailable = false; + + // We are flushing everything + + huffman.FlushBlock(window, blockStart, strstart - blockStart, + finish); + blockStart = strstart; + return false; + } + + if (strstart >= 2 * DeflaterConstants.WSIZE - DeflaterConstants.MIN_LOOKAHEAD) + { + /* slide window, as FindLongestMatch needs this. + * This should only happen when flushing and the window + * is almost full. + */ + SlideWindow(); + } + + int prevMatch = matchStart; + int prevLen = matchLen; + if (lookahead >= DeflaterConstants.MIN_MATCH) + { + + int hashHead = InsertString(); + + if (strategy != DeflateStrategy.HuffmanOnly && + hashHead != 0 && + strstart - hashHead <= DeflaterConstants.MAX_DIST && + FindLongestMatch(hashHead)) + { + + // longestMatch sets matchStart and matchLen + + // Discard match if too small and too far away + if (matchLen <= 5 && (strategy == DeflateStrategy.Filtered || (matchLen == DeflaterConstants.MIN_MATCH && strstart - matchStart > TooFar))) + matchLen = DeflaterConstants.MIN_MATCH - 1; + } + } + + // previous match was better + if ((prevLen >= DeflaterConstants.MIN_MATCH) && (matchLen <= prevLen)) + { + + huffman.TallyDist(strstart - 1 - prevMatch, prevLen); + prevLen -= 2; + do + { + strstart++; + lookahead--; + if (lookahead >= DeflaterConstants.MIN_MATCH) + InsertString(); + + } while (--prevLen > 0); + + strstart++; + lookahead--; + prevAvailable = false; + matchLen = DeflaterConstants.MIN_MATCH - 1; + } + else + { + if (prevAvailable) + huffman.TallyLit(window[strstart - 1] & 0xff); + + prevAvailable = true; + strstart++; + lookahead--; + } + + if (huffman.IsFull()) + { + int len = strstart - blockStart; + + if (prevAvailable) + len--; + + bool lastBlock = (finish && (lookahead == 0) && !prevAvailable); + huffman.FlushBlock(window, blockStart, len, lastBlock); + blockStart += len; + return !lastBlock; + } + } + return true; + } + + #region Instance Fields + + // Hash index of string to be inserted + int ins_h; + + /// + /// Hashtable, hashing three characters to an index for window, so + /// that window[index]..window[index+2] have this hash code. + /// Note that the array should really be unsigned short, so you need + /// to and the values with 0xffff. + /// + short[] head; + + /// + /// prev[index & WMASK] points to the previous index that has the + /// same hash code as the string starting at index. This way + /// entries with the same hash code are in a linked list. + /// Note that the array should really be unsigned short, so you need + /// to and the values with 0xffff. + /// + short[] prev; + + int matchStart; + // Length of best match + int matchLen; + // Set if previous match exists + bool prevAvailable; + int blockStart; + + /// + /// Points to the current character in the window. + /// + int strstart; + + /// + /// lookahead is the number of characters starting at strstart in + /// window that are valid. + /// So window[strstart] until window[strstart+lookahead-1] are valid + /// characters. + /// + int lookahead; + + /// + /// This array contains the part of the uncompressed stream that + /// is of relevance. The current character is indexed by strstart. + /// + byte[] window; + + DeflateStrategy strategy; + int max_chain, max_lazy, niceLength, goodLength; + + /// + /// The current compression function. + /// + int compressionFunction; + + /// + /// The input data for compression. + /// + byte[] inputBuf; + + /// + /// The total bytes of input read. + /// + long totalIn; + + /// + /// The offset into inputBuf, where input data starts. + /// + int inputOff; + + /// + /// The end offset of the input data. + /// + int inputEnd; + + DeflaterPending pending; + DeflaterHuffman huffman; + + /// + /// The adler checksum + /// + IChecksum checksum; + #endregion + } +} diff --git a/UpdateLib/UpdateLib/Compression/Deflaters/DeflaterHuffman.cs b/UpdateLib/UpdateLib/Compression/Deflaters/DeflaterHuffman.cs new file mode 100644 index 0000000..41d8c2a --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/Deflaters/DeflaterHuffman.cs @@ -0,0 +1,894 @@ +/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +/* Copyright © 2000-2016 SharpZipLib Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +using System; + +namespace MatthiWare.UpdateLib.Compression.Deflaters +{ + /// + /// This is the DeflaterHuffman class. + /// + /// This class is not thread safe. This is inherent in the API, due + /// to the split of Deflate and SetInput. + /// + /// author of the original java version : Jochen Hoenicke + /// + public class DeflaterHuffman + { + const int BUFSIZE = 1 << (DeflaterConstants.DEFAULT_MEM_LEVEL + 6); + const int LITERAL_NUM = 286; + + // Number of distance codes + const int DIST_NUM = 30; + // Number of codes used to transfer bit lengths + const int BITLEN_NUM = 19; + + // repeat previous bit length 3-6 times (2 bits of repeat count) + const int REP_3_6 = 16; + // repeat a zero length 3-10 times (3 bits of repeat count) + const int REP_3_10 = 17; + // repeat a zero length 11-138 times (7 bits of repeat count) + const int REP_11_138 = 18; + + const int EOF_SYMBOL = 256; + + // The lengths of the bit length codes are sent in order of decreasing + // probability, to avoid transmitting the lengths for unused bit length codes. + static readonly int[] BL_ORDER = { 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 }; + + static readonly byte[] bit4Reverse = { + 0, + 8, + 4, + 12, + 2, + 10, + 6, + 14, + 1, + 9, + 5, + 13, + 3, + 11, + 7, + 15 + }; + + static short[] staticLCodes; + static byte[] staticLLength; + static short[] staticDCodes; + static byte[] staticDLength; + + class Tree + { + #region Instance Fields + public short[] freqs; + + public byte[] length; + + public int minNumCodes; + + public int numCodes; + + short[] codes; + readonly int[] bl_counts; + readonly int maxLength; + DeflaterHuffman dh; + #endregion + + #region Constructors + public Tree(DeflaterHuffman dh, int elems, int minCodes, int maxLength) + { + this.dh = dh; + this.minNumCodes = minCodes; + this.maxLength = maxLength; + freqs = new short[elems]; + bl_counts = new int[maxLength]; + } + + #endregion + + /// + /// Resets the internal state of the tree + /// + public void Reset() + { + for (int i = 0; i < freqs.Length; i++) + freqs[i] = 0; + + codes = null; + length = null; + } + + public void WriteSymbol(int code) + { + // if (DeflaterConstants.DEBUGGING) { + // freqs[code]--; + // // Console.Write("writeSymbol("+freqs.length+","+code+"): "); + // } + dh.pending.WriteBits(codes[code] & 0xffff, length[code]); + } + + /// + /// Check that all frequencies are zero + /// + /// + /// At least one frequency is non-zero + /// + public void CheckEmpty() + { + bool empty = true; + for (int i = 0; i < freqs.Length; i++) + empty &= freqs[i] == 0; + + if (!empty) + throw new InvalidOperationException("!Empty"); + } + + /// + /// Set static codes and length + /// + /// new codes + /// length for new codes + public void SetStaticCodes(short[] staticCodes, byte[] staticLengths) + { + codes = staticCodes; + length = staticLengths; + } + + /// + /// Build dynamic codes and lengths + /// + public void BuildCodes() + { + int numSymbols = freqs.Length; + int[] nextCode = new int[maxLength]; + int code = 0; + + codes = new short[freqs.Length]; + + // if (DeflaterConstants.DEBUGGING) { + // //Console.WriteLine("buildCodes: "+freqs.Length); + // } + + for (int bits = 0; bits < maxLength; bits++) + { + nextCode[bits] = code; + code += bl_counts[bits] << (15 - bits); + + // if (DeflaterConstants.DEBUGGING) { + // //Console.WriteLine("bits: " + ( bits + 1) + " count: " + bl_counts[bits] + // +" nextCode: "+code); + // } + } + + for (int i = 0; i < numCodes; i++) + { + int bits = length[i]; + if (bits > 0) + { + + // if (DeflaterConstants.DEBUGGING) { + // //Console.WriteLine("codes["+i+"] = rev(" + nextCode[bits-1]+"), + // +bits); + // } + + codes[i] = BitReverse(nextCode[bits - 1]); + nextCode[bits - 1] += 1 << (16 - bits); + } + } + } + + public void BuildTree() + { + int numSymbols = freqs.Length; + + /* heap is a priority queue, sorted by frequency, least frequent + * nodes first. The heap is a binary tree, with the property, that + * the parent node is smaller than both child nodes. This assures + * that the smallest node is the first parent. + * + * The binary tree is encoded in an array: 0 is root node and + * the nodes 2*n+1, 2*n+2 are the child nodes of node n. + */ + int[] heap = new int[numSymbols]; + int heapLen = 0; + int maxCode = 0; + for (int n = 0; n < numSymbols; n++) + { + int freq = freqs[n]; + if (freq != 0) + { + // Insert n into heap + int pos = heapLen++; + int ppos; + + while (pos > 0 && freqs[heap[ppos = (pos - 1) / 2]] > freq) + { + heap[pos] = heap[ppos]; + pos = ppos; + } + + heap[pos] = n; + + maxCode = n; + } + } + + /* We could encode a single literal with 0 bits but then we + * don't see the literals. Therefore we force at least two + * literals to avoid this case. We don't care about order in + * this case, both literals get a 1 bit code. + */ + while (heapLen < 2) + { + int node = maxCode < 2 ? ++maxCode : 0; + heap[heapLen++] = node; + } + + numCodes = Math.Max(maxCode + 1, minNumCodes); + + int numLeafs = heapLen; + int[] childs = new int[4 * heapLen - 2]; + int[] values = new int[2 * heapLen - 1]; + int numNodes = numLeafs; + + for (int i = 0; i < heapLen; i++) + { + int node = heap[i]; + childs[2 * i] = node; + childs[2 * i + 1] = -1; + values[i] = freqs[node] << 8; + heap[i] = i; + } + + /* Construct the Huffman tree by repeatedly combining the least two + * frequent nodes. + */ + do + { + int first = heap[0]; + int last = heap[--heapLen]; + + // Propagate the hole to the leafs of the heap + int ppos = 0; + int path = 1; + + while (path < heapLen) + { + if (path + 1 < heapLen && values[heap[path]] > values[heap[path + 1]]) + path++; + + heap[ppos] = heap[path]; + ppos = path; + path = path * 2 + 1; + } + + /* Now propagate the last element down along path. Normally + * it shouldn't go too deep. + */ + int lastVal = values[last]; + + while ((path = ppos) > 0 && values[heap[ppos = (path - 1) / 2]] > lastVal) + heap[path] = heap[ppos]; + + heap[path] = last; + + + int second = heap[0]; + + // Create a new node father of first and second + last = numNodes++; + childs[2 * last] = first; + childs[2 * last + 1] = second; + int mindepth = Math.Min(values[first] & 0xff, values[second] & 0xff); + values[last] = lastVal = values[first] + values[second] - mindepth + 1; + + // Again, propagate the hole to the leafs + ppos = 0; + path = 1; + + while (path < heapLen) + { + if (path + 1 < heapLen && values[heap[path]] > values[heap[path + 1]]) + path++; + + heap[ppos] = heap[path]; + ppos = path; + path = ppos * 2 + 1; + } + + // Now propagate the new element down along path + while ((path = ppos) > 0 && values[heap[ppos = (path - 1) / 2]] > lastVal) + heap[path] = heap[ppos]; + + heap[path] = last; + } while (heapLen > 1); + + if (heap[0] != childs.Length / 2 - 1) + throw new AccessViolationException("Heap invariant violated"); + + BuildLength(childs); + } + + /// + /// Get encoded length + /// + /// Encoded length, the sum of frequencies * lengths + public int GetEncodedLength() + { + int len = 0; + + for (int i = 0; i < freqs.Length; i++) + len += freqs[i] * length[i]; + + return len; + } + + /// + /// Scan a literal or distance tree to determine the frequencies of the codes + /// in the bit length tree. + /// + public void CalcBLFreq(Tree blTree) + { + int max_count; /* max repeat count */ + int min_count; /* min repeat count */ + int count; /* repeat count of the current code */ + int curlen = -1; /* length of current code */ + + int i = 0; + while (i < numCodes) + { + count = 1; + int nextlen = length[i]; + + if (nextlen == 0) + { + max_count = 138; + min_count = 3; + } + else + { + max_count = 6; + min_count = 3; + if (curlen != nextlen) + { + blTree.freqs[nextlen]++; + count = 0; + } + } + + curlen = nextlen; + i++; + + while (i < numCodes && curlen == length[i]) + { + i++; + if (++count >= max_count) + break; + } + + if (count < min_count) + blTree.freqs[curlen] += (short)count; + else if (curlen != 0) + blTree.freqs[REP_3_6]++; + else if (count <= 10) + blTree.freqs[REP_3_10]++; + else + blTree.freqs[REP_11_138]++; + } + } + + /// + /// Write tree values + /// + /// Tree to write + public void WriteTree(Tree blTree) + { + int max_count; // max repeat count + int min_count; // min repeat count + int count; // repeat count of the current code + int curlen = -1; // length of current code + + int i = 0; + while (i < numCodes) + { + count = 1; + int nextlen = length[i]; + + if (nextlen == 0) + { + max_count = 138; + min_count = 3; + } + else + { + max_count = 6; + min_count = 3; + if (curlen != nextlen) + { + blTree.WriteSymbol(nextlen); + count = 0; + } + } + + curlen = nextlen; + i++; + + while (i < numCodes && curlen == length[i]) + { + i++; + if (++count >= max_count) + break; + } + + if (count < min_count) + { + while (count-- > 0) + blTree.WriteSymbol(curlen); + } + else if (curlen != 0) + { + blTree.WriteSymbol(REP_3_6); + dh.pending.WriteBits(count - 3, 2); + } + else if (count <= 10) + { + blTree.WriteSymbol(REP_3_10); + dh.pending.WriteBits(count - 3, 3); + } + else + { + blTree.WriteSymbol(REP_11_138); + dh.pending.WriteBits(count - 11, 7); + } + } + } + + void BuildLength(int[] childs) + { + length = new byte[freqs.Length]; + int numNodes = childs.Length / 2; + int numLeafs = (numNodes + 1) / 2; + int overflow = 0; + + for (int i = 0; i < maxLength; i++) + bl_counts[i] = 0; + + // First calculate optimal bit lengths + int[] lengths = new int[numNodes]; + lengths[numNodes - 1] = 0; + + for (int i = numNodes - 1; i >= 0; i--) + { + if (childs[2 * i + 1] != -1) + { + int bitLength = lengths[i] + 1; + + if (bitLength > maxLength) + { + bitLength = maxLength; + overflow++; + } + + lengths[childs[2 * i]] = lengths[childs[2 * i + 1]] = bitLength; + } + else + { + // A leaf node + int bitLength = lengths[i]; + bl_counts[bitLength - 1]++; + length[childs[2 * i]] = (byte)lengths[i]; + } + } + + if (overflow == 0) + return; + + int incrBitLen = maxLength - 1; + do + { + // Find the first bit length which could increase: + while (bl_counts[--incrBitLen] == 0) ; + + // Move this node one down and remove a corresponding + // number of overflow nodes. + do + { + bl_counts[incrBitLen]--; + bl_counts[++incrBitLen]++; + overflow -= 1 << (maxLength - 1 - incrBitLen); + } while (overflow > 0 && incrBitLen < maxLength - 1); + } while (overflow > 0); + + /* We may have overshot above. Move some nodes from maxLength to + * maxLength-1 in that case. + */ + bl_counts[maxLength - 1] += overflow; + bl_counts[maxLength - 2] -= overflow; + + /* Now recompute all bit lengths, scanning in increasing + * frequency. It is simpler to reconstruct all lengths instead of + * fixing only the wrong ones. This idea is taken from 'ar' + * written by Haruhiko Okumura. + * + * The nodes were inserted with decreasing frequency into the childs + * array. + */ + int nodePtr = 2 * numLeafs; + for (int bits = maxLength; bits != 0; bits--) + { + int n = bl_counts[bits - 1]; + while (n > 0) + { + int childPtr = 2 * childs[nodePtr++]; + if (childs[childPtr + 1] == -1) + { + // We found another leaf + length[childs[childPtr]] = (byte)bits; + n--; + } + } + } + // if (DeflaterConstants.DEBUGGING) { + // //Console.WriteLine("*** After overflow elimination. ***"); + // for (int i=0; i < numLeafs; i++) { + // //Console.WriteLine("Node "+childs[2*i]+" freq: "+freqs[childs[2*i]] + // + " len: "+length[childs[2*i]]); + // } + // } + } + + } + + #region Instance Fields + /// + /// Pending buffer to use + /// + public DeflaterPending pending; + + Tree literalTree; + Tree distTree; + Tree blTree; + + // Buffer for distances + short[] d_buf; + byte[] l_buf; + int last_lit; + int extra_bits; + #endregion + + static DeflaterHuffman() + { + // See RFC 1951 3.2.6 + // Literal codes + staticLCodes = new short[LITERAL_NUM]; + staticLLength = new byte[LITERAL_NUM]; + + int i = 0; + while (i < 144) + { + staticLCodes[i] = BitReverse((0x030 + i) << 8); + staticLLength[i++] = 8; + } + + while (i < 256) + { + staticLCodes[i] = BitReverse((0x190 - 144 + i) << 7); + staticLLength[i++] = 9; + } + + while (i < 280) + { + staticLCodes[i] = BitReverse((0x000 - 256 + i) << 9); + staticLLength[i++] = 7; + } + + while (i < LITERAL_NUM) + { + staticLCodes[i] = BitReverse((0x0c0 - 280 + i) << 8); + staticLLength[i++] = 8; + } + + // Distance codes + staticDCodes = new short[DIST_NUM]; + staticDLength = new byte[DIST_NUM]; + + for (i = 0; i < DIST_NUM; i++) + { + staticDCodes[i] = BitReverse(i << 11); + staticDLength[i] = 5; + } + } + + /// + /// Construct instance with pending buffer + /// + /// Pending buffer to use + public DeflaterHuffman(DeflaterPending pending) + { + this.pending = pending; + + literalTree = new Tree(this, LITERAL_NUM, 257, 15); + distTree = new Tree(this, DIST_NUM, 1, 15); + blTree = new Tree(this, BITLEN_NUM, 4, 7); + + d_buf = new short[BUFSIZE]; + l_buf = new byte[BUFSIZE]; + } + + /// + /// Reset internal state + /// + public void Reset() + { + last_lit = 0; + extra_bits = 0; + literalTree.Reset(); + distTree.Reset(); + blTree.Reset(); + } + + /// + /// Write all trees to pending buffer + /// + /// The number/rank of treecodes to send. + public void SendAllTrees(int blTreeCodes) + { + blTree.BuildCodes(); + literalTree.BuildCodes(); + distTree.BuildCodes(); + pending.WriteBits(literalTree.numCodes - 257, 5); + pending.WriteBits(distTree.numCodes - 1, 5); + pending.WriteBits(blTreeCodes - 4, 4); + + for (int rank = 0; rank < blTreeCodes; rank++) + pending.WriteBits(blTree.length[BL_ORDER[rank]], 3); + + literalTree.WriteTree(blTree); + distTree.WriteTree(blTree); + } + + /// + /// Compress current buffer writing data to pending buffer + /// + public void CompressBlock() + { + for (int i = 0; i < last_lit; i++) + { + int litlen = l_buf[i] & 0xff; + int dist = d_buf[i]; + if (dist-- != 0) + { + int lc = Lcode(litlen); + literalTree.WriteSymbol(lc); + + int bits = (lc - 261) / 4; + if (bits > 0 && bits <= 5) + pending.WriteBits(litlen & ((1 << bits) - 1), bits); + + int dc = Dcode(dist); + distTree.WriteSymbol(dc); + + bits = dc / 2 - 1; + if (bits > 0) + pending.WriteBits(dist & ((1 << bits) - 1), bits); + } + else + literalTree.WriteSymbol(litlen); + } + + literalTree.WriteSymbol(EOF_SYMBOL); + } + + /// + /// Flush block to output with no compression + /// + /// Data to write + /// Index of first byte to write + /// Count of bytes to write + /// True if this is the last block + public void FlushStoredBlock(byte[] stored, int storedOffset, int storedLength, bool lastBlock) + { + pending.WriteBits((DeflaterConstants.STORED_BLOCK << 1) + (lastBlock ? 1 : 0), 3); + pending.AlignToByte(); + pending.WriteShort(storedLength); + pending.WriteShort(~storedLength); + pending.WriteBlock(stored, storedOffset, storedLength); + Reset(); + } + + /// + /// Flush block to output with compression + /// + /// Data to flush + /// Index of first byte to flush + /// Count of bytes to flush + /// True if this is the last block + public void FlushBlock(byte[] stored, int storedOffset, int storedLength, bool lastBlock) + { + literalTree.freqs[EOF_SYMBOL]++; + + // Build trees + literalTree.BuildTree(); + distTree.BuildTree(); + + // Calculate bitlen frequency + literalTree.CalcBLFreq(blTree); + distTree.CalcBLFreq(blTree); + + // Build bitlen tree + blTree.BuildTree(); + + int blTreeCodes = 4; + for (int i = 18; i > blTreeCodes; i--) + if (blTree.length[BL_ORDER[i]] > 0) + blTreeCodes = i + 1; + + int opt_len = 14 + blTreeCodes * 3 + blTree.GetEncodedLength() + + literalTree.GetEncodedLength() + distTree.GetEncodedLength() + + extra_bits; + + int static_len = extra_bits; + + for (int i = 0; i < LITERAL_NUM; i++) + static_len += literalTree.freqs[i] * staticLLength[i]; + + for (int i = 0; i < DIST_NUM; i++) + static_len += distTree.freqs[i] * staticDLength[i]; + + if (opt_len >= static_len) + opt_len = static_len;// Force static trees + + if (storedOffset >= 0 && storedLength + 4 < opt_len >> 3) + { + // Store Block + + // if (DeflaterConstants.DEBUGGING) { + // //Console.WriteLine("Storing, since " + storedLength + " < " + opt_len + // + " <= " + static_len); + // } + FlushStoredBlock(stored, storedOffset, storedLength, lastBlock); + } + else if (opt_len == static_len) + { + // Encode with static tree + pending.WriteBits((DeflaterConstants.STATIC_TREES << 1) + (lastBlock ? 1 : 0), 3); + literalTree.SetStaticCodes(staticLCodes, staticLLength); + distTree.SetStaticCodes(staticDCodes, staticDLength); + CompressBlock(); + Reset(); + } + else + { + // Encode with dynamic tree + pending.WriteBits((DeflaterConstants.DYN_TREES << 1) + (lastBlock ? 1 : 0), 3); + SendAllTrees(blTreeCodes); + CompressBlock(); + Reset(); + } + } + + /// + /// Get value indicating if internal buffer is full + /// + /// true if buffer is full + public bool IsFull() => last_lit >= BUFSIZE; + + /// + /// Add literal to buffer + /// + /// Literal value to add to buffer. + /// Value indicating internal buffer is full + public bool TallyLit(int literal) + { + d_buf[last_lit] = 0; + l_buf[last_lit++] = (byte)literal; + literalTree.freqs[literal]++; + return IsFull(); + } + + /// + /// Add distance code and length to literal and distance trees + /// + /// Distance code + /// Length + /// Value indicating if internal buffer is full + public bool TallyDist(int distance, int length) + { + + d_buf[last_lit] = (short)distance; + l_buf[last_lit++] = (byte)(length - 3); + + int lc = Lcode(length - 3); + literalTree.freqs[lc]++; + + if (lc >= 265 && lc < 285) + extra_bits += (lc - 261) / 4; + + int dc = Dcode(distance - 1); + distTree.freqs[dc]++; + + if (dc >= 4) + extra_bits += dc / 2 - 1; + + return IsFull(); + } + + + /// + /// Reverse the bits of a 16 bit value. + /// + /// Value to reverse bits + /// Value with bits reversed + public static short BitReverse(int toReverse) + { + return (short)(bit4Reverse[toReverse & 0xF] << 12 | + bit4Reverse[(toReverse >> 4) & 0xF] << 8 | + bit4Reverse[(toReverse >> 8) & 0xF] << 4 | + bit4Reverse[toReverse >> 12]); + } + + static int Lcode(int length) + { + if (length == 255) + return 285; + + int code = 257; + + while (length >= 8) + { + code += 4; + length >>= 1; + } + + return code + length; + } + + static int Dcode(int distance) + { + int code = 0; + + while (distance >= 4) + { + code += 2; + distance >>= 1; + } + + return code + distance; + } + } +} diff --git a/UpdateLib/UpdateLib/Compression/Deflaters/DeflaterPending.cs b/UpdateLib/UpdateLib/Compression/Deflaters/DeflaterPending.cs new file mode 100644 index 0000000..6376660 --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/Deflaters/DeflaterPending.cs @@ -0,0 +1,53 @@ +/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +/* Copyright © 2000-2016 SharpZipLib Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + + +namespace MatthiWare.UpdateLib.Compression.Deflaters +{ + /// + /// This class stores the pending output of the Deflater. + /// + /// author of the original java version : Jochen Hoenicke + /// + public class DeflaterPending : PendingBuffer + { + /// + /// Construct instance with default buffer size + /// + public DeflaterPending() : base(DeflaterConstants.PENDING_BUF_SIZE) + { + } + } +} diff --git a/UpdateLib/UpdateLib/Compression/Deflaters/Inflater.cs b/UpdateLib/UpdateLib/Compression/Deflaters/Inflater.cs new file mode 100644 index 0000000..df7df7d --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/Deflaters/Inflater.cs @@ -0,0 +1,857 @@ +/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +/* Copyright © 2000-2016 SharpZipLib Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +using MatthiWare.UpdateLib.Compression.Checksum; +using MatthiWare.UpdateLib.Compression.Streams; +using System; + +namespace MatthiWare.UpdateLib.Compression.Deflaters +{ + /// + /// Inflater is used to decompress data that has been compressed according + /// to the "deflate" standard described in rfc1951. + /// + /// By default Zlib (rfc1950) headers and footers are expected in the input. + /// You can use constructor public Inflater(bool noHeader) passing true + /// if there is no Zlib header information + /// + /// The usage is as following. First you have to set some input with + /// SetInput(), then Inflate() it. If inflate doesn't + /// inflate any bytes there may be three reasons: + ///
    + ///
  • IsNeedingInput() returns true because the input buffer is empty. + /// You have to provide more input with SetInput(). + /// NOTE: IsNeedingInput() also returns true when, the stream is finished. + ///
  • + ///
  • IsNeedingDictionary() returns true, you have to provide a preset + /// dictionary with SetDictionary().
  • + ///
  • IsFinished returns true, the inflater has finished.
  • + ///
+ /// Once the first output byte is produced, a dictionary will not be + /// needed at a later stage. + /// + /// author of the original java version : John Leuner, Jochen Hoenicke + ///
+ public class Inflater + { + #region Constants/Readonly + /// + /// Copy lengths for literal codes 257..285 + /// + static readonly int[] CPLENS = { + 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, + 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258 + }; + + /// + /// Extra bits for literal codes 257..285 + /// + static readonly int[] CPLEXT = { + 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, + 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0 + }; + + /// + /// Copy offsets for distance codes 0..29 + /// + static readonly int[] CPDIST = { + 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, + 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, + 8193, 12289, 16385, 24577 + }; + + /// + /// Extra bits for distance codes + /// + static readonly int[] CPDEXT = { + 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, + 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, + 12, 12, 13, 13 + }; + + /// + /// These are the possible states for an inflater + /// + const int DECODE_HEADER = 0; + const int DECODE_DICT = 1; + const int DECODE_BLOCKS = 2; + const int DECODE_STORED_LEN1 = 3; + const int DECODE_STORED_LEN2 = 4; + const int DECODE_STORED = 5; + const int DECODE_DYN_HEADER = 6; + const int DECODE_HUFFMAN = 7; + const int DECODE_HUFFMAN_LENBITS = 8; + const int DECODE_HUFFMAN_DIST = 9; + const int DECODE_HUFFMAN_DISTBITS = 10; + const int DECODE_CHKSUM = 11; + const int FINISHED = 12; + #endregion + + #region Instance Fields + /// + /// This variable contains the current state. + /// + int mode; + + /// + /// The adler checksum of the dictionary or of the decompressed + /// stream, as it is written in the header resp. footer of the + /// compressed stream. + /// Only valid if mode is DECODE_DICT or DECODE_CHKSUM. + /// + int readAdler; + + /// + /// The number of bits needed to complete the current state. This + /// is valid, if mode is DECODE_DICT, DECODE_CHKSUM, + /// DECODE_HUFFMAN_LENBITS or DECODE_HUFFMAN_DISTBITS. + /// + int neededBits; + int repLength; + int repDist; + int uncomprLen; + + /// + /// True, if the last block flag was set in the last block of the + /// inflated stream. This means that the stream ends after the + /// current block. + /// + bool isLastBlock; + + /// + /// The total number of inflated bytes. + /// + long totalOut; + + /// + /// The total number of bytes set with setInput(). This is not the + /// value returned by the TotalIn property, since this also includes the + /// unprocessed input. + /// + long totalIn; + + /// + /// This variable stores the noHeader flag that was given to the constructor. + /// True means, that the inflated stream doesn't contain a Zlib header or + /// footer. + /// + bool noHeader; + readonly StreamManipulator input; + OutputWindow outputWindow; + InflaterDynHeader dynHeader; + InflaterHuffmanTree litlenTree, distTree; + IChecksum checksum; + #endregion + + #region Constructors + /// + /// Creates a new inflater or RFC1951 decompressor + /// RFC1950/Zlib headers and footers will be expected in the input data + /// + public Inflater() : this(false) + { + } + + /// + /// Creates a new inflater. + /// + /// + /// True if no RFC1950/Zlib header and footer fields are expected in the input data + /// + /// This is used for GZIPed/Zipped input. + /// + /// For compatibility with + /// Sun JDK you should provide one byte of input more than needed in + /// this case. + /// + public Inflater(bool NoHeader) + { + noHeader = NoHeader; + checksum = new Adler32(); + input = new StreamManipulator(); + outputWindow = new OutputWindow(); + mode = NoHeader ? DECODE_BLOCKS : DECODE_HEADER; + } + #endregion + + /// + /// Resets the inflater so that a new stream can be decompressed. All + /// pending input and output will be discarded. + /// + public void Reset() + { + mode = noHeader ? DECODE_BLOCKS : DECODE_HEADER; + totalIn = 0; + totalOut = 0; + input.Reset(); + outputWindow.Reset(); + dynHeader = null; + litlenTree = null; + distTree = null; + isLastBlock = false; + checksum.Reset(); + } + + /// + /// Decodes a zlib/RFC1950 header. + /// + /// + /// False if more input is needed. + /// + /// + /// The header is invalid. + /// + private bool DecodeHeader() + { + int header = input.PeekBits(16); + + if (header < 0) + return false; + + input.DropBits(16); + + // The header is written in "wrong" byte order + header = ((header << 8) | (header >> 8)) & 0xffff; + if (header % 31 != 0) + throw new NotSupportedException("Header checksum invalid"); + + if ((header & 0x0f00) != (Deflater.DEFLATED << 8)) + throw new NotSupportedException("Compression Method unknown"); + + /* Maximum size of the backwards window in bits. + * We currently ignore this, but we could use it to make the + * inflater window more space efficient. On the other hand the + * full window (15 bits) is needed most times, anyway. + int max_wbits = ((header & 0x7000) >> 12) + 8; + */ + + if ((header & 0x0020) == 0) + mode = DECODE_BLOCKS; // Dictionary flag? + else + { + mode = DECODE_DICT; + neededBits = 32; + } + return true; + } + + /// + /// Decodes the dictionary checksum after the deflate header. + /// + /// + /// False if more input is needed. + /// + private bool DecodeDict() + { + while (neededBits > 0) + { + int dictByte = input.PeekBits(8); + + if (dictByte < 0) + return false; + + input.DropBits(8); + readAdler = (readAdler << 8) | dictByte; + neededBits -= 8; + } + + return false; + } + + /// + /// Decodes the huffman encoded symbols in the input stream. + /// + /// + /// false if more input is needed, true if output window is + /// full or the current block ends. + /// + /// + /// if deflated stream is invalid. + /// + private bool DecodeHuffman() + { + int free = outputWindow.GetFreeSpace(); + while (free >= 258) + { + int symbol; + switch (mode) + { + case DECODE_HUFFMAN: + // This is the inner loop so it is optimized a bit + while (((symbol = litlenTree.GetSymbol(input)) & ~0xff) == 0) + { + outputWindow.Write(symbol); + + if (--free < 258) + return true; + } + + if (symbol < 257) + { + if (symbol < 0) + return false; + else + { + // symbol == 256: end of block + distTree = null; + litlenTree = null; + mode = DECODE_BLOCKS; + return true; + } + } + + try + { + repLength = CPLENS[symbol - 257]; + neededBits = CPLEXT[symbol - 257]; + } + catch (Exception e) + { + throw new Exception("Illegal rep length code", e); + } + goto case DECODE_HUFFMAN_LENBITS; // fall through + + case DECODE_HUFFMAN_LENBITS: + if (neededBits > 0) + { + mode = DECODE_HUFFMAN_LENBITS; + int i = input.PeekBits(neededBits); + + if (i < 0) + return false; + + input.DropBits(neededBits); + repLength += i; + } + + mode = DECODE_HUFFMAN_DIST; + goto case DECODE_HUFFMAN_DIST; // fall through + + case DECODE_HUFFMAN_DIST: + symbol = distTree.GetSymbol(input); + if (symbol < 0) + return false; + + try + { + repDist = CPDIST[symbol]; + neededBits = CPDEXT[symbol]; + } + catch (Exception e) + { + throw new Exception("Illegal rep dist code", e); + } + + goto case DECODE_HUFFMAN_DISTBITS; // fall through + + case DECODE_HUFFMAN_DISTBITS: + if (neededBits > 0) + { + mode = DECODE_HUFFMAN_DISTBITS; + int i = input.PeekBits(neededBits); + if (i < 0) + return false; + + input.DropBits(neededBits); + repDist += i; + } + + outputWindow.Repeat(repLength, repDist); + free -= repLength; + mode = DECODE_HUFFMAN; + break; + + default: + throw new NotSupportedException("Inflater unknown mode"); + } + } + return true; + } + + /// + /// Decodes the adler checksum after the deflate stream. + /// + /// + /// false if more input is needed. + /// + /// + /// If checksum doesn't match. + /// + private bool DecodeChksum() + { + while (neededBits > 0) + { + int chkByte = input.PeekBits(8); + if (chkByte < 0) + return false; + + input.DropBits(8); + readAdler = (readAdler << 8) | chkByte; + neededBits -= 8; + } + + if ((int)checksum.Value != readAdler) + throw new Exception("Adler chksum doesn't match: " + (int)checksum.Value + " vs. " + readAdler); + + mode = FINISHED; + return false; + } + + /// + /// Decodes the deflated stream. + /// + /// + /// false if more input is needed, or if finished. + /// + /// + /// if deflated stream is invalid. + /// + private bool Decode() + { + switch (mode) + { + case DECODE_HEADER: + return DecodeHeader(); + + case DECODE_DICT: + return DecodeDict(); + + case DECODE_CHKSUM: + return DecodeChksum(); + + case DECODE_BLOCKS: + if (isLastBlock) + { + if (noHeader) + { + mode = FINISHED; + return false; + } + else + { + input.SkipToByteBoundary(); + neededBits = 32; + mode = DECODE_CHKSUM; + return true; + } + } + + int type = input.PeekBits(3); + if (type < 0) + return false; + + input.DropBits(3); + + isLastBlock |= (type & 1) != 0; + switch (type >> 1) + { + case DeflaterConstants.STORED_BLOCK: + input.SkipToByteBoundary(); + mode = DECODE_STORED_LEN1; + break; + case DeflaterConstants.STATIC_TREES: + litlenTree = InflaterHuffmanTree.defLitLenTree; + distTree = InflaterHuffmanTree.defDistTree; + mode = DECODE_HUFFMAN; + break; + case DeflaterConstants.DYN_TREES: + dynHeader = new InflaterDynHeader(); + mode = DECODE_DYN_HEADER; + break; + default: + throw new NotSupportedException("Unknown block type " + type); + } + return true; + + case DECODE_STORED_LEN1: + { + if ((uncomprLen = input.PeekBits(16)) < 0) + return false; + + input.DropBits(16); + mode = DECODE_STORED_LEN2; + } + goto case DECODE_STORED_LEN2; // fall through + + case DECODE_STORED_LEN2: + { + int nlen = input.PeekBits(16); + if (nlen < 0) + return false; + + input.DropBits(16); + if (nlen != (uncomprLen ^ 0xffff)) + throw new FormatException("broken uncompressed block"); + + mode = DECODE_STORED; + } + goto case DECODE_STORED; // fall through + + case DECODE_STORED: + { + int more = outputWindow.CopyStored(input, uncomprLen); + uncomprLen -= more; + if (uncomprLen == 0) + { + mode = DECODE_BLOCKS; + return true; + } + return !input.IsNeedingInput; + } + + case DECODE_DYN_HEADER: + if (!dynHeader.Decode(input)) + return false; + + litlenTree = dynHeader.BuildLitLenTree(); + distTree = dynHeader.BuildDistTree(); + mode = DECODE_HUFFMAN; + goto case DECODE_HUFFMAN; // fall through + + case DECODE_HUFFMAN: + case DECODE_HUFFMAN_LENBITS: + case DECODE_HUFFMAN_DIST: + case DECODE_HUFFMAN_DISTBITS: + return DecodeHuffman(); + + case FINISHED: + return false; + + default: + throw new NotSupportedException("Inflater.Decode unknown mode"); + } + } + + /// + /// Sets the preset dictionary. This should only be called, if + /// needsDictionary() returns true and it should set the same + /// dictionary, that was used for deflating. The getAdler() + /// function returns the checksum of the dictionary needed. + /// + /// + /// The dictionary. + /// + public void SetDictionary(byte[] buffer) => SetDictionary(buffer, 0, buffer.Length); + + /// + /// Sets the preset dictionary. This should only be called, if + /// needsDictionary() returns true and it should set the same + /// dictionary, that was used for deflating. The getAdler() + /// function returns the checksum of the dictionary needed. + /// + /// + /// The dictionary. + /// + /// + /// The index into buffer where the dictionary starts. + /// + /// + /// The number of bytes in the dictionary. + /// + /// + /// No dictionary is needed. + /// + /// + /// The adler checksum for the buffer is invalid + /// + public void SetDictionary(byte[] buffer, int index, int count) + { + if (buffer == null) + throw new ArgumentNullException(nameof(buffer)); + + if (index < 0) + throw new ArgumentOutOfRangeException(nameof(index)); + + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + if (!IsNeedingDictionary) + throw new InvalidOperationException("Dictionary is not needed"); + + checksum.Update(buffer, index, count); + + if ((int)checksum.Value != readAdler) + throw new InvalidOperationException("Wrong checksum"); + + checksum.Reset(); + outputWindow.CopyDict(buffer, index, count); + mode = DECODE_BLOCKS; + } + + /// + /// Sets the input. This should only be called, if needsInput() + /// returns true. + /// + /// + /// the input. + /// + public void SetInput(byte[] buffer) + { + SetInput(buffer, 0, buffer.Length); + } + + /// + /// Sets the input. This should only be called, if needsInput() + /// returns true. + /// + /// + /// The source of input data + /// + /// + /// The index into buffer where the input starts. + /// + /// + /// The number of bytes of input to use. + /// + /// + /// No input is needed. + /// + /// + /// The index and/or count are wrong. + /// + public void SetInput(byte[] buffer, int index, int count) + { + input.SetInput(buffer, index, count); + totalIn += count; + } + + /// + /// Inflates the compressed stream to the output buffer. If this + /// returns 0, you should check, whether IsNeedingDictionary(), + /// IsNeedingInput() or IsFinished() returns true, to determine why no + /// further output is produced. + /// + /// + /// the output buffer. + /// + /// + /// The number of bytes written to the buffer, 0 if no further + /// output can be produced. + /// + /// + /// if buffer has length 0. + /// + /// + /// if deflated stream is invalid. + /// + public int Inflate(byte[] buffer) + { + if (buffer == null) + throw new ArgumentNullException(nameof(buffer)); + + return Inflate(buffer, 0, buffer.Length); + } + + /// + /// Inflates the compressed stream to the output buffer. If this + /// returns 0, you should check, whether needsDictionary(), + /// needsInput() or finished() returns true, to determine why no + /// further output is produced. + /// + /// + /// the output buffer. + /// + /// + /// the offset in buffer where storing starts. + /// + /// + /// the maximum number of bytes to output. + /// + /// + /// the number of bytes written to the buffer, 0 if no further output can be produced. + /// + /// + /// if count is less than 0. + /// + /// + /// if the index and / or count are wrong. + /// + /// + /// if deflated stream is invalid. + /// + public int Inflate(byte[] buffer, int offset, int count) + { + if (buffer == null) + throw new ArgumentNullException(nameof(buffer)); + + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count), "count cannot be negative"); + + if (offset < 0) + throw new ArgumentOutOfRangeException(nameof(offset), "offset cannot be negative"); + + if (offset + count > buffer.Length) + throw new ArgumentException("count exceeds buffer bounds"); + + // Special case: count may be zero + if (count == 0) + { + if (!IsFinished) + Decode(); // -jr- 08-Nov-2003 INFLATE_BUG fix.. + + return 0; + } + + int bytesCopied = 0; + + do + { + if (mode != DECODE_CHKSUM) + { + /* Don't give away any output, if we are waiting for the + * checksum in the input stream. + * + * With this trick we have always: + * IsNeedingInput() and not IsFinished() + * implies more output can be produced. + */ + int more = outputWindow.CopyOutput(buffer, offset, count); + + if (more > 0) + { + checksum.Update(buffer, offset, more); + offset += more; + bytesCopied += more; + totalOut += more; + count -= more; + + if (count == 0) + return bytesCopied; + } + } + } while (Decode() || ((outputWindow.GetAvailable() > 0) && (mode != DECODE_CHKSUM))); + return bytesCopied; + } + + /// + /// Returns true, if the input buffer is empty. + /// You should then call setInput(). + /// NOTE: This method also returns true when the stream is finished. + /// + public bool IsNeedingInput + { + get + { + return input.IsNeedingInput; + } + } + + /// + /// Returns true, if a preset dictionary is needed to inflate the input. + /// + public bool IsNeedingDictionary + { + get + { + return mode == DECODE_DICT && neededBits == 0; + } + } + + /// + /// Returns true, if the inflater has finished. This means, that no + /// input is needed and no output can be produced. + /// + public bool IsFinished + { + get + { + return mode == FINISHED && outputWindow.GetAvailable() == 0; + } + } + + /// + /// Gets the adler checksum. This is either the checksum of all + /// uncompressed bytes returned by inflate(), or if needsDictionary() + /// returns true (and thus no output was yet produced) this is the + /// adler checksum of the expected dictionary. + /// + /// + /// the adler checksum. + /// + public int Adler + { + get + { + return IsNeedingDictionary ? readAdler : (int)checksum.Value; + } + } + + /// + /// Gets the total number of output bytes returned by Inflate(). + /// + /// + /// the total number of output bytes. + /// + public long TotalOut + { + get + { + return totalOut; + } + } + + /// + /// Gets the total number of processed compressed input bytes. + /// + /// + /// The total number of bytes of processed input bytes. + /// + public long TotalIn + { + get + { + return totalIn - (long)RemainingInput; + } + } + + /// + /// Gets the number of unprocessed input bytes. Useful, if the end of the + /// stream is reached and you want to further process the bytes after + /// the deflate stream. + /// + /// + /// The number of bytes of the input which have not been processed. + /// + public int RemainingInput + { + // TODO: This should be a long? + get + { + return input.AvailableBytes; + } + + } + } +} diff --git a/UpdateLib/UpdateLib/Compression/Deflaters/InflaterDynHeader.cs b/UpdateLib/UpdateLib/Compression/Deflaters/InflaterDynHeader.cs new file mode 100644 index 0000000..d115e8f --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/Deflaters/InflaterDynHeader.cs @@ -0,0 +1,207 @@ +/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +/* Copyright © 2000-2016 SharpZipLib Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +using MatthiWare.UpdateLib.Compression.Streams; +using System; + +namespace MatthiWare.UpdateLib.Compression.Deflaters +{ + public class InflaterDynHeader + { + #region Constants + const int LNUM = 0; + const int DNUM = 1; + const int BLNUM = 2; + const int BLLENS = 3; + const int LENS = 4; + const int REPS = 5; + + static readonly int[] repMin = { 3, 3, 11 }; + static readonly int[] repBits = { 2, 3, 7 }; + + static readonly int[] BL_ORDER = + { 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 }; + #endregion + + public bool Decode(StreamManipulator input) + { + decode_loop: + for (;;) + { + switch (mode) + { + case LNUM: + lnum = input.PeekBits(5); + if (lnum < 0) + return false; + + lnum += 257; + input.DropBits(5); + // System.err.println("LNUM: "+lnum); + mode = DNUM; + goto case DNUM; // fall through + case DNUM: + dnum = input.PeekBits(5); + if (dnum < 0) + { + return false; + } + dnum++; + input.DropBits(5); + // System.err.println("DNUM: "+dnum); + num = lnum + dnum; + litdistLens = new byte[num]; + mode = BLNUM; + goto case BLNUM; // fall through + case BLNUM: + blnum = input.PeekBits(4); + if (blnum < 0) + { + return false; + } + blnum += 4; + input.DropBits(4); + blLens = new byte[19]; + ptr = 0; + // System.err.println("BLNUM: "+blnum); + mode = BLLENS; + goto case BLLENS; // fall through + case BLLENS: + while (ptr < blnum) + { + int len = input.PeekBits(3); + if (len < 0) + return false; + + input.DropBits(3); + // System.err.println("blLens["+BL_ORDER[ptr]+"]: "+len); + blLens[BL_ORDER[ptr]] = (byte)len; + ptr++; + } + blTree = new InflaterHuffmanTree(blLens); + blLens = null; + ptr = 0; + mode = LENS; + goto case LENS; // fall through + case LENS: + { + int symbol; + while (((symbol = blTree.GetSymbol(input)) & ~15) == 0) + { + /* Normal case: symbol in [0..15] */ + + // System.err.println("litdistLens["+ptr+"]: "+symbol); + litdistLens[ptr++] = lastLen = (byte)symbol; + + if (ptr == num) + return true; + } + + /* need more input ? */ + if (symbol < 0) + return false; + + /* otherwise repeat code */ + if (symbol >= 17) + lastLen = 0; + else + { + if (ptr == 0) + throw new Exception("Repeating zero"); + } + repSymbol = symbol - 16; + } + mode = REPS; + goto case REPS; // fall through + case REPS: + { + int bits = repBits[repSymbol]; + int count = input.PeekBits(bits); + + if (count < 0) + return false; + + input.DropBits(bits); + count += repMin[repSymbol]; + // System.err.println("litdistLens repeated: "+count); + + if (ptr + count > num) + throw new Exception($"litdistLens repeated: {count}"); + + while (count-- > 0) + litdistLens[ptr++] = lastLen; + + if (ptr == num) + return true; + } + + mode = LENS; + goto decode_loop; + } + } + } + + public InflaterHuffmanTree BuildLitLenTree() + { + byte[] litlenLens = new byte[lnum]; + Array.Copy(litdistLens, 0, litlenLens, 0, lnum); + return new InflaterHuffmanTree(litlenLens); + } + + public InflaterHuffmanTree BuildDistTree() + { + byte[] distLens = new byte[dnum]; + Array.Copy(litdistLens, lnum, distLens, 0, dnum); + return new InflaterHuffmanTree(distLens); + } + + #region Instance Fields + byte[] blLens; + byte[] litdistLens; + + InflaterHuffmanTree blTree; + + /// + /// The current decode mode + /// + int mode; + int lnum, dnum, blnum, num; + int repSymbol; + byte lastLen; + int ptr; + #endregion + + } +} diff --git a/UpdateLib/UpdateLib/Compression/Deflaters/InflaterHuffmanTree.cs b/UpdateLib/UpdateLib/Compression/Deflaters/InflaterHuffmanTree.cs new file mode 100644 index 0000000..c1e838d --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/Deflaters/InflaterHuffmanTree.cs @@ -0,0 +1,257 @@ +/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +/* Copyright © 2000-2016 SharpZipLib Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +using MatthiWare.UpdateLib.Compression.Streams; +using System; + +namespace MatthiWare.UpdateLib.Compression.Deflaters +{ + /// + /// Huffman tree used for inflation + /// + public class InflaterHuffmanTree + { + #region Constants + const int MAX_BITLEN = 15; + #endregion + + #region Instance Fields + short[] tree; + #endregion + + /// + /// Literal length tree + /// + public static InflaterHuffmanTree defLitLenTree; + + /// + /// Distance tree + /// + public static InflaterHuffmanTree defDistTree; + + static InflaterHuffmanTree() + { + try + { + byte[] codeLengths = new byte[288]; + int i = 0; + + while (i < 144) + codeLengths[i++] = 8; + + while (i < 256) + codeLengths[i++] = 9; + + while (i < 280) + codeLengths[i++] = 7; + + while (i < 288) + codeLengths[i++] = 8; + + defLitLenTree = new InflaterHuffmanTree(codeLengths); + + codeLengths = new byte[32]; + i = 0; + while (i < 32) + codeLengths[i++] = 5; + + defDistTree = new InflaterHuffmanTree(codeLengths); + } + catch (Exception e) + { + throw new Exception("InflaterHuffmanTree: static tree length illegal", e); + } + } + + #region Constructors + /// + /// Constructs a Huffman tree from the array of code lengths. + /// + /// + /// the array of code lengths + /// + public InflaterHuffmanTree(byte[] codeLengths) + { + BuildTree(codeLengths); + } + #endregion + + void BuildTree(byte[] codeLengths) + { + int[] blCount = new int[MAX_BITLEN + 1]; + int[] nextCode = new int[MAX_BITLEN + 1]; + + for (int i = 0; i < codeLengths.Length; i++) + { + int bits = codeLengths[i]; + + if (bits > 0) + blCount[bits]++; + } + + int code = 0; + int treeSize = 512; + for (int bits = 1; bits <= MAX_BITLEN; bits++) + { + nextCode[bits] = code; + code += blCount[bits] << (16 - bits); + if (bits >= 10) + { + /* We need an extra table for bit lengths >= 10. */ + int start = nextCode[bits] & 0x1ff80; + int end = code & 0x1ff80; + treeSize += (end - start) >> (16 - bits); + } + } + + /* -jr comment this out! doesnt work for dynamic trees and pkzip 2.04g + if (code != 65536) + { + throw new SharpZipBaseException("Code lengths don't add up properly."); + } + */ + /* Now create and fill the extra tables from longest to shortest + * bit len. This way the sub trees will be aligned. + */ + tree = new short[treeSize]; + int treePtr = 512; + for (int bits = MAX_BITLEN; bits >= 10; bits--) + { + int end = code & 0x1ff80; + code -= blCount[bits] << (16 - bits); + int start = code & 0x1ff80; + for (int i = start; i < end; i += 1 << 7) + { + tree[DeflaterHuffman.BitReverse(i)] = (short)((-treePtr << 4) | bits); + treePtr += 1 << (bits - 9); + } + } + + for (int i = 0; i < codeLengths.Length; i++) + { + int bits = codeLengths[i]; + if (bits == 0) + continue; + + code = nextCode[bits]; + int revcode = DeflaterHuffman.BitReverse(code); + if (bits <= 9) + { + do + { + tree[revcode] = (short)((i << 4) | bits); + revcode += 1 << bits; + } while (revcode < 512); + } + else + { + int subTree = tree[revcode & 511]; + int treeLen = 1 << (subTree & 15); + subTree = -(subTree >> 4); + do + { + tree[subTree | (revcode >> 9)] = (short)((i << 4) | bits); + revcode += 1 << bits; + } while (revcode < treeLen); + } + + nextCode[bits] = code + (1 << (16 - bits)); + } + + } + + /// + /// Reads the next symbol from input. The symbol is encoded using the + /// huffman tree. + /// + /// + /// input the input source. + /// + /// + /// the next symbol, or -1 if not enough input is available. + /// + public int GetSymbol(StreamManipulator input) + { + int lookahead, symbol; + if ((lookahead = input.PeekBits(9)) >= 0) + { + if ((symbol = tree[lookahead]) >= 0) + { + input.DropBits(symbol & 15); + return symbol >> 4; + } + + int subtree = -(symbol >> 4); + int bitlen = symbol & 15; + + if ((lookahead = input.PeekBits(bitlen)) >= 0) + { + symbol = tree[subtree | (lookahead >> 9)]; + input.DropBits(symbol & 15); + + return symbol >> 4; + } + else + { + int bits = input.AvailableBits; + lookahead = input.PeekBits(bits); + symbol = tree[subtree | (lookahead >> 9)]; + + if ((symbol & 15) <= bits) + { + input.DropBits(symbol & 15); + return symbol >> 4; + } + else + return -1; + } + } + else + { + int bits = input.AvailableBits; + lookahead = input.PeekBits(bits); + symbol = tree[lookahead]; + + if (symbol >= 0 && (symbol & 15) <= bits) + { + input.DropBits(symbol & 15); + return symbol >> 4; + } + else + return -1; + } + } + } +} diff --git a/UpdateLib/UpdateLib/Compression/Deflaters/PendingBuffer.cs b/UpdateLib/UpdateLib/Compression/Deflaters/PendingBuffer.cs new file mode 100644 index 0000000..30c15a3 --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/Deflaters/PendingBuffer.cs @@ -0,0 +1,258 @@ +/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +/* Copyright © 2000-2016 SharpZipLib Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + + +using System; + +namespace MatthiWare.UpdateLib.Compression.Deflaters +{ + /// + /// This class is general purpose class for writing data to a buffer. + /// + /// It allows you to write bits as well as bytes + /// Based on DeflaterPending.java + /// + /// author of the original java version : Jochen Hoenicke + /// + public class PendingBuffer + { + #region Instance Fields + /// + /// Internal work buffer + /// + readonly byte[] buffer; + + int start; + int end; + + uint bits; + int bitCount; + #endregion + + #region Constructors + /// + /// construct instance using default buffer size of 4096 + /// + public PendingBuffer() : this(4096) + { + } + + /// + /// construct instance using specified buffer size + /// + /// + /// size to use for internal buffer + /// + public PendingBuffer(int bufferSize) + { + buffer = new byte[bufferSize]; + } + + #endregion + + /// + /// Clear internal state/buffers + /// + public void Reset() + { + start = end = bitCount = 0; + } + + /// + /// Write a byte to buffer + /// + /// + /// The value to write + /// + public void WriteByte(int value) + { + buffer[end++] = unchecked((byte)value); + } + + /// + /// Write a short value to buffer LSB first + /// + /// + /// The value to write. + /// + public void WriteShort(int value) + { + buffer[end++] = unchecked((byte)value); + buffer[end++] = unchecked((byte)(value >> 8)); + } + + /// + /// write an integer LSB first + /// + /// The value to write. + public void WriteInt(int value) + { + buffer[end++] = unchecked((byte)value); + buffer[end++] = unchecked((byte)(value >> 8)); + buffer[end++] = unchecked((byte)(value >> 16)); + buffer[end++] = unchecked((byte)(value >> 24)); + } + + /// + /// Write a block of data to buffer + /// + /// data to write + /// offset of first byte to write + /// number of bytes to write + public void WriteBlock(byte[] block, int offset, int length) + { + Array.Copy(block, offset, buffer, end, length); + end += length; + } + + /// + /// The number of bits written to the buffer + /// + public int BitCount + { + get + { + return bitCount; + } + } + + /// + /// Align internal buffer on a byte boundary + /// + public void AlignToByte() + { + if (bitCount > 0) + { + buffer[end++] = unchecked((byte)bits); + if (bitCount > 8) + { + buffer[end++] = unchecked((byte)(bits >> 8)); + } + } + bits = 0; + bitCount = 0; + } + + /// + /// Write bits to internal buffer + /// + /// source of bits + /// number of bits to write + public void WriteBits(int b, int count) + { + bits |= (uint)(b << bitCount); + bitCount += count; + if (bitCount >= 16) + { + buffer[end++] = unchecked((byte)bits); + buffer[end++] = unchecked((byte)(bits >> 8)); + bits >>= 16; + bitCount -= 16; + } + } + + /// + /// Write a short value to internal buffer most significant byte first + /// + /// value to write + public void WriteShortMSB(int s) + { + buffer[end++] = unchecked((byte)(s >> 8)); + buffer[end++] = unchecked((byte)s); + } + + /// + /// Indicates if buffer has been flushed + /// + public bool IsFlushed + { + get + { + return end == 0; + } + } + + /// + /// Flushes the pending buffer into the given output array. If the + /// output array is to small, only a partial flush is done. + /// + /// The output array. + /// The offset into output array. + /// The maximum number of bytes to store. + /// The number of bytes flushed. + public int Flush(byte[] output, int offset, int length) + { + if (bitCount >= 8) + { + buffer[end++] = unchecked((byte)bits); + bits >>= 8; + bitCount -= 8; + } + + if (length > end - start) + { + length = end - start; + Array.Copy(buffer, start, output, offset, length); + start = 0; + end = 0; + } + else + { + Array.Copy(buffer, start, output, offset, length); + start += length; + } + + return length; + } + + /// + /// Convert internal buffer to byte array. + /// Buffer is empty on completion + /// + /// + /// The internal buffer contents converted to a byte array. + /// + public byte[] ToByteArray() + { + AlignToByte(); + + byte[] result = new byte[end - start]; + Array.Copy(buffer, start, result, 0, result.Length); + start = 0; + end = 0; + return result; + } + } +} diff --git a/UpdateLib/UpdateLib/Compression/GZip/GZip.cs b/UpdateLib/UpdateLib/Compression/GZip/GZip.cs new file mode 100644 index 0000000..3af8332 --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/GZip/GZip.cs @@ -0,0 +1,62 @@ +/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +/* Copyright © 2000-2016 SharpZipLib Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +using MatthiWare.UpdateLib.Utils; +using System; +using System.IO; + +namespace MatthiWare.UpdateLib.Compression.GZip +{ + public static class GZip + { + public static void Decompress(Stream inStream, Stream outStream) + { + if (inStream == null || outStream == null) + throw new ArgumentNullException("Streams"); + + using (var gzip = new GZipInputStream(inStream)) + IOUtils.Copy(gzip, outStream, new byte[4096]); + } + + public static void Decompress(Stream inStream, Stream outStream, int level) + { + if (inStream == null || outStream == null) + throw new ArgumentNullException("Streams"); + + using (var gzip = new GZipOutputStream(outStream, level)) + IOUtils.Copy(inStream, gzip, new byte[4096]); + } + } +} diff --git a/UpdateLib/UpdateLib/Compression/GZip/GZipConstants.cs b/UpdateLib/UpdateLib/Compression/GZip/GZipConstants.cs new file mode 100644 index 0000000..b1fa152 --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/GZip/GZipConstants.cs @@ -0,0 +1,86 @@ +/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +/* Copyright © 2000-2016 SharpZipLib Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + + +namespace MatthiWare.UpdateLib.Compression.GZip +{ + /// + /// This class contains constants used for gzip. + /// + public static class GZipConstants + { + /// + /// Magic number found at start of GZIP header + /// + public const int GZIP_MAGIC = 0x1F8B; + + /* The flag byte is divided into individual bits as follows: + + bit 0 FTEXT + bit 1 FHCRC + bit 2 FEXTRA + bit 3 FNAME + bit 4 FCOMMENT + bit 5 reserved + bit 6 reserved + bit 7 reserved + */ + + /// + /// Flag bit mask for text + /// + public const int FTEXT = 0x1; + + /// + /// Flag bitmask for Crc + /// + public const int FHCRC = 0x2; + + /// + /// Flag bit mask for extra + /// + public const int FEXTRA = 0x4; + + /// + /// flag bitmask for name + /// + public const int FNAME = 0x8; + + /// + /// flag bit mask indicating comment is present + /// + public const int FCOMMENT = 0x10; + } +} diff --git a/UpdateLib/UpdateLib/Compression/GZip/GZipException.cs b/UpdateLib/UpdateLib/Compression/GZip/GZipException.cs new file mode 100644 index 0000000..2e11775 --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/GZip/GZipException.cs @@ -0,0 +1,51 @@ +/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +/* Copyright © 2000-2016 SharpZipLib Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +using System; + +namespace MatthiWare.UpdateLib.Compression.GZip +{ + + [Serializable] + public class GZipException : Exception + { + public GZipException() { } + public GZipException(string message) : base(message) { } + public GZipException(string message, Exception inner) : base(message, inner) { } + protected GZipException( + System.Runtime.Serialization.SerializationInfo info, + System.Runtime.Serialization.StreamingContext context) : base(info, context) { } + } +} diff --git a/UpdateLib/UpdateLib/Compression/GZip/GZipInputStream.cs b/UpdateLib/UpdateLib/Compression/GZip/GZipInputStream.cs new file mode 100644 index 0000000..04f0233 --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/GZip/GZipInputStream.cs @@ -0,0 +1,382 @@ +/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +/* Copyright © 2000-2016 SharpZipLib Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +using System; +using System.IO; + +using MatthiWare.UpdateLib.Compression.Checksum; +using MatthiWare.UpdateLib.Compression.Deflaters; +using MatthiWare.UpdateLib.Compression.Streams; + +namespace MatthiWare.UpdateLib.Compression.GZip +{ + + /// + /// This filter stream is used to decompress a "GZIP" format stream. + /// The "GZIP" format is described baseInputStream RFC 1952. + /// + /// author of the original java version : John Leuner + /// + /// This sample shows how to unzip a gzipped file + /// + /// using System; + /// using System.IO; + /// + /// using ICSharpCode.SharpZipLib.Core; + /// using ICSharpCode.SharpZipLib.GZip; + /// + /// class MainClass + /// { + /// public static void Main(string[] args) + /// { + /// using (Stream inStream = new GZipInputStream(File.OpenRead(args[0]))) + /// using (FileStream outStream = File.Create(Path.GetFileNameWithoutExtension(args[0]))) { + /// byte[] buffer = new byte[4096]; + /// StreamUtils.Copy(inStream, outStream, buffer); + /// } + /// } + /// } + /// + /// + public class GZipInputStream : InflaterInputStream + { + #region Instance Fields + /// + /// CRC-32 value for uncompressed data + /// + protected Crc32 crc; + + /// + /// Flag to indicate if we've read the GZIP header yet for the current member (block of compressed data). + /// This is tracked per-block as the file is parsed. + /// + bool readGZIPHeader; + + /// + /// Flag to indicate if at least one block in a stream with concatenated blocks was read successfully. + /// This allows us to exit gracefully if downstream data is not in gzip format. + /// + bool completedLastBlock; + #endregion + + #region Constructors + /// + /// Creates a GZipInputStream with the default buffer size + /// + /// + /// The stream to read compressed data from (baseInputStream GZIP format) + /// + public GZipInputStream(Stream baseInputStream, bool isOwner = true) + : this(baseInputStream, 4096) + { + IsStreamOwner = isOwner; + } + + /// + /// Creates a GZIPInputStream with the specified buffer size + /// + /// + /// The stream to read compressed data from (baseInputStream GZIP format) + /// + /// + /// Size of the buffer to use + /// + public GZipInputStream(Stream baseInputStream, int size) + : base(baseInputStream, new Inflater(true), size) + { + } + #endregion + + #region Stream overrides + /// + /// Reads uncompressed data into an array of bytes + /// + /// + /// The buffer to read uncompressed data into + /// + /// + /// The offset indicating where the data should be placed + /// + /// + /// The number of uncompressed bytes to be read + /// + /// Returns the number of bytes actually read. + public override int Read(byte[] buffer, int offset, int count) + { + // A GZIP file can contain multiple blocks of compressed data, although this is quite rare. + // A compressed block could potentially be empty, so we need to loop until we reach EOF or + // we find data. + while (true) + { + + // If we haven't read the header for this block, read it + if (!readGZIPHeader) + { + + // Try to read header. If there is no header (0 bytes available), this is EOF. If there is + // an incomplete header, this will throw an exception. + try + { + if (!ReadHeader()) + return 0; + } + catch (Exception ex) when (completedLastBlock && (ex is GZipException || ex is EndOfStreamException)) + { + // if we completed the last block (i.e. we're in a stream that has multiple blocks concatenated + // we want to return gracefully from any header parsing exceptions since sometimes there may + // be trailing garbage on a stream + return 0; + } + } + + // Try to read compressed data + int bytesRead = base.Read(buffer, offset, count); + if (bytesRead > 0) + crc.Update(buffer, offset, bytesRead); + + // If this is the end of stream, read the footer + if (inflater.IsFinished) + ReadFooter(); + + if (bytesRead > 0) + return bytesRead; + } + } + #endregion + + #region Support routines + bool ReadHeader() + { + // Initialize CRC for this block + crc = new Crc32(); + + // Make sure there is data in file. We can't rely on ReadLeByte() to fill the buffer, as this could be EOF, + // which is fine, but ReadLeByte() throws an exception if it doesn't find data, so we do this part ourselves. + if (inputBuffer.Available <= 0) + { + inputBuffer.Fill(); + + if (inputBuffer.Available <= 0) + return false; // No header, EOF. + } + + // 1. Check the two magic bytes + var headCRC = new Crc32(); + int magic = inputBuffer.ReadLeByte(); + + if (magic < 0) + throw new EndOfStreamException("EOS reading GZIP header"); + + headCRC.Update(magic); + + if (magic != (GZipConstants.GZIP_MAGIC >> 8)) + throw new GZipException("Error GZIP header, first magic byte doesn't match"); + + //magic = baseInputStream.ReadByte(); + magic = inputBuffer.ReadLeByte(); + + if (magic < 0) + throw new EndOfStreamException("EOS reading GZIP header"); + + if (magic != (GZipConstants.GZIP_MAGIC & 0xFF)) + throw new GZipException("Error GZIP header, second magic byte doesn't match"); + + headCRC.Update(magic); + + // 2. Check the compression type (must be 8) + int compressionType = inputBuffer.ReadLeByte(); + + if (compressionType < 0) + throw new EndOfStreamException("EOS reading GZIP header"); + + if (compressionType != 8) + throw new GZipException("Error GZIP header, data not in deflate format"); + + headCRC.Update(compressionType); + + // 3. Check the flags + int flags = inputBuffer.ReadLeByte(); + if (flags < 0) + throw new EndOfStreamException("EOS reading GZIP header"); + + headCRC.Update(flags); + + /* This flag byte is divided into individual bits as follows: + bit 0 FTEXT + bit 1 FHCRC + bit 2 FEXTRA + bit 3 FNAME + bit 4 FCOMMENT + bit 5 reserved + bit 6 reserved + bit 7 reserved + */ + + // 3.1 Check the reserved bits are zero + + if ((flags & 0xE0) != 0) + throw new GZipException("Reserved flag bits in GZIP header != 0"); + + // 4.-6. Skip the modification time, extra flags, and OS type + for (int i = 0; i < 6; i++) + { + int readByte = inputBuffer.ReadLeByte(); + + if (readByte < 0) + throw new EndOfStreamException("EOS reading GZIP header"); + + headCRC.Update(readByte); + } + + // 7. Read extra field + if ((flags & GZipConstants.FEXTRA) != 0) + { + + // XLEN is total length of extra subfields, we will skip them all + int len1, len2; + len1 = inputBuffer.ReadLeByte(); + len2 = inputBuffer.ReadLeByte(); + + if ((len1 < 0) || (len2 < 0)) + throw new EndOfStreamException("EOS reading GZIP header"); + + headCRC.Update(len1); + headCRC.Update(len2); + + int extraLen = (len2 << 8) | len1; // gzip is LSB first + for (int i = 0; i < extraLen; i++) + { + int readByte = inputBuffer.ReadLeByte(); + if (readByte < 0) + throw new EndOfStreamException("EOS reading GZIP header"); + + headCRC.Update(readByte); + } + } + + // 8. Read file name + if ((flags & GZipConstants.FNAME) != 0) + { + int readByte; + while ((readByte = inputBuffer.ReadLeByte()) > 0) + headCRC.Update(readByte); + + if (readByte < 0) + throw new EndOfStreamException("EOS reading GZIP header"); + + headCRC.Update(readByte); + } + + // 9. Read comment + if ((flags & GZipConstants.FCOMMENT) != 0) + { + int readByte; + while ((readByte = inputBuffer.ReadLeByte()) > 0) + headCRC.Update(readByte); + + if (readByte < 0) + throw new EndOfStreamException("EOS reading GZIP header"); + + headCRC.Update(readByte); + } + + // 10. Read header CRC + if ((flags & GZipConstants.FHCRC) != 0) + { + int tempByte; + int crcval = inputBuffer.ReadLeByte(); + + if (crcval < 0) + throw new EndOfStreamException("EOS reading GZIP header"); + + tempByte = inputBuffer.ReadLeByte(); + + if (tempByte < 0) + throw new EndOfStreamException("EOS reading GZIP header"); + + crcval = (crcval << 8) | tempByte; + + if (crcval != ((int)headCRC.Value & 0xffff)) + throw new GZipException("Header CRC value mismatch"); + } + + readGZIPHeader = true; + return true; + } + + void ReadFooter() + { + byte[] footer = new byte[8]; + + // End of stream; reclaim all bytes from inf, read the final byte count, and reset the inflator + long bytesRead = inflater.TotalOut & 0xffffffff; + inputBuffer.Available += inflater.RemainingInput; + inflater.Reset(); + + // Read footer from inputBuffer + int needed = 8; + while (needed > 0) + { + int count = inputBuffer.ReadClearTextBuffer(footer, 8 - needed, needed); + if (count <= 0) + throw new EndOfStreamException("EOS reading GZIP footer"); + + needed -= count; // Jewel Jan 16 + } + + // Calculate CRC + int crcval = (footer[0] & 0xff) | ((footer[1] & 0xff) << 8) | ((footer[2] & 0xff) << 16) | (footer[3] << 24); + if (crcval != (int)crc.Value) + throw new GZipException("GZIP crc sum mismatch, theirs \"" + crcval + "\" and ours \"" + (int)crc.Value); + + // NOTE The total here is the original total modulo 2 ^ 32. + uint total = + ((uint)footer[4] & 0xff) | + (((uint)footer[5] & 0xff) << 8) | + (((uint)footer[6] & 0xff) << 16) | + ((uint)footer[7] << 24); + + if (bytesRead != total) + throw new GZipException("Number of bytes mismatch in footer"); + + // Mark header read as false so if another header exists, we'll continue reading through the file + readGZIPHeader = false; + + // Indicate that we succeeded on at least one block so we can exit gracefully if there is trailing garbage downstream + completedLastBlock = true; + } + #endregion + } +} diff --git a/UpdateLib/UpdateLib/Compression/GZip/GZipOutputStream.cs b/UpdateLib/UpdateLib/Compression/GZip/GZipOutputStream.cs new file mode 100644 index 0000000..0e05719 --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/GZip/GZipOutputStream.cs @@ -0,0 +1,258 @@ +/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +/* Copyright © 2000-2016 SharpZipLib Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +using System; +using System.IO; + +using MatthiWare.UpdateLib.Compression.Checksum; +using MatthiWare.UpdateLib.Compression.Deflaters; +using MatthiWare.UpdateLib.Compression.Streams; + +namespace MatthiWare.UpdateLib.Compression.GZip +{ + /// + /// This filter stream is used to compress a stream into a "GZIP" stream. + /// The "GZIP" format is described in RFC 1952. + /// + /// author of the original java version : John Leuner + /// + /// This sample shows how to gzip a file + /// + /// using System; + /// using System.IO; + /// + /// using ICSharpCode.SharpZipLib.GZip; + /// using ICSharpCode.SharpZipLib.Core; + /// + /// class MainClass + /// { + /// public static void Main(string[] args) + /// { + /// using (Stream s = new GZipOutputStream(File.Create(args[0] + ".gz"))) + /// using (FileStream fs = File.OpenRead(args[0])) { + /// byte[] writeData = new byte[4096]; + /// Streamutils.Copy(s, fs, writeData); + /// } + /// } + /// } + /// } + /// + /// + public class GZipOutputStream : DeflaterOutputStream + { + enum OutputState + { + Header, + Footer, + Finished, + Closed, + }; + + #region Instance Fields + /// + /// CRC-32 value for uncompressed data + /// + protected Crc32 crc = new Crc32(); + OutputState state_ = OutputState.Header; + #endregion + + #region Constructors + /// + /// Creates a GzipOutputStream with the default buffer size + /// + /// + /// The stream to read data (to be compressed) from + /// + public GZipOutputStream(Stream baseOutputStream, bool isOwner = true) + : this(baseOutputStream, 4096) + { + IsStreamOwner = isOwner; + } + + /// + /// Creates a GZipOutputStream with the specified buffer size + /// + /// + /// The stream to read data (to be compressed) from + /// + /// + /// Size of the buffer to use + /// + public GZipOutputStream(Stream baseOutputStream, int size) : base(baseOutputStream, new Deflater(Deflater.DEFAULT_COMPRESSION, true), size) + { + } + #endregion + + #region Public API + /// + /// Sets the active compression level (1-9). The new level will be activated + /// immediately. + /// + /// The compression level to set. + /// + /// Level specified is not supported. + /// + /// + public void SetLevel(int level) + { + if (level < Deflater.BEST_SPEED) + throw new ArgumentOutOfRangeException(nameof(level)); + + deflater_.SetLevel(level); + } + + /// + /// Get the current compression level. + /// + /// The current compression level. + public int GetLevel() => deflater_.GetLevel(); + #endregion + + #region Stream overrides + /// + /// Write given buffer to output updating crc + /// + /// Buffer to write + /// Offset of first byte in buf to write + /// Number of bytes to write + public override void Write(byte[] buffer, int offset, int count) + { + if (state_ == OutputState.Header) + WriteHeader(); + + if (state_ != OutputState.Footer) + throw new InvalidOperationException("Write not permitted in current state"); + + crc.Update(buffer, offset, count); + base.Write(buffer, offset, count); + } + + /// + /// Writes remaining compressed output data to the output stream + /// and closes it. + /// + protected override void Dispose(bool disposing) + { + try + { + Finish(); + } + finally + { + if (state_ != OutputState.Closed) + { + state_ = OutputState.Closed; + + if (IsStreamOwner) + baseOutputStream_.Dispose(); + } + } + } + #endregion + + #region DeflaterOutputStream overrides + /// + /// Finish compression and write any footer information required to stream + /// + public override void Finish() + { + // If no data has been written a header should be added. + if (state_ == OutputState.Header) + WriteHeader(); + + if (state_ == OutputState.Footer) + { + state_ = OutputState.Finished; + base.Finish(); + + var totalin = (uint)(deflater_.TotalIn & 0xffffffff); + var crcval = (uint)(crc.Value & 0xffffffff); + + byte[] gzipFooter; + + unchecked + { + gzipFooter = new byte[] { + (byte) crcval, (byte) (crcval >> 8), + (byte) (crcval >> 16), (byte) (crcval >> 24), + + (byte) totalin, (byte) (totalin >> 8), + (byte) (totalin >> 16), (byte) (totalin >> 24) + }; + } + + baseOutputStream_.Write(gzipFooter, 0, gzipFooter.Length); + } + } + #endregion + + #region Support Routines + void WriteHeader() + { + if (state_ == OutputState.Header) + { + state_ = OutputState.Footer; + + var mod_time = (int)((DateTime.Now.Ticks - new DateTime(1970, 1, 1).Ticks) / 10000000L); // Ticks give back 100ns intervals + byte[] gzipHeader = { + // The two magic bytes + (GZipConstants.GZIP_MAGIC >> 8), + (GZipConstants.GZIP_MAGIC & 0xff), + + // The compression type + Deflater.DEFLATED, + + // The flags (not set) + 0, + + // The modification time + (byte) mod_time, + (byte) (mod_time >> 8), + (byte) (mod_time >> 16), + (byte) (mod_time >> 24), + + // The extra flags + 0, + + // The OS type (unknown) + 255 + }; + + baseOutputStream_.Write(gzipHeader, 0, gzipHeader.Length); + } + } + #endregion + } +} diff --git a/UpdateLib/UpdateLib/Compression/PatchBuilder.cs b/UpdateLib/UpdateLib/Compression/PatchBuilder.cs new file mode 100644 index 0000000..5e9936a --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/PatchBuilder.cs @@ -0,0 +1,23 @@ +using MatthiWare.UpdateLib.Common; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace MatthiWare.UpdateLib.Compression +{ + public class PatchBuilder + { + + public event ProgressChangedHandler ProgressChanged; + + public void Generate() + { + + } + + protected void OnProgressChanged(bool completed, double progress) + => ProgressChanged?.Invoke(completed, progress); + + } +} diff --git a/UpdateLib/UpdateLib/Compression/Patcher.cs b/UpdateLib/UpdateLib/Compression/Patcher.cs new file mode 100644 index 0000000..b0dcec8 --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/Patcher.cs @@ -0,0 +1,37 @@ +/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using MatthiWare.UpdateLib.Common; + +namespace MatthiWare.UpdateLib.Compression +{ + public class Patcher + { + public event ProgressChangedHandler ProgressChanged; + + public void Patch() + { + + } + + protected void OnProgressChanged(bool completed, double progress) + => ProgressChanged?.Invoke(completed, progress); + } +} diff --git a/UpdateLib/UpdateLib/Compression/Streams/DeflaterOutputStream.cs b/UpdateLib/UpdateLib/Compression/Streams/DeflaterOutputStream.cs new file mode 100644 index 0000000..4e814c2 --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/Streams/DeflaterOutputStream.cs @@ -0,0 +1,388 @@ +/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +/* Copyright © 2000-2016 SharpZipLib Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +using MatthiWare.UpdateLib.Compression.Deflaters; +using System; +using System.IO; +using System.Security.Cryptography; + +namespace MatthiWare.UpdateLib.Compression.Streams +{ + /// + /// A special stream deflating or compressing the bytes that are + /// written to it. It uses a Deflater to perform actual deflating.
+ /// Authors of the original java version : Tom Tromey, Jochen Hoenicke + ///
+ public class DeflaterOutputStream : Stream + { + #region Constructors + /// + /// Creates a new DeflaterOutputStream with a default Deflater and default buffer size. + /// + /// + /// the output stream where deflated output should be written. + /// + public DeflaterOutputStream(Stream baseOutputStream) + : this(baseOutputStream, new Deflater(), 512) + { + } + + /// + /// Creates a new DeflaterOutputStream with the given Deflater and + /// default buffer size. + /// + /// + /// the output stream where deflated output should be written. + /// + /// + /// the underlying deflater. + /// + public DeflaterOutputStream(Stream baseOutputStream, Deflater deflater) + : this(baseOutputStream, deflater, 512) + { + } + + /// + /// Creates a new DeflaterOutputStream with the given Deflater and + /// buffer size. + /// + /// + /// The output stream where deflated output is written. + /// + /// + /// The underlying deflater to use + /// + /// + /// The buffer size in bytes to use when deflating (minimum value 512) + /// + /// + /// bufsize is less than or equal to zero. + /// + /// + /// baseOutputStream does not support writing + /// + /// + /// deflater instance is null + /// + public DeflaterOutputStream(Stream baseOutputStream, Deflater deflater, int bufferSize) + { + if (baseOutputStream == null) + throw new ArgumentNullException(nameof(baseOutputStream)); + + if (baseOutputStream.CanWrite == false) + { + throw new ArgumentException("Must support writing", nameof(baseOutputStream)); + } + + if (deflater == null) + throw new ArgumentNullException(nameof(deflater)); + + if (bufferSize < 512) + throw new ArgumentOutOfRangeException(nameof(bufferSize)); + + baseOutputStream_ = baseOutputStream; + buffer_ = new byte[bufferSize]; + deflater_ = deflater; + } + + #endregion + + #region Public API + /// + /// Finishes the stream by calling finish() on the deflater. + /// + /// + /// Not all input is deflated + /// + public virtual void Finish() + { + deflater_.Finish(); + while (!deflater_.IsFinished) + { + int len = deflater_.Deflate(buffer_, 0, buffer_.Length); + if (len <= 0) + break; + + baseOutputStream_.Write(buffer_, 0, len); + } + + if (!deflater_.IsFinished) + throw new IOException("Can't deflate all input?"); + + baseOutputStream_.Flush(); + } + + /// + /// Gets or sets a flag indicating ownership of underlying stream. + /// When the flag is true will close the underlying stream also. + /// + /// The default value is true. + public bool IsStreamOwner { get; set; } = true; + + /// + /// Allows client to determine if an entry can be patched after its added + /// + public bool CanPatchEntries + { + get + { + return baseOutputStream_.CanSeek; + } + } + + #endregion + + #region Deflation Support + /// + /// Deflates everything in the input buffers. This will call + /// def.deflate() until all bytes from the input buffers + /// are processed. + /// + protected void Deflate() + { + while (!deflater_.IsNeedingInput) + { + int deflateCount = deflater_.Deflate(buffer_, 0, buffer_.Length); + + if (deflateCount <= 0) + break; + + baseOutputStream_.Write(buffer_, 0, deflateCount); + } + + if (!deflater_.IsNeedingInput) + throw new IOException("DeflaterOutputStream can't deflate all input?"); + } + #endregion + + #region Stream Overrides + /// + /// Gets value indicating stream can be read from + /// + public override bool CanRead + { + get + { + return false; + } + } + + /// + /// Gets a value indicating if seeking is supported for this stream + /// This property always returns false + /// + public override bool CanSeek + { + get + { + return false; + } + } + + /// + /// Get value indicating if this stream supports writing + /// + public override bool CanWrite + { + get + { + return baseOutputStream_.CanWrite; + } + } + + /// + /// Get current length of stream + /// + public override long Length + { + get + { + return baseOutputStream_.Length; + } + } + + /// + /// Gets the current position within the stream. + /// + /// Any attempt to set position + public override long Position + { + get + { + return baseOutputStream_.Position; + } + set + { + throw new NotSupportedException("Position property not supported"); + } + } + + /// + /// Sets the current position of this stream to the given value. Not supported by this class! + /// + /// The offset relative to the to seek. + /// The to seek from. + /// The new position in the stream. + /// Any access + public override long Seek(long offset, SeekOrigin origin) + { + throw new NotSupportedException("DeflaterOutputStream Seek not supported"); + } + + /// + /// Sets the length of this stream to the given value. Not supported by this class! + /// + /// The new stream length. + /// Any access + public override void SetLength(long value) + { + throw new NotSupportedException("DeflaterOutputStream SetLength not supported"); + } + + /// + /// Read a byte from stream advancing position by one + /// + /// The byte read cast to an int. THe value is -1 if at the end of the stream. + /// Any access + public override int ReadByte() + { + throw new NotSupportedException("DeflaterOutputStream ReadByte not supported"); + } + + /// + /// Read a block of bytes from stream + /// + /// The buffer to store read data in. + /// The offset to start storing at. + /// The maximum number of bytes to read. + /// The actual number of bytes read. Zero if end of stream is detected. + /// Any access + public override int Read(byte[] buffer, int offset, int count) + { + throw new NotSupportedException("DeflaterOutputStream Read not supported"); + } + + /// + /// Flushes the stream by calling Flush on the deflater and then + /// on the underlying stream. This ensures that all bytes are flushed. + /// + public override void Flush() + { + deflater_.Flush(); + Deflate(); + baseOutputStream_.Flush(); + } + + /// + /// Calls and closes the underlying + /// stream when is true. + /// + protected override void Dispose(bool disposing) + { + if (!isClosed_) + { + isClosed_ = true; + + try + { + Finish(); + } + finally + { + if (IsStreamOwner) + baseOutputStream_.Dispose(); + } + } + } + + /// + /// Writes a single byte to the compressed output stream. + /// + /// + /// The byte value. + /// + public override void WriteByte(byte value) + { + byte[] b = new byte[1]; + b[0] = value; + Write(b, 0, 1); + } + + /// + /// Writes bytes from an array to the compressed stream. + /// + /// + /// The byte array + /// + /// + /// The offset into the byte array where to start. + /// + /// + /// The number of bytes to write. + /// + public override void Write(byte[] buffer, int offset, int count) + { + deflater_.SetInput(buffer, offset, count); + Deflate(); + } + #endregion + + #region Instance Fields + /// + /// This buffer is used temporarily to retrieve the bytes from the + /// deflater and write them to the underlying output stream. + /// + byte[] buffer_; + + /// + /// The deflater which is used to deflate the stream. + /// + protected Deflater deflater_; + + /// + /// Base stream the deflater depends on. + /// + protected Stream baseOutputStream_; + + bool isClosed_; + #endregion + + #region Static Fields + + // Static to help ensure that multiple files within a zip will get different random salt + private static RandomNumberGenerator _aesRnd = RandomNumberGenerator.Create(); + #endregion + } +} diff --git a/UpdateLib/UpdateLib/Compression/Streams/InflaterInputStream.cs b/UpdateLib/UpdateLib/Compression/Streams/InflaterInputStream.cs new file mode 100644 index 0000000..c13add9 --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/Streams/InflaterInputStream.cs @@ -0,0 +1,642 @@ +/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +/* Copyright © 2000-2016 SharpZipLib Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +using System; +using System.IO; + +using MatthiWare.UpdateLib.Compression.Deflaters; + +namespace MatthiWare.UpdateLib.Compression.Streams +{ + /// + /// An input buffer customised for use by + /// + /// + /// The buffer supports decryption of incoming data. + /// + public class InflaterInputBuffer + { + #region Constructors + /// + /// Initialise a new instance of with a default buffer size + /// + /// The stream to buffer. + public InflaterInputBuffer(Stream stream) : this(stream, 4096) + { + } + + /// + /// Initialise a new instance of + /// + /// The stream to buffer. + /// The size to use for the buffer + /// A minimum buffer size of 1KB is permitted. Lower sizes are treated as 1KB. + public InflaterInputBuffer(Stream stream, int bufferSize) + { + inputStream = stream; + + if (bufferSize < 1024) + bufferSize = 1024; + + rawData = new byte[bufferSize]; + clearText = rawData; + } + #endregion + + /// + /// Get the length of bytes bytes in the + /// + public int RawLength + { + get + { + return rawLength; + } + } + + /// + /// Get the contents of the raw data buffer. + /// + /// This may contain encrypted data. + public byte[] RawData + { + get + { + return rawData; + } + } + + /// + /// Get the number of useable bytes in + /// + public int ClearTextLength + { + get + { + return clearTextLength; + } + } + + /// + /// Get the contents of the clear text buffer. + /// + public byte[] ClearText + { + get + { + return clearText; + } + } + + /// + /// Get/set the number of bytes available + /// + public int Available + { + get { return available; } + set { available = value; } + } + + /// + /// Call passing the current clear text buffer contents. + /// + /// The inflater to set input for. + public void SetInflaterInput(Inflater inflater) + { + if (available > 0) + { + inflater.SetInput(clearText, clearTextLength - available, available); + available = 0; + } + } + + /// + /// Fill the buffer from the underlying input stream. + /// + public void Fill() + { + rawLength = 0; + int toRead = rawData.Length; + + while (toRead > 0) + { + int count = inputStream.Read(rawData, rawLength, toRead); + if (count <= 0) + break; + + rawLength += count; + toRead -= count; + } + + clearTextLength = rawLength; + + + available = clearTextLength; + } + + /// + /// Read a buffer directly from the input stream + /// + /// The buffer to fill + /// Returns the number of bytes read. + public int ReadRawBuffer(byte[] buffer) => ReadRawBuffer(buffer, 0, buffer.Length); + + /// + /// Read a buffer directly from the input stream + /// + /// The buffer to read into + /// The offset to start reading data into. + /// The number of bytes to read. + /// Returns the number of bytes read. + public int ReadRawBuffer(byte[] outBuffer, int offset, int length) + { + if (length < 0) + throw new ArgumentOutOfRangeException(nameof(length)); + + int currentOffset = offset; + int currentLength = length; + + while (currentLength > 0) + { + if (available <= 0) + { + Fill(); + if (available <= 0) + return 0; + } + + int toCopy = Math.Min(currentLength, available); + + Array.Copy(rawData, rawLength - available, outBuffer, currentOffset, toCopy); + currentOffset += toCopy; + currentLength -= toCopy; + available -= toCopy; + } + return length; + } + + /// + /// Read clear text data from the input stream. + /// + /// The buffer to add data to. + /// The offset to start adding data at. + /// The number of bytes to read. + /// Returns the number of bytes actually read. + public int ReadClearTextBuffer(byte[] outBuffer, int offset, int length) + { + if (length < 0) + throw new ArgumentOutOfRangeException(nameof(length)); + + int currentOffset = offset; + int currentLength = length; + + while (currentLength > 0) + { + if (available <= 0) + { + Fill(); + if (available <= 0) + return 0; + } + + int toCopy = Math.Min(currentLength, available); + Array.Copy(clearText, clearTextLength - available, outBuffer, currentOffset, toCopy); + currentOffset += toCopy; + currentLength -= toCopy; + available -= toCopy; + } + return length; + } + + /// + /// Read a from the input stream. + /// + /// Returns the byte read. + public int ReadLeByte() + { + if (available <= 0) + { + Fill(); + + if (available <= 0) + throw new EndOfStreamException("EOF in header"); + } + + byte result = rawData[rawLength - available]; + available -= 1; + return result; + } + + /// + /// Read an in little endian byte order. + /// + /// The short value read case to an int. + public int ReadLeShort() => ReadLeByte() | (ReadLeByte() << 8); + + /// + /// Read an in little endian byte order. + /// + /// The int value read. + public int ReadLeInt() => ReadLeShort() | (ReadLeShort() << 16); + + /// + /// Read a in little endian byte order. + /// + /// The long value read. + public long ReadLeLong() => (uint)ReadLeInt() | ((long)ReadLeInt() << 32); + + #region Instance Fields + int rawLength; + byte[] rawData; + + int clearTextLength; + byte[] clearText; + + int available; + Stream inputStream; + #endregion + } + + /// + /// This filter stream is used to decompress data compressed using the "deflate" + /// format. The "deflate" format is described in RFC 1951. + /// + /// This stream may form the basis for other decompression filters, such + /// as the GZipInputStream. + /// + /// Author of the original java version : John Leuner. + /// + public class InflaterInputStream : Stream + { + #region Constructors + /// + /// Create an InflaterInputStream with the default decompressor + /// and a default buffer size of 4KB. + /// + /// + /// The InputStream to read bytes from + /// + public InflaterInputStream(Stream baseInputStream) + : this(baseInputStream, new Inflater(), 4096) + { + } + + /// + /// Create an InflaterInputStream with the specified decompressor + /// and a default buffer size of 4KB. + /// + /// + /// The source of input data + /// + /// + /// The decompressor used to decompress data read from baseInputStream + /// + public InflaterInputStream(Stream baseInputStream, Inflater inf) + : this(baseInputStream, inf, 4096) + { + } + + /// + /// Create an InflaterInputStream with the specified decompressor + /// and the specified buffer size. + /// + /// + /// The InputStream to read bytes from + /// + /// + /// The decompressor to use + /// + /// + /// Size of the buffer to use + /// + public InflaterInputStream(Stream baseInputStream, Inflater inflater, int bufferSize) + { + if (bufferSize <= 0) + throw new ArgumentOutOfRangeException(nameof(bufferSize)); + + this.baseInputStream = baseInputStream ?? throw new ArgumentNullException(nameof(baseInputStream)); + this.inflater = inflater ?? throw new ArgumentNullException(nameof(inflater)); + + inputBuffer = new InflaterInputBuffer(baseInputStream, bufferSize); + } + + #endregion + + /// + /// Gets or sets a flag indicating ownership of underlying stream. + /// When the flag is true will close the underlying stream also. + /// + /// The default value is true. + public bool IsStreamOwner { get; set; } = true; + + /// + /// Skip specified number of bytes of uncompressed data + /// + /// + /// Number of bytes to skip + /// + /// + /// The number of bytes skipped, zero if the end of + /// stream has been reached + /// + /// + /// The number of bytes to skip is less than or equal to zero. + /// + public long Skip(long count) + { + if (count <= 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + // v0.80 Skip by seeking if underlying stream supports it... + if (baseInputStream.CanSeek) + { + baseInputStream.Seek(count, SeekOrigin.Current); + return count; + } + else + { + int length = 2048; + if (count < length) + length = (int)count; + + byte[] tmp = new byte[length]; + int readCount = 1; + long toSkip = count; + + while ((toSkip > 0) && (readCount > 0)) + { + if (toSkip < length) + length = (int)toSkip; + + readCount = baseInputStream.Read(tmp, 0, length); + toSkip -= readCount; + } + + return count - toSkip; + } + } + + /// + /// Returns 0 once the end of the stream (EOF) has been reached. + /// Otherwise returns 1. + /// + public virtual int Available + { + get + { + return inflater.IsFinished ? 0 : 1; + } + } + + /// + /// Fills the buffer with more data to decompress. + /// + /// + /// Stream ends early + /// + protected void Fill() + { + // Protect against redundant calls + if (inputBuffer.Available <= 0) + { + inputBuffer.Fill(); + + if (inputBuffer.Available <= 0) + throw new EndOfStreamException("Unexpected EOF"); + } + + inputBuffer.SetInflaterInput(inflater); + } + + #region Stream Overrides + /// + /// Gets a value indicating whether the current stream supports reading + /// + public override bool CanRead + { + get + { + return baseInputStream.CanRead; + } + } + + /// + /// Gets a value of false indicating seeking is not supported for this stream. + /// + public override bool CanSeek + { + get + { + return false; + } + } + + /// + /// Gets a value of false indicating that this stream is not writeable. + /// + public override bool CanWrite + { + get + { + return false; + } + } + + /// + /// A value representing the length of the stream in bytes. + /// + public override long Length + { + get + { + //return inputBuffer.RawLength; + throw new NotSupportedException("InflaterInputStream Length is not supported"); + } + } + + /// + /// The current position within the stream. + /// Throws a NotSupportedException when attempting to set the position + /// + /// Attempting to set the position + public override long Position + { + get + { + return baseInputStream.Position; + } + set + { + throw new NotSupportedException("InflaterInputStream Position not supported"); + } + } + + /// + /// Flushes the baseInputStream + /// + public override void Flush() => baseInputStream.Flush(); + + /// + /// Sets the position within the current stream + /// Always throws a NotSupportedException + /// + /// The relative offset to seek to. + /// The defining where to seek from. + /// The new position in the stream. + /// Any access + public override long Seek(long offset, SeekOrigin origin) + { + throw new NotSupportedException("Seek not supported"); + } + + /// + /// Set the length of the current stream + /// Always throws a NotSupportedException + /// + /// The new length value for the stream. + /// Any access + public override void SetLength(long value) + { + throw new NotSupportedException("InflaterInputStream SetLength not supported"); + } + + /// + /// Writes a sequence of bytes to stream and advances the current position + /// This method always throws a NotSupportedException + /// + /// Thew buffer containing data to write. + /// The offset of the first byte to write. + /// The number of bytes to write. + /// Any access + public override void Write(byte[] buffer, int offset, int count) + { + throw new NotSupportedException("InflaterInputStream Write not supported"); + } + + /// + /// Writes one byte to the current stream and advances the current position + /// Always throws a NotSupportedException + /// + /// The byte to write. + /// Any access + public override void WriteByte(byte value) + { + throw new NotSupportedException("InflaterInputStream WriteByte not supported"); + } + + /// + /// Closes the input stream. When + /// is true the underlying stream is also closed. + /// + protected override void Dispose(bool disposing) + { + if (!isClosed) + { + isClosed = true; + + if (IsStreamOwner) + baseInputStream.Dispose(); + } + } + + /// + /// Reads decompressed data into the provided buffer byte array + /// + /// + /// The array to read and decompress data into + /// + /// + /// The offset indicating where the data should be placed + /// + /// + /// The number of bytes to decompress + /// + /// The number of bytes read. Zero signals the end of stream + /// + /// Inflater needs a dictionary + /// + public override int Read(byte[] buffer, int offset, int count) + { + if (inflater.IsNeedingDictionary) + throw new InvalidOperationException("Need a dictionary"); + + int remainingBytes = count; + while (true) + { + int bytesRead = inflater.Inflate(buffer, offset, remainingBytes); + offset += bytesRead; + remainingBytes -= bytesRead; + + if (remainingBytes == 0 || inflater.IsFinished) + break; + + if (inflater.IsNeedingInput) + Fill(); + else if (bytesRead == 0) + throw new IOException("Nothing reead"); + } + + return count - remainingBytes; + } + #endregion + + #region Instance Fields + /// + /// Decompressor for this stream + /// + protected Inflater inflater; + + /// + /// Input buffer for this stream. + /// + protected InflaterInputBuffer inputBuffer; + + /// + /// Base stream the inflater reads from. + /// + private Stream baseInputStream; + + /// + /// The compressed size + /// + protected long csize; + + /// + /// Flag indicating wether this instance has been closed or not. + /// + bool isClosed; + #endregion + } +} diff --git a/UpdateLib/UpdateLib/Compression/Streams/OutputWindow.cs b/UpdateLib/UpdateLib/Compression/Streams/OutputWindow.cs new file mode 100644 index 0000000..aded4b3 --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/Streams/OutputWindow.cs @@ -0,0 +1,233 @@ +/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +/* Copyright © 2000-2016 SharpZipLib Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +using System; + +namespace MatthiWare.UpdateLib.Compression.Streams +{ + /// + /// Contains the output from the Inflation process. + /// We need to have a window so that we can refer backwards into the output stream + /// to repeat stuff.
+ /// Author of the original java version : John Leuner + ///
+ public class OutputWindow + { + #region Constants + const int WindowSize = 1 << 15; + const int WindowMask = WindowSize - 1; + #endregion + + #region Instance Fields + byte[] window = new byte[WindowSize]; //The window is 2^15 bytes + int windowEnd; + int windowFilled; + #endregion + + /// + /// Write a byte to this output window + /// + /// value to write + /// + /// if window is full + /// + public void Write(int value) + { + if (windowFilled++ == WindowSize) + throw new InvalidOperationException("Window full"); + + window[windowEnd++] = (byte)value; + windowEnd &= WindowMask; + } + + + private void SlowRepeat(int repStart, int length, int distance) + { + while (length-- > 0) + { + window[windowEnd++] = window[repStart++]; + windowEnd &= WindowMask; + repStart &= WindowMask; + } + } + + /// + /// Append a byte pattern already in the window itself + /// + /// length of pattern to copy + /// distance from end of window pattern occurs + /// + /// If the repeated data overflows the window + /// + public void Repeat(int length, int distance) + { + if ((windowFilled += length) > WindowSize) + throw new InvalidOperationException("Window full"); + + int repStart = (windowEnd - distance) & WindowMask; + int border = WindowSize - length; + + if ((repStart <= border) && (windowEnd < border)) + { + if (length <= distance) + { + Array.Copy(window, repStart, window, windowEnd, length); + windowEnd += length; + } + else + { + // We have to copy manually, since the repeat pattern overlaps. + while (length-- > 0) + window[windowEnd++] = window[repStart++]; + } + } + else + SlowRepeat(repStart, length, distance); + } + + /// + /// Copy from input manipulator to internal window + /// + /// source of data + /// length of data to copy + /// the number of bytes copied + public int CopyStored(StreamManipulator input, int length) + { + length = Math.Min(Math.Min(length, WindowSize - windowFilled), input.AvailableBytes); + int copied; + + int tailLen = WindowSize - windowEnd; + if (length > tailLen) + { + copied = input.CopyBytes(window, windowEnd, tailLen); + + if (copied == tailLen) + copied += input.CopyBytes(window, 0, length - tailLen); + } + else + copied = input.CopyBytes(window, windowEnd, length); + + windowEnd = (windowEnd + copied) & WindowMask; + windowFilled += copied; + + return copied; + } + + /// + /// Copy dictionary to window + /// + /// source dictionary + /// offset of start in source dictionary + /// length of dictionary + /// + /// If window isnt empty + /// + public void CopyDict(byte[] dictionary, int offset, int length) + { + if (dictionary == null) + throw new ArgumentNullException(nameof(dictionary)); + + if (windowFilled > 0) + throw new InvalidOperationException(); + + if (length > WindowSize) + { + offset += length - WindowSize; + length = WindowSize; + } + + Array.Copy(dictionary, offset, window, 0, length); + windowEnd = length & WindowMask; + } + + /// + /// Get remaining unfilled space in window + /// + /// Number of bytes left in window + public int GetFreeSpace()=> WindowSize - windowFilled; + + /// + /// Get bytes available for output in window + /// + /// Number of bytes filled + public int GetAvailable()=>windowFilled; + + /// + /// Copy contents of window to output + /// + /// buffer to copy to + /// offset to start at + /// number of bytes to count + /// The number of bytes copied + /// + /// If a window underflow occurs + /// + public int CopyOutput(byte[] output, int offset, int len) + { + int copyEnd = windowEnd; + + if (len > windowFilled) + len = windowFilled; + else + copyEnd = (windowEnd - windowFilled + len) & WindowMask; + + int copied = len; + int tailLen = len - copyEnd; + + if (tailLen > 0) + { + Array.Copy(window, WindowSize - tailLen, output, offset, tailLen); + offset += tailLen; + len = copyEnd; + } + + Array.Copy(window, copyEnd - len, output, offset, len); + windowFilled -= copied; + + if (windowFilled < 0) + throw new InvalidOperationException(); + + return copied; + } + + /// + /// Reset by clearing window so GetAvailable returns 0 + /// + public void Reset() + { + windowFilled = windowEnd = 0; + } + } +} diff --git a/UpdateLib/UpdateLib/Compression/Streams/StreamManipulator.cs b/UpdateLib/UpdateLib/Compression/Streams/StreamManipulator.cs new file mode 100644 index 0000000..d78211e --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/Streams/StreamManipulator.cs @@ -0,0 +1,282 @@ +/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +/* Copyright © 2000-2016 SharpZipLib Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +using System; + +namespace MatthiWare.UpdateLib.Compression.Streams +{ + /// + /// This class allows us to retrieve a specified number of bits from + /// the input buffer, as well as copy big byte blocks. + /// + /// It uses an int buffer to store up to 31 bits for direct + /// manipulation. This guarantees that we can get at least 16 bits, + /// but we only need at most 15, so this is all safe. + /// + /// There are some optimizations in this class, for example, you must + /// never peek more than 8 bits more than needed, and you must first + /// peek bits before you may drop them. This is not a general purpose + /// class but optimized for the behaviour of the Inflater. + /// + /// authors of the original java version : John Leuner, Jochen Hoenicke + /// + public class StreamManipulator + { + /// + /// Get the next sequence of bits but don't increase input pointer. bitCount must be + /// less or equal 16 and if this call succeeds, you must drop + /// at least n - 8 bits in the next call. + /// + /// The number of bits to peek. + /// + /// the value of the bits, or -1 if not enough bits available. */ + /// + public int PeekBits(int bitCount) + { + if (bitsInBuffer_ < bitCount) + { + if (windowStart_ == windowEnd_) + return -1; // ok + + buffer_ |= (uint)((window_[windowStart_++] & 0xff | + (window_[windowStart_++] & 0xff) << 8) << bitsInBuffer_); + bitsInBuffer_ += 16; + } + + return (int)(buffer_ & ((1 << bitCount) - 1)); + } + + /// + /// Drops the next n bits from the input. You should have called PeekBits + /// with a bigger or equal n before, to make sure that enough bits are in + /// the bit buffer. + /// + /// The number of bits to drop. + public void DropBits(int bitCount) + { + buffer_ >>= bitCount; + bitsInBuffer_ -= bitCount; + } + + /// + /// Gets the next n bits and increases input pointer. This is equivalent + /// to followed by , except for correct error handling. + /// + /// The number of bits to retrieve. + /// + /// the value of the bits, or -1 if not enough bits available. + /// + public int GetBits(int bitCount) + { + int bits = PeekBits(bitCount); + + if (bits >= 0) + DropBits(bitCount); + + return bits; + } + + /// + /// Gets the number of bits available in the bit buffer. This must be + /// only called when a previous PeekBits() returned -1. + /// + /// + /// the number of bits available. + /// + public int AvailableBits + { + get + { + return bitsInBuffer_; + } + } + + /// + /// Gets the number of bytes available. + /// + /// + /// The number of bytes available. + /// + public int AvailableBytes + { + get + { + return windowEnd_ - windowStart_ + (bitsInBuffer_ >> 3); + } + } + + /// + /// Skips to the next byte boundary. + /// + public void SkipToByteBoundary() + { + buffer_ >>= (bitsInBuffer_ & 7); + bitsInBuffer_ &= ~7; + } + + /// + /// Returns true when SetInput can be called + /// + public bool IsNeedingInput + { + get + { + return windowStart_ == windowEnd_; + } + } + + /// + /// Copies bytes from input buffer to output buffer starting + /// at output[offset]. You have to make sure, that the buffer is + /// byte aligned. If not enough bytes are available, copies fewer + /// bytes. + /// + /// + /// The buffer to copy bytes to. + /// + /// + /// The offset in the buffer at which copying starts + /// + /// + /// The length to copy, 0 is allowed. + /// + /// + /// The number of bytes copied, 0 if no bytes were available. + /// + /// + /// Length is less than zero + /// + /// + /// Bit buffer isnt byte aligned + /// + public int CopyBytes(byte[] output, int offset, int length) + { + if (length < 0) + throw new ArgumentOutOfRangeException(nameof(length)); + + if ((bitsInBuffer_ & 7) != 0) + // bits_in_buffer may only be 0 or a multiple of 8 + throw new InvalidOperationException("Bit buffer is not byte aligned!"); + + int count = 0; + while ((bitsInBuffer_ > 0) && (length > 0)) + { + output[offset++] = (byte)buffer_; + buffer_ >>= 8; + bitsInBuffer_ -= 8; + length--; + count++; + } + + if (length == 0) + return count; + + int avail = windowEnd_ - windowStart_; + + if (length > avail) + length = avail; + + Array.Copy(window_, windowStart_, output, offset, length); + windowStart_ += length; + + if (((windowStart_ - windowEnd_) & 1) != 0) + { + // We always want an even number of bytes in input, see peekBits + buffer_ = (uint)(window_[windowStart_++] & 0xff); + bitsInBuffer_ = 8; + } + + return count + length; + } + + /// + /// Resets state and empties internal buffers + /// + public void Reset() + { + buffer_ = 0; + windowStart_ = windowEnd_ = bitsInBuffer_ = 0; + } + + /// + /// Add more input for consumption. + /// Only call when IsNeedingInput returns true + /// + /// data to be input + /// offset of first byte of input + /// number of bytes of input to add. + public void SetInput(byte[] buffer, int offset, int count) + { + if (buffer == null) + throw new ArgumentNullException(nameof(buffer)); + + if (offset < 0) + throw new ArgumentOutOfRangeException(nameof(offset), "Cannot be negative"); + + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count), "Cannot be negative"); + + if (windowStart_ < windowEnd_) + throw new InvalidOperationException("Old input was not completely processed"); + + int end = offset + count; + + // We want to throw an ArrayIndexOutOfBoundsException early. + // Note the check also handles integer wrap around. + if ((offset > end) || (end > buffer.Length)) + throw new ArgumentOutOfRangeException(nameof(count)); + + if ((count & 1) != 0) + { + // We always want an even number of bytes in input, see PeekBits + buffer_ |= (uint)((buffer[offset++] & 0xff) << bitsInBuffer_); + bitsInBuffer_ += 8; + } + + window_ = buffer; + windowStart_ = offset; + windowEnd_ = end; + } + + #region Instance Fields + private byte[] window_; + private int windowStart_; + private int windowEnd_; + + private uint buffer_; + private int bitsInBuffer_; + #endregion + } +} diff --git a/UpdateLib/UpdateLib/Compression/VCDiff/AddressCache.cs b/UpdateLib/UpdateLib/Compression/VCDiff/AddressCache.cs new file mode 100644 index 0000000..8e4d05f --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/VCDiff/AddressCache.cs @@ -0,0 +1,81 @@ +/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using System; +using System.IO; +using MatthiWare.UpdateLib.Utils; + +namespace MatthiWare.UpdateLib.Compression.VCDiff +{ + internal class AddressCache + { + const byte SelfMode = 0; + const byte HereMode = 1; + + int m_nearSize, m_sameSize, m_nextNearSlot; + int[] m_near, m_same; + + Stream m_addressStream; + + internal AddressCache(int nearSize, int sameSize) + { + m_nearSize = nearSize; + m_sameSize = sameSize; + m_near = new int[nearSize]; + m_same = new int[sameSize * 256]; + } + + public void Reset(byte[] addresses) + { + m_nextNearSlot = 0; + Array.Clear(m_near, 0, m_near.Length); + Array.Clear(m_same, 0, m_same.Length); + + m_addressStream = new MemoryStream(addresses, false); + } + + internal int DecodeAddress(int here, byte mode) + { + int ret; + + if (mode == SelfMode) + ret = m_addressStream.ReadBigEndian7BitEncodedInt(); + else if (mode == HereMode) + ret = here - m_addressStream.ReadBigEndian7BitEncodedInt(); + else if (mode - 2 < m_nearSize) // near cache + ret = m_near[mode - 2] + m_addressStream.ReadBigEndian7BitEncodedInt(); + else // same cache + ret = m_same[((mode - (2 + m_nearSize)) * 256) + m_addressStream.CheckedReadByte()]; + + Update(ret); + + return ret; + } + + private void Update(int address) + { + if (m_nearSize > 0) + { + m_near[m_nextNearSlot] = address; + m_nextNearSlot = (m_nextNearSlot + 1) % m_nearSize; + } + + if (m_sameSize > 0) + m_same[address % (m_sameSize * 256)] = address; + } + + } +} diff --git a/UpdateLib/UpdateLib/Compression/VCDiff/CodeTable.cs b/UpdateLib/UpdateLib/Compression/VCDiff/CodeTable.cs new file mode 100644 index 0000000..5042faa --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/VCDiff/CodeTable.cs @@ -0,0 +1,111 @@ +/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using MatthiWare.UpdateLib.Common; +using System; + +namespace MatthiWare.UpdateLib.Compression.VCDiff +{ + internal class CodeTable + { + internal static CodeTable Default = BuildDefaultCodeTable(); + Instruction[,] m_instructions = new Instruction[256, 2]; + + internal CodeTable(Instruction[,] instructions) + { + if (instructions == null) + throw new ArgumentNullException(nameof(instructions)); + if (instructions.Rank != 2) + throw new ArgumentException("Array must have a rank of 2", nameof(instructions)); + if (instructions.GetLength(0) != 256) + throw new ArgumentException("Array must have a outer length of 256", nameof(instructions)); + if (instructions.GetLength(1) != 2) + throw new ArgumentException("Array must have a innter length of 2", nameof(instructions)); + + Array.Copy(instructions, 0, m_instructions, 0, 512); + } + + internal Instruction this[int x, int y] + { + get + { + return m_instructions[x, y]; + } + } + + private static CodeTable BuildDefaultCodeTable() + { + // default are NoOps with size and mode 0. + Instruction[,] instructions = new Instruction[256, 2]; + instructions[0, 0] = new Instruction(InstructionType.Run, 0, 0); + + for (byte i = 0; i < 18; i++) + instructions[i + 1, 0] = new Instruction(InstructionType.Add, i, 0); + + int index = 19; + + // instructions 19-162 + for (byte mode = 0; mode < 9; mode++) + { + instructions[index++, 0] = new Instruction(InstructionType.Copy, 0, mode); + for (byte size = 4; size < 19; size++) + instructions[index++, 0] = new Instruction(InstructionType.Copy, size, mode); + } + + // instructions 163-234 + for (byte mode = 0; mode < 6; mode++) + for (byte addSize = 1; addSize < 5; addSize++) + for (byte copySize = 4; copySize < 7; copySize++) + { + instructions[index, 0] = new Instruction(InstructionType.Add, addSize, 0); + instructions[index++, 0] = new Instruction(InstructionType.Copy, copySize, mode); + } + + // instructions 235-246 + for (byte mode = 6; mode < 9; mode++) + for (byte addSize = 1; addSize < 5; addSize++) + { + instructions[index, 0] = new Instruction(InstructionType.Add, addSize, 0); + instructions[index++, 1] = new Instruction(InstructionType.Copy, 4, mode); + } + + for (byte mode = 0; mode < 9; mode++) + { + instructions[index, 0] = new Instruction(InstructionType.Copy, 4, mode); + instructions[index++, 1] = new Instruction(InstructionType.Add, 1, 0); + } + + return new CodeTable(instructions); + } + + internal byte[] GetBytes() + { + byte[] ret = new byte[1536]; + + for (int i = 0; i < 256; i++) + { + ret[i] = (byte)m_instructions[i, 0].Type; + ret[i + 256] = (byte)m_instructions[i, 1].Type; + ret[i + 512] = m_instructions[i, 0].Size; + ret[i + 768] = m_instructions[i, 1].Size; + ret[i + 1024] = m_instructions[i, 0].Size; + ret[i + 1028] = m_instructions[i, 1].Size; + } + + return ret; + } + } +} diff --git a/UpdateLib/UpdateLib/Compression/VCDiff/Instruction.cs b/UpdateLib/UpdateLib/Compression/VCDiff/Instruction.cs new file mode 100644 index 0000000..ac35e63 --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/VCDiff/Instruction.cs @@ -0,0 +1,36 @@ +/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using MatthiWare.UpdateLib.Common; + +namespace MatthiWare.UpdateLib.Compression.VCDiff +{ + internal struct Instruction + { + public readonly InstructionType Type; + + public readonly byte Size; + + public readonly byte Mode; + + internal Instruction(InstructionType type, byte size, byte mode) + { + Type = type; + Size = size; + Mode = mode; + } + } +} diff --git a/UpdateLib/UpdateLib/Compression/VCDiff/VCDiffDecoder.cs b/UpdateLib/UpdateLib/Compression/VCDiff/VCDiffDecoder.cs new file mode 100644 index 0000000..b8e32d8 --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/VCDiff/VCDiffDecoder.cs @@ -0,0 +1,198 @@ +/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using System; +using System.IO; +using MatthiWare.UpdateLib.Utils; +using MatthiWare.UpdateLib.Common; + +namespace MatthiWare.UpdateLib.Compression.VCDiff +{ + public sealed class VCDiffDecoder + { + private Stream m_original, m_delta, m_output; + + private CodeTable m_codeTable = CodeTable.Default; + + private AddressCache m_cache = new AddressCache(4, 3); + + public event ProgressChangedHandler ProgressChanged; + + public VCDiffDecoder(Stream original, Stream delta, Stream output) + { + if (original == null) throw new ArgumentNullException(nameof(original)); + if (delta == null) throw new ArgumentNullException(nameof(delta)); + if (output == null) throw new ArgumentNullException(nameof(output)); + + if (!original.CanRead || !original.CanSeek) + throw new ArgumentException("Must be able to read and seek in stream", nameof(original)); + + if (!delta.CanRead) + throw new ArgumentException("Must be able to read in stream", nameof(delta)); + + if (!output.CanWrite || !output.CanSeek || !output.CanRead) + throw new ArgumentException("Must be able to read, seek and write in stream", nameof(output)); + + m_original = original; + m_delta = delta; + m_output = output; + } + + public void Decode() + { + ReadHeader(); + + while (DecodeWindow()) + OnProgressChanged(false, (m_delta.Position * 1.0) / m_delta.Length); + + OnProgressChanged(true, 1); + } + + private void OnProgressChanged(bool completed, double progress) + => ProgressChanged?.Invoke(completed, progress); + + private void ReadHeader() + { + byte[] header = m_delta.CheckedReadBytes(4); + + if (header[0] != 0xd6 || + header[1] != 0xc3 || + header[2] != 0xc4) + throw new VCDiffFormatException("Invalid header in delta stream"); + + if (header[3] != 0) + throw new VCDiffFormatException("Only VCDiff Version 0 is supported"); + + byte headerIndicator = m_delta.CheckedReadByte(); + + if ((headerIndicator & 1) != 0) + throw new VCDiffFormatException("Secondary compressors are not supported"); + + if ((headerIndicator & 0xf8) != 0) + throw new VCDiffFormatException("Invalid header indicator, bits 3-7 not all zero"); + } + + private bool DecodeWindow() + { + int windowIndicator = m_delta.ReadByte(); + + if (windowIndicator == -1) + return false; + + Stream sourceStream; + int sourceStreamPostReadSeek = -1; + windowIndicator &= 0xfb; + + switch (windowIndicator & 3) + { + case 0: + sourceStream = null; + break; + case 1: + sourceStream = m_original; + break; + case 2: + sourceStream = m_output; + sourceStreamPostReadSeek = (int)m_output.Position; + break; + default: + throw new VCDiffFormatException("Invalid window indicator"); + } + + + int sourceLength = m_delta.ReadBigEndian7BitEncodedInt(); + int sourcePosition = m_delta.ReadBigEndian7BitEncodedInt(); + + sourceStream.Position = sourcePosition; + byte[] sourceData = sourceStream.CheckedReadBytes(sourceLength); + if (sourceStreamPostReadSeek != -1) + sourceStream.Position = sourceStreamPostReadSeek; + + m_delta.ReadBigEndian7BitEncodedInt(); + + int targetLength = m_delta.ReadBigEndian7BitEncodedInt(); + byte[] targetData = new byte[targetLength]; + MemoryStream targetDataStream = new MemoryStream(targetData, true); + + if (m_delta.CheckedReadByte() != 0) + throw new VCDiffFormatException("Unable to handle compressed delta sections"); + + int addRunDataLength = m_delta.ReadBigEndian7BitEncodedInt(); + int instructionsLength = m_delta.ReadBigEndian7BitEncodedInt(); + int addressesLength = m_delta.ReadBigEndian7BitEncodedInt(); + + byte[] addRunData = m_delta.CheckedReadBytes(addRunDataLength); + byte[] instructions = m_delta.CheckedReadBytes(instructionsLength); + byte[] addresses = m_delta.CheckedReadBytes(addressesLength); + + int addRunDataIndex = 0; + MemoryStream instructionStream = new MemoryStream(instructions, false); + + m_cache.Reset(addresses); + + while (true) + { + int instructionIndex = instructionStream.ReadByte(); + if (instructionIndex == -1) + break; + + for (int i = 0; i < 2; i++) + { + Instruction instruction = m_codeTable[instructionIndex, i]; + int size = instruction.Size; + + if (size == 0 && instruction.Type != InstructionType.NoOp) + size = instructionStream.ReadBigEndian7BitEncodedInt(); + + switch (instruction.Type) + { + case InstructionType.NoOp: + break; + case InstructionType.Add: + targetDataStream.Write(addRunData, addRunDataIndex, size); + addRunDataIndex += size; + break; + case InstructionType.Copy: + int addr = m_cache.DecodeAddress((int)targetDataStream.Position + sourceLength, instruction.Mode); + if (addr < sourceData.Length) + targetDataStream.Write(sourceData, addr, size); + else + { + addr -= sourceLength; + if (addr + size < targetDataStream.Position) + targetDataStream.Write(targetData, addr, size); + else + for (int j = 0; j < size; j++) + targetDataStream.WriteByte(targetData[addr++]); + } + break; + case InstructionType.Run: + byte data = addRunData[addRunDataIndex++]; + for (int j = 0; j < size; j++) + targetDataStream.WriteByte(data); + break; + default: + throw new VCDiffFormatException("Invalid instruction type found"); + } + } + + m_output.Write(targetData, 0, targetLength); + } + + return true; + } + } +} diff --git a/UpdateLib/UpdateLib/Compression/VCDiff/VCDiffFormatException.cs b/UpdateLib/UpdateLib/Compression/VCDiff/VCDiffFormatException.cs new file mode 100644 index 0000000..02f9621 --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/VCDiff/VCDiffFormatException.cs @@ -0,0 +1,35 @@ +/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using System; +using System.Runtime.Serialization; + +namespace MatthiWare.UpdateLib.Compression.VCDiff +{ + [Serializable] + public class VCDiffFormatException : Exception + { + public VCDiffFormatException() { } + + public VCDiffFormatException(string message) : base(message) { } + + public VCDiffFormatException(string message, Exception inner) : base(message, inner) { } + + protected VCDiffFormatException( + SerializationInfo info, + StreamingContext context) : base(info, context) { } + } +} diff --git a/UpdateLib/UpdateLib/Compression/Zip/Zip.cs b/UpdateLib/UpdateLib/Compression/Zip/Zip.cs new file mode 100644 index 0000000..8c8614b --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/Zip/Zip.cs @@ -0,0 +1,22 @@ +/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +namespace MatthiWare.UpdateLib.Compression.Zip +{ + public static class Zip + { + } +} diff --git a/UpdateLib/UpdateLib/Compression/Zip/ZipConstants.cs b/UpdateLib/UpdateLib/Compression/Zip/ZipConstants.cs new file mode 100644 index 0000000..3a03c92 --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/Zip/ZipConstants.cs @@ -0,0 +1,470 @@ +using System; +/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +/* Copyright © 2000-2016 SharpZipLib Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +using System.Text; + +namespace MatthiWare.UpdateLib.Compression.Zip +{ + #region Enumerations + + /// + /// Determines how entries are tested to see if they should use Zip64 extensions or not. + /// + public enum UseZip64 + { + /// + /// Zip64 will not be forced on entries during processing. + /// + /// An entry can have this overridden if required + Off, + /// + /// Zip64 should always be used. + /// + On, + /// + /// #ZipLib will determine use based on entry values when added to archive. + /// + Dynamic, + } + + /// + /// The kind of compression used for an entry in an archive + /// + public enum CompressionMethod + { + /// + /// A direct copy of the file contents is held in the archive + /// + Stored = 0, + + /// + /// Common Zip compression method using a sliding dictionary + /// of up to 32KB and secondary compression from Huffman/Shannon-Fano trees + /// + Deflated = 8, + + /// + /// An extension to deflate with a 64KB window. Not supported by #Zip currently + /// + Deflate64 = 9, + + /// + /// BZip2 compression. Not supported by #Zip. + /// + BZip2 = 11 + + } + + /// + /// Defines the contents of the general bit flags field for an archive entry. + /// + [Flags] + public enum GeneralBitFlags + { + /// + /// Bit 0 if set indicates that the file is encrypted + /// + Encrypted = 0x0001, + /// + /// Bits 1 and 2 - Two bits defining the compression method (only for Method 6 Imploding and 8,9 Deflating) + /// + Method = 0x0006, + /// + /// Bit 3 if set indicates a trailing data desciptor is appended to the entry data + /// + Descriptor = 0x0008, + /// + /// Bit 4 is reserved for use with method 8 for enhanced deflation + /// + ReservedPKware4 = 0x0010, + /// + /// Bit 5 if set indicates the file contains Pkzip compressed patched data. + /// Requires version 2.7 or greater. + /// + Patched = 0x0020, + /// + /// Bit 6 if set indicates strong encryption has been used for this entry. + /// + StrongEncryption = 0x0040, + /// + /// Bit 7 is currently unused + /// + Unused7 = 0x0080, + /// + /// Bit 8 is currently unused + /// + Unused8 = 0x0100, + /// + /// Bit 9 is currently unused + /// + Unused9 = 0x0200, + /// + /// Bit 10 is currently unused + /// + Unused10 = 0x0400, + /// + /// Bit 11 if set indicates the filename and + /// comment fields for this file must be encoded using UTF-8. + /// + UnicodeText = 0x0800, + /// + /// Bit 12 is documented as being reserved by PKware for enhanced compression. + /// + EnhancedCompress = 0x1000, + /// + /// Bit 13 if set indicates that values in the local header are masked to hide + /// their actual values, and the central directory is encrypted. + /// + /// + /// Used when encrypting the central directory contents. + /// + HeaderMasked = 0x2000, + /// + /// Bit 14 is documented as being reserved for use by PKware + /// + ReservedPkware14 = 0x4000, + /// + /// Bit 15 is documented as being reserved for use by PKware + /// + ReservedPkware15 = 0x8000 + } + + #endregion + + /// + /// This class contains constants used for Zip format files + /// + public static class ZipConstants + { + #region Versions + /// + /// The version made by field for entries in the central header when created by this library + /// + /// + /// This is also the Zip version for the library when comparing against the version required to extract + /// for an entry. See . + /// + public const int VersionMadeBy = 51; // was 45 before AES + + /// + /// The version required for Zip64 extensions (4.5 or higher) + /// + public const int VersionZip64 = 45; + #endregion + + #region Header Sizes + /// + /// Size of local entry header (excluding variable length fields at end) + /// + public const int LocalHeaderBaseSize = 30; + + /// + /// Size of Zip64 data descriptor + /// + public const int Zip64DataDescriptorSize = 24; + + /// + /// Size of data descriptor + /// + public const int DataDescriptorSize = 16; + + /// + /// Size of central header entry (excluding variable fields) + /// + public const int CentralHeaderBaseSize = 46; + + /// + /// Size of end of central record (excluding variable fields) + /// + public const int EndOfCentralRecordBaseSize = 22; + + /// + /// Size of 'classic' cryptographic header stored before any entry data + /// + public const int CryptoHeaderSize = 12; + #endregion + + #region Header Signatures + + /// + /// Signature for local entry header + /// + public const int LocalHeaderSignature = 'P' | ('K' << 8) | (3 << 16) | (4 << 24); + + /// + /// Signature for local entry header + /// + [Obsolete("Use LocalHeaderSignature instead")] + public const int LOCSIG = 'P' | ('K' << 8) | (3 << 16) | (4 << 24); + + /// + /// Signature for spanning entry + /// + public const int SpanningSignature = 'P' | ('K' << 8) | (7 << 16) | (8 << 24); + + /// + /// Signature for spanning entry + /// + [Obsolete("Use SpanningSignature instead")] + public const int SPANNINGSIG = 'P' | ('K' << 8) | (7 << 16) | (8 << 24); + + /// + /// Signature for temporary spanning entry + /// + public const int SpanningTempSignature = 'P' | ('K' << 8) | ('0' << 16) | ('0' << 24); + + /// + /// Signature for temporary spanning entry + /// + [Obsolete("Use SpanningTempSignature instead")] + public const int SPANTEMPSIG = 'P' | ('K' << 8) | ('0' << 16) | ('0' << 24); + + /// + /// Signature for data descriptor + /// + /// + /// This is only used where the length, Crc, or compressed size isnt known when the + /// entry is created and the output stream doesnt support seeking. + /// The local entry cannot be 'patched' with the correct values in this case + /// so the values are recorded after the data prefixed by this header, as well as in the central directory. + /// + public const int DataDescriptorSignature = 'P' | ('K' << 8) | (7 << 16) | (8 << 24); + + /// + /// Signature for data descriptor + /// + /// + /// This is only used where the length, Crc, or compressed size isnt known when the + /// entry is created and the output stream doesnt support seeking. + /// The local entry cannot be 'patched' with the correct values in this case + /// so the values are recorded after the data prefixed by this header, as well as in the central directory. + /// + [Obsolete("Use DataDescriptorSignature instead")] + public const int EXTSIG = 'P' | ('K' << 8) | (7 << 16) | (8 << 24); + + /// + /// Signature for central header + /// + [Obsolete("Use CentralHeaderSignature instead")] + public const int CENSIG = 'P' | ('K' << 8) | (1 << 16) | (2 << 24); + + /// + /// Signature for central header + /// + public const int CentralHeaderSignature = 'P' | ('K' << 8) | (1 << 16) | (2 << 24); + + /// + /// Signature for Zip64 central file header + /// + public const int Zip64CentralFileHeaderSignature = 'P' | ('K' << 8) | (6 << 16) | (6 << 24); + + /// + /// Signature for Zip64 central file header + /// + [Obsolete("Use Zip64CentralFileHeaderSignature instead")] + public const int CENSIG64 = 'P' | ('K' << 8) | (6 << 16) | (6 << 24); + + /// + /// Signature for Zip64 central directory locator + /// + public const int Zip64CentralDirLocatorSignature = 'P' | ('K' << 8) | (6 << 16) | (7 << 24); + + /// + /// Signature for archive extra data signature (were headers are encrypted). + /// + public const int ArchiveExtraDataSignature = 'P' | ('K' << 8) | (6 << 16) | (7 << 24); + + /// + /// Central header digitial signature + /// + public const int CentralHeaderDigitalSignature = 'P' | ('K' << 8) | (5 << 16) | (5 << 24); + + /// + /// Central header digitial signature + /// + [Obsolete("Use CentralHeaderDigitalSignaure instead")] + public const int CENDIGITALSIG = 'P' | ('K' << 8) | (5 << 16) | (5 << 24); + + /// + /// End of central directory record signature + /// + public const int EndOfCentralDirectorySignature = 'P' | ('K' << 8) | (5 << 16) | (6 << 24); + + /// + /// End of central directory record signature + /// + [Obsolete("Use EndOfCentralDirectorySignature instead")] + public const int ENDSIG = 'P' | ('K' << 8) | (5 << 16) | (6 << 24); + #endregion + + /// + /// The original Zip specification (https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT) states + /// that file names should only be encoded with IBM Code Page 437 or UTF-8. + /// In practice, most zip apps use OEM or system encoding (typically cp437 on Windows). + /// Let's be good citizens and default to UTF-8 http://utf8everywhere.org/ + /// + static int defaultCodePage = Encoding.UTF8.CodePage; + + /// + /// Default encoding used for string conversion. 0 gives the default system OEM code page. + /// Using the default code page isnt the full solution neccessarily + /// there are many variable factors, codepage 850 is often a good choice for + /// European users, however be careful about compatability. + /// + public static int DefaultCodePage + { + get + { + return defaultCodePage; + } + set + { + if ((value < 0) || (value > 65535) || + (value == 1) || (value == 2) || (value == 3) || (value == 42)) + throw new ArgumentOutOfRangeException(nameof(value)); + + defaultCodePage = value; + } + } + + /// + /// Convert a portion of a byte array to a string. + /// + /// + /// Data to convert to string + /// + /// + /// Number of bytes to convert starting from index 0 + /// + /// + /// data[0]..data[count - 1] converted to a string + /// + public static string ConvertToString(byte[] data, int count) + { + if (data == null) + return string.Empty; + + return Encoding.GetEncoding(DefaultCodePage).GetString(data, 0, count); + } + + /// + /// Convert a byte array to string + /// + /// + /// Byte array to convert + /// + /// + /// dataconverted to a string + /// + public static string ConvertToString(byte[] data) + { + if (data == null) + return string.Empty; + + return ConvertToString(data, data.Length); + } + + /// + /// Convert a byte array to string + /// + /// The applicable general purpose bits flags + /// + /// Byte array to convert + /// + /// The number of bytes to convert. + /// + /// dataconverted to a string + /// + public static string ConvertToStringExt(int flags, byte[] data, int count) + { + if (data == null) + return string.Empty; + + return (flags & (int)GeneralBitFlags.UnicodeText) != 0 ? + Encoding.UTF8.GetString(data, 0, count) : + ConvertToString(data, count); + } + + /// + /// Convert a byte array to string + /// + /// + /// Byte array to convert + /// + /// The applicable general purpose bits flags + /// + /// dataconverted to a string + /// + public static string ConvertToStringExt(int flags, byte[] data) + { + if (data == null) + return string.Empty; + + return ((flags & (int)GeneralBitFlags.UnicodeText) != 0) ? Encoding.UTF8.GetString(data, 0, data.Length) : ConvertToString(data, data.Length); + } + + /// + /// Convert a string to a byte array + /// + /// + /// String to convert to an array + /// + /// Converted array + public static byte[] ConvertToArray(string str) + { + if (str == null) + return new byte[0]; + + return Encoding.GetEncoding(DefaultCodePage).GetBytes(str); + } + + /// + /// Convert a string to a byte array + /// + /// The applicable general purpose bits flags + /// + /// String to convert to an array + /// + /// Converted array + public static byte[] ConvertToArray(int flags, string str) + { + if (str == null) + return new byte[0]; + + return ((flags & (int)GeneralBitFlags.UnicodeText) != 0) ? Encoding.UTF8.GetBytes(str) : ConvertToArray(str); + } + } +} diff --git a/UpdateLib/UpdateLib/Compression/Zip/ZipEntry.cs b/UpdateLib/UpdateLib/Compression/Zip/ZipEntry.cs new file mode 100644 index 0000000..9c0831e --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/Zip/ZipEntry.cs @@ -0,0 +1,1056 @@ +/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +/* Copyright © 2000-2016 SharpZipLib Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +using System; +using System.IO; + +namespace MatthiWare.UpdateLib.Compression.Zip +{ + /// + /// Defines known values for the property. + /// + public enum HostSystemID + { + /// + /// Host system = MSDOS + /// + Msdos = 0, + /// + /// Host system = Amiga + /// + Amiga = 1, + /// + /// Host system = Open VMS + /// + OpenVms = 2, + /// + /// Host system = Unix + /// + Unix = 3, + /// + /// Host system = VMCms + /// + VMCms = 4, + /// + /// Host system = Atari ST + /// + AtariST = 5, + /// + /// Host system = OS2 + /// + OS2 = 6, + /// + /// Host system = Macintosh + /// + Macintosh = 7, + /// + /// Host system = ZSystem + /// + ZSystem = 8, + /// + /// Host system = Cpm + /// + Cpm = 9, + /// + /// Host system = Windows NT + /// + WindowsNT = 10, + /// + /// Host system = MVS + /// + MVS = 11, + /// + /// Host system = VSE + /// + Vse = 12, + /// + /// Host system = Acorn RISC + /// + AcornRisc = 13, + /// + /// Host system = VFAT + /// + Vfat = 14, + /// + /// Host system = Alternate MVS + /// + AlternateMvs = 15, + /// + /// Host system = BEOS + /// + BeOS = 16, + /// + /// Host system = Tandem + /// + Tandem = 17, + /// + /// Host system = OS400 + /// + OS400 = 18, + /// + /// Host system = OSX + /// + OSX = 19, + /// + /// Host system = WinZIP AES + /// + WinZipAES = 99, + } + + /// + /// This class represents an entry in a zip archive. This can be a file + /// or a directory + /// ZipFile and ZipInputStream will give you instances of this class as + /// information about the members in an archive. ZipOutputStream + /// uses an instance of this class when creating an entry in a Zip file. + ///
+ ///
Author of the original java version : Jochen Hoenicke + ///
+ public class ZipEntry + { + [Flags] + enum Known : byte + { + None = 0, + Size = 0x01, + CompressedSize = 0x02, + Crc = 0x04, + Time = 0x08, + ExternalAttributes = 0x10, + } + + #region Constructors + /// + /// Creates a zip entry with the given name. + /// + /// + /// The name for this entry. Can include directory components. + /// The convention for names is 'unix' style paths with relative names only. + /// There are with no device names and path elements are separated by '/' characters. + /// + /// + /// The name passed is null + /// + public ZipEntry(string name) + : this(name, 0, ZipConstants.VersionMadeBy, CompressionMethod.Deflated) + { + } + + /// + /// Creates a zip entry with the given name and version required to extract + /// + /// + /// The name for this entry. Can include directory components. + /// The convention for names is 'unix' style paths with no device names and + /// path elements separated by '/' characters. This is not enforced see CleanName + /// on how to ensure names are valid if this is desired. + /// + /// + /// The minimum 'feature version' required this entry + /// + /// + /// The name passed is null + /// + internal ZipEntry(string name, int versionRequiredToExtract) + : this(name, versionRequiredToExtract, ZipConstants.VersionMadeBy, + CompressionMethod.Deflated) + { + } + + /// + /// Initializes an entry with the given name and made by information + /// + /// Name for this entry + /// Version and HostSystem Information + /// Minimum required zip feature version required to extract this entry + /// Compression method for this entry. + /// + /// The name passed is null + /// + /// + /// versionRequiredToExtract should be 0 (auto-calculate) or > 10 + /// + /// + /// This constructor is used by the ZipFile class when reading from the central header + /// It is not generally useful, use the constructor specifying the name only. + /// + internal ZipEntry(string name, int versionRequiredToExtract, int madeByInfo, + CompressionMethod method) + { + if (name == null) + throw new ArgumentNullException(nameof(name)); + + if (name.Length > 0xffff) + throw new ArgumentException("Name is too long", nameof(name)); + + if ((versionRequiredToExtract != 0) && (versionRequiredToExtract < 10)) + throw new ArgumentOutOfRangeException(nameof(versionRequiredToExtract)); + + + DateTime = DateTime.Now; + this.name = CleanName(name); + versionMadeBy = (ushort)madeByInfo; + versionToExtract = (ushort)versionRequiredToExtract; + this.method = method; + } + + #endregion + + /// + /// Get a value indicating wether the entry has a CRC value available. + /// + public bool HasCrc + { + get + { + return (known & Known.Crc) != 0; + } + } + + /// + /// Get / set a flag indicating wether entry name and comment text are + /// encoded in unicode UTF8. + /// + /// This is an assistant that interprets the flags property. + public bool IsUnicodeText + { + get + { + return (flags & (int)GeneralBitFlags.UnicodeText) != 0; + } + set + { + if (value) + { + flags |= (int)GeneralBitFlags.UnicodeText; + } + else + { + flags &= ~(int)GeneralBitFlags.UnicodeText; + } + } + } + + /// + /// Get/Set general purpose bit flag for entry + /// + /// + /// General purpose bit flag
+ ///
+ /// Bit 0: If set, indicates the file is encrypted
+ /// Bit 1-2 Only used for compression type 6 Imploding, and 8, 9 deflating
+ /// Imploding:
+ /// Bit 1 if set indicates an 8K sliding dictionary was used. If clear a 4k dictionary was used
+ /// Bit 2 if set indicates 3 Shannon-Fanno trees were used to encode the sliding dictionary, 2 otherwise
+ ///
+ /// Deflating:
+ /// Bit 2 Bit 1
+ /// 0 0 Normal compression was used
+ /// 0 1 Maximum compression was used
+ /// 1 0 Fast compression was used
+ /// 1 1 Super fast compression was used
+ ///
+ /// Bit 3: If set, the fields crc-32, compressed size + /// and uncompressed size are were not able to be written during zip file creation + /// The correct values are held in a data descriptor immediately following the compressed data.
+ /// Bit 4: Reserved for use by PKZIP for enhanced deflating
+ /// Bit 5: If set indicates the file contains compressed patch data
+ /// Bit 6: If set indicates strong encryption was used.
+ /// Bit 7-10: Unused or reserved
+ /// Bit 11: If set the name and comments for this entry are in unicode.
+ /// Bit 12-15: Unused or reserved
+ ///
+ /// + /// + public int Flags + { + get + { + return flags; + } + set + { + flags = value; + } + } + + /// + /// Get/Set index of this entry in Zip file + /// + /// This is only valid when the entry is part of a + public long ZipFileIndex + { + get + { + return zipFileIndex; + } + set + { + zipFileIndex = value; + } + } + + /// + /// Get/set offset for use in central header + /// + public long Offset + { + get + { + return offset; + } + set + { + offset = value; + } + } + + /// + /// Get/Set external file attributes as an integer. + /// The values of this are operating system dependant see + /// HostSystem for details + /// + public int ExternalFileAttributes + { + get + { + return ((known & Known.ExternalAttributes) == 0) ? -1 : externalFileAttributes; + } + + set + { + externalFileAttributes = value; + known |= Known.ExternalAttributes; + } + } + + /// + /// Get the version made by for this entry or zero if unknown. + /// The value / 10 indicates the major version number, and + /// the value mod 10 is the minor version number + /// + public int VersionMadeBy + { + get + { + return (versionMadeBy & 0xff); + } + } + + /// + /// Get a value indicating this entry is for a DOS/Windows system. + /// + public bool IsDOSEntry + { + get + { + return ((HostSystem == (int)HostSystemID.Msdos) || + (HostSystem == (int)HostSystemID.WindowsNT)); + } + } + + /// + /// Test the external attributes for this to + /// see if the external attributes are Dos based (including WINNT and variants) + /// and match the values + /// + /// The attributes to test. + /// Returns true if the external attributes are known to be DOS/Windows + /// based and have the same attributes set as the value passed. + bool HasDosAttributes(int attributes) + { + bool result = false; + + if ((known & Known.ExternalAttributes) != 0) + result |= (((HostSystem == (int)HostSystemID.Msdos) || + (HostSystem == (int)HostSystemID.WindowsNT)) && + (ExternalFileAttributes & attributes) == attributes); + + return result; + } + + /// + /// Gets the compatability information for the external file attribute + /// If the external file attributes are compatible with MS-DOS and can be read + /// by PKZIP for DOS version 2.04g then this value will be zero. Otherwise the value + /// will be non-zero and identify the host system on which the attributes are compatible. + /// + /// + /// + /// The values for this as defined in the Zip File format and by others are shown below. The values are somewhat + /// misleading in some cases as they are not all used as shown. You should consult the relevant documentation + /// to obtain up to date and correct information. The modified appnote by the infozip group is + /// particularly helpful as it documents a lot of peculiarities. The document is however a little dated. + /// + /// 0 - MS-DOS and OS/2 (FAT / VFAT / FAT32 file systems) + /// 1 - Amiga + /// 2 - OpenVMS + /// 3 - Unix + /// 4 - VM/CMS + /// 5 - Atari ST + /// 6 - OS/2 HPFS + /// 7 - Macintosh + /// 8 - Z-System + /// 9 - CP/M + /// 10 - Windows NTFS + /// 11 - MVS (OS/390 - Z/OS) + /// 12 - VSE + /// 13 - Acorn Risc + /// 14 - VFAT + /// 15 - Alternate MVS + /// 16 - BeOS + /// 17 - Tandem + /// 18 - OS/400 + /// 19 - OS/X (Darwin) + /// 99 - WinZip AES + /// remainder - unused + /// + /// + public int HostSystem + { + get + { + return (versionMadeBy >> 8) & 0xff; + } + + set + { + versionMadeBy &= 0xff; + versionMadeBy |= (ushort)((value & 0xff) << 8); + } + } + + /// + /// Get minimum Zip feature version required to extract this entry + /// + /// + /// Minimum features are defined as:
+ /// 1.0 - Default value
+ /// 1.1 - File is a volume label
+ /// 2.0 - File is a folder/directory
+ /// 2.0 - File is compressed using Deflate compression
+ /// 2.0 - File is encrypted using traditional encryption
+ /// 2.1 - File is compressed using Deflate64
+ /// 2.5 - File is compressed using PKWARE DCL Implode
+ /// 2.7 - File is a patch data set
+ /// 4.5 - File uses Zip64 format extensions
+ /// 4.6 - File is compressed using BZIP2 compression
+ /// 5.0 - File is encrypted using DES
+ /// 5.0 - File is encrypted using 3DES
+ /// 5.0 - File is encrypted using original RC2 encryption
+ /// 5.0 - File is encrypted using RC4 encryption
+ /// 5.1 - File is encrypted using AES encryption
+ /// 5.1 - File is encrypted using corrected RC2 encryption
+ /// 5.1 - File is encrypted using corrected RC2-64 encryption
+ /// 6.1 - File is encrypted using non-OAEP key wrapping
+ /// 6.2 - Central directory encryption (not confirmed yet)
+ /// 6.3 - File is compressed using LZMA
+ /// 6.3 - File is compressed using PPMD+
+ /// 6.3 - File is encrypted using Blowfish
+ /// 6.3 - File is encrypted using Twofish
+ ///
+ /// + public int Version + { + get + { + // Return recorded version if known. + if (versionToExtract != 0) + return versionToExtract & 0x00ff; // Only lower order byte. High order is O/S file system. + else + { + int result = 10; + + if (CentralHeaderRequiresZip64) + result = ZipConstants.VersionZip64; + else if (CompressionMethod.Deflated == method) + result = 20; + else if (IsDirectory == true) + result = 20; + else if (HasDosAttributes(0x08)) + result = 11; + + return result; + } + } + } + + /// + /// Get a value indicating whether this entry can be decompressed by the library. + /// + /// This is based on the and + /// wether the compression method is supported. + public bool CanDecompress + { + get + { + return (Version <= ZipConstants.VersionMadeBy) && + ((Version == 10) || + (Version == 11) || + (Version == 20) || + (Version == 45) || + (Version == 51)) && + IsCompressionMethodSupported(); + } + } + + /// + /// Force this entry to be recorded using Zip64 extensions. + /// + public void ForceZip64() + { + forceZip64_ = true; + } + + /// + /// Get a value indicating wether Zip64 extensions were forced. + /// + /// A value of true if Zip64 extensions have been forced on; false if not. + public bool IsZip64Forced() => forceZip64_; + + /// + /// Gets a value indicating if the entry requires Zip64 extensions + /// to store the full entry values. + /// + /// A value of true if a local header requires Zip64 extensions; false if not. + public bool LocalHeaderRequiresZip64 + { + get + { + bool result = forceZip64_; + + if (!result) + { + // TODO: A better estimation of the true limit based on compression overhead should be used + // to determine when an entry should use Zip64. + result = + ((size >= uint.MaxValue) || (compressedSize >= uint.MaxValue)) && + ((versionToExtract == 0) || (versionToExtract >= ZipConstants.VersionZip64)); + } + + return result; + } + } + + /// + /// Get a value indicating wether the central directory entry requires Zip64 extensions to be stored. + /// + public bool CentralHeaderRequiresZip64 + { + get + { + return LocalHeaderRequiresZip64 || (offset >= uint.MaxValue); + } + } + + /// + /// Get/Set DosTime value. + /// + /// + /// The MS-DOS date format can only represent dates between 1/1/1980 and 12/31/2107. + /// + public long DosTime + { + get + { + return ((known & Known.Time) == 0) ? 0 : dosTime; + } + + set + { + unchecked + { + dosTime = (uint)value; + } + + known |= Known.Time; + } + } + + /// + /// Gets/Sets the time of last modification of the entry. + /// + /// + /// The property is updated to match this as far as possible. + /// + public DateTime DateTime + { + get + { + uint sec = Math.Min(59, 2 * (dosTime & 0x1f)); + uint min = Math.Min(59, (dosTime >> 5) & 0x3f); + uint hrs = Math.Min(23, (dosTime >> 11) & 0x1f); + uint mon = Math.Max(1, Math.Min(12, ((dosTime >> 21) & 0xf))); + uint year = ((dosTime >> 25) & 0x7f) + 1980; + int day = Math.Max(1, Math.Min(DateTime.DaysInMonth((int)year, (int)mon), (int)((dosTime >> 16) & 0x1f))); + return new System.DateTime((int)year, (int)mon, day, (int)hrs, (int)min, (int)sec); + } + + set + { + var year = (uint)value.Year; + var month = (uint)value.Month; + var day = (uint)value.Day; + var hour = (uint)value.Hour; + var minute = (uint)value.Minute; + var second = (uint)value.Second; + + if (year < 1980) + { + year = 1980; + month = 1; + day = 1; + hour = 0; + minute = 0; + second = 0; + } + else if (year > 2107) + { + year = 2107; + month = 12; + day = 31; + hour = 23; + minute = 59; + second = 59; + } + + DosTime = ((year - 1980) & 0x7f) << 25 | + (month << 21) | + (day << 16) | + (hour << 11) | + (minute << 5) | + (second >> 1); + } + } + + /// + /// Returns the entry name. + /// + /// + /// The unix naming convention is followed. + /// Path components in the entry should always separated by forward slashes ('/'). + /// Dos device names like C: should also be removed. + /// See the class, or + /// + public string Name + { + get + { + return name; + } + } + + /// + /// Gets/Sets the size of the uncompressed data. + /// + /// + /// The size or -1 if unknown. + /// + /// Setting the size before adding an entry to an archive can help + /// avoid compatability problems with some archivers which dont understand Zip64 extensions. + public long Size + { + get + { + return (known & Known.Size) != 0 ? (long)size : -1L; + } + set + { + size = (ulong)value; + known |= Known.Size; + } + } + + /// + /// Gets/Sets the size of the compressed data. + /// + /// + /// The compressed entry size or -1 if unknown. + /// + public long CompressedSize + { + get + { + return (known & Known.CompressedSize) != 0 ? (long)compressedSize : -1L; + } + set + { + compressedSize = (ulong)value; + known |= Known.CompressedSize; + } + } + + /// + /// Gets/Sets the crc of the uncompressed data. + /// + /// + /// Crc is not in the range 0..0xffffffffL + /// + /// + /// The crc value or -1 if unknown. + /// + public long Crc + { + get + { + return (known & Known.Crc) != 0 ? crc & 0xffffffffL : -1L; + } + set + { + if ((crc & 0xffffffff00000000L) != 0) + throw new ArgumentOutOfRangeException(nameof(value)); + + crc = (uint)value; + known |= Known.Crc; + } + } + + /// + /// Gets/Sets the compression method. Only Deflated and Stored are supported. + /// + /// + /// The compression method for this entry + /// + /// + /// + public CompressionMethod CompressionMethod + { + get + { + return method; + } + + set + { + if (!IsCompressionMethodSupported(value)) + throw new NotSupportedException("Compression method not supported"); + + method = value; + } + } + + /// + /// Gets/Sets the extra data. + /// + /// + /// Extra data is longer than 64KB (0xffff) bytes. + /// + /// + /// Extra data or null if not set. + /// + public byte[] ExtraData + { + + get + { + // TODO: This is slightly safer but less efficient. Think about wether it should change. + // return (byte[]) extra.Clone(); + return extra; + } + + set + { + if (value == null) + extra = null; + else + { + if (value.Length > 0xffff) + throw new ArgumentOutOfRangeException(nameof(value)); + + extra = new byte[value.Length]; + Array.Copy(value, 0, extra, 0, value.Length); + } + } + } + + /// + /// Process extra data fields updating the entry based on the contents. + /// + /// True if the extra data fields should be handled + /// for a local header, rather than for a central header. + /// + internal void ProcessExtraData(bool localHeader) + { + var extraData = new ZipExtraData(extra); + + if (extraData.Find(0x0001)) + { + // Version required to extract is ignored here as some archivers dont set it correctly + // in theory it should be version 45 or higher + + // The recorded size will change but remember that this is zip64. + forceZip64_ = true; + + if (extraData.ValueLength < 4) + throw new ZipException("Extra data extended Zip64 information length is invalid"); + + // (localHeader ||) was deleted, because actually there is no specific difference with reading sizes between local header & central directory + // https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT + // ... + // 4.4 Explanation of fields + // ... + // 4.4.8 compressed size: (4 bytes) + // 4.4.9 uncompressed size: (4 bytes) + // + // The size of the file compressed (4.4.8) and uncompressed, + // (4.4.9) respectively. When a decryption header is present it + // will be placed in front of the file data and the value of the + // compressed file size will include the bytes of the decryption + // header. If bit 3 of the general purpose bit flag is set, + // these fields are set to zero in the local header and the + // correct values are put in the data descriptor and + // in the central directory. If an archive is in ZIP64 format + // and the value in this field is 0xFFFFFFFF, the size will be + // in the corresponding 8 byte ZIP64 extended information + // extra field. When encrypting the central directory, if the + // local header is not in ZIP64 format and general purpose bit + // flag 13 is set indicating masking, the value stored for the + // uncompressed size in the Local Header will be zero. + // + // Othewise there is problem with minizip implementation + if (size == uint.MaxValue) + size = (ulong)extraData.ReadLong(); + + if (compressedSize == uint.MaxValue) + compressedSize = (ulong)extraData.ReadLong(); + + if (!localHeader && (offset == uint.MaxValue)) + offset = extraData.ReadLong(); + + // Disk number on which file starts is ignored + } + else if (((versionToExtract & 0xff) >= ZipConstants.VersionZip64) && + (size == uint.MaxValue || compressedSize == uint.MaxValue)) + throw new ZipException("Zip64 Extended information required but is missing."); + + DateTime = GetDateTime(extraData); + } + + private DateTime GetDateTime(ZipExtraData extraData) + { + // Check for Unix timestamp + ExtendedUnixData unixData = extraData.GetData(); + if (unixData != null && + // Only apply modification time, but require all other values to be present + // This is done to match InfoZIP's behaviour + ((unixData.Include & ExtendedUnixData.Flags.ModificationTime) != 0) && + ((unixData.Include & ExtendedUnixData.Flags.AccessTime) != 0) && + ((unixData.Include & ExtendedUnixData.Flags.CreateTime) != 0)) + return unixData.ModificationTime; + + // Fall back to DOS time + uint sec = Math.Min(59, 2 * (dosTime & 0x1f)); + uint min = Math.Min(59, (dosTime >> 5) & 0x3f); + uint hrs = Math.Min(23, (dosTime >> 11) & 0x1f); + uint mon = Math.Max(1, Math.Min(12, ((dosTime >> 21) & 0xf))); + uint year = ((dosTime >> 25) & 0x7f) + 1980; + int day = Math.Max(1, Math.Min(DateTime.DaysInMonth((int)year, (int)mon), (int)((dosTime >> 16) & 0x1f))); + return new DateTime((int)year, (int)mon, day, (int)hrs, (int)min, (int)sec, DateTimeKind.Utc); + } + + /// + /// Gets/Sets the entry comment. + /// + /// + /// If comment is longer than 0xffff. + /// + /// + /// The comment or null if not set. + /// + /// + /// A comment is only available for entries when read via the class. + /// The class doesnt have the comment data available. + /// + public string Comment + { + get + { + return comment; + } + set + { + // This test is strictly incorrect as the length is in characters + // while the storage limit is in bytes. + // While the test is partially correct in that a comment of this length or greater + // is definitely invalid, shorter comments may also have an invalid length + // where there are multi-byte characters + // The full test is not possible here however as the code page to apply conversions with + // isnt available. + if ((value != null) && (value.Length > 0xffff)) + throw new ArgumentOutOfRangeException(nameof(value), "cannot exceed 65535"); + + comment = value; + } + } + + /// + /// Gets a value indicating if the entry is a directory. + /// however. + /// + /// + /// A directory is determined by an entry name with a trailing slash '/'. + /// The external file attributes can also indicate an entry is for a directory. + /// Currently only dos/windows attributes are tested in this manner. + /// The trailing slash convention should always be followed. + /// + public bool IsDirectory + { + get + { + int nameLength = name.Length; + return ((nameLength > 0) && + ((name[nameLength - 1] == '/') || (name[nameLength - 1] == '\\'))) || + HasDosAttributes(16); + } + } + + /// + /// Get a value of true if the entry appears to be a file; false otherwise + /// + /// + /// This only takes account of DOS/Windows attributes. Other operating systems are ignored. + /// For linux and others the result may be incorrect. + /// + public bool IsFile + { + get + { + return !IsDirectory && !HasDosAttributes(8); + } + } + + /// + /// Test entry to see if data can be extracted. + /// + /// Returns true if data can be extracted for this entry; false otherwise. + public bool IsCompressionMethodSupported() => IsCompressionMethodSupported(CompressionMethod); + + #region ICloneable Members + /// + /// Creates a copy of this zip entry. + /// + /// An that is a copy of the current instance. + public object Clone() + { + var result = (ZipEntry)MemberwiseClone(); + + // Ensure extra data is unique if it exists. + if (extra != null) + { + result.extra = new byte[extra.Length]; + Array.Copy(extra, 0, result.extra, 0, extra.Length); + } + + return result; + } + + #endregion + + /// + /// Gets a string representation of this ZipEntry. + /// + /// A readable textual representation of this + public override string ToString() => name; + + /// + /// Test a compression method to see if this library + /// supports extracting data compressed with that method + /// + /// The compression method to test. + /// Returns true if the compression method is supported; false otherwise + public static bool IsCompressionMethodSupported(CompressionMethod method) + { + return + (method == CompressionMethod.Deflated) || + (method == CompressionMethod.Stored); + } + + /// + /// Cleans a name making it conform to Zip file conventions. + /// Devices names ('c:\') and UNC share names ('\\server\share') are removed + /// and forward slashes ('\') are converted to back slashes ('/'). + /// Names are made relative by trimming leading slashes which is compatible + /// with the ZIP naming convention. + /// + /// The name to clean + /// The 'cleaned' name. + /// + /// The Zip name transform class is more flexible. + /// + public static string CleanName(string name) + { + if (name == null) + return string.Empty; + + if (Path.IsPathRooted(name)) + // NOTE: + // for UNC names... \\machine\share\zoom\beet.txt gives \zoom\beet.txt + name = name.Substring(Path.GetPathRoot(name).Length); + + name = name.Replace(@"\", "/"); + + while ((name.Length > 0) && (name[0] == '/')) + name = name.Remove(0, 1); + + return name; + } + + #region Instance Fields + Known known; + int externalFileAttributes = -1; // contains external attributes (O/S dependant) + + ushort versionMadeBy; // Contains host system and version information + // only relevant for central header entries + + string name; + ulong size; + ulong compressedSize; + ushort versionToExtract; // Version required to extract (library handles <= 2.0) + uint crc; + uint dosTime; + + CompressionMethod method = CompressionMethod.Deflated; + byte[] extra; + string comment; + + int flags; // general purpose bit flags + + long zipFileIndex = -1; // used by ZipFile + long offset; // used by ZipFile and ZipOutputStream + + bool forceZip64_; + #endregion + } +} diff --git a/UpdateLib/UpdateLib/Compression/Zip/ZipException.cs b/UpdateLib/UpdateLib/Compression/Zip/ZipException.cs new file mode 100644 index 0000000..646fbdc --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/Zip/ZipException.cs @@ -0,0 +1,51 @@ +/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +/* Copyright © 2000-2016 SharpZipLib Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +using System; + +namespace MatthiWare.UpdateLib.Compression.Zip +{ + + [Serializable] + public class ZipException : Exception + { + public ZipException() { } + public ZipException(string message) : base(message) { } + public ZipException(string message, Exception inner) : base(message, inner) { } + protected ZipException( + System.Runtime.Serialization.SerializationInfo info, + System.Runtime.Serialization.StreamingContext context) : base(info, context) { } + } +} diff --git a/UpdateLib/UpdateLib/Compression/Zip/ZipExtraData.cs b/UpdateLib/UpdateLib/Compression/Zip/ZipExtraData.cs new file mode 100644 index 0000000..627bbda --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/Zip/ZipExtraData.cs @@ -0,0 +1,970 @@ +/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +/* Copyright © 2000-2016 SharpZipLib Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +using System; +using System.IO; + +namespace MatthiWare.UpdateLib.Compression.Zip +{ + // TODO: Sort out wether tagged data is useful and what a good implementation might look like. + // Its just a sketch of an idea at the moment. + + /// + /// ExtraData tagged value interface. + /// + public interface ITaggedData + { + /// + /// Get the ID for this tagged data value. + /// + short TagID { get; } + + /// + /// Set the contents of this instance from the data passed. + /// + /// The data to extract contents from. + /// The offset to begin extracting data from. + /// The number of bytes to extract. + void SetData(byte[] data, int offset, int count); + + /// + /// Get the data representing this instance. + /// + /// Returns the data for this instance. + byte[] GetData(); + } + + /// + /// A raw binary tagged value + /// + public class RawTaggedData : ITaggedData + { + /// + /// Initialise a new instance. + /// + /// The tag ID. + public RawTaggedData(short tag) + { + _tag = tag; + } + + #region ITaggedData Members + + /// + /// Get the ID for this tagged data value. + /// + public short TagID + { + get { return _tag; } + set { _tag = value; } + } + + /// + /// Set the data from the raw values provided. + /// + /// The raw data to extract values from. + /// The index to start extracting values from. + /// The number of bytes available. + public void SetData(byte[] data, int offset, int count) + { + if (data == null) + throw new ArgumentNullException(nameof(data)); + + _data = new byte[count]; + Array.Copy(data, offset, _data, 0, count); + } + + /// + /// Get the binary data representing this instance. + /// + /// The raw binary data representing this instance. + public byte[] GetData() => _data; + + #endregion + + /// + /// Get /set the binary data representing this instance. + /// + /// The raw binary data representing this instance. + public byte[] Data + { + get { return _data; } + set { _data = value; } + } + + #region Instance Fields + /// + /// The tag ID for this instance. + /// + short _tag; + + byte[] _data; + #endregion + } + + /// + /// Class representing extended unix date time values. + /// + public class ExtendedUnixData : ITaggedData + { + /// + /// Flags indicate which values are included in this instance. + /// + [Flags] + public enum Flags : byte + { + /// + /// The modification time is included + /// + ModificationTime = 0x01, + + /// + /// The access time is included + /// + AccessTime = 0x02, + + /// + /// The create time is included. + /// + CreateTime = 0x04, + } + + #region ITaggedData Members + + /// + /// Get the ID + /// + public short TagID + { + get { return 0x5455; } + } + + /// + /// Set the data from the raw values provided. + /// + /// The raw data to extract values from. + /// The index to start extracting values from. + /// The number of bytes available. + public void SetData(byte[] data, int index, int count) + { + using (MemoryStream ms = new MemoryStream(data, index, count, false)) + using (ZipHelperStream helperStream = new ZipHelperStream(ms)) + { + // bit 0 if set, modification time is present + // bit 1 if set, access time is present + // bit 2 if set, creation time is present + + _flags = (Flags)helperStream.ReadByte(); + if (((_flags & Flags.ModificationTime) != 0)) + { + int iTime = helperStream.ReadLEInt(); + + _modificationTime = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc) + + new TimeSpan(0, 0, 0, iTime, 0); + + // Central-header version is truncated after modification time + if (count <= 5) return; + } + + if ((_flags & Flags.AccessTime) != 0) + { + int iTime = helperStream.ReadLEInt(); + + _lastAccessTime = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc) + + new TimeSpan(0, 0, 0, iTime, 0); + } + + if ((_flags & Flags.CreateTime) != 0) + { + int iTime = helperStream.ReadLEInt(); + + _createTime = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc) + + new TimeSpan(0, 0, 0, iTime, 0); + } + } + } + + /// + /// Get the binary data representing this instance. + /// + /// The raw binary data representing this instance. + public byte[] GetData() + { + using (MemoryStream ms = new MemoryStream()) + using (ZipHelperStream helperStream = new ZipHelperStream(ms)) + { + helperStream.IsStreamOwner = false; + helperStream.WriteByte((byte)_flags); // Flags + + if ((_flags & Flags.ModificationTime) != 0) + { + TimeSpan span = _modificationTime - new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc); + var seconds = (int)span.TotalSeconds; + helperStream.WriteLEInt(seconds); + } + + if ((_flags & Flags.AccessTime) != 0) + { + TimeSpan span = _lastAccessTime - new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc); + var seconds = (int)span.TotalSeconds; + helperStream.WriteLEInt(seconds); + } + + if ((_flags & Flags.CreateTime) != 0) + { + TimeSpan span = _createTime - new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc); + var seconds = (int)span.TotalSeconds; + helperStream.WriteLEInt(seconds); + } + + return ms.ToArray(); + } + } + + #endregion + + /// + /// Test a value to see if is valid and can be represented here. + /// + /// The value to test. + /// Returns true if the value is valid and can be represented; false if not. + /// The standard Unix time is a signed integer data type, directly encoding the Unix time number, + /// which is the number of seconds since 1970-01-01. + /// Being 32 bits means the values here cover a range of about 136 years. + /// The minimum representable time is 1901-12-13 20:45:52, + /// and the maximum representable time is 2038-01-19 03:14:07. + /// + public static bool IsValidValue(DateTime value) + { + return ((value >= new DateTime(1901, 12, 13, 20, 45, 52)) || + (value <= new DateTime(2038, 1, 19, 03, 14, 07))); + } + + /// + /// Get /set the Modification Time + /// + /// + /// + public DateTime ModificationTime + { + get { return _modificationTime; } + set + { + if (!IsValidValue(value)) + throw new ArgumentOutOfRangeException(nameof(value)); + + _flags |= Flags.ModificationTime; + _modificationTime = value; + } + } + + /// + /// Get / set the Access Time + /// + /// + /// + public DateTime AccessTime + { + get { return _lastAccessTime; } + set + { + if (!IsValidValue(value)) + throw new ArgumentOutOfRangeException(nameof(value)); + + _flags |= Flags.AccessTime; + _lastAccessTime = value; + } + } + + /// + /// Get / Set the Create Time + /// + /// + /// + public DateTime CreateTime + { + get { return _createTime; } + set + { + if (!IsValidValue(value)) + throw new ArgumentOutOfRangeException(nameof(value)); + + _flags |= Flags.CreateTime; + _createTime = value; + } + } + + /// + /// Get/set the values to include. + /// + public Flags Include + { + get { return _flags; } + set { _flags = value; } + } + + #region Instance Fields + Flags _flags; + DateTime _modificationTime = new DateTime(1970, 1, 1); + DateTime _lastAccessTime = new DateTime(1970, 1, 1); + DateTime _createTime = new DateTime(1970, 1, 1); + #endregion + } + + /// + /// Class handling NT date time values. + /// + public class NTTaggedData : ITaggedData + { + /// + /// Get the ID for this tagged data value. + /// + public short TagID + { + get { return 10; } + } + + /// + /// Set the data from the raw values provided. + /// + /// The raw data to extract values from. + /// The index to start extracting values from. + /// The number of bytes available. + public void SetData(byte[] data, int index, int count) + { + using (MemoryStream ms = new MemoryStream(data, index, count, false)) + using (ZipHelperStream helperStream = new ZipHelperStream(ms)) + { + helperStream.ReadLEInt(); // Reserved + while (helperStream.Position < helperStream.Length) + { + int ntfsTag = helperStream.ReadLEShort(); + int ntfsLength = helperStream.ReadLEShort(); + + if (ntfsTag == 1) + { + if (ntfsLength >= 24) + { + long lastModificationTicks = helperStream.ReadLELong(); + _lastModificationTime = DateTime.FromFileTimeUtc(lastModificationTicks); + + long lastAccessTicks = helperStream.ReadLELong(); + _lastAccessTime = DateTime.FromFileTimeUtc(lastAccessTicks); + + long createTimeTicks = helperStream.ReadLELong(); + _createTime = DateTime.FromFileTimeUtc(createTimeTicks); + } + + break; + } + else + { + // An unknown NTFS tag so simply skip it. + helperStream.Seek(ntfsLength, SeekOrigin.Current); + } + } + } + } + + /// + /// Get the binary data representing this instance. + /// + /// The raw binary data representing this instance. + public byte[] GetData() + { + using (MemoryStream ms = new MemoryStream()) + using (ZipHelperStream helperStream = new ZipHelperStream(ms)) + { + helperStream.IsStreamOwner = false; + helperStream.WriteLEInt(0); // Reserved + helperStream.WriteLEShort(1); // Tag + helperStream.WriteLEShort(24); // Length = 3 x 8. + helperStream.WriteLELong(_lastModificationTime.ToFileTimeUtc()); + helperStream.WriteLELong(_lastAccessTime.ToFileTimeUtc()); + helperStream.WriteLELong(_createTime.ToFileTimeUtc()); + + return ms.ToArray(); + } + } + + /// + /// Test a valuie to see if is valid and can be represented here. + /// + /// The value to test. + /// Returns true if the value is valid and can be represented; false if not. + /// + /// NTFS filetimes are 64-bit unsigned integers, stored in Intel + /// (least significant byte first) byte order. They determine the + /// number of 1.0E-07 seconds (1/10th microseconds!) past WinNT "epoch", + /// which is "01-Jan-1601 00:00:00 UTC". 28 May 60056 is the upper limit + /// + public static bool IsValidValue(DateTime value) + { + bool result = true; + + try + { + value.ToFileTimeUtc(); + } + catch + { + result = false; + } + + return result; + } + + /// + /// Get/set the last modification time. + /// + public DateTime LastModificationTime + { + get { return _lastModificationTime; } + set + { + if (!IsValidValue(value)) + throw new ArgumentOutOfRangeException(nameof(value)); + + _lastModificationTime = value; + } + } + + /// + /// Get /set the create time + /// + public DateTime CreateTime + { + get { return _createTime; } + set + { + if (!IsValidValue(value)) + throw new ArgumentOutOfRangeException(nameof(value)); + + _createTime = value; + } + } + + /// + /// Get /set the last access time. + /// + public DateTime LastAccessTime + { + get { return _lastAccessTime; } + set + { + if (!IsValidValue(value)) + throw new ArgumentOutOfRangeException(nameof(value)); + + _lastAccessTime = value; + } + } + + #region Instance Fields + DateTime _lastAccessTime = DateTime.FromFileTimeUtc(0); + DateTime _lastModificationTime = DateTime.FromFileTimeUtc(0); + DateTime _createTime = DateTime.FromFileTimeUtc(0); + #endregion + } + + /// + /// A factory that creates tagged data instances. + /// + interface ITaggedDataFactory + { + /// + /// Get data for a specific tag value. + /// + /// The tag ID to find. + /// The data to search. + /// The offset to begin extracting data from. + /// The number of bytes to extract. + /// The located value found, or null if not found. + ITaggedData Create(short tag, byte[] data, int offset, int count); + } + + /// + /// + /// A class to handle the extra data field for Zip entries + /// + /// + /// Extra data contains 0 or more values each prefixed by a header tag and length. + /// They contain zero or more bytes of actual data. + /// The data is held internally using a copy on write strategy. This is more efficient but + /// means that for extra data created by passing in data can have the values modified by the caller + /// in some circumstances. + /// + sealed public class ZipExtraData : IDisposable + { + #region Constructors + /// + /// Initialise a default instance. + /// + public ZipExtraData() + { + Clear(); + } + + /// + /// Initialise with known extra data. + /// + /// The extra data. + public ZipExtraData(byte[] data) + { + _data = data ?? new byte[0]; + } + #endregion + + /// + /// Get the raw extra data value + /// + /// Returns the raw byte[] extra data this instance represents. + public byte[] GetEntryData() + { + if (Length > ushort.MaxValue) + throw new ZipException("Data exceeds maximum length"); + + return (byte[])_data.Clone(); + } + + /// + /// Clear the stored data. + /// + public void Clear() + { + if ((_data == null) || (_data.Length != 0)) + _data = new byte[0]; + } + + /// + /// Gets the current extra data length. + /// + public int Length + { + get { return _data.Length; } + } + + /// + /// Get a read-only for the associated tag. + /// + /// The tag to locate data for. + /// Returns a containing tag data or null if no tag was found. + public Stream GetStreamForTag(int tag) + { + Stream result = null; + + if (Find(tag)) + result = new MemoryStream(_data, _index, _readValueLength, false); + + return result; + } + + /// + /// Get the tagged data for a tag. + /// + /// The tag to search for. + /// Returns a tagged value or null if none found. + public T GetData() + where T : class, ITaggedData, new() + { + T result = new T(); + + if (!Find(result.TagID)) + return default(T); + + result.SetData(_data, _readValueStart, _readValueLength); + + return result; + } + + /// + /// Get the length of the last value found by + /// + /// This is only valid if has previously returned true. + public int ValueLength + { + get { return _readValueLength; } + } + + /// + /// Get the index for the current read value. + /// + /// This is only valid if has previously returned true. + /// Initially the result will be the index of the first byte of actual data. The value is updated after calls to + /// , and . + public int CurrentReadIndex + { + get { return _index; } + } + + /// + /// Get the number of bytes remaining to be read for the current value; + /// + public int UnreadCount + { + get + { + if ((_readValueStart > _data.Length) || + (_readValueStart < 4)) + throw new ZipException("Find must be called before calling a Read method"); + + return _readValueStart + _readValueLength - _index; + } + } + + /// + /// Find an extra data value + /// + /// The identifier for the value to find. + /// Returns true if the value was found; false otherwise. + public bool Find(int headerID) + { + _readValueStart = _data.Length; + _readValueLength = 0; + _index = 0; + + int localLength = _readValueStart; + int localTag = headerID - 1; + + // Trailing bytes that cant make up an entry (as there arent enough + // bytes for a tag and length) are ignored! + while ((localTag != headerID) && (_index < _data.Length - 3)) + { + localTag = ReadShortInternal(); + localLength = ReadShortInternal(); + + if (localTag != headerID) + _index += localLength; + } + + bool result = (localTag == headerID) && ((_index + localLength) <= _data.Length); + + if (result) + { + _readValueStart = _index; + _readValueLength = localLength; + } + + return result; + } + + /// + /// Add a new entry to extra data. + /// + /// The value to add. + public void AddEntry(ITaggedData taggedData) + { + if (taggedData == null) + throw new ArgumentNullException(nameof(taggedData)); + + AddEntry(taggedData.TagID, taggedData.GetData()); + } + + /// + /// Add a new entry to extra data + /// + /// The ID for this entry. + /// The data to add. + /// If the ID already exists its contents are replaced. + public void AddEntry(int headerID, byte[] fieldData) + { + if ((headerID > ushort.MaxValue) || (headerID < 0)) + throw new ArgumentOutOfRangeException(nameof(headerID)); + + int addLength = (fieldData == null) ? 0 : fieldData.Length; + + if (addLength > ushort.MaxValue) + throw new ArgumentOutOfRangeException(nameof(fieldData), "exceeds maximum length"); + + // Test for new length before adjusting data. + int newLength = _data.Length + addLength + 4; + + if (Find(headerID)) + newLength -= (ValueLength + 4); + + if (newLength > ushort.MaxValue) + throw new ZipException("Data exceeds maximum length"); + + Delete(headerID); + + byte[] newData = new byte[newLength]; + _data.CopyTo(newData, 0); + + int index = _data.Length; + _data = newData; + + SetShort(ref index, headerID); + SetShort(ref index, addLength); + + if (fieldData != null) + fieldData.CopyTo(newData, index); + } + + /// + /// Start adding a new entry. + /// + /// Add data using , , , or . + /// The new entry is completed and actually added by calling + /// + public void StartNewEntry() + { + _newEntry = new MemoryStream(); + } + + /// + /// Add entry data added since using the ID passed. + /// + /// The identifier to use for this entry. + public void AddNewEntry(int headerID) + { + byte[] newData = _newEntry.ToArray(); + _newEntry = null; + AddEntry(headerID, newData); + } + + /// + /// Add a byte of data to the pending new entry. + /// + /// The byte to add. + /// + public void AddData(byte data) + { + _newEntry.WriteByte(data); + } + + /// + /// Add data to a pending new entry. + /// + /// The data to add. + /// + public void AddData(byte[] data) + { + if (data == null) + throw new ArgumentNullException(nameof(data)); + + _newEntry.Write(data, 0, data.Length); + } + + /// + /// Add a short value in little endian order to the pending new entry. + /// + /// The data to add. + /// + public void AddLeShort(int toAdd) + { + unchecked + { + _newEntry.WriteByte((byte)toAdd); + _newEntry.WriteByte((byte)(toAdd >> 8)); + } + } + + /// + /// Add an integer value in little endian order to the pending new entry. + /// + /// The data to add. + /// + public void AddLeInt(int toAdd) + { + unchecked + { + AddLeShort((short)toAdd); + AddLeShort((short)(toAdd >> 16)); + } + } + + /// + /// Add a long value in little endian order to the pending new entry. + /// + /// The data to add. + /// + public void AddLeLong(long toAdd) + { + unchecked + { + AddLeInt((int)(toAdd & 0xffffffff)); + AddLeInt((int)(toAdd >> 32)); + } + } + + /// + /// Delete an extra data field. + /// + /// The identifier of the field to delete. + /// Returns true if the field was found and deleted. + public bool Delete(int headerID) + { + bool result = false; + + if (Find(headerID)) + { + result = true; + int trueStart = _readValueStart - 4; + + byte[] newData = new byte[_data.Length - (ValueLength + 4)]; + Array.Copy(_data, 0, newData, 0, trueStart); + + int trueEnd = trueStart + ValueLength + 4; + Array.Copy(_data, trueEnd, newData, trueStart, _data.Length - trueEnd); + _data = newData; + } + + return result; + } + + #region Reading Support + /// + /// Read a long in little endian form from the last found data value + /// + /// Returns the long value read. + public long ReadLong() + { + ReadCheck(8); + return (ReadInt() & 0xffffffff) | (((long)ReadInt()) << 32); + } + + /// + /// Read an integer in little endian form from the last found data value. + /// + /// Returns the integer read. + public int ReadInt() + { + ReadCheck(4); + + int result = _data[_index] + (_data[_index + 1] << 8) + + (_data[_index + 2] << 16) + (_data[_index + 3] << 24); + + _index += 4; + + return result; + } + + /// + /// Read a short value in little endian form from the last found data value. + /// + /// Returns the short value read. + public int ReadShort() + { + ReadCheck(2); + + int result = _data[_index] + (_data[_index + 1] << 8); + _index += 2; + + return result; + } + + /// + /// Read a byte from an extra data + /// + /// The byte value read or -1 if the end of data has been reached. + public int ReadByte() + { + int result = -1; + + if ((_index < _data.Length) && (_readValueStart + _readValueLength > _index)) + result = _data[_index++]; + + return result; + } + + /// + /// Skip data during reading. + /// + /// The number of bytes to skip. + public void Skip(int amount) + { + ReadCheck(amount); + _index += amount; + } + + void ReadCheck(int length) + { + if ((_readValueStart > _data.Length) || + (_readValueStart < 4)) + throw new ZipException("Find must be called before calling a Read method"); + + if (_index > _readValueStart + _readValueLength - length) + throw new ZipException("End of extra data"); + + if (_index + length < 4) + throw new ZipException("Cannot read before start of tag"); + } + + /// + /// Internal form of that reads data at any location. + /// + /// Returns the short value read. + int ReadShortInternal() + { + if (_index > _data.Length - 2) + throw new ZipException("End of extra data"); + + int result = _data[_index++] + (_data[_index++] << 8); + + return result; + } + + void SetShort(ref int index, int source) + { + _data[index++] = (byte)source; + _data[index++] = (byte)(source >> 8); + } + + #endregion + + #region IDisposable Members + + /// + /// Dispose of this instance. + /// + public void Dispose() + { + if (_newEntry != null) + { + _newEntry.Dispose(); + } + } + + #endregion + + #region Instance Fields + int _index; + int _readValueStart; + int _readValueLength; + + MemoryStream _newEntry; + byte[] _data; + #endregion + } +} diff --git a/UpdateLib/UpdateLib/Compression/Zip/ZipFile.cs b/UpdateLib/UpdateLib/Compression/Zip/ZipFile.cs new file mode 100644 index 0000000..44140ef --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/Zip/ZipFile.cs @@ -0,0 +1,566 @@ +/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +/* Copyright © 2000-2016 SharpZipLib Contributors +* +* Permission is hereby granted, free of charge, to any person obtaining a copy of this +* software and associated documentation files (the "Software"), to deal in the Software +* without restriction, including without limitation the rights to use, copy, modify, merge, +* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons +* to whom the Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in all copies or +* substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +* PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +* FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +*/ + +using System; +using System.Collections; +using System.IO; +using System.Runtime.CompilerServices; + +using MatthiWare.UpdateLib.Utils; + +namespace MatthiWare.UpdateLib.Compression.Zip +{ + #region ZipFile Class + /// + /// This class represents a Zip archive. You can ask for the contained + /// entries, or get an input stream for a file entry. The entry is + /// automatically decompressed. + /// + /// You can also update the archive adding or deleting entries. + /// + /// This class is thread safe for input: You can open input streams for arbitrary + /// entries in different threads. + ///
+ ///
Author of the original java version : Jochen Hoenicke + ///
+ /// + /// + /// using System; + /// using System.Text; + /// using System.Collections; + /// using System.IO; + /// + /// using ICSharpCode.SharpZipLib.Zip; + /// + /// class MainClass + /// { + /// static public void Main(string[] args) + /// { + /// using (ZipFile zFile = new ZipFile(args[0])) { + /// Console.WriteLine("Listing of : " + zFile.Name); + /// Console.WriteLine(""); + /// Console.WriteLine("Raw Size Size Date Time Name"); + /// Console.WriteLine("-------- -------- -------- ------ ---------"); + /// foreach (ZipEntry e in zFile) { + /// if ( e.IsFile ) { + /// DateTime d = e.DateTime; + /// Console.WriteLine("{0, -10}{1, -10}{2} {3} {4}", e.Size, e.CompressedSize, + /// d.ToString("dd-MM-yy"), d.ToString("HH:mm"), + /// e.Name); + /// } + /// } + /// } + /// } + /// } + /// + /// + public class ZipFile : IEnumerable, IDisposable + { + #region Constructors + + /// + /// Opens a Zip file reading the given . + /// + /// The to read archive data from. + /// The supplied argument is null. + /// + /// An i/o error occurs. + /// + /// + /// The file doesn't contain a valid zip archive. + /// + public ZipFile(FileStream file) + { + if (file == null) + throw new ArgumentNullException(nameof(file)); + + if (!file.CanSeek) + throw new ArgumentException("Stream is not seekable", nameof(file)); + + baseStream_ = file; + name_ = file.Name; + isStreamOwner = true; + + try + { + ReadEntries(); + } + catch + { + DisposeInternal(true); + throw; + } + } + + #endregion + + #region Destructors and Closing + /// + /// Finalize this instance. + /// + ~ZipFile() + { + Dispose(false); + } + + /// + /// Closes the ZipFile. If the stream is owned then this also closes the underlying input stream. + /// Once closed, no further instance methods should be called. + /// + /// + /// An i/o error occurs. + /// + public void Close() + { + DisposeInternal(true); + GC.SuppressFinalize(this); + } + + #endregion + + #region Properties + /// + /// Get/set a flag indicating if the underlying stream is owned by the ZipFile instance. + /// If the flag is true then the stream will be closed when Close is called. + /// + /// + /// The default value is true in all cases. + /// + public bool IsStreamOwner + { + get { return isStreamOwner; } + set { isStreamOwner = value; } + } + + /// + /// Get the number of entries contained in this . + /// + public long Count + { + get + { + return entries_.Length; + } + } + + /// + /// Indexer property for ZipEntries + /// + [IndexerName("EntryByIndex")] + public ZipEntry this[int index] + { + get + { + return (ZipEntry)entries_[index].Clone(); + } + } + + #endregion + + #region Input Handling + /// + /// Gets an enumerator for the Zip entries in this Zip file. + /// + /// Returns an for this archive. + /// + /// The Zip file has been closed. + /// + public IEnumerator GetEnumerator() + { + if (isDisposed_) + { + throw new ObjectDisposedException("ZipFile"); + } + + return new ZipEntryEnumerator(entries_); + } + + /// + /// Return the index of the entry with a matching name + /// + /// Entry name to find + /// If true the comparison is case insensitive + /// The index position of the matching entry or -1 if not found + /// + /// The Zip file has been closed. + /// + public int FindEntry(string name, bool ignoreCase) + { + if (isDisposed_) + { + throw new ObjectDisposedException("ZipFile"); + } + + // TODO: This will be slow as the next ice age for huge archives! + for (int i = 0; i < entries_.Length; i++) + { + if (string.Compare(name, entries_[i].Name, ignoreCase ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal) == 0) + { + return i; + } + } + return -1; + } + + /// + /// Searches for a zip entry in this archive with the given name. + /// String comparisons are case insensitive + /// + /// + /// The name to find. May contain directory components separated by slashes ('/'). + /// + /// + /// A clone of the zip entry, or null if no entry with that name exists. + /// + /// + /// The Zip file has been closed. + /// + public ZipEntry GetEntry(string name) + { + if (isDisposed_) + { + throw new ObjectDisposedException("ZipFile"); + } + + int index = FindEntry(name, true); + return (index >= 0) ? (ZipEntry)entries_[index].Clone() : null; + } + + #endregion + + #endregion + + #region Disposing + + #region IDisposable Members + void IDisposable.Dispose() + { + Close(); + } + #endregion + + void DisposeInternal(bool disposing) + { + if (!isDisposed_) + { + isDisposed_ = true; + entries_ = new ZipEntry[0]; + + if (IsStreamOwner && (baseStream_ != null)) + lock (baseStream_) + baseStream_.Dispose(); + } + } + + /// + /// Releases the unmanaged resources used by the this instance and optionally releases the managed resources. + /// + /// true to release both managed and unmanaged resources; + /// false to release only unmanaged resources. + protected virtual void Dispose(bool disposing) + { + DisposeInternal(disposing); + } + + #endregion + + #region Internal routines + #region Reading + /// + /// Read an unsigned short in little endian byte order. + /// + /// Returns the value read. + /// + /// The stream ends prematurely + /// + ushort ReadLEUshort() + { + int data1 = baseStream_.ReadByte(); + + if (data1 < 0) + { + throw new EndOfStreamException("End of stream"); + } + + int data2 = baseStream_.ReadByte(); + + if (data2 < 0) + { + throw new EndOfStreamException("End of stream"); + } + + + return unchecked((ushort)((ushort)data1 | (ushort)(data2 << 8))); + } + + /// + /// Read a uint in little endian byte order. + /// + /// Returns the value read. + /// + /// An i/o error occurs. + /// + /// + /// The file ends prematurely + /// + uint ReadLEUint() + { + return (uint)(ReadLEUshort() | (ReadLEUshort() << 16)); + } + + ulong ReadLEUlong() + { + return ReadLEUint() | ((ulong)ReadLEUint() << 32); + } + + #endregion + // NOTE this returns the offset of the first byte after the signature. + long LocateBlockWithSignature(int signature, long endLocation, int minimumBlockSize, int maximumVariableData) + { + using (ZipHelperStream les = new ZipHelperStream(baseStream_)) + { + return les.LocateBlockWithSignature(signature, endLocation, minimumBlockSize, maximumVariableData); + } + } + + /// + /// Search for and read the central directory of a zip file filling the entries array. + /// + /// + /// An i/o error occurs. + /// + /// + /// The central directory is malformed or cannot be found + /// + void ReadEntries() + { + // Search for the End Of Central Directory. When a zip comment is + // present the directory will start earlier + // + // The search is limited to 64K which is the maximum size of a trailing comment field to aid speed. + // This should be compatible with both SFX and ZIP files but has only been tested for Zip files + // If a SFX file has the Zip data attached as a resource and there are other resources occuring later then + // this could be invalid. + // Could also speed this up by reading memory in larger blocks. + + if (baseStream_.CanSeek == false) + throw new ZipException("ZipFile stream must be seekable"); + + long locatedEndOfCentralDir = LocateBlockWithSignature(ZipConstants.EndOfCentralDirectorySignature, + baseStream_.Length, ZipConstants.EndOfCentralRecordBaseSize, 0xffff); + + if (locatedEndOfCentralDir < 0) + throw new ZipException("Cannot find central directory"); + + // Read end of central directory record + ushort thisDiskNumber = ReadLEUshort(); + ushort startCentralDirDisk = ReadLEUshort(); + ulong entriesForThisDisk = ReadLEUshort(); + ulong entriesForWholeCentralDir = ReadLEUshort(); + ulong centralDirSize = ReadLEUint(); + long offsetOfCentralDir = ReadLEUint(); + uint commentSize = ReadLEUshort(); + + comment_ = (commentSize > 0) ? + ZipConstants.ConvertToString(baseStream_.CheckedReadBytes((int)commentSize)) : + string.Empty; + + bool isZip64 = false; + + // Check if zip64 header information is required. + if ((thisDiskNumber == 0xffff) || + (startCentralDirDisk == 0xffff) || + (entriesForThisDisk == 0xffff) || + (entriesForWholeCentralDir == 0xffff) || + (centralDirSize == 0xffffffff) || + (offsetOfCentralDir == 0xffffffff)) + { + isZip64 = true; + + long offset = LocateBlockWithSignature(ZipConstants.Zip64CentralDirLocatorSignature, locatedEndOfCentralDir, 0, 0x1000); + if (offset < 0) + throw new ZipException("Cannot find Zip64 locator"); + + // number of the disk with the start of the zip64 end of central directory 4 bytes + // relative offset of the zip64 end of central directory record 8 bytes + // total number of disks 4 bytes + ReadLEUint(); // startDisk64 is not currently used + ulong offset64 = ReadLEUlong(); + uint totalDisks = ReadLEUint(); + + baseStream_.Position = (long)offset64; + long sig64 = ReadLEUint(); + + if (sig64 != ZipConstants.Zip64CentralFileHeaderSignature) + throw new ZipException(string.Format("Invalid Zip64 Central directory signature at {0:X}", offset64)); + + // NOTE: Record size = SizeOfFixedFields + SizeOfVariableData - 12. + ulong recordSize = ReadLEUlong(); + int versionMadeBy = ReadLEUshort(); + int versionToExtract = ReadLEUshort(); + uint thisDisk = ReadLEUint(); + uint centralDirDisk = ReadLEUint(); + entriesForThisDisk = ReadLEUlong(); + entriesForWholeCentralDir = ReadLEUlong(); + centralDirSize = ReadLEUlong(); + offsetOfCentralDir = (long)ReadLEUlong(); + + // NOTE: zip64 extensible data sector (variable size) is ignored. + } + + entries_ = new ZipEntry[entriesForThisDisk]; + + // SFX/embedded support, find the offset of the first entry vis the start of the stream + // This applies to Zip files that are appended to the end of an SFX stub. + // Or are appended as a resource to an executable. + // Zip files created by some archivers have the offsets altered to reflect the true offsets + // and so dont require any adjustment here... + // TODO: Difficulty with Zip64 and SFX offset handling needs resolution - maths? + if (!isZip64 && (offsetOfCentralDir < locatedEndOfCentralDir - (4 + (long)centralDirSize))) + { + offsetOfFirstEntry = locatedEndOfCentralDir - (4 + (long)centralDirSize + offsetOfCentralDir); + + if (offsetOfFirstEntry <= 0) + throw new ZipException("Invalid embedded zip archive"); + } + + baseStream_.Seek(offsetOfFirstEntry + offsetOfCentralDir, SeekOrigin.Begin); + + for (ulong i = 0; i < entriesForThisDisk; i++) + { + if (ReadLEUint() != ZipConstants.CentralHeaderSignature) + throw new ZipException("Wrong Central Directory signature"); + + int versionMadeBy = ReadLEUshort(); + int versionToExtract = ReadLEUshort(); + int bitFlags = ReadLEUshort(); + int method = ReadLEUshort(); + uint dostime = ReadLEUint(); + uint crc = ReadLEUint(); + var csize = (long)ReadLEUint(); + var size = (long)ReadLEUint(); + int nameLen = ReadLEUshort(); + int extraLen = ReadLEUshort(); + int commentLen = ReadLEUshort(); + + int diskStartNo = ReadLEUshort(); // Not currently used + int internalAttributes = ReadLEUshort(); // Not currently used + + uint externalAttributes = ReadLEUint(); + long offset = ReadLEUint(); + + byte[] buffer = new byte[Math.Max(nameLen, commentLen)]; + + baseStream_.CheckedReadBytes(buffer, 0, nameLen); + string name = ZipConstants.ConvertToStringExt(bitFlags, buffer, nameLen); + + var entry = new ZipEntry(name, versionToExtract, versionMadeBy, (CompressionMethod)method); + entry.Crc = crc & 0xffffffffL; + entry.Size = size & 0xffffffffL; + entry.CompressedSize = csize & 0xffffffffL; + entry.Flags = bitFlags; + entry.DosTime = dostime; + entry.ZipFileIndex = (long)i; + entry.Offset = offset; + entry.ExternalFileAttributes = (int)externalAttributes; + + if (extraLen > 0) + entry.ExtraData = baseStream_.CheckedReadBytes(extraLen); + + entry.ProcessExtraData(false); + + if (commentLen > 0) + { + baseStream_.CheckedReadBytes(buffer, 0, commentLen); + entry.Comment = ZipConstants.ConvertToStringExt(bitFlags, buffer, commentLen); + } + + entries_[i] = entry; + } + } + + #endregion + + #region Instance Fields + bool isDisposed_; + string name_; + string comment_; + Stream baseStream_; + bool isStreamOwner; + long offsetOfFirstEntry; + ZipEntry[] entries_; + #endregion + + #region Support Classes + + /// + /// An enumerator for Zip entries + /// + class ZipEntryEnumerator : IEnumerator + { + #region Constructors + public ZipEntryEnumerator(ZipEntry[] entries) + { + array = entries; + } + + #endregion + #region IEnumerator Members + public object Current + { + get + { + return array[index]; + } + } + + public void Reset() + { + index = -1; + } + + public bool MoveNext() + { + return (++index < array.Length); + } + #endregion + #region Instance Fields + ZipEntry[] array; + int index = -1; + #endregion + } + #endregion + } +} diff --git a/UpdateLib/UpdateLib/Compression/Zip/ZipHelperStream.cs b/UpdateLib/UpdateLib/Compression/Zip/ZipHelperStream.cs new file mode 100644 index 0000000..9ae6de7 --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/Zip/ZipHelperStream.cs @@ -0,0 +1,618 @@ +/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +/* Copyright © 2000-2016 SharpZipLib Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +using System; +using System.IO; + +namespace MatthiWare.UpdateLib.Compression.Zip +{ + /// + /// Holds data pertinent to a data descriptor. + /// + public class DescriptorData + { + /// + /// Get /set the compressed size of data. + /// + public long CompressedSize + { + get { return compressedSize; } + set { compressedSize = value; } + } + + /// + /// Get / set the uncompressed size of data + /// + public long Size + { + get { return size; } + set { size = value; } + } + + /// + /// Get /set the crc value. + /// + public long Crc + { + get { return crc; } + set { crc = (value & 0xffffffff); } + } + + #region Instance Fields + long size; + long compressedSize; + long crc; + #endregion + } + + class EntryPatchData + { + public long SizePatchOffset + { + get { return sizePatchOffset_; } + set { sizePatchOffset_ = value; } + } + + public long CrcPatchOffset + { + get { return crcPatchOffset_; } + set { crcPatchOffset_ = value; } + } + + #region Instance Fields + long sizePatchOffset_; + long crcPatchOffset_; + #endregion + } + + /// + /// This class assists with writing/reading from Zip files. + /// + internal class ZipHelperStream : Stream + { + #region Constructors + /// + /// Initialise an instance of this class. + /// + /// The name of the file to open. + public ZipHelperStream(string name) + { + stream_ = new FileStream(name, FileMode.Open, FileAccess.ReadWrite); + isOwner_ = true; + } + + /// + /// Initialise a new instance of . + /// + /// The stream to use. + public ZipHelperStream(Stream stream) + { + stream_ = stream; + } + #endregion + + /// + /// Get / set a value indicating wether the the underlying stream is owned or not. + /// + /// If the stream is owned it is closed when this instance is closed. + public bool IsStreamOwner + { + get { return isOwner_; } + set { isOwner_ = value; } + } + + #region Base Stream Methods + public override bool CanRead + { + get { return stream_.CanRead; } + } + + public override bool CanSeek + { + get { return stream_.CanSeek; } + } + + public override bool CanTimeout + { + get { return stream_.CanTimeout; } + } + + public override long Length + { + get { return stream_.Length; } + } + + public override long Position + { + get { return stream_.Position; } + set { stream_.Position = value; } + } + + public override bool CanWrite + { + get { return stream_.CanWrite; } + } + + public override void Flush() + { + stream_.Flush(); + } + + public override long Seek(long offset, SeekOrigin origin) + { + return stream_.Seek(offset, origin); + } + + public override void SetLength(long value) + { + stream_.SetLength(value); + } + + public override int Read(byte[] buffer, int offset, int count) + { + return stream_.Read(buffer, offset, count); + } + + public override void Write(byte[] buffer, int offset, int count) + { + stream_.Write(buffer, offset, count); + } + + /// + /// Close the stream. + /// + /// + /// The underlying stream is closed only if is true. + /// + protected override void Dispose(bool disposing) + { + Stream toClose = stream_; + stream_ = null; + if (isOwner_ && (toClose != null)) + { + isOwner_ = false; + toClose.Dispose(); + } + } + + #endregion + + // Write the local file header + // TODO: ZipHelperStream.WriteLocalHeader is not yet used and needs checking for ZipFile and ZipOuptutStream usage + void WriteLocalHeader(ZipEntry entry, EntryPatchData patchData) + { + CompressionMethod method = entry.CompressionMethod; + bool headerInfoAvailable = true; // How to get this? + bool patchEntryHeader = false; + + WriteLEInt(ZipConstants.LocalHeaderSignature); + + WriteLEShort(entry.Version); + WriteLEShort(entry.Flags); + WriteLEShort((byte)method); + WriteLEInt((int)entry.DosTime); + + if (headerInfoAvailable) + { + WriteLEInt((int)entry.Crc); + + if (entry.LocalHeaderRequiresZip64) + { + WriteLEInt(-1); + WriteLEInt(-1); + } + else + { + WriteLEInt((int)entry.CompressedSize); + WriteLEInt((int)entry.Size); + } + } + else + { + if (patchData != null) + { + patchData.CrcPatchOffset = stream_.Position; + } + WriteLEInt(0); // Crc + + if (patchData != null) + { + patchData.SizePatchOffset = stream_.Position; + } + + // For local header both sizes appear in Zip64 Extended Information + if (entry.LocalHeaderRequiresZip64 && patchEntryHeader) + { + WriteLEInt(-1); + WriteLEInt(-1); + } + else + { + WriteLEInt(0); // Compressed size + WriteLEInt(0); // Uncompressed size + } + } + + byte[] name = ZipConstants.ConvertToArray(entry.Flags, entry.Name); + + if (name.Length > 0xFFFF) + throw new ZipException("Entry name too long."); + + var ed = new ZipExtraData(entry.ExtraData); + + if (entry.LocalHeaderRequiresZip64 && (headerInfoAvailable || patchEntryHeader)) + { + ed.StartNewEntry(); + + if (headerInfoAvailable) + { + ed.AddLeLong(entry.Size); + ed.AddLeLong(entry.CompressedSize); + } + else + { + ed.AddLeLong(-1); + ed.AddLeLong(-1); + } + + ed.AddNewEntry(1); + + if (!ed.Find(1)) + throw new ZipException("Internal error cant find extra data"); + + if (patchData != null) + patchData.SizePatchOffset = ed.CurrentReadIndex; + } + else + { + ed.Delete(1); + } + + byte[] extra = ed.GetEntryData(); + + WriteLEShort(name.Length); + WriteLEShort(extra.Length); + + if (name.Length > 0) + stream_.Write(name, 0, name.Length); + + if (entry.LocalHeaderRequiresZip64 && patchEntryHeader) + patchData.SizePatchOffset += stream_.Position; + + if (extra.Length > 0) + stream_.Write(extra, 0, extra.Length); + } + + /// + /// Locates a block with the desired . + /// + /// The signature to find. + /// Location, marking the end of block. + /// Minimum size of the block. + /// The maximum variable data. + /// Eeturns the offset of the first byte after the signature; -1 if not found + public long LocateBlockWithSignature(int signature, long endLocation, int minimumBlockSize, int maximumVariableData) + { + long pos = endLocation - minimumBlockSize; + if (pos < 0) + return -1; + + long giveUpMarker = Math.Max(pos - maximumVariableData, 0); + + // TODO: This loop could be optimised for speed. + do + { + if (pos < giveUpMarker) + return -1; + + Seek(pos--, SeekOrigin.Begin); + + } while (ReadLEInt() != signature); + + return Position; + } + + /// + /// Write Zip64 end of central directory records (File header and locator). + /// + /// The number of entries in the central directory. + /// The size of entries in the central directory. + /// The offset of the dentral directory. + public void WriteZip64EndOfCentralDirectory(long noOfEntries, long sizeEntries, long centralDirOffset) + { + long centralSignatureOffset = stream_.Position; + WriteLEInt(ZipConstants.Zip64CentralFileHeaderSignature); + WriteLELong(44); // Size of this record (total size of remaining fields in header or full size - 12) + WriteLEShort(ZipConstants.VersionMadeBy); // Version made by + WriteLEShort(ZipConstants.VersionZip64); // Version to extract + WriteLEInt(0); // Number of this disk + WriteLEInt(0); // number of the disk with the start of the central directory + WriteLELong(noOfEntries); // No of entries on this disk + WriteLELong(noOfEntries); // Total No of entries in central directory + WriteLELong(sizeEntries); // Size of the central directory + WriteLELong(centralDirOffset); // offset of start of central directory + // zip64 extensible data sector not catered for here (variable size) + + // Write the Zip64 end of central directory locator + WriteLEInt(ZipConstants.Zip64CentralDirLocatorSignature); + + // no of the disk with the start of the zip64 end of central directory + WriteLEInt(0); + + // relative offset of the zip64 end of central directory record + WriteLELong(centralSignatureOffset); + + // total number of disks + WriteLEInt(1); + } + + /// + /// Write the required records to end the central directory. + /// + /// The number of entries in the directory. + /// The size of the entries in the directory. + /// The start of the central directory. + /// The archive comment. (This can be null). + public void WriteEndOfCentralDirectory(long noOfEntries, long sizeEntries, + long startOfCentralDirectory, byte[] comment) + { + + if ((noOfEntries >= 0xffff) || + (startOfCentralDirectory >= 0xffffffff) || + (sizeEntries >= 0xffffffff)) + WriteZip64EndOfCentralDirectory(noOfEntries, sizeEntries, startOfCentralDirectory); + + WriteLEInt(ZipConstants.EndOfCentralDirectorySignature); + + // TODO: ZipFile Multi disk handling not done + WriteLEShort(0); // number of this disk + WriteLEShort(0); // no of disk with start of central dir + + + // Number of entries + if (noOfEntries >= 0xffff) + { + WriteLEUshort(0xffff); // Zip64 marker + WriteLEUshort(0xffff); + } + else + { + WriteLEShort((short)noOfEntries); // entries in central dir for this disk + WriteLEShort((short)noOfEntries); // total entries in central directory + } + + // Size of the central directory + if (sizeEntries >= 0xffffffff) + WriteLEUint(0xffffffff); // Zip64 marker + else + WriteLEInt((int)sizeEntries); + + + // offset of start of central directory + if (startOfCentralDirectory >= 0xffffffff) + WriteLEUint(0xffffffff); // Zip64 marker + else + WriteLEInt((int)startOfCentralDirectory); + + int commentLength = (comment != null) ? comment.Length : 0; + + if (commentLength > 0xffff) + throw new ZipException(string.Format("Comment length({0}) is too long can only be 64K", commentLength)); + + WriteLEShort(commentLength); + + if (commentLength > 0) + Write(comment, 0, comment.Length); + } + + #region LE value reading/writing + /// + /// Read an unsigned short in little endian byte order. + /// + /// Returns the value read. + /// + /// An i/o error occurs. + /// + /// + /// The file ends prematurely + /// + public int ReadLEShort() + { + int byteValue1 = stream_.ReadByte(); + + if (byteValue1 < 0) + throw new EndOfStreamException(); + + int byteValue2 = stream_.ReadByte(); + if (byteValue2 < 0) + throw new EndOfStreamException(); + + return byteValue1 | (byteValue2 << 8); + } + + /// + /// Read an int in little endian byte order. + /// + /// Returns the value read. + /// + /// An i/o error occurs. + /// + /// + /// The file ends prematurely + /// + public int ReadLEInt() => ReadLEShort() | (ReadLEShort() << 16); + + /// + /// Read a long in little endian byte order. + /// + /// The value read. + public long ReadLELong() => (uint)ReadLEInt() | ((long)ReadLEInt() << 32); + + /// + /// Write an unsigned short in little endian byte order. + /// + /// The value to write. + public void WriteLEShort(int value) + { + stream_.WriteByte((byte)(value & 0xff)); + stream_.WriteByte((byte)((value >> 8) & 0xff)); + } + + /// + /// Write a ushort in little endian byte order. + /// + /// The value to write. + public void WriteLEUshort(ushort value) + { + stream_.WriteByte((byte)(value & 0xff)); + stream_.WriteByte((byte)(value >> 8)); + } + + /// + /// Write an int in little endian byte order. + /// + /// The value to write. + public void WriteLEInt(int value) + { + WriteLEShort(value); + WriteLEShort(value >> 16); + } + + /// + /// Write a uint in little endian byte order. + /// + /// The value to write. + public void WriteLEUint(uint value) + { + WriteLEUshort((ushort)(value & 0xffff)); + WriteLEUshort((ushort)(value >> 16)); + } + + /// + /// Write a long in little endian byte order. + /// + /// The value to write. + public void WriteLELong(long value) + { + WriteLEInt((int)value); + WriteLEInt((int)(value >> 32)); + } + + /// + /// Write a ulong in little endian byte order. + /// + /// The value to write. + public void WriteLEUlong(ulong value) + { + WriteLEUint((uint)(value & 0xffffffff)); + WriteLEUint((uint)(value >> 32)); + } + + #endregion + + /// + /// Write a data descriptor. + /// + /// The entry to write a descriptor for. + /// Returns the number of descriptor bytes written. + public int WriteDataDescriptor(ZipEntry entry) + { + if (entry == null) + throw new ArgumentNullException(nameof(entry)); + + int result = 0; + + // Add data descriptor if flagged as required + if ((entry.Flags & (int)GeneralBitFlags.Descriptor) != 0) + { + // The signature is not PKZIP originally but is now described as optional + // in the PKZIP Appnote documenting trhe format. + WriteLEInt(ZipConstants.DataDescriptorSignature); + WriteLEInt(unchecked((int)(entry.Crc))); + + result += 8; + + if (entry.LocalHeaderRequiresZip64) + { + WriteLELong(entry.CompressedSize); + WriteLELong(entry.Size); + result += 16; + } + else + { + WriteLEInt((int)entry.CompressedSize); + WriteLEInt((int)entry.Size); + result += 8; + } + } + + return result; + } + + /// + /// Read data descriptor at the end of compressed data. + /// + /// if set to true [zip64]. + /// The data to fill in. + /// Returns the number of bytes read in the descriptor. + public void ReadDataDescriptor(bool zip64, DescriptorData data) + { + int intValue = ReadLEInt(); + + // In theory this may not be a descriptor according to PKZIP appnote. + // In practise its always there. + if (intValue != ZipConstants.DataDescriptorSignature) + throw new ZipException("Data descriptor signature not found"); + + data.Crc = ReadLEInt(); + + if (zip64) + { + data.CompressedSize = ReadLELong(); + data.Size = ReadLELong(); + } + else + { + data.CompressedSize = ReadLEInt(); + data.Size = ReadLEInt(); + } + } + + #region Instance Fields + bool isOwner_; + Stream stream_; + #endregion + } +} diff --git a/UpdateLib/UpdateLib/Compression/Zip/ZipInputStream.cs b/UpdateLib/UpdateLib/Compression/Zip/ZipInputStream.cs new file mode 100644 index 0000000..995a5c6 --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/Zip/ZipInputStream.cs @@ -0,0 +1,608 @@ +/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +/* Copyright © 2000-2016 SharpZipLib Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +using MatthiWare.UpdateLib.Compression.Checksum; +using MatthiWare.UpdateLib.Compression.Deflaters; +using MatthiWare.UpdateLib.Compression.Streams; +using System; +using System.IO; + +namespace MatthiWare.UpdateLib.Compression.Zip +{ + /// + /// This is an InflaterInputStream that reads the files baseInputStream an zip archive + /// one after another. It has a special method to get the zip entry of + /// the next file. The zip entry contains information about the file name + /// size, compressed size, Crc, etc. + /// It includes support for Stored and Deflated entries. + ///
+ ///
Author of the original java version : Jochen Hoenicke + ///
+ /// + /// This sample shows how to read a zip file + /// + /// using System; + /// using System.Text; + /// using System.IO; + /// + /// using ICSharpCode.SharpZipLib.Zip; + /// + /// class MainClass + /// { + /// public static void Main(string[] args) + /// { + /// using ( ZipInputStream s = new ZipInputStream(File.OpenRead(args[0]))) { + /// + /// ZipEntry theEntry; + /// const int size = 2048; + /// byte[] data = new byte[2048]; + /// + /// while ((theEntry = s.GetNextEntry()) != null) { + /// if ( entry.IsFile ) { + /// Console.Write("Show contents (y/n) ?"); + /// if (Console.ReadLine() == "y") { + /// while (true) { + /// size = s.Read(data, 0, data.Length); + /// if (size > 0) { + /// Console.Write(new ASCIIEncoding().GetString(data, 0, size)); + /// } else { + /// break; + /// } + /// } + /// } + /// } + /// } + /// } + /// } + /// } + /// + /// + public class ZipInputStream : InflaterInputStream + { + #region Instance Fields + + /// + /// Delegate for reading bytes from a stream. + /// + delegate int ReadDataHandler(byte[] b, int offset, int length); + + /// + /// The current reader this instance. + /// + ReadDataHandler internalReader; + + IChecksum checksum = new Crc32(); + ZipEntry entry; + + long size; + int method; + int flags; + string password; + #endregion + + #region Constructors + /// + /// Creates a new Zip input stream, for reading a zip archive. + /// + /// The underlying providing data. + public ZipInputStream(Stream baseInputStream) + : base(baseInputStream, new Inflater(true)) + { + internalReader = new ReadDataHandler(ReadingNotAvailable); + } + + /// + /// Creates a new Zip input stream, for reading a zip archive. + /// + /// The underlying providing data. + /// Size of the buffer. + public ZipInputStream(Stream baseInputStream, int bufferSize) + : base(baseInputStream, new Inflater(true), bufferSize) + { + internalReader = new ReadDataHandler(ReadingNotAvailable); + } + #endregion + + /// + /// Optional password used for encryption when non-null + /// + /// A password for all encrypted entries in this + public string Password + { + get + { + return password; + } + set + { + password = value; + } + } + + + /// + /// Gets a value indicating if there is a current entry and it can be decompressed + /// + /// + /// The entry can only be decompressed if the library supports the zip features required to extract it. + /// See the ZipEntry Version property for more details. + /// + public bool CanDecompressEntry + { + get + { + return (entry != null) && entry.CanDecompress; + } + } + + /// + /// Advances to the next entry in the archive + /// + /// + /// The next entry in the archive or null if there are no more entries. + /// + /// + /// If the previous entry is still open CloseEntry is called. + /// + /// + /// Input stream is closed + /// + /// + /// Password is not set, password is invalid, compression method is invalid, + /// version required to extract is not supported + /// + public ZipEntry GetNextEntry() + { + if (checksum == null) + throw new InvalidOperationException("Closed."); + + if (entry != null) + CloseEntry(); + + int header = inputBuffer.ReadLeInt(); + + if (header == ZipConstants.CentralHeaderSignature || + header == ZipConstants.EndOfCentralDirectorySignature || + header == ZipConstants.CentralHeaderDigitalSignature || + header == ZipConstants.ArchiveExtraDataSignature || + header == ZipConstants.Zip64CentralFileHeaderSignature) + { + // No more individual entries exist + Dispose(); + return null; + } + + // -jr- 07-Dec-2003 Ignore spanning temporary signatures if found + // Spanning signature is same as descriptor signature and is untested as yet. + if ((header == ZipConstants.SpanningTempSignature) || (header == ZipConstants.SpanningSignature)) + header = inputBuffer.ReadLeInt(); + + if (header != ZipConstants.LocalHeaderSignature) + throw new ZipException("Wrong Local header signature: 0x" + string.Format("{0:X}", header)); + + var versionRequiredToExtract = (short)inputBuffer.ReadLeShort(); + + flags = inputBuffer.ReadLeShort(); + method = inputBuffer.ReadLeShort(); + var dostime = (uint)inputBuffer.ReadLeInt(); + int crc2 = inputBuffer.ReadLeInt(); + csize = inputBuffer.ReadLeInt(); + size = inputBuffer.ReadLeInt(); + int nameLen = inputBuffer.ReadLeShort(); + int extraLen = inputBuffer.ReadLeShort(); + + byte[] buffer = new byte[nameLen]; + inputBuffer.ReadRawBuffer(buffer); + + string name = ZipConstants.ConvertToStringExt(flags, buffer); + + entry = new ZipEntry(name, versionRequiredToExtract) + { + Flags = flags, + CompressionMethod = (CompressionMethod)method + }; + + if ((flags & 8) == 0) + { + entry.Crc = crc2 & 0xFFFFFFFFL; + entry.Size = size & 0xFFFFFFFFL; + entry.CompressedSize = csize & 0xFFFFFFFFL; + } + else + { + + // This allows for GNU, WinZip and possibly other archives, the PKZIP spec + // says these values are zero under these circumstances. + if (crc2 != 0) + entry.Crc = crc2 & 0xFFFFFFFFL; + + if (size != 0) + entry.Size = size & 0xFFFFFFFFL; + + if (csize != 0) + entry.CompressedSize = csize & 0xFFFFFFFFL; + } + + entry.DosTime = dostime; + + // If local header requires Zip64 is true then the extended header should contain + // both values. + + // Handle extra data if present. This can set/alter some fields of the entry. + if (extraLen > 0) + { + byte[] extra = new byte[extraLen]; + inputBuffer.ReadRawBuffer(extra); + entry.ExtraData = extra; + } + + entry.ProcessExtraData(true); + if (entry.CompressedSize >= 0) + csize = entry.CompressedSize; + + if (entry.Size >= 0) + size = entry.Size; + + if (method == (int)CompressionMethod.Stored && csize != size) + throw new ZipException("Stored, but compressed != uncompressed"); + + // Determine how to handle reading of data if this is attempted. + if (entry.IsCompressionMethodSupported()) + internalReader = new ReadDataHandler(InitialRead); + else + internalReader = new ReadDataHandler(ReadingNotSupported); + + return entry; + } + + /// + /// Read data descriptor at the end of compressed data. + /// + void ReadDataDescriptor() + { + if (inputBuffer.ReadLeInt() != ZipConstants.DataDescriptorSignature) + throw new ZipException("Data descriptor signature not found"); + + entry.Crc = inputBuffer.ReadLeInt() & 0xFFFFFFFFL; + + if (entry.LocalHeaderRequiresZip64) + { + csize = inputBuffer.ReadLeLong(); + size = inputBuffer.ReadLeLong(); + } + else + { + csize = inputBuffer.ReadLeInt(); + size = inputBuffer.ReadLeInt(); + } + + entry.CompressedSize = csize; + entry.Size = size; + } + + /// + /// Complete cleanup as the final part of closing. + /// + /// True if the crc value should be tested + void CompleteCloseEntry(bool testCrc) + { + if ((flags & 8) != 0) + ReadDataDescriptor(); + + size = 0; + + if (testCrc && + ((checksum.Value & 0xFFFFFFFFL) != entry.Crc) && + (entry.Crc != -1)) + throw new ZipException("CRC mismatch"); + + checksum.Reset(); + + if (method == (int)CompressionMethod.Deflated) + inflater.Reset(); + + entry = null; + } + + /// + /// Closes the current zip entry and moves to the next one. + /// + /// + /// The stream is closed + /// + /// + /// The Zip stream ends early + /// + public void CloseEntry() + { + if (checksum == null) + throw new InvalidOperationException("Closed"); + + if (entry == null) + return; + + if (method == (int)CompressionMethod.Deflated) + { + if ((flags & 8) != 0) + { + // We don't know how much we must skip, read until end. + byte[] tmp = new byte[4096]; + + // Read will close this entry + while (Read(tmp, 0, tmp.Length) > 0) ; + + return; + } + + csize -= inflater.TotalIn; + inputBuffer.Available += inflater.RemainingInput; + } + + if ((inputBuffer.Available > csize) && (csize >= 0)) + inputBuffer.Available = (int)(inputBuffer.Available - csize); + else + { + csize -= inputBuffer.Available; + inputBuffer.Available = 0; + while (csize != 0) + { + long skipped = Skip(csize); + + if (skipped <= 0) + throw new ZipException("Zip archive ends early."); + + csize -= skipped; + } + } + + CompleteCloseEntry(false); + } + + /// + /// Returns 1 if there is an entry available + /// Otherwise returns 0. + /// + public override int Available + { + get + { + return entry != null ? 1 : 0; + } + } + + /// + /// Returns the current size that can be read from the current entry if available + /// + /// Thrown if the entry size is not known. + /// Thrown if no entry is currently available. + public override long Length + { + get + { + if (entry == null) + throw new InvalidOperationException("No current entry"); + + if (entry.Size < 0) + throw new ZipException("Length not available for the current entry"); + + return entry.Size; + } + + } + + /// + /// Reads a byte from the current zip entry. + /// + /// + /// The byte or -1 if end of stream is reached. + /// + public override int ReadByte() + { + byte[] b = new byte[1]; + + return (Read(b, 0, 1) <= 0) ? -1 : b[0] & 0xff; + } + + /// + /// Handle attempts to read by throwing an . + /// + /// The destination array to store data in. + /// The offset at which data read should be stored. + /// The maximum number of bytes to read. + /// Returns the number of bytes actually read. + int ReadingNotAvailable(byte[] destination, int offset, int count) + { + throw new IOException("Unable to read from this stream"); + } + + /// + /// Handle attempts to read from this entry by throwing an exception + /// + int ReadingNotSupported(byte[] destination, int offset, int count) + { + throw new ZipException("The compression method for this entry is not supported"); + } + + /// + /// Perform the initial read on an entry which may include + /// reading encryption headers and setting up inflation. + /// + /// The destination to fill with data read. + /// The offset to start reading at. + /// The maximum number of bytes to read. + /// The actual number of bytes read. + int InitialRead(byte[] destination, int offset, int count) + { + if (!CanDecompressEntry) + throw new ZipException($"Library cannot extract this entry. Version required is ({entry.Version})"); + + if ((csize > 0) || ((flags & (int)GeneralBitFlags.Descriptor) != 0)) + { + if ((method == (int)CompressionMethod.Deflated) && (inputBuffer.Available > 0)) + inputBuffer.SetInflaterInput(inflater); + + internalReader = new ReadDataHandler(BodyRead); + return BodyRead(destination, offset, count); + } + else + { + internalReader = new ReadDataHandler(ReadingNotAvailable); + return 0; + } + } + + /// + /// Read a block of bytes from the stream. + /// + /// The destination for the bytes. + /// The index to start storing data. + /// The number of bytes to attempt to read. + /// Returns the number of bytes read. + /// Zero bytes read means end of stream. + public override int Read(byte[] buffer, int offset, int count) + { + if (buffer == null) + throw new ArgumentNullException(nameof(buffer)); + + if (offset < 0) + throw new ArgumentOutOfRangeException(nameof(offset), "Cannot be negative"); + + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count), "Cannot be negative"); + + if ((buffer.Length - offset) < count) + throw new ArgumentException("Invalid offset/count combination"); + + return internalReader(buffer, offset, count); + } + + /// + /// Reads a block of bytes from the current zip entry. + /// + /// + /// The number of bytes read (this may be less than the length requested, even before the end of stream), or 0 on end of stream. + /// + /// + /// An i/o error occured. + /// + /// + /// The deflated stream is corrupted. + /// + /// + /// The stream is not open. + /// + int BodyRead(byte[] buffer, int offset, int count) + { + if (checksum == null) + throw new InvalidOperationException("Closed"); + + if ((entry == null) || (count <= 0)) + return 0; + + if (offset + count > buffer.Length) + throw new ArgumentException("Offset + count exceeds buffer size"); + + bool finished = false; + + switch (method) + { + case (int)CompressionMethod.Deflated: + + count = base.Read(buffer, offset, count); + + if (count <= 0) + { + if (!inflater.IsFinished) + throw new ZipException("Inflater not finished!"); + + inputBuffer.Available = inflater.RemainingInput; + + // A csize of -1 is from an unpatched local header + if ((flags & 8) == 0 && + (inflater.TotalIn != csize && csize != 0xFFFFFFFF && csize != -1 || inflater.TotalOut != size)) + throw new ZipException("Size mismatch: " + csize + ";" + size + " <-> " + inflater.TotalIn + ";" + inflater.TotalOut); + + inflater.Reset(); + finished = true; + } + break; + + case (int)CompressionMethod.Stored: + + if ((count > csize) && (csize >= 0)) + count = (int)csize; + + if (count > 0) + { + count = inputBuffer.ReadClearTextBuffer(buffer, offset, count); + + if (count > 0) + { + csize -= count; + size -= count; + } + } + + if (csize == 0) + finished = true; + else + if (count < 0) + throw new ZipException("EOF in stored block"); + + break; + } + + if (count > 0) + checksum.Update(buffer, offset, count); + + if (finished) + CompleteCloseEntry(true); + + return count; + } + + /// + /// Closes the zip input stream + /// + protected override void Dispose(bool disposing) + { + internalReader = new ReadDataHandler(ReadingNotAvailable); + checksum = null; + entry = null; + + base.Dispose(disposing); + } + } +} diff --git a/UpdateLib/UpdateLib/Compression/Zip/ZipOutputStream.cs b/UpdateLib/UpdateLib/Compression/Zip/ZipOutputStream.cs new file mode 100644 index 0000000..3ca7c4c --- /dev/null +++ b/UpdateLib/UpdateLib/Compression/Zip/ZipOutputStream.cs @@ -0,0 +1,735 @@ +/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +/* Copyright © 2000-2016 SharpZipLib Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +using MatthiWare.UpdateLib.Compression.Checksum; +using MatthiWare.UpdateLib.Compression.Deflaters; +using MatthiWare.UpdateLib.Compression.Streams; +using System; +using System.Collections.Generic; +using System.IO; + +namespace MatthiWare.UpdateLib.Compression.Zip +{ + /// + /// This is a DeflaterOutputStream that writes the files into a zip + /// archive one after another. It has a special method to start a new + /// zip entry. The zip entries contains information about the file name + /// size, compressed size, CRC, etc. + /// + /// It includes support for Stored and Deflated entries. + /// This class is not thread safe. + ///
+ ///
Author of the original java version : Jochen Hoenicke + ///
+ /// This sample shows how to create a zip file + /// + /// using System; + /// using System.IO; + /// + /// using ICSharpCode.SharpZipLib.Core; + /// using ICSharpCode.SharpZipLib.Zip; + /// + /// class MainClass + /// { + /// public static void Main(string[] args) + /// { + /// string[] filenames = Directory.GetFiles(args[0]); + /// byte[] buffer = new byte[4096]; + /// + /// using ( ZipOutputStream s = new ZipOutputStream(File.Create(args[1])) ) { + /// + /// s.SetLevel(9); // 0 - store only to 9 - means best compression + /// + /// foreach (string file in filenames) { + /// ZipEntry entry = new ZipEntry(file); + /// s.PutNextEntry(entry); + /// + /// using (FileStream fs = File.OpenRead(file)) { + /// StreamUtils.Copy(fs, s, buffer); + /// } + /// } + /// } + /// } + /// } + /// + /// + public class ZipOutputStream : DeflaterOutputStream + { + #region Constructors + /// + /// Creates a new Zip output stream, writing a zip archive. + /// + /// + /// The output stream to which the archive contents are written. + /// + public ZipOutputStream(Stream baseOutputStream) + : base(baseOutputStream, new Deflater(Deflater.DEFAULT_COMPRESSION, true)) + { + } + + /// + /// Creates a new Zip output stream, writing a zip archive. + /// + /// The output stream to which the archive contents are written. + /// Size of the buffer to use. + public ZipOutputStream(Stream baseOutputStream, int bufferSize) + : base(baseOutputStream, new Deflater(Deflater.DEFAULT_COMPRESSION, true), bufferSize) + { + } + #endregion + + /// + /// Gets a flag value of true if the central header has been added for this archive; false if it has not been added. + /// + /// No further entries can be added once this has been done. + public bool IsFinished + { + get + { + return entries == null; + } + } + + /// + /// Set the zip file comment. + /// + /// + /// The comment text for the entire archive. + /// + /// + /// The converted comment is longer than 0xffff bytes. + /// + public void SetComment(string comment) + { + // TODO: Its not yet clear how to handle unicode comments here. + byte[] commentBytes = ZipConstants.ConvertToArray(comment); + + if (commentBytes.Length > 0xffff) + throw new ArgumentOutOfRangeException(nameof(comment)); + + zipComment = commentBytes; + } + + /// + /// Sets the compression level. The new level will be activated + /// immediately. + /// + /// The new compression level (1 to 9). + /// + /// Level specified is not supported. + /// + /// + public void SetLevel(int level) + { + deflater_.SetLevel(level); + defaultCompressionLevel = level; + } + + /// + /// Get the current deflater compression level + /// + /// The current compression level + public int GetLevel() + { + return deflater_.GetLevel(); + } + + /// + /// Get / set a value indicating how Zip64 Extension usage is determined when adding entries. + /// + /// Older archivers may not understand Zip64 extensions. + /// If backwards compatability is an issue be careful when adding entries to an archive. + /// Setting this property to off is workable but less desirable as in those circumstances adding a file + /// larger then 4GB will fail. + public UseZip64 UseZip64 + { + get { return useZip64_; } + set { useZip64_ = value; } + } + + /// + /// Write an unsigned short in little endian byte order. + /// + private void WriteLeShort(int value) + { + unchecked + { + baseOutputStream_.WriteByte((byte)(value & 0xff)); + baseOutputStream_.WriteByte((byte)((value >> 8) & 0xff)); + } + } + + /// + /// Write an int in little endian byte order. + /// + private void WriteLeInt(int value) + { + unchecked + { + WriteLeShort(value); + WriteLeShort(value >> 16); + } + } + + /// + /// Write an int in little endian byte order. + /// + private void WriteLeLong(long value) + { + unchecked + { + WriteLeInt((int)value); + WriteLeInt((int)(value >> 32)); + } + } + + /// + /// Starts a new Zip entry. It automatically closes the previous + /// entry if present. + /// All entry elements bar name are optional, but must be correct if present. + /// If the compression method is stored and the output is not patchable + /// the compression for that entry is automatically changed to deflate level 0 + /// + /// + /// the entry. + /// + /// + /// if entry passed is null. + /// + /// + /// if an I/O error occured. + /// + /// + /// if stream was finished + /// + /// + /// Too many entries in the Zip file
+ /// Entry name is too long
+ /// Finish has already been called
+ ///
+ public void PutNextEntry(ZipEntry entry) + { + if (entry == null) + throw new ArgumentNullException(nameof(entry)); + + if (entries == null) + throw new InvalidOperationException("ZipOutputStream was finished"); + + if (curEntry != null) + CloseEntry(); + + if (entries.Count == int.MaxValue) + throw new ZipException("Too many entries for Zip file"); + + CompressionMethod method = entry.CompressionMethod; + int compressionLevel = defaultCompressionLevel; + + // Clear flags that the library manages internally + entry.Flags &= (int)GeneralBitFlags.UnicodeText; + patchEntryHeader = false; + + bool headerInfoAvailable; + + // No need to compress - definitely no data. + if (entry.Size == 0) + { + entry.CompressedSize = entry.Size; + entry.Crc = 0; + method = CompressionMethod.Stored; + headerInfoAvailable = true; + } + else + { + headerInfoAvailable = (entry.Size >= 0) && entry.HasCrc && entry.CompressedSize >= 0; + + // Switch to deflation if storing isnt possible. + if (method == CompressionMethod.Stored) + { + if (!headerInfoAvailable) + { + if (!CanPatchEntries) + { + // Can't patch entries so storing is not possible. + method = CompressionMethod.Deflated; + compressionLevel = 0; + } + } + else // entry.size must be > 0 + { + entry.CompressedSize = entry.Size; + headerInfoAvailable = entry.HasCrc; + } + } + } + + if (headerInfoAvailable == false) + { + if (CanPatchEntries == false) + { + // Only way to record size and compressed size is to append a data descriptor + // after compressed data. + + // Stored entries of this form have already been converted to deflating. + entry.Flags |= 8; + } + else + { + patchEntryHeader = true; + } + } + + entry.Offset = offset; + entry.CompressionMethod = method; + + curMethod = method; + sizePatchPos = -1; + + if ((useZip64_ == UseZip64.On) || ((entry.Size < 0) && (useZip64_ == UseZip64.Dynamic))) + entry.ForceZip64(); + + // Write the local file header + WriteLeInt(ZipConstants.LocalHeaderSignature); + + WriteLeShort(entry.Version); + WriteLeShort(entry.Flags); + WriteLeShort((byte)entry.CompressionMethod); + WriteLeInt((int)entry.DosTime); + + // TODO: Refactor header writing. Its done in several places. + if (headerInfoAvailable) + { + WriteLeInt((int)entry.Crc); + + if (entry.LocalHeaderRequiresZip64) + { + WriteLeInt(-1); + WriteLeInt(-1); + } + else + { + WriteLeInt((int)entry.CompressedSize); + WriteLeInt((int)entry.Size); + } + } + else + { + if (patchEntryHeader) + crcPatchPos = baseOutputStream_.Position; + + WriteLeInt(0); // Crc + + if (patchEntryHeader) + sizePatchPos = baseOutputStream_.Position; + + // For local header both sizes appear in Zip64 Extended Information + if (entry.LocalHeaderRequiresZip64 || patchEntryHeader) + { + WriteLeInt(-1); + WriteLeInt(-1); + } + else + { + WriteLeInt(0); // Compressed size + WriteLeInt(0); // Uncompressed size + } + } + + byte[] name = ZipConstants.ConvertToArray(entry.Flags, entry.Name); + + if (name.Length > 0xFFFF) + throw new ZipException("Entry name too long."); + + var ed = new ZipExtraData(entry.ExtraData); + + if (entry.LocalHeaderRequiresZip64) + { + ed.StartNewEntry(); + + if (headerInfoAvailable) + { + ed.AddLeLong(entry.Size); + ed.AddLeLong(entry.CompressedSize); + } + else + { + ed.AddLeLong(-1); + ed.AddLeLong(-1); + } + + ed.AddNewEntry(1); + + if (!ed.Find(1)) + throw new ZipException("Internal error cant find extra data"); + + if (patchEntryHeader) + sizePatchPos = ed.CurrentReadIndex; + } + else + ed.Delete(1); + + byte[] extra = ed.GetEntryData(); + + WriteLeShort(name.Length); + WriteLeShort(extra.Length); + + if (name.Length > 0) + baseOutputStream_.Write(name, 0, name.Length); + + if (entry.LocalHeaderRequiresZip64 && patchEntryHeader) + sizePatchPos += baseOutputStream_.Position; + + if (extra.Length > 0) + baseOutputStream_.Write(extra, 0, extra.Length); + + offset += ZipConstants.LocalHeaderBaseSize + name.Length + extra.Length; + + // Activate the entry. + curEntry = entry; + checksum.Reset(); + + if (method == CompressionMethod.Deflated) + { + deflater_.Reset(); + deflater_.SetLevel(compressionLevel); + } + + size = 0; + } + + /// + /// Closes the current entry, updating header and footer information as required + /// + /// + /// An I/O error occurs. + /// + /// + /// No entry is active. + /// + public void CloseEntry() + { + if (curEntry == null) + throw new InvalidOperationException("No open entry"); + + long csize = size; + + // First finish the deflater, if appropriate + if (curMethod == CompressionMethod.Deflated) + { + if (size >= 0) + { + base.Finish(); + csize = deflater_.TotalOut; + } + else + deflater_.Reset(); + } + + if (curEntry.Size < 0) + curEntry.Size = size; + else if (curEntry.Size != size) + throw new ZipException("size was " + size + ", but I expected " + curEntry.Size); + + if (curEntry.CompressedSize < 0) + curEntry.CompressedSize = csize; + else if (curEntry.CompressedSize != csize) + throw new ZipException("compressed size was " + csize + ", but I expected " + curEntry.CompressedSize); + + if (curEntry.Crc < 0) + curEntry.Crc = checksum.Value; + else if (curEntry.Crc != checksum.Value) + throw new ZipException("crc was " + checksum.Value + ", but I expected " + curEntry.Crc); + + offset += csize; + + // Patch the header if possible + if (patchEntryHeader) + { + patchEntryHeader = false; + + long curPos = baseOutputStream_.Position; + baseOutputStream_.Seek(crcPatchPos, SeekOrigin.Begin); + WriteLeInt((int)curEntry.Crc); + + if (curEntry.LocalHeaderRequiresZip64) + { + if (sizePatchPos == -1) + throw new ZipException("Entry requires zip64 but this has been turned off"); + + baseOutputStream_.Seek(sizePatchPos, SeekOrigin.Begin); + WriteLeLong(curEntry.Size); + WriteLeLong(curEntry.CompressedSize); + } + else + { + WriteLeInt((int)curEntry.CompressedSize); + WriteLeInt((int)curEntry.Size); + } + + baseOutputStream_.Seek(curPos, SeekOrigin.Begin); + } + + // Add data descriptor if flagged as required + if ((curEntry.Flags & 8) != 0) + { + WriteLeInt(ZipConstants.DataDescriptorSignature); + WriteLeInt(unchecked((int)curEntry.Crc)); + + if (curEntry.LocalHeaderRequiresZip64) + { + WriteLeLong(curEntry.CompressedSize); + WriteLeLong(curEntry.Size); + offset += ZipConstants.Zip64DataDescriptorSize; + } + else + { + WriteLeInt((int)curEntry.CompressedSize); + WriteLeInt((int)curEntry.Size); + offset += ZipConstants.DataDescriptorSize; + } + } + + entries.Add(curEntry); + curEntry = null; + } + + /// + /// Writes the given buffer to the current entry. + /// + /// The buffer containing data to write. + /// The offset of the first byte to write. + /// The number of bytes to write. + /// Archive size is invalid + /// No entry is active. + public override void Write(byte[] buffer, int offset, int count) + { + if (curEntry == null) + throw new InvalidOperationException("No open entry."); + + if (buffer == null) + throw new ArgumentNullException(nameof(buffer)); + + if (offset < 0) + throw new ArgumentOutOfRangeException(nameof(offset), "Cannot be negative"); + + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count), "Cannot be negative"); + + if ((buffer.Length - offset) < count) + throw new ArgumentException("Invalid offset/count combination"); + + checksum.Update(buffer, offset, count); + size += count; + + switch (curMethod) + { + case CompressionMethod.Deflated: + base.Write(buffer, offset, count); + break; + + case CompressionMethod.Stored: + baseOutputStream_.Write(buffer, offset, count); + break; + } + } + + /// + /// Finishes the stream. This will write the central directory at the + /// end of the zip file and flush the stream. + /// + /// + /// This is automatically called when the stream is closed. + /// + /// + /// An I/O error occurs. + /// + /// + /// Comment exceeds the maximum length
+ /// Entry name exceeds the maximum length + ///
+ public override void Finish() + { + if (entries == null) + return; + + if (curEntry != null) + CloseEntry(); + + long numEntries = entries.Count; + long sizeEntries = 0; + + foreach (ZipEntry entry in entries) + { + WriteLeInt(ZipConstants.CentralHeaderSignature); + WriteLeShort(ZipConstants.VersionMadeBy); + WriteLeShort(entry.Version); + WriteLeShort(entry.Flags); + WriteLeShort((short)entry.CompressionMethod); + WriteLeInt((int)entry.DosTime); + WriteLeInt((int)entry.Crc); + + WriteLeInt(entry.IsZip64Forced() || (entry.CompressedSize >= uint.MaxValue) ? + -1 : + (int)entry.CompressedSize); + + WriteLeInt(entry.IsZip64Forced() || (entry.Size >= uint.MaxValue) ? + -1 : + (int)entry.Size); + + byte[] name = ZipConstants.ConvertToArray(entry.Flags, entry.Name); + + if (name.Length > 0xffff) + throw new ZipException("Name too long."); + + var ed = new ZipExtraData(entry.ExtraData); + + if (entry.CentralHeaderRequiresZip64) + { + ed.StartNewEntry(); + if (entry.IsZip64Forced() || + (entry.Size >= 0xffffffff)) + ed.AddLeLong(entry.Size); + + if (entry.IsZip64Forced() || + (entry.CompressedSize >= 0xffffffff)) + ed.AddLeLong(entry.CompressedSize); + + if (entry.Offset >= 0xffffffff) + ed.AddLeLong(entry.Offset); + + ed.AddNewEntry(1); + } + else + ed.Delete(1); + + byte[] extra = ed.GetEntryData(); + + byte[] entryComment = + (entry.Comment != null) ? + ZipConstants.ConvertToArray(entry.Flags, entry.Comment) : + new byte[0]; + + if (entryComment.Length > 0xffff) + throw new ZipException("Comment too long."); + + WriteLeShort(name.Length); + WriteLeShort(extra.Length); + WriteLeShort(entryComment.Length); + WriteLeShort(0); // disk number + WriteLeShort(0); // internal file attributes + // external file attributes + + if (entry.ExternalFileAttributes != -1) + WriteLeInt(entry.ExternalFileAttributes); + else + WriteLeInt(entry.IsDirectory ? 16 : 0); // mark entry as directory (from nikolam.AT.perfectinfo.com) + + WriteLeInt(entry.Offset >= uint.MaxValue ? -1 : (int)entry.Offset); + + if (name.Length > 0) + baseOutputStream_.Write(name, 0, name.Length); + + if (extra.Length > 0) + baseOutputStream_.Write(extra, 0, extra.Length); + + if (entryComment.Length > 0) + baseOutputStream_.Write(entryComment, 0, entryComment.Length); + + sizeEntries += ZipConstants.CentralHeaderBaseSize + name.Length + extra.Length + entryComment.Length; + } + + using (ZipHelperStream zhs = new ZipHelperStream(baseOutputStream_)) + zhs.WriteEndOfCentralDirectory(numEntries, sizeEntries, offset, zipComment); + + entries = null; + } + + #region Instance Fields + /// + /// The entries for the archive. + /// + List entries = new List(); + + /// + /// Used to track the crc of data added to entries. + /// + IChecksum checksum = new Crc32(); + + /// + /// The current entry being added. + /// + ZipEntry curEntry; + + int defaultCompressionLevel = Deflater.DEFAULT_COMPRESSION; + + CompressionMethod curMethod = CompressionMethod.Deflated; + + /// + /// Used to track the size of data for an entry during writing. + /// + long size; + + /// + /// Offset to be recorded for each entry in the central header. + /// + long offset; + + /// + /// Comment for the entire archive recorded in central header. + /// + byte[] zipComment = new byte[0]; + + /// + /// Flag indicating that header patching is required for the current entry. + /// + bool patchEntryHeader; + + /// + /// Position to patch crc + /// + long crcPatchPos = -1; + + /// + /// Position to patch size. + /// + long sizePatchPos = -1; + + // Default is dynamic which is not backwards compatible and can cause problems + // with XP's built in compression which cant read Zip64 archives. + // However it does avoid the situation were a large file is added and cannot be completed correctly. + // NOTE: Setting the size for entries before they are added is the best solution! + UseZip64 useZip64_ = UseZip64.On; + #endregion + } +} diff --git a/UpdateLib/UpdateLib/Controls/UpdaterControl.Designer.cs b/UpdateLib/UpdateLib/Controls/UpdaterControl.Designer.cs new file mode 100644 index 0000000..46bf967 --- /dev/null +++ b/UpdateLib/UpdateLib/Controls/UpdaterControl.Designer.cs @@ -0,0 +1,49 @@ +namespace MatthiWare.UpdateLib.Controls +{ + partial class UpdaterControl + { + /// + /// 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 Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.SuspendLayout(); + // + // UpdaterControl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.Transparent; + this.DoubleBuffered = true; + this.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.Name = "UpdaterControl"; + this.Size = new System.Drawing.Size(369, 77); + this.ResumeLayout(false); + + } + + #endregion + } +} diff --git a/UpdateLib/UpdateLib/Controls/UpdaterControl.cs b/UpdateLib/UpdateLib/Controls/UpdaterControl.cs new file mode 100644 index 0000000..919c063 --- /dev/null +++ b/UpdateLib/UpdateLib/Controls/UpdaterControl.cs @@ -0,0 +1,288 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Windows.Forms; +using MatthiWare.UpdateLib.Properties; + +namespace MatthiWare.UpdateLib.Controls +{ + [ToolboxBitmap(typeof(UpdaterControl), "UpdaterControl.bmp")] + [Obsolete("We will no longer be supporting the UpdaterControl")] + public partial class UpdaterControl : UserControl + { + private const int ICON_SIZE = 16; + private const int XY_OFFSET = 2; + private const int PROGRESS_SPEED = 200; + + private Brush brush; + private float x_text, y_text; + + private const string CHECK_FOR_UPDATES = "Please check for updates"; + + private Point oldLocation; + private ToolTip tooltip = new ToolTip(); + + private Dictionary cachedMeasure = new Dictionary(); + private string _text = CHECK_FOR_UPDATES; + public override string Text + { + get { return _text; } + set + { + if (_text != value) + { + _text = value; + Invalidate(); + } + + } + } + + private int progressIndex = 0; + private Bitmap[] progressImages = new Bitmap[50]; + + private Dictionary cachedImages = new Dictionary(); + + private Timer timer; + + private UpdaterIcon _icon = UpdaterIcon.Info; + private UpdaterIcon Icon + { + get { return _icon; } + set + { + if (_icon != value) + { + _icon = value; + Invalidate(); + } + + } + } + + public enum UpdaterIcon : byte + { + Info = 0, + Error = 1, + Done = 2, + Update = 3, + Progress = 4 + } + + public UpdaterControl() + { + InitializeComponent(); + + SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor | ControlStyles.UserPaint, true); + SetStyle(ControlStyles.ContainerControl, false); + + Size = new Size(XY_OFFSET * 2 + ICON_SIZE, XY_OFFSET * 2 + ICON_SIZE); + timer = new Timer(); + timer.Interval = PROGRESS_SPEED; + timer.Tick += update_progress; + + // caching + LoadImages(); + MakeBrushFromForeColor(); + CalcFont(); + + } + + private void update_progress(object sender, EventArgs e) + { + Invalidate(); + if (++progressIndex >= progressImages.Length) + progressIndex = 0; + } + + private void StartProgress() + { + progressIndex = 0; + timer.Start(); + } + + private void StopProgress() + { + timer.Stop(); + } + + public override Font Font + { + get + { + return base.Font; + } + + set + { + base.Font = value; + // invalidate the cache + cachedMeasure.Clear(); + CalcFont(); + } + } + + private void CalcFont() + { + SizeF size = GetAndCacheSize(); + + int height = XY_OFFSET * 2 + ICON_SIZE; + + x_text = XY_OFFSET * 2 + ICON_SIZE; + y_text = (height / 2) - (size.Height / 2); + } + + private SizeF GetAndCacheSize() + { + if (!cachedMeasure.ContainsKey(Text)) + { + Graphics g = Graphics.FromImage(new Bitmap(1,1)); + SizeF size = g.MeasureString(Text, base.Font); + + cachedMeasure.Add(Text, size); + } + + return cachedMeasure[Text]; + } + + public override Color ForeColor + { + get + { + return base.ForeColor; + } + + set + { + base.ForeColor = value; + MakeBrushFromForeColor(); + } + } + + private void MakeBrushFromForeColor() + { + brush = new SolidBrush(base.ForeColor); + } + + private void LoadImages() + { + Resources.status_download.RotateFlip(RotateFlipType.RotateNoneFlipY); + cachedImages.Add(UpdaterIcon.Info, Resources.status_info); + cachedImages.Add(UpdaterIcon.Error, Resources.status_error); + cachedImages.Add(UpdaterIcon.Done, Resources.status_done); + cachedImages.Add(UpdaterIcon.Update, Resources.status_update); + + Bitmap spritesheet = Resources.status_working; + + int i = 0; + for (int x = 0; x < 10; x++) + { + for (int y = 0; y < 5; y++) + { + Bitmap bmp = new Bitmap(16, 16); + Graphics g = Graphics.FromImage(bmp); + + Rectangle dest = new Rectangle(0, 0, 16, 16); + Rectangle src = new Rectangle(x * 16, y * 16, 16, 16); + + g.DrawImage(spritesheet, dest, src, GraphicsUnit.Pixel); + + g.Dispose(); + + progressImages[i++] = bmp; + } + } + + } + + protected override void OnPaint(PaintEventArgs e) + { + base.OnPaint(e); + + DrawIcon(e.Graphics); + DrawText(e.Graphics); + } + + private void DrawIcon(Graphics g) + { + g.DrawImage((Icon == UpdaterIcon.Progress) ? progressImages[progressIndex] : cachedImages[Icon], + XY_OFFSET, + XY_OFFSET, + ICON_SIZE, + ICON_SIZE); + } + + private void DrawText(Graphics g) + { + g.DrawString(Text, Font, brush, x_text, y_text); + } + + protected override void OnMouseEnter(EventArgs e) + { + base.OnMouseEnter(e); + + oldLocation = Location; + int newWidth = CalcNewWidth(); + Width = newWidth; + + if (Location.X + newWidth > ParentForm.Width) + { + int amountToRemove = ParentForm.Width - (Location.X + newWidth) - (XY_OFFSET * 2 + ICON_SIZE); + Point x = Location; + x.X += amountToRemove; + Location = x; + } + } + + protected override void OnMouseLeave(EventArgs e) + { + base.OnMouseLeave(e); + + Location = oldLocation; + Width = XY_OFFSET * 2 + ICON_SIZE; + + tooltip.Active = false; + } + + protected override void OnMouseHover(EventArgs e) + { + base.OnMouseHover(e); + + + tooltip.ToolTipIcon = ToolTipIcon.Info; + tooltip.ToolTipTitle = Text; + tooltip.UseAnimation = true; + tooltip.Active = true; + tooltip.Show("Please click here to start checking for updates", Parent, Location.X + Width + (ICON_SIZE), Location.Y + Height); + + } + + protected override void OnClick(EventArgs e) + { + base.OnClick(e); + + Text = "Checking for updates.."; + Icon = UpdaterIcon.Progress; + + int currWidth = Width; + int newWidth = CalcNewWidth(); + + int offset = currWidth - newWidth; + Point x = Location; + x.X += offset; + Location = x; + Width = newWidth; + + StartProgress(); + + + } + + private int CalcNewWidth() + { + SizeF size = GetAndCacheSize(); + return (int)size.Width + (XY_OFFSET * 2 + ICON_SIZE); + } + + } +} diff --git a/UpdateLib/UpdateLib/Controls/UpdaterControl.resx b/UpdateLib/UpdateLib/Controls/UpdaterControl.resx new file mode 100644 index 0000000..7080a7d --- /dev/null +++ b/UpdateLib/UpdateLib/Controls/UpdaterControl.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/UpdateLib/UpdateLib/Files/CacheFile.cs b/UpdateLib/UpdateLib/Files/CacheFile.cs index 85e1226..dc0584d 100644 --- a/UpdateLib/UpdateLib/Files/CacheFile.cs +++ b/UpdateLib/UpdateLib/Files/CacheFile.cs @@ -9,14 +9,14 @@ namespace MatthiWare.UpdateLib.Files [Serializable] public class CacheFile : FileBase { - private static Lazy m_filePath = new Lazy(() => $""); + private static Lazy m_filePath = new Lazy(() => $"{IOUtils.AppDataPath}\\Cache.xml"); public UpdateVersion CurrentVersion { get; set; } public override CacheFile Load() - => Load(m_filePath.Value); + => Load(m_filePath); public override void Save() - => Save(m_filePath.Value); + => Save(m_filePath); } } diff --git a/UpdateLib/UpdateLib/Files/HashCacheFile.cs b/UpdateLib/UpdateLib/Files/HashCacheFile.cs index 51e3afd..132a3d3 100644 --- a/UpdateLib/UpdateLib/Files/HashCacheFile.cs +++ b/UpdateLib/UpdateLib/Files/HashCacheFile.cs @@ -61,12 +61,12 @@ public void AddOrUpdateEntry(string fullPath, string hash = "") Items.Add(entry); } - //Updater.Instance.Logger.Debug(nameof(HashCacheFile), nameof(AddOrUpdateEntry), $"Cache updated for file -> '{entry.FilePath}'"); + Updater.Instance.Logger.Debug(nameof(HashCacheFile), nameof(AddOrUpdateEntry), $"Cache updated for file -> '{entry.FilePath}'"); } } #region Save/Load - private static string GetStoragePath() => ""; + private static string GetStoragePath() => $@"{IOUtils.CachePath}\{FILE_NAME}"; /// /// Loads the from the default storage location diff --git a/UpdateLib/UpdateLib/Files/UpdateCatalogFile.cs b/UpdateLib/UpdateLib/Files/UpdateCatalogFile.cs index 9e55b5c..43827a8 100644 --- a/UpdateLib/UpdateLib/Files/UpdateCatalogFile.cs +++ b/UpdateLib/UpdateLib/Files/UpdateCatalogFile.cs @@ -31,6 +31,7 @@ using MatthiWare.UpdateLib.Common; using MatthiWare.UpdateLib.Common.Abstraction; +using MatthiWare.UpdateLib.Compression.GZip; namespace MatthiWare.UpdateLib.Files { @@ -70,11 +71,11 @@ public UpdateInfo GetLatestUpdateForVersion(UpdateVersion currentVersion) public override UpdateCatalogFile Load() => throw new NotImplementedException(); public override UpdateCatalogFile Load(Stream stream) - => base.Load(stream); + => base.Load(new GZipInputStream(stream, false)); public override void Save() => throw new NotImplementedException(); public override void Save(Stream stream) - => base.Save(stream); + => base.Save(new GZipOutputStream(stream, false)); } } diff --git a/UpdateLib/UpdateLib/Files/UpdateMetadataFile.cs b/UpdateLib/UpdateLib/Files/UpdateMetadataFile.cs index 18473d3..6a9a96e 100644 --- a/UpdateLib/UpdateLib/Files/UpdateMetadataFile.cs +++ b/UpdateLib/UpdateLib/Files/UpdateMetadataFile.cs @@ -7,6 +7,7 @@ using MatthiWare.UpdateLib.Common; using MatthiWare.UpdateLib.Common.Abstraction; +using MatthiWare.UpdateLib.Compression.GZip; namespace MatthiWare.UpdateLib.Files { @@ -40,11 +41,11 @@ public UpdateMetadataFile() { } public override UpdateMetadataFile Load() => throw new NotImplementedException(); public override UpdateMetadataFile Load(Stream stream) - => base.Load(stream); + => base.Load(new GZipInputStream(stream, false)); public override void Save() => throw new NotImplementedException(); public override void Save(Stream stream) - => base.Save(stream); + => base.Save(new GZipOutputStream(stream, false)); } } diff --git a/UpdateLib/UpdateLib/Logging/ILogWriter.cs b/UpdateLib/UpdateLib/Logging/ILogWriter.cs new file mode 100644 index 0000000..d5a50b2 --- /dev/null +++ b/UpdateLib/UpdateLib/Logging/ILogWriter.cs @@ -0,0 +1,28 @@ +/* UpdateLib - .Net auto update library + * Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using MatthiWare.UpdateLib.Common; + +namespace MatthiWare.UpdateLib.Logging +{ + public interface ILogWriter + { + LoggingLevel LoggingLevel { get; } + + void Log(string text); + } +} diff --git a/UpdateLib/UpdateLib/Logging/ILogger.cs b/UpdateLib/UpdateLib/Logging/ILogger.cs new file mode 100644 index 0000000..0699618 --- /dev/null +++ b/UpdateLib/UpdateLib/Logging/ILogger.cs @@ -0,0 +1,35 @@ +/* UpdateLib - .Net auto update library + * Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using MatthiWare.UpdateLib.Common; +using System; +using System.Collections.Generic; + +namespace MatthiWare.UpdateLib.Logging +{ + public interface ILogger + { + LoggingLevel LogLevel { get; set; } + ICollection Writers { get; } + void Log(string tag, string msg, LoggingLevel level); + void Debug(string className, string methodName, string msg); + void Info(string className, string methodName, string msg); + void Warn(string className, string methodName, string msg); + void Error(string className, string methodName, string msg); + void Error(string className, string methodName, Exception e); + } +} diff --git a/UpdateLib/UpdateLib/Logging/Logger.cs b/UpdateLib/UpdateLib/Logging/Logger.cs new file mode 100644 index 0000000..d93d950 --- /dev/null +++ b/UpdateLib/UpdateLib/Logging/Logger.cs @@ -0,0 +1,68 @@ +/* UpdateLib - .Net auto update library + * Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using MatthiWare.UpdateLib.Common; + +namespace MatthiWare.UpdateLib.Logging +{ + public class Logger : ILogger + { + public LoggingLevel LogLevel { get; set; } = LoggingLevel.Debug; + + public ICollection Writers { get; } = new List(); + + private const string TEMPLATE = "[{0}][{1}][{2}]: {3}"; + + public void Log(string tag, string msg, LoggingLevel level) + { + if (level < LogLevel) return; + + Writers + .Where(w => w.LoggingLevel >= LogLevel && level >= w.LoggingLevel) + .ToList() + .ForEach(w => w.Log(string.Format(TEMPLATE, DateTime.Now, level, tag, msg))); + } + + public void Debug(string className, string methodName, string msg) + { + Log($"{className}::{methodName}", msg, LoggingLevel.Debug); + } + + public void Info(string className, string methodName, string msg) + { + Log($"{className}::{methodName}", msg, LoggingLevel.Info); + } + + public void Warn(string className, string methodName, string msg) + { + Log($"{className}::{methodName}", msg, LoggingLevel.Warn); + } + + public void Error(string className, string methodName, string msg) + { + Log($"{className}::{methodName}", msg, LoggingLevel.Error); + } + + public void Error(string className, string methodName, Exception e) + { + Error(className, string.IsNullOrEmpty(methodName) ? e.TargetSite.Name : methodName, e.ToString()); + } + } +} diff --git a/UpdateLib/UpdateLib/Logging/Writers/ConsoleLogWriter.cs b/UpdateLib/UpdateLib/Logging/Writers/ConsoleLogWriter.cs new file mode 100644 index 0000000..102f0d5 --- /dev/null +++ b/UpdateLib/UpdateLib/Logging/Writers/ConsoleLogWriter.cs @@ -0,0 +1,32 @@ +/* UpdateLib - .Net auto update library + * Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using MatthiWare.UpdateLib.Common; +using System.Diagnostics; + +namespace MatthiWare.UpdateLib.Logging.Writers +{ + public class ConsoleLogWriter : ILogWriter + { + public LoggingLevel LoggingLevel { get { return LoggingLevel.Debug; } } + + public void Log(string text) + { + Debug.WriteLine(text); + } + } +} diff --git a/UpdateLib/UpdateLib/Logging/Writers/FileLogWriter.cs b/UpdateLib/UpdateLib/Logging/Writers/FileLogWriter.cs new file mode 100644 index 0000000..c7db11e --- /dev/null +++ b/UpdateLib/UpdateLib/Logging/Writers/FileLogWriter.cs @@ -0,0 +1,72 @@ +/* UpdateLib - .Net auto update library + * Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using System; +using System.IO; + +using MatthiWare.UpdateLib.Common; +using MatthiWare.UpdateLib.Tasks; +using MatthiWare.UpdateLib.Threading; +using MatthiWare.UpdateLib.Utils; + +namespace MatthiWare.UpdateLib.Logging.Writers +{ + public class FileLogWriter : ILogWriter + { + public LoggingLevel LoggingLevel { get { return LoggingLevel.Debug; } } + + private Lazy m_logFile = new Lazy(GetLogFile); + + private ConcurrentQueue m_logQueue = new ConcurrentQueue(); + private AsyncTask m_logTask; + + public FileLogWriter() + { + m_logTask = AsyncTaskFactory.From(new Action(Log)); + } + + private static FileInfo GetLogFile() + { + FileInfo m_logFile = new FileInfo($@"{IOUtils.LogPath}\log_{DateTime.Now.ToString("yyyyMMdd")}.log"); + + if (!m_logFile.Directory.Exists) + m_logFile.Directory.Create(); + + return m_logFile; + } + + public void Log(string text) + { + m_logQueue.Enqueue(text); + + if (!m_logTask.IsRunning) + m_logTask.Start(); + } + + private void Log() + { + using (StreamWriter writer = new StreamWriter(m_logFile.Value.Open(FileMode.OpenOrCreate, FileAccess.Write))) + while (m_logQueue.TryDequeue(out string text)) + { + writer.BaseStream.Seek(0, SeekOrigin.End); + writer.WriteLine(text); + } + + } + } +} + diff --git a/UpdateLib/UpdateLib/Properties/Resources.Designer.cs b/UpdateLib/UpdateLib/Properties/Resources.Designer.cs new file mode 100644 index 0000000..dc9696e --- /dev/null +++ b/UpdateLib/UpdateLib/Properties/Resources.Designer.cs @@ -0,0 +1,133 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace MatthiWare.UpdateLib.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // 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")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MatthiWare.UpdateLib.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap status_done { + get { + object obj = ResourceManager.GetObject("status_done", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap status_download { + get { + object obj = ResourceManager.GetObject("status_download", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap status_error { + get { + object obj = ResourceManager.GetObject("status_error", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap status_info { + get { + object obj = ResourceManager.GetObject("status_info", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap status_update { + get { + object obj = ResourceManager.GetObject("status_update", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap status_warning { + get { + object obj = ResourceManager.GetObject("status_warning", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap status_working { + get { + object obj = ResourceManager.GetObject("status_working", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } +} diff --git a/UpdateLib/UpdateLib/Properties/Resources.resx b/UpdateLib/UpdateLib/Properties/Resources.resx new file mode 100644 index 0000000..acdb544 --- /dev/null +++ b/UpdateLib/UpdateLib/Properties/Resources.resx @@ -0,0 +1,142 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + ..\Resources\status_done.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\status_download.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\status_error.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\status_info.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\status_update.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\status_warning.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\status_working.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/UpdateLib/UpdateLib/Resources/project_16px.png b/UpdateLib/UpdateLib/Resources/project_16px.png new file mode 100644 index 0000000000000000000000000000000000000000..25fe53638760c704f3418e4eba29e18e92140f68 GIT binary patch literal 244 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt^DJzX3_ zECi1R9uz!ez!SXSuz`?|aJkI32EiFCPGtH%*&WB%=Uy77a@+GCY;=hC=^8;`1(tCCNR6^{wxE0GE#x_SCe{z$LSF+fzdfRu-U6Hl+s_Qzw p3#OlR-?k~zzN+O#cVex$S(_g z71~H}%hr{<9anm^oa;XLa-t2`$eB+b>haJx_-sbGEpCBX9PpL2PngktQ|BFhx1wP= z{{s9#3g02uRI}Avn%ziESjpE9 zOq{Xzp2prM8Z-K3OU&ZJPogwJ%64IR7=CR*`!)5JV3pWvodw5Tw>4O?nd9LQpn%`- zQ-ksvPKxh3-3ByYl34F5MCvpTMMWVF@RcBwD5^YAc`FZ9NIDgmHW}?=b_B2yQ5tMf w?<8Q>dJG08aZT_S0xi!f&<2b#$%Fs)3CHe%gtRvDcmMzZ07*qoM6N<$g7{I%`Tzg` literal 0 HcmV?d00001 diff --git a/UpdateLib/UpdateLib/Resources/status_download.png b/UpdateLib/UpdateLib/Resources/status_download.png new file mode 100644 index 0000000000000000000000000000000000000000..f94bfe7311824d2896bda232ae8df1b12b49d637 GIT binary patch literal 493 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61SBU+%rFB|Ea{HEjtmSN`)Ym%P6qN7l0AZa z85r9685nwi_%BdXqXPp&Z6yQ4%Weh+o2Lv6l4pu-TFZfIISV`@iy0XB4ude`@%$Aj zKtah8*NBqf{Irtt#G+J&g2c?c61}|C5(N`I13g1y6XxhD1_nkuPZ!4!3;*OF{z?lX znD;*q;&}8qPFG+Hr-zej0z)kG>hnbpyH-!yy8Ws2`-=0`in9wvv>2HqOio;nxtg<& z)8(ah=Y<2}n}k+`tbeN~AevvbcuF}FP{j)=mP6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udq2b^lI6wp1FXzN3T;~FU%Lck$-deE#qz9yYP3D3t8{6 z?<+s(e(3(_^YOu_)K8!O1p}D#{JO;G(*OVf32;bRa{vGi!~g&e!~vBn4jTXf0g_2X zK~y+TrII^H13?gm|2*(OP!R;1U?nkN6q}T`R?$K`v9qzX5EQHg3(+PB3YKhz5lSd8mm51VIzyC6{~T*7a^lOxy#-4~E^Dx%+o#W^IIme_&@Tm+cD)>!A`{8x9urEy-1af%|BY`y5ruuN6k?JC=2!=~9rNdzN}Ec>7N{L3C#6GF#?;hrRM7_F<*>x6FDH0s4UAauWeG=N%F zS6g?x_d?LwC+HmD3t^p$m4H^OVd}3w%=h)9b6Ty2`7b~chmmuhpuK}qXDD@sZtqeQ zex-{gfYvqBeElAAH`Sq=vN?E%*7YS93xM)=A!xS2URQ#h5;Py;T(RV00pN0PI)hUr zpFlpYgnW$H3Ejad&U&*Fki=nRttV(`$Wz3o^CHPp$W!!2fXx@*Vh)(5nR#;f2C*rU zUm;lqAWxB5hW%r%)66UYk~oa4^K5KwLY9IZmwDeoR_23N4d*Hs8sOLH*6i;0z>bl5 zo5FrR1`*^Q3>4j+9>0Gk22eVQ!)SClrSqtP*eMDrhgKB9+l%rOKK1W<0eIZgjDD0Z z^yRmSd49MJ?gmf@f|{+>_uRrvVRruX*%p`ICq@^AfH)|Mxy8HYe7Ie{LGh=835Wvm smcn`T!OPCc#h0s0cB?36?D9p1poj507*qoM6N<$f`snslK=n! literal 0 HcmV?d00001 diff --git a/UpdateLib/UpdateLib/Resources/status_working.png b/UpdateLib/UpdateLib/Resources/status_working.png new file mode 100644 index 0000000000000000000000000000000000000000..6003cee9e14bbbe11ce52b62bffff9b1e695c252 GIT binary patch literal 1600 zcmX|>2{crD9LHy4W{j~-WeLN~B#&Y&Gjq+*@It(V7jwKp*&<7pLX2aZXqhO_6Irsp zSM-jhrp0n9TgsNS7^NZ}DM_f1N%Q`7&+$9w{_f}ge&6r^_dEC8b4Bj1yNC)}3J3&( z=l?xofe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KokJJ78GZ4dFrblM2#sXR)Vx98ARC;Kd#^dv%Tyi$}5~;%6wwRo0yL9qrsO{}x zTk|u8ggCmGubPuSvRD<0$%yQV9?xbs&1V?`YjQ^12lwrP8my`TjRl!3~1 zCSST;. + */ + +using System; +using System.Diagnostics; +using System.IO; +using System.Runtime.InteropServices; +using System.Security.AccessControl; +using System.Security.Principal; + +using MatthiWare.UpdateLib.Common; +using MatthiWare.UpdateLib.Utils; + +using Microsoft.Win32; + +namespace MatthiWare.UpdateLib.Security +{ + public static class PermissionUtil + { + private const string uacRegistryKey = "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System"; + private const string uacRegistryValue = "EnableLUA"; + + private static uint STANDARD_RIGHTS_READ = 0x00020000; + private static uint TOKEN_QUERY = 0x0008; + private static uint TOKEN_READ = (STANDARD_RIGHTS_READ | TOKEN_QUERY); + + [DllImport("advapi32.dll", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + private static extern bool OpenProcessToken(IntPtr ProcessHandle, UInt32 DesiredAccess, out IntPtr TokenHandle); + + [DllImport("advapi32.dll", SetLastError = true)] + private static extern bool GetTokenInformation(IntPtr TokenHandle, TOKEN_INFORMATION_CLASS TokenInformationClass, IntPtr TokenInformation, uint TokenInformationLength, out uint ReturnLength); + + public static bool IsUacEnabled => m_lazyIsUacEnabled; + + public static bool IsProcessElevated => m_lazyIsElevated; + + private static Lazy m_lazyIsUacEnabled = new Lazy(() => + { + RegistryKey uacKey = Registry.LocalMachine.OpenSubKey(uacRegistryKey, false); + bool result = uacKey.GetValue(uacRegistryValue).Equals(1); + return result; + }); + + private static Lazy m_lazyIsElevated = new Lazy(() => + { + if (IsUacEnabled) + { + IntPtr tokenHandle; + if (!OpenProcessToken(Process.GetCurrentProcess().Handle, TOKEN_READ, out tokenHandle)) + { + Updater.Instance.Logger.Warn(nameof(PermissionUtil), nameof(IsProcessElevated), "Could not get process token. Win32 Error Code: " + Marshal.GetLastWin32Error()); + return false; + } + + TOKEN_ELEVATION_TYPE elevationResult = TOKEN_ELEVATION_TYPE.TokenElevationTypeDefault; + + int elevationResultSize = Marshal.SizeOf((int)elevationResult); + uint returnedSize = 0; + IntPtr elevationTypePtr = Marshal.AllocHGlobal(elevationResultSize); + + bool success = GetTokenInformation(tokenHandle, TOKEN_INFORMATION_CLASS.TokenElevationType, elevationTypePtr, (uint)elevationResultSize, out returnedSize); + if (!success) + { + Updater.Instance.Logger.Warn(nameof(PermissionUtil), nameof(IsProcessElevated), "Unable to determine the current elevation."); + return false; + } + + elevationResult = (TOKEN_ELEVATION_TYPE)Marshal.ReadInt32(elevationTypePtr); + bool isProcessAdmin = elevationResult == TOKEN_ELEVATION_TYPE.TokenElevationTypeFull; + return isProcessAdmin; + } + else + { + WindowsIdentity identity = WindowsIdentity.GetCurrent(); + WindowsPrincipal principal = new WindowsPrincipal(identity); + return principal.IsInRole(WindowsBuiltInRole.Administrator); + } + }); + + + public static bool DirectoryHasPermission(string dir, FileSystemRights accessRights = FileSystemRights.Modify) + { + if (string.IsNullOrEmpty(dir)) + return false; + + try + { + AuthorizationRuleCollection rules = Directory.GetAccessControl(dir).GetAccessRules(true, true, typeof(SecurityIdentifier)); + WindowsIdentity identity = WindowsIdentity.GetCurrent(); + + foreach (FileSystemAccessRule rule in rules) + if (identity.Groups.Contains(rule.IdentityReference) || rule.IdentityReference == identity.User) + if ((accessRights & rule.FileSystemRights) == accessRights && rule.AccessControlType == AccessControlType.Allow) + return true; + } + catch (Exception e) + { + Updater.Instance.Logger.Warn(nameof(PermissionUtil), nameof(DirectoryHasPermission), $"Current user has no access rights to: '{dir}'{Environment.NewLine}{e.ToString()}"); + } + + return false; + } + + public static bool CheckRegPermission(RegistryKeyEntry key) + { + try + { + RegistryHelper.InternalOpenSubKey(key.Parent.DestinationLocation, key.Name); + return true; + } + catch (Exception ex) + { + Updater.Instance.Logger.Error(nameof(PermissionUtil), nameof(CheckRegPermission), ex); + return false; + } + } + } +} diff --git a/UpdateLib/UpdateLib/Tasks/AsyncTask.cs b/UpdateLib/UpdateLib/Tasks/AsyncTask.cs new file mode 100644 index 0000000..9fae9f0 --- /dev/null +++ b/UpdateLib/UpdateLib/Tasks/AsyncTask.cs @@ -0,0 +1,436 @@ +/* Copyright + * + * UpdateLib - .Net auto update library + * + * File: AsyncTask.cs v0.5 + * + * Author: Matthias Beerens + * + * Copyright (C) 2016 - MatthiWare + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Diagnostics; +using System.Threading; + +using MatthiWare.UpdateLib.Common; + +namespace MatthiWare.UpdateLib.Tasks +{ + /// + /// Base class for all Tasks that need to be run Async + /// + public abstract class AsyncTask + { + + #region private fields + + protected Exception m_lastException = null; + + private bool m_useSyncContext = true; + private SynchronizationContext m_syncContext; + + internal bool IsChildTask { get; set; } = false; + +#if DEBUG + public Stopwatch m_sw = new Stopwatch(); +#endif + + private readonly Queue m_childTasks = new Queue(); + private ManualResetEvent m_waitHandle = new ManualResetEvent(true); + private readonly object sync = new object(); + + private bool m_running = false; + private bool m_cancelled = false; + private bool m_completed = false; + + #endregion + + #region events + + /// + /// Raises when this is completed. + /// + public event EventHandler TaskCompleted; + /// + /// Raises when the progress changed. + /// + public event EventHandler TaskProgressChanged; + + #endregion + + #region properties + + public Exception LastException + { + get + { + lock (sync) + return m_lastException; + } + } + + /// + /// Gets if there have been any errors in the task. + /// + public bool HasErrors + { + get + { + lock (sync) + return m_lastException != null; + } + } + + public bool IsCompleted + { + get + { + lock (sync) + return m_completed; + } + } + + /// + /// Gets if the current is cancelled. + /// + public bool IsCancelled + { + get + { + lock (sync) + return m_cancelled; + } + } + + + + /// + /// Gets if the current is Running. + /// + public bool IsRunning + { + get + { + lock (sync) + return m_running; + } + } + + #endregion + + #region static methods + + /// + /// Blocks the calling threads and calls on each in . + /// + /// The tasks to await. + public static void WaitAll(IEnumerable tasks) + { + foreach (AsyncTask task in tasks) + task.AwaitTask(); + } + + #endregion + + #region FluentAPI + + /// + /// Enable if we should switch back to the synchronization context to continue our Task completed. + /// + /// default is true. + /// Indicate if we should use the synchronization context + /// The task object for fluent API. + public AsyncTask ConfigureAwait(bool useSyncContext) + { + m_useSyncContext = useSyncContext; + return this; + } + + /// + /// Starts the task + /// + /// Returns the current Task. + public AsyncTask Start() + { + lock (sync) + { + if (m_running) + return this; + + Reset(); + + m_syncContext = SynchronizationContext.Current; + + Action worker = new Action(() => + { + try + { + m_running = true; + DoWork(); + } + catch (Exception ex) + { + m_lastException = ex; + + Updater.Instance.Logger.Error(GetType().Name, null, ex); + } + finally + { + AwaitWorkers(); + + m_running = false; + m_completed = true; + } + }); + +#if DEBUG + m_sw.Start(); +#endif + + worker.BeginInvoke(new AsyncCallback((IAsyncResult r) => + { +#if DEBUG + m_sw.Stop(); + Updater.Instance.Logger.Debug(GetType().Name, nameof(Start), $"Completed in {m_sw.ElapsedMilliseconds}ms"); +#endif + worker.EndInvoke(r); + + OnTaskCompleted(m_lastException, IsCancelled); + + m_waitHandle.Set(); + + }), null); ; + + return this; + } + } + + /// + /// Blocks the calling thread until the complete task is done. + /// DO NOT call this in the worker method use method instead. + /// + public AsyncTask AwaitTask() + { + lock (sync) + { + if (IsChildTask && !m_completed && !m_running) + Reset(); + + if (m_waitHandle != null) + { + m_waitHandle.WaitOne(); + m_waitHandle.Close(); + m_waitHandle = null; + } + + return this; + } + } + + #endregion + + /// + /// Resets the task back to its initial state + /// + private void Reset() + { + m_cancelled = false; + m_running = false; + m_lastException = null; + m_completed = false; + + m_waitHandle.Reset(); + m_childTasks.Clear(); + +#if DEBUG + m_sw.Reset(); +#endif + } + + /// + /// The worker method. + /// + protected abstract void DoWork(); + + /// + /// Cancels the current + /// Check in the worker code to see if the got cancelled. + /// + public virtual void Cancel() + { + lock (sync) + m_cancelled = true; + } + + /// + /// Adds a new inner task + /// + /// + /// Optional arguments for the action + protected void Enqueue(Delegate action, params object[] args) + { + lock (sync) + { + // Don't allow to start another child task when the parent task has been cancelled or contains errors. + if (m_lastException != null || m_cancelled) + return; + + var task = AsyncTaskFactory.From(action, args); + + task.IsChildTask = true; + task.TaskCompleted += (o, e) => + { + if (e.Error != null) + { + m_lastException = e.Error?.InnerException ?? e.Error; + + Updater.Instance.Logger.Error(GetType().Name, null, LastException); + } + }; + + m_childTasks.Enqueue(task); + + WorkerScheduler.Instance.Schedule(task); + } + } + + /// + /// Blocks the calling thread until all the workers are done. + /// + protected void AwaitWorkers() + { + lock (sync) + while (m_childTasks.Count != 0) + m_childTasks.Dequeue().AwaitTask(); + } + + /// + /// Raises the event. + /// + /// The amount of work that is done. + /// The total amount of work. + protected virtual void OnTaskProgressChanged(int done, int total) + => OnTaskProgressChanged((int)((done / (double)total) * 100)); + + /// /// Raises the event. + /// + /// The percentage of work that is done. + protected virtual void OnTaskProgressChanged(int percent) + => OnTaskProgressChanged(new ProgressChangedEventArgs(percent, null)); + + private int m_lastProgressUpdate = -1; + + /// + /// Raises the event. + /// + /// The event. + protected virtual void OnTaskProgressChanged(ProgressChangedEventArgs e) + { + // filter out redundant calls + if (m_lastProgressUpdate == e.ProgressPercentage) + return; + + m_lastProgressUpdate = e.ProgressPercentage; + + if (!m_useSyncContext || m_syncContext == null) + TaskProgressChanged?.Invoke(this, e); + else + m_syncContext.Post(new SendOrPostCallback((o) => TaskProgressChanged?.Invoke(this, e)), null); + + } + + /// + /// Raises the event. + /// + /// If an occured pass the object. + /// Indicates whether the got cancelled. + protected virtual void OnTaskCompleted(Exception e, bool cancelled = false) + => OnTaskCompleted(new AsyncCompletedEventArgs(e, cancelled, null)); + + /// + /// Raises the event. + /// + /// The event. + protected virtual void OnTaskCompleted(AsyncCompletedEventArgs e) + { + if (!m_useSyncContext || m_syncContext == null) + TaskCompleted?.Invoke(this, e); + else + m_syncContext.Post(new SendOrPostCallback((o) => TaskCompleted?.Invoke(this, e)), null); + } + } + + /// + /// Base class for all Tasks that need to be run Async + /// + /// The type of the Result object + public abstract class AsyncTask : AsyncTask + { + /// + /// Gets or sets the result + /// + public virtual ResultType Result { get; protected set; } = default(ResultType); + } + + /// + /// Base class for all Tasks that need to be run Async + /// + /// The task type to be returned from the FluentAPI + /// The type of the Result object + public abstract class AsyncTask : AsyncTask where TaskType : AsyncTask + { + #region FluentAPI + + /// + /// Enable if we should switch back to the synchronization context to continue our Task completed. + /// + /// default is true. + /// Indicate if we should use the synchronization context + /// The task object for fluent API. + public new TaskType ConfigureAwait(bool useSyncContext) + { + return (TaskType)base.ConfigureAwait(useSyncContext); + } + + /// + /// Starts the task + /// + /// Returns the current Task. + public new TaskType Start() + { + return (TaskType)base.Start(); + + } + + /// + /// Blocks the calling thread until the complete task is done. + /// DO NOT call this in the worker method use method instead. + /// + /// + public new TaskType AwaitTask() + { + return (TaskType)base.AwaitTask(); + + } + + #endregion + } + + +} diff --git a/UpdateLib/UpdateLib/Tasks/AsyncTaskFactory.cs b/UpdateLib/UpdateLib/Tasks/AsyncTaskFactory.cs new file mode 100644 index 0000000..c6ccb2b --- /dev/null +++ b/UpdateLib/UpdateLib/Tasks/AsyncTaskFactory.cs @@ -0,0 +1,105 @@ +/* Copyright + * + * UpdateLib - .Net auto update library + * + * File: AsyncTaskFactory.cs v0.5 + * + * Author: Matthias Beerens + * + * Copyright (C) 2016 - MatthiWare + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using System; + +namespace MatthiWare.UpdateLib.Tasks +{ + /// + /// Factory methods for creating and starting a new task + /// + public class AsyncTaskFactory + { + /// + /// Starts a new task + /// + /// The action delegate + /// The parameters to pass to the action + /// The object + public static AsyncTask StartNew(Delegate action, params object[] args) + => new AnonymousTask(action, args).Start(); + + /// + /// Starts a new task + /// + /// The result type + /// The action delegate + /// The parameters to pass to the action + /// The object with result property + public static AsyncTask StartNew(Delegate action, params object[] args) + => new AnonymousTask(action, args).Start(); + + /// + /// Creates a new task + /// + /// The action delegate + /// The parameters to pass to the action + /// The object + public static AsyncTask From(Delegate action, params object[] args) + => new AnonymousTask(action, args); + + /// + /// Creates a new task + /// + /// The result type + /// The action delegate + /// The parameters to pass to the action + /// The object with result property + public static AsyncTask From(Delegate action, params object[] args) + => new AnonymousTask(action, args); + + private class AnonymousTask : AsyncTask + { + private Delegate action; + private object[] args; + + public AnonymousTask(Delegate action, params object[] args) + { + this.action = action; + this.args = args; + } + + protected override void DoWork() + => action.DynamicInvoke(args); + } + + private class AnonymousTask : AsyncTask> + { + private Delegate action; + private object[] args; + + public AnonymousTask(Delegate action, params object[] args) + { + this.action = action; + this.args = args; + } + + protected override void DoWork() + { + Result = (TResult)action.DynamicInvoke(args); + } + } + + } +} diff --git a/UpdateLib/UpdateLib/Tasks/CheckForUpdatedItemsTask.cs b/UpdateLib/UpdateLib/Tasks/CheckForUpdatedItemsTask.cs new file mode 100644 index 0000000..c70dd02 --- /dev/null +++ b/UpdateLib/UpdateLib/Tasks/CheckForUpdatedItemsTask.cs @@ -0,0 +1,107 @@ +/* Copyright + * + * UpdateLib - .Net auto update library + * + * File: CheckForUpdatedItemsTask.cs v0.5 + * + * Author: Matthias Beerens + * + * Copyright (C) 2016 - MatthiWare + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using MatthiWare.UpdateLib.Common; +using MatthiWare.UpdateLib.Files; +using MatthiWare.UpdateLib.Utils; +using System; +using System.Collections.Generic; +using System.Linq; + +namespace MatthiWare.UpdateLib.Tasks +{ + public class CheckForUpdatedItemsTask : AsyncTask + { + private Files.UpdateInfo m_updateFile; + private HashCacheFile m_cacheFile; + + public CheckForUpdatedItemsTask(Files.UpdateInfo update, HashCacheFile cache) + { + m_updateFile = update ?? throw new ArgumentNullException(nameof(update)); + m_cacheFile = cache ?? throw new ArgumentNullException(nameof(cache)); + } + + protected override void DoWork() + { + foreach (DirectoryEntry dir in m_updateFile.Folders) + Enqueue(new Action(CheckFiles), dir); + + foreach (DirectoryEntry dir in m_updateFile.Registry) + Enqueue(new Action(CheckRegister), dir); + + AwaitWorkers(); + + Result = m_updateFile.FileCount > 0 || m_updateFile.RegistryKeyCount > 0; + } + + private void CheckFiles(DirectoryEntry dir) + { + dir.Items.RemoveAll(fe => + { + string convertedPath = Updater.Instance.Converter.Convert(fe.DestinationLocation); + HashCacheEntry cacheEntry = m_cacheFile.Items.Find(hash => hash.FilePath.Equals(convertedPath)); + + if (cacheEntry == null) + return false; + + return (fe as FileEntry)?.Hash.Equals(cacheEntry.Hash) ?? true; + }); + + IEnumerable dirsToCheck = dir.Directories.Where(d => d.Count > 0); + int left = dirsToCheck.Count(); + + foreach (DirectoryEntry subDir in dir.Directories) + { + if (--left == 0) + CheckFiles(subDir); + else + Enqueue(new Action(CheckFiles), subDir); + } + } + + private void CheckRegister(DirectoryEntry dir) + { + dir.Items.RemoveAll(entry => + { + RegistryKeyEntry key = entry as RegistryKeyEntry; + + if (key == null) + return true; + + return RegistryHelper.IsSame(key); + }); + + IEnumerable dirsToCheck = dir.Directories.Where(d => d.Count > 0); + int left = dirsToCheck.Count(); + + foreach (DirectoryEntry subDir in dir.Directories) + { + if (--left == 0) + CheckRegister(subDir); + else + Enqueue(new Action(CheckRegister), dir); + } + } + } +} diff --git a/UpdateLib/UpdateLib/Tasks/CheckForUpdatesCompletedEventArgs.cs b/UpdateLib/UpdateLib/Tasks/CheckForUpdatesCompletedEventArgs.cs new file mode 100644 index 0000000..977d103 --- /dev/null +++ b/UpdateLib/UpdateLib/Tasks/CheckForUpdatesCompletedEventArgs.cs @@ -0,0 +1,49 @@ +/* Copyright + * + * UpdateLib - .Net auto update library + * + * File: CheckForUpdatesCompletedEventArgs.cs v0.5 + * + * Author: Matthias Beerens + * + * Copyright (C) 2016 - MatthiWare + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using MatthiWare.UpdateLib.Common; +using System; +using System.ComponentModel; + +namespace MatthiWare.UpdateLib.Tasks +{ + public class CheckForUpdatesCompletedEventArgs : AsyncCompletedEventArgs + { + public UpdateVersion LatestVersion { get; set; } + public bool UpdateAvailable { get; set; } + + public CheckForUpdatesCompletedEventArgs(CheckForUpdatesTask.CheckForUpdatesResult result, Exception error, bool cancelled, object userState) + : base(error, cancelled, userState) + { + LatestVersion = result.Version; + UpdateAvailable = result.UpdateAvailable; + } + + public CheckForUpdatesCompletedEventArgs(CheckForUpdatesTask.CheckForUpdatesResult result, AsyncCompletedEventArgs e) + : this(result, e.Error, e.Cancelled, e.UserState) + { + + } + } +} diff --git a/UpdateLib/UpdateLib/Tasks/CheckForUpdatesTask.cs b/UpdateLib/UpdateLib/Tasks/CheckForUpdatesTask.cs new file mode 100644 index 0000000..a889391 --- /dev/null +++ b/UpdateLib/UpdateLib/Tasks/CheckForUpdatesTask.cs @@ -0,0 +1,134 @@ +/* Copyright + * + * UpdateLib - .Net auto update library + * + * File: CheckForUpdatesTask.cs v0.5 + * + * Author: Matthias Beerens + * + * Copyright (C) 2016 - MatthiWare + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using System; +using System.Collections.Generic; +using System.Net; + +using MatthiWare.UpdateLib.Common; +using MatthiWare.UpdateLib.Common.Abstraction; +using MatthiWare.UpdateLib.Common.Exceptions; +using MatthiWare.UpdateLib.Files; +using MatthiWare.UpdateLib.Utils; + +using static MatthiWare.UpdateLib.Tasks.CheckForUpdatesTask; + +namespace MatthiWare.UpdateLib.Tasks +{ + public class CheckForUpdatesTask : AsyncTask + { + public IList Urls { get; set; } + + private WebClient m_wc; + private UpdateVersion m_version; + private Updater m_updater; + + private const string REPLACE_FILE_NAME = "%file%"; + + public CheckForUpdatesTask(IList urls, UpdateVersion currentVersion) + { + Urls = urls ?? throw new ArgumentNullException(nameof(urls)); + m_version = currentVersion ?? throw new ArgumentNullException(nameof(currentVersion)); + if (urls.Count == 0) throw new ArgumentException("Empty url list provided", nameof(urls)); + + m_wc = new WebClient(); + m_updater = Updater.Instance; + } + + protected override void DoWork() + { + Result = new CheckForUpdatesResult(); + + if (!NetworkUtils.HasConnection()) throw new NoInternetException("No internet available"); + + if (IsCancelled) return; + + // load the updatefile from disk + var file = DownloadFile(Urls.Replace(REPLACE_FILE_NAME, UpdateCatalogFile.FILE_NAME), $"{IOUtils.AppDataPath}\\{UpdateCatalogFile.FILE_NAME}"); + + if (IsCancelled) return; + + if (file.Catalog == null || file.Catalog.Count == 0) throw new InvalidUpdateServerException(); + + Result.UpdateInfo = file.GetLatestUpdateForVersion(m_version); + Result.ApplicationName = file.ApplicationName; + Result.DownloadURLs = file.DownloadUrls; + + if (!Result.UpdateAvailable || IsCancelled) return; + + if (Result.DownloadURLs == null || Result.DownloadURLs.Count == 0) throw new InvalidUpdateServerException(); + + var meta = DownloadFile(Result.DownloadURLs.Replace(REPLACE_FILE_NAME, Result.UpdateInfo.FileName), $"{IOUtils.TempPath}\\{UpdateMetadataFile.FILE_NAME}"); + + if (IsCancelled) return; + + var privilegesCheckTask = new CheckRequiredPrivilegesTask(meta).ConfigureAwait(false).Start(); + Result.AdminRightsNeeded = privilegesCheckTask.AwaitTask().Result; + } + + private T DownloadFile(IEnumerable urlsToUse, string localFile) where T : FileBase, new() + { + var enumerator = urlsToUse.GetEnumerator(); + + m_updater.Logger.Info(nameof(CheckForUpdatesTask), nameof(DownloadFile), $"Getting {typeof(T).GetDescription()}"); + + do + { + if (!enumerator.MoveNext() || string.IsNullOrEmpty(enumerator.Current)) + throw new UnableToDownloadUpdateException(); + } while (!DownloadLocalFile(enumerator.Current, localFile)); + + return FileManager.LoadFile(localFile); + } + + private bool DownloadLocalFile(string url, string localFile) + { + m_updater.Logger.Debug(nameof(CheckForUpdatesTask), nameof(DownloadLocalFile), $"Attempting to download file from {url}"); + + try + { + m_wc.DownloadFile(url, localFile); + + m_updater.Logger.Info(nameof(CheckForUpdatesTask), nameof(DownloadLocalFile), $"Succesfully downloaded file from {url}"); + } + catch (Exception e) + { + m_updater.Logger.Error(nameof(CheckForUpdatesTask), nameof(DoWork), e); + return false; + } + + return true; + } + + public class CheckForUpdatesResult + { + public UpdateVersion Version { get { return UpdateInfo.Version; } } + public bool UpdateAvailable => UpdateInfo != null; + public UpdateInfo UpdateInfo { get; set; } + public string ApplicationName { get; set; } + public IList DownloadURLs { get; set; } + public bool AdminRightsNeeded { get; set; } + } + } +} diff --git a/UpdateLib/UpdateLib/Tasks/CheckRequiredPrivilegesTask.cs b/UpdateLib/UpdateLib/Tasks/CheckRequiredPrivilegesTask.cs new file mode 100644 index 0000000..9f683ef --- /dev/null +++ b/UpdateLib/UpdateLib/Tasks/CheckRequiredPrivilegesTask.cs @@ -0,0 +1,92 @@ +/* Copyright + * + * UpdateLib - .Net auto update library + * + * File: CheckRequiredPrivilegesTask.cs v0.5 + * + * Author: Matthias Beerens + * + * Copyright (C) 2016 - MatthiWare + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using System.Linq; + +using MatthiWare.UpdateLib.Common; +using MatthiWare.UpdateLib.Files; +using MatthiWare.UpdateLib.Security; +using MatthiWare.UpdateLib.Utils; + +namespace MatthiWare.UpdateLib.Tasks +{ + public class CheckRequiredPrivilegesTask : AsyncTask + { + + public UpdateMetadataFile UpdateFile { get; set; } + + public CheckRequiredPrivilegesTask(UpdateMetadataFile updateFile) + { + UpdateFile = updateFile; + } + + protected override void DoWork() + { + Result = false; + + if (PermissionUtil.IsProcessElevated) + return; + + foreach (DirectoryEntry dir in UpdateFile.Folders) + if (!CheckHasSufficientPermissionsForDirectory(dir)) + { + Result = true; + return; + } + + + foreach (DirectoryEntry dir in UpdateFile.Registry) + if (!CheckHasSufficientPermissionForRegistry(dir)) + { + Result = true; + return; + } + + Updater.Instance.Logger.Info(nameof(CheckRequiredPrivilegesTask), nameof(DoWork), $"Elavation required: {Result}"); + } + + private bool CheckHasSufficientPermissionsForDirectory(DirectoryEntry dir) + { + string localPath = Updater.Instance.Converter.Convert(dir.DestinationLocation); + + if (!PermissionUtil.DirectoryHasPermission(localPath)) + return false; + + foreach (DirectoryEntry subDir in dir.Directories) + if (!CheckHasSufficientPermissionsForDirectory(subDir)) + return false; + + return true; + } + + private bool CheckHasSufficientPermissionForRegistry(DirectoryEntry dir) + { + foreach (RegistryKeyEntry key in dir.GetItems().Select(e => e as RegistryKeyEntry).NotNull()) + if (!PermissionUtil.CheckRegPermission(key)) + return false; + + return true; + } + } +} diff --git a/UpdateLib/UpdateLib/Tasks/CleanUpTask.cs b/UpdateLib/UpdateLib/Tasks/CleanUpTask.cs new file mode 100644 index 0000000..3487dc2 --- /dev/null +++ b/UpdateLib/UpdateLib/Tasks/CleanUpTask.cs @@ -0,0 +1,60 @@ +/* Copyright + * + * UpdateLib - .Net auto update library + * + * File: CleanUpTask.cs v0.5 + * + * Author: Matthias Beerens + * + * Copyright (C) 2016 - MatthiWare + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using System; +using System.IO; + +namespace MatthiWare.UpdateLib.Tasks +{ + public class CleanUpTask : AsyncTask + { + public string PathToClean { get; set; } + public string SearchPattern { get; set; } + public bool IncludeSubDirectories { get; set; } + + public CleanUpTask(string pathToCleanUp, string searchPattern = "*.old.tmp", bool includeSubDirs = true) + { + PathToClean = Updater.Instance.Converter.Convert(pathToCleanUp); + SearchPattern = searchPattern; + IncludeSubDirectories = includeSubDirs; + } + protected override void DoWork() + { + DirectoryInfo dir = new DirectoryInfo(PathToClean); + FileInfo[] files = dir.GetFiles(SearchPattern, IncludeSubDirectories ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly); + + foreach (FileInfo file in files) + { + try + { + file.Delete(); + } + catch (Exception e) + { + Updater.Instance.Logger.Error(nameof(CleanUpTask), nameof(DoWork), e); + } + } + } + } +} diff --git a/UpdateLib/UpdateLib/Tasks/DownloadManager.cs b/UpdateLib/UpdateLib/Tasks/DownloadManager.cs new file mode 100644 index 0000000..9e35f3f --- /dev/null +++ b/UpdateLib/UpdateLib/Tasks/DownloadManager.cs @@ -0,0 +1,118 @@ +/* Copyright + * + * UpdateLib - .Net auto update library + * + * File: DownloadManager.cs v0.5 + * + * Author: Matthias Beerens + * + * Copyright (C) 2016 - MatthiWare + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.IO; +using System.Net; + +using MatthiWare.UpdateLib.Common; +using MatthiWare.UpdateLib.Common.Exceptions; +using MatthiWare.UpdateLib.Security; +using MatthiWare.UpdateLib.Utils; + +namespace MatthiWare.UpdateLib.Tasks +{ + public class DownloadManager + { + private UpdateInfo m_updateInfo; + + private IList m_urls; + + public event EventHandler ProgressChanged; + public event EventHandler Completed; + + private int index = 0; + + private Updater updater; + + public DownloadManager(UpdateInfo updateInfo, IList urls) + { + m_urls = urls ?? throw new ArgumentNullException(nameof(urls)); + m_updateInfo = updateInfo ?? throw new ArgumentNullException(nameof(updateInfo)); + + if (m_urls.Count == 0) throw new ArgumentException("No download sources specified ", nameof(urls)); + + updater = Updater.Instance; + } + + public void Download() + { + var urlToUse = GetNextUrl(); + + if (string.IsNullOrEmpty(urlToUse)) + throw new WebException("Unable to download patch from specified download sources"); + + var local = new FileInfo($"{IOUtils.TempPath}\\{m_updateInfo.FileName}"); + + if (!local.Directory.Exists) local.Directory.Create(); + if (local.Exists) local.Delete(); + + var task = new DownloadTask(urlToUse, local.FullName); + + task.TaskProgressChanged += (o, e) => OnProgressChanged(e.ProgressPercentage, 110); + + task.TaskCompleted += (o, e) => + { + if (e.Error != null) + { + updater.Logger.Error(nameof(DownloadManager), nameof(Download), e.Error); + updater.Logger.Info(nameof(DownloadManager), nameof(Download), "Attempting to download patch from next url.."); + + task.Url = GetNextUrl(); + + if (string.IsNullOrEmpty(task.Url)) + OnCompleted(new WebException("Unable to download patch from specified download sources", e.Error)); + else + task.Start(); + + return; + } + + var hash = HashUtil.GetHash(local.FullName); + + if (m_updateInfo.Hash != hash) + { + OnCompleted(new InvalidHashException($"Hash doesn't match was expecting '{m_updateInfo.Hash}' but got '{hash}'")); + return; + } + + OnProgressChanged(100, 100); + OnCompleted(null); + }; + + task.Start(); + } + + protected void OnProgressChanged(int done, int total) + => ProgressChanged?.Invoke(this, new ProgressChangedEventArgs((int)((done / (double)total) * 100), null)); + + protected void OnCompleted(Exception e) + => Completed?.Invoke(this, new AsyncCompletedEventArgs(e, false, null)); + + private string GetNextUrl() + => (index < m_urls.Count) ? m_urls[index++].Replace("%file%", m_updateInfo.FileName) : string.Empty; + } +} diff --git a/UpdateLib/UpdateLib/Tasks/DownloadTask.cs b/UpdateLib/UpdateLib/Tasks/DownloadTask.cs new file mode 100644 index 0000000..999531d --- /dev/null +++ b/UpdateLib/UpdateLib/Tasks/DownloadTask.cs @@ -0,0 +1,85 @@ +/* Copyright + * + * UpdateLib - .Net auto update library + * +/* Copyright + * + * UpdateLib - .Net auto update library + * + * File: DownloadTask.cs v0.5 + * + * Author: Matthias Beerens + * + * Copyright (C) 2016 - MatthiWare + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using System; +using System.IO; +using System.Net; +using System.Threading; + +namespace MatthiWare.UpdateLib.Tasks +{ + public class DownloadTask : AsyncTask + { + private WebClient webClient; + private ManualResetEvent wait; + private Updater m_updater; + + public string Url { get; set; } + public string Local { get; set; } + + public DownloadTask(string url, string local) + { + if (string.IsNullOrEmpty(local)) throw new ArgumentNullException(nameof(local)); + if (string.IsNullOrEmpty(url)) throw new ArgumentNullException(nameof(url)); + + Url = url; + Local = local; + + webClient = new WebClient(); + webClient.DownloadProgressChanged += (o, e) => { OnTaskProgressChanged(e.ProgressPercentage); }; + webClient.DownloadFileCompleted += (o, e) => { wait.Set(); }; + + m_updater = Updater.Instance; + } + + protected override void DoWork() + { + if (IsCancelled) + return; + + wait = new ManualResetEvent(false); + + m_updater.Logger.Debug(nameof(DownloadTask), nameof(DoWork), $"LocalFile => {Local}"); + m_updater.Logger.Debug(nameof(DownloadTask), nameof(DoWork), $"RemoteFile => {Url}"); + + var fi = new FileInfo(Local); + + if (!fi.Directory.Exists) + fi.Directory.Create(); + + var uri = new Uri(Url); + webClient.DownloadFileAsync(uri, Local); + + wait.WaitOne(); + wait.Close(); + wait = null; + + OnTaskProgressChanged(100); + } + } +} diff --git a/UpdateLib/UpdateLib/Tasks/LoadCacheTask.cs b/UpdateLib/UpdateLib/Tasks/LoadCacheTask.cs new file mode 100644 index 0000000..c0b8850 --- /dev/null +++ b/UpdateLib/UpdateLib/Tasks/LoadCacheTask.cs @@ -0,0 +1,38 @@ +using System; +using System.Linq; +using System.Reflection; + +using MatthiWare.UpdateLib.Common; +using MatthiWare.UpdateLib.Files; +using MatthiWare.UpdateLib.Utils; + +namespace MatthiWare.UpdateLib.Tasks +{ + public class LoadCacheTask : AsyncTask + { + private Lazy m_lazyUpdateVersion = new Lazy(() => + { + ApplicationVersionAttribute attr = Assembly.GetEntryAssembly()?.GetCustomAttributes(typeof(ApplicationVersionAttribute), true).FirstOrDefault() as ApplicationVersionAttribute; + + return attr?.Version ?? "0.0.0"; + }); + + + + protected override void DoWork() + { + try + { + Result = FileManager.LoadFile(); + } + catch (Exception e) + { + Updater.Instance.Logger.Error(nameof(LoadCacheTask), nameof(DoWork), e); + + Result = new CacheFile(); + Result.CurrentVersion = m_lazyUpdateVersion; + Result.Save(); + } + } + } +} diff --git a/UpdateLib/UpdateLib/Tasks/UpdatableTask.cs b/UpdateLib/UpdateLib/Tasks/UpdatableTask.cs new file mode 100644 index 0000000..4309a12 --- /dev/null +++ b/UpdateLib/UpdateLib/Tasks/UpdatableTask.cs @@ -0,0 +1,49 @@ +/* Copyright + * + * UpdateLib - .Net auto update library + * + * File: UpdatableTask.cs v0.5 + * + * Author: Matthias Beerens + * + * Copyright (C) 2016 - MatthiWare + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +namespace MatthiWare.UpdateLib.Tasks +{ + public abstract class UpdatableTask : AsyncTask + { + private new void Start() + { + base.Start(); + } + + public void Update() + { + Start(); + } + + public override void Cancel() + { + base.Cancel(); + + Rollback(); + } + + public abstract void Rollback(); + + } +} diff --git a/UpdateLib/UpdateLib/Tasks/UpdateCacheTask.cs b/UpdateLib/UpdateLib/Tasks/UpdateCacheTask.cs new file mode 100644 index 0000000..ce2c51a --- /dev/null +++ b/UpdateLib/UpdateLib/Tasks/UpdateCacheTask.cs @@ -0,0 +1,125 @@ +/* Copyright + * + * UpdateLib - .Net auto update library + * + * File: UpdateCacheTask.cs v0.5 + * + * Author: Matthias Beerens + * + * Copyright (C) 2016 - MatthiWare + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using MatthiWare.UpdateLib.Common; +using MatthiWare.UpdateLib.Files; +using MatthiWare.UpdateLib.Utils; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; + +namespace MatthiWare.UpdateLib.Tasks +{ + public class UpdateCacheTask : AsyncTask + { + private Dictionary existingEntries = null; + private IEnumerable files = null; + + protected override void DoWork() + { + existingEntries = new Dictionary(); + + try + { + // first of lets load the file, (file might be corrupt..) + Result = FileManager.LoadFile(); + + Result.Items.ForEach(e => existingEntries.Add(e, false)); + } + catch (Exception e) + { + Updater.Instance.Logger.Error(nameof(UpdateCacheTask), nameof(DoWork), e); + Result = null; + } + + var dir = new DirectoryInfo(Updater.Instance.Converter.Convert("%appdir%")); + files = dir.GetFiles("*", SearchOption.AllDirectories).Where(f => !f.FullName.Contains(".old.tmp")); + + Updater.Instance.Logger.Debug(nameof(UpdateCacheTask), nameof(DoWork), $"found {files.Count()} files to recheck."); + + if (Result == null) // The file doesn't exist yet + { + Result = CreateNewHashCacheFile(); + + return; + } + + CheckFiles(); + + existingEntries.Where(e => e.Value == false).ForEach(e => Result.Items.Remove(e.Key)); + + Result.Save(); + } + + private void CheckFiles() + { + foreach (System.IO.FileInfo f in files) + { + HashCacheEntry entry = base.Result.Items.Find(match => match.FilePath == f.FullName); + if (entry == null) + { + try + { + base.Result.Items.Add(new HashCacheEntry(f.FullName)); + } + catch (Exception ex) // file might no longer exist or is in use + { + Updater.Instance.Logger.Error(nameof(UpdateCacheTask), nameof(DoWork), ex); + } + + continue; + } + + existingEntries[entry] = true; + + // check to see if the file has been modified since last cache check + entry.Recalculate(); + } + } + + private HashCacheFile CreateNewHashCacheFile() + { + Updater.Instance.Logger.Warn(nameof(UpdateCacheTask), nameof(DoWork), $"{nameof(HashCacheFile)} doesn't exist. Creating.."); + + var result = new HashCacheFile(); + + foreach (System.IO.FileInfo f in files) + { + try + { + result.Items.Add(new HashCacheEntry(f.FullName)); + } + catch (Exception ex) // file might no longer exist or is in use + { + Updater.Instance.Logger.Error(nameof(UpdateCacheTask), nameof(DoWork), ex); + } + } + + result.Save(); + + return result; + } + } +} diff --git a/UpdateLib/UpdateLib/Tasks/UpdateRegistryTask.cs b/UpdateLib/UpdateLib/Tasks/UpdateRegistryTask.cs new file mode 100644 index 0000000..5cbbb87 --- /dev/null +++ b/UpdateLib/UpdateLib/Tasks/UpdateRegistryTask.cs @@ -0,0 +1,138 @@ +/* Copyright + * + * UpdateLib - .Net auto update library + * + * File: UpdateRegistryTask.cs v0.5 + * + * Author: Matthias Beerens + * + * Copyright (C) 2016 - MatthiWare + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using MatthiWare.UpdateLib.Common; +using MatthiWare.UpdateLib.Utils; +using Microsoft.Win32; +using System; +using System.Collections.Generic; +using System.Linq; + +namespace MatthiWare.UpdateLib.Tasks +{ + public class UpdateRegistryTask : UpdatableTask + { + + public IEnumerable Keys { get; set; } + + private List cachedUpdates = new List(); + + public UpdateRegistryTask(IEnumerable keys) + { + Keys = keys; + } + + protected override void DoWork() + { + cachedUpdates.Clear(); + + int total = Keys.Count(); + int count = 0; + + foreach (RegistryKeyEntry key in Keys) + { + UpdateKey(key); + + OnTaskProgressChanged(++count, total); + } + } + + private void UpdateKey(RegistryKeyEntry key) + { + string path = key.Parent.DestinationLocation; + + RollbackData rollback = new RollbackData(key); + + cachedUpdates.Add(rollback); + + RegistryHelper.Update(key, rollback); + + Updater.Instance.Logger.Info( + nameof(UpdateRegistryTask), + nameof(UpdateKey), + $"Succesfully updated {key.DestinationLocation}"); + } + + public override void Rollback() + { + int total = cachedUpdates.Count; + int count = 0; + + foreach (RollbackData data in cachedUpdates) + { + RollbackFailSafe(data); + + OnTaskProgressChanged(++count, total); + } + } + + private void RollbackFailSafe(RollbackData data) + { + try + { + RegistryKey key = RegistryHelper.GetOrMakeKey(data.path); + + if (!data.existed) + { + key.DeleteValue(data.key); + + Updater.Instance.Logger.Warn( + nameof(UpdateRegistryTask), + nameof(Rollback), + $"Deleted -> {data.path}\\{data.key}"); + + return; + } + + key.SetValue(data.key, data.cachedValue, data.type); + + Updater.Instance.Logger.Warn( + nameof(UpdateRegistryTask), + nameof(Rollback), + $"Rolled back -> {data.path}\\{data.key}"); + } + catch (Exception e) + { + Updater.Instance.Logger.Error(nameof(UpdateRegistryTask), nameof(Rollback), e); + } + } + + public struct RollbackData + { + public bool existed; + public string path; + public string key; + public object cachedValue; + public RegistryValueKind type; + + public RollbackData(RegistryKeyEntry l_key) + { + key = l_key.Name; + path = l_key.Parent.DestinationLocation; + existed = RegistryHelper.Exists(l_key, out cachedValue); + type = RegistryValueKind.Unknown; + } + } + } +} diff --git a/UpdateLib/UpdateLib/UI/Components/ChangelogPage.Designer.cs b/UpdateLib/UpdateLib/UI/Components/ChangelogPage.Designer.cs new file mode 100644 index 0000000..55dbc85 --- /dev/null +++ b/UpdateLib/UpdateLib/UI/Components/ChangelogPage.Designer.cs @@ -0,0 +1,83 @@ +namespace MatthiWare.UpdateLib.UI.Components +{ + partial class ChangelogPage + { + /// + /// 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 Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ChangelogPage)); + this.txtTitle = new System.Windows.Forms.Label(); + this.richTextBox1 = new System.Windows.Forms.RichTextBox(); + this.SuspendLayout(); + // + // txtTitle + // + this.txtTitle.AutoSize = true; + this.txtTitle.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.txtTitle.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(43)))), ((int)(((byte)(129)))), ((int)(((byte)(181))))); + this.txtTitle.Location = new System.Drawing.Point(12, 12); + this.txtTitle.Name = "txtTitle"; + this.txtTitle.Size = new System.Drawing.Size(224, 25); + this.txtTitle.TabIndex = 1; + this.txtTitle.Text = "Changelog / Patchnotes"; + // + // richTextBox1 + // + this.richTextBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.richTextBox1.BackColor = System.Drawing.SystemColors.Window; + this.richTextBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.richTextBox1.Cursor = System.Windows.Forms.Cursors.IBeam; + this.richTextBox1.Location = new System.Drawing.Point(14, 52); + this.richTextBox1.Name = "richTextBox1"; + this.richTextBox1.ReadOnly = true; + this.richTextBox1.Size = new System.Drawing.Size(612, 359); + this.richTextBox1.TabIndex = 2; + this.richTextBox1.Text = resources.GetString("richTextBox1.Text"); + // + // ChangelogPage + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.SystemColors.Window; + this.Controls.Add(this.richTextBox1); + this.Controls.Add(this.txtTitle); + this.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.Name = "ChangelogPage"; + this.Size = new System.Drawing.Size(637, 425); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label txtTitle; + private System.Windows.Forms.RichTextBox richTextBox1; + } +} diff --git a/UpdateLib/UpdateLib/UI/Components/ChangelogPage.cs b/UpdateLib/UpdateLib/UI/Components/ChangelogPage.cs new file mode 100644 index 0000000..cad8560 --- /dev/null +++ b/UpdateLib/UpdateLib/UI/Components/ChangelogPage.cs @@ -0,0 +1,127 @@ +/* UpdateLib - .Net auto update library + * Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using System; +using System.Windows.Forms; + +namespace MatthiWare.UpdateLib.UI.Components +{ + public partial class ChangelogPage : UserControl, IWizardPage + { + public ChangelogPage(UpdaterForm parent) + { + InitializeComponent(); + + _updaterForm = parent; + } + + public UserControl Conent + { + get + { + return this; + } + } + + + + public bool NeedsCancel + { + get + { + return false; + } + } + + public bool NeedsExecution + { + get + { + return false; + } + } + + public string Title + { + get + { + return txtTitle.Text; + } + } + + private UpdaterForm _updaterForm; + public UpdaterForm UpdaterForm + { + get + { + return _updaterForm; + } + } + + private bool _isbusy; + public bool IsBusy + { + get + { + return _isbusy; + } + + set + { + _isbusy = value; + } + } + + public bool IsDone + {get;set; + } + + public bool HasErrors + { + get; set; + } + + public void PageEntered() + { + IsDone = true; + } + + public event EventHandler PageUpdate; + + public bool NeedsRollBack { get { return false; } } + + public void UpdateState() + { + + } + + public void Cancel() + { + IsDone = true; + } + + public void Execute() + { + throw new NotImplementedException(); + } + + public void Rollback() + { + + } + } +} diff --git a/UpdateLib/UpdateLib/UI/Components/ChangelogPage.resx b/UpdateLib/UpdateLib/UI/Components/ChangelogPage.resx new file mode 100644 index 0000000..35f5067 --- /dev/null +++ b/UpdateLib/UpdateLib/UI/Components/ChangelogPage.resx @@ -0,0 +1,235 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + # Change Log +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/) +and this project adheres to [Semantic Versioning](http://semver.org/). + +## [Unreleased] +### Added +- zh-CN and zh-TW translations from @tianshuo. +- de translation from @mpbzh. +- it-IT translation from @roalz. +- sv translation from @magol. +- tr-TR translation from @karalamalar. +- fr translation from @zapashcanon. + +### Changed +- Start versioning based on the current English version at 0.3.0 to help +translation authors keep things up-to-date. +- Fix typos in zh-CN translation. +- Fix typos in pt-BR translation. + +## [0.3.0] - 2015-12-03 +### Added +- RU translation from @aishek. +- pt-BR translation from @tallesl. +- es-ES translation from @ZeliosAriex. + +## [0.2.0] - 2015-10-06 +### Changed +- Remove exclusionary mentions of "open source" since this project can benefit +both "open" and "closed" source projects equally. + +## [0.1.0] - 2015-10-06 +### Added +- Answer "Should you ever rewrite a change log?". + +### Changed +- Improve argument against commit logs. +- Start following [SemVer](http://semver.org) properly. + +## [0.0.8] - 2015-02-17 +### Changed +- Update year to match in every README example. +- Reluctantly stop making fun of Brits only, since most of the world + writes dates in a strange way. + +### Fixed +- Fix typos in recent README changes. +- Update outdated unreleased diff link. + +## [0.0.7] - 2015-02-16 +### Added +- Link, and make it obvious that date format is ISO 8601. + +### Changed +- Clarified the section on "Is there a standard change log format?". + +### Fixed +- Fix Markdown links to tag comparison URL with footnote-style links. + +## [0.0.6] - 2014-12-12 +### Added +- README section on "yanked" releases. + +## [0.0.5] - 2014-08-09 +### Added +- Markdown links to version tags on release headings. +- Unreleased section to gather unreleased changes and encourage note +keeping prior to releases. + +## [0.0.4] - 2014-08-09 +### Added +- Better explanation of the difference between the file ("CHANGELOG") +and its function "the change log". + +### Changed +- Refer to a "change log" instead of a "CHANGELOG" throughout the site +to differentiate between the file and the purpose of the file - the +logging of changes. + +### Removed +- Remove empty sections from CHANGELOG, they occupy too much space and +create too much noise in the file. People will have to assume that the +missing sections were intentionally left out because they contained no +notable changes. + +## [0.0.3] - 2014-08-09 +### Added +- "Why should I care?" section mentioning The Changelog podcast. + +## [0.0.2] - 2014-07-10 +### Added +- Explanation of the recommended reverse chronological release ordering. + +## 0.0.1 - 2014-05-31 +### Added +- This CHANGELOG file to hopefully serve as an evolving example of a standardized open source project CHANGELOG. +- CNAME file to enable GitHub Pages custom domain +- README now contains answers to common questions about CHANGELOGs +- Good examples and basic guidelines, including proper date formatting. +- Counter-examples: "What makes unicorns cry?" + +[Unreleased]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.3.0...HEAD +[0.3.0]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.2.0...v0.3.0 +[0.2.0]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.1.0...v0.2.0 +[0.1.0]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.0.8...v0.1.0 +[0.0.8]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.0.7...v0.0.8 +[0.0.7]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.0.6...v0.0.7 +[0.0.6]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.0.5...v0.0.6 +[0.0.5]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.0.4...v0.0.5 +[0.0.4]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.0.3...v0.0.4 +[0.0.3]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.0.2...v0.0.3 +[0.0.2]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.0.1...v0.0.2 + + \ No newline at end of file diff --git a/UpdateLib/UpdateLib/UI/Components/FinishPage.Designer.cs b/UpdateLib/UpdateLib/UI/Components/FinishPage.Designer.cs new file mode 100644 index 0000000..e58fabf --- /dev/null +++ b/UpdateLib/UpdateLib/UI/Components/FinishPage.Designer.cs @@ -0,0 +1,97 @@ +namespace MatthiWare.UpdateLib.UI.Components +{ + partial class FinishPage + { + /// + /// 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 Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FinishPage)); + this.txtFinished = new System.Windows.Forms.Label(); + this.txtDescription = new System.Windows.Forms.Label(); + this.cbRestart = new System.Windows.Forms.CheckBox(); + this.SuspendLayout(); + // + // txtFinished + // + this.txtFinished.AutoSize = true; + this.txtFinished.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.txtFinished.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(43)))), ((int)(((byte)(129)))), ((int)(((byte)(181))))); + this.txtFinished.Location = new System.Drawing.Point(12, 12); + this.txtFinished.Name = "txtFinished"; + this.txtFinished.Size = new System.Drawing.Size(85, 25); + this.txtFinished.TabIndex = 0; + this.txtFinished.Text = "Finished"; + // + // txtDescription + // + this.txtDescription.AutoSize = true; + this.txtDescription.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.txtDescription.Location = new System.Drawing.Point(14, 52); + this.txtDescription.Name = "txtDescription"; + this.txtDescription.Size = new System.Drawing.Size(433, 136); + this.txtDescription.TabIndex = 1; + this.txtDescription.Text = resources.GetString("txtDescription.Text"); + // + // cbRestart + // + this.cbRestart.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.cbRestart.AutoSize = true; + this.cbRestart.Checked = true; + this.cbRestart.CheckState = System.Windows.Forms.CheckState.Checked; + this.cbRestart.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.cbRestart.Location = new System.Drawing.Point(17, 202); + this.cbRestart.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.cbRestart.Name = "cbRestart"; + this.cbRestart.Size = new System.Drawing.Size(136, 21); + this.cbRestart.TabIndex = 2; + this.cbRestart.Text = "Restart application"; + this.cbRestart.UseVisualStyleBackColor = true; + this.cbRestart.CheckedChanged += new System.EventHandler(this.cbRestart_CheckedChanged); + // + // FinishPage + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.SystemColors.Window; + this.Controls.Add(this.cbRestart); + this.Controls.Add(this.txtDescription); + this.Controls.Add(this.txtFinished); + this.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.Name = "FinishPage"; + this.Size = new System.Drawing.Size(701, 245); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label txtFinished; + private System.Windows.Forms.Label txtDescription; + private System.Windows.Forms.CheckBox cbRestart; + } +} diff --git a/UpdateLib/UpdateLib/UI/Components/FinishPage.cs b/UpdateLib/UpdateLib/UI/Components/FinishPage.cs new file mode 100644 index 0000000..e2512b5 --- /dev/null +++ b/UpdateLib/UpdateLib/UI/Components/FinishPage.cs @@ -0,0 +1,170 @@ +/* UpdateLib - .Net auto update library + * Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using System; +using System.Windows.Forms; + +namespace MatthiWare.UpdateLib.UI.Components +{ + public partial class FinishPage : UserControl, IWizardPage + { + + private UpdaterForm _updaterForm; + + public FinishPage(UpdaterForm parent) + { + InitializeComponent(); + + _updaterForm = parent; + + txtDescription.Text = txtDescription.Text.Replace("%AppName%", parent.ApplicationName); + txtDescription.Text = txtDescription.Text.Replace("%version%", parent.UpdateInfo.Version); + } + + public void UpdateState() + { + var version = _updaterForm.UpdateInfo.Version; + string appName = _updaterForm.ApplicationName; + + if (_updaterForm.HasHadErrors) + { + cbRestart.Checked = false; + cbRestart.Enabled = false; + + txtDescription.Text = $"{appName} was unable to update to version {version}!\n\n" + + "Check the log files for more information!\n\n" + + "Press Finish to close this wizard."; + + txtFinished.Text = "Finished (with errors)"; + } + else if (_updaterForm.UserCancelled) + { + cbRestart.Checked = false; + cbRestart.Enabled = false; + + txtDescription.Text = $"{appName} was unable to update to version {version}!\n\n" + + "Update process cancelled by the user.\n\n" + + "Press Finish to close this wizard."; + + txtFinished.Text = "Finished (cancelled)"; + } + } + + public UserControl Conent + { + get + { + return this; + } + } + + private bool _isbusy; + public bool IsBusy + { + get + { + return _isbusy; + } + + set + { + _isbusy = value; + } + } + + private bool _isdone; + public bool IsDone + { + get + { + return _isdone; + } + + set + { + _isdone = value; + } + } + + public void PageEntered() + { + IsDone = true; + } + + public bool NeedsCancel + { + get + { + return false; + } + } + + public bool NeedsExecution + { + get + { + return false; + } + } + + public string Title + { + get + { + return txtFinished.Text; + } + } + + + public UpdaterForm UpdaterForm + { + get + { + return _updaterForm; + } + } + + public bool NeedsRollBack { get { return false; } } + + public bool HasErrors + { + get; set; + } + + public event EventHandler PageUpdate; + + public void Cancel() + { + IsDone = true; + } + + public void Execute() + { + throw new NotImplementedException(); + } + + private void cbRestart_CheckedChanged(object sender, EventArgs e) + { + UpdaterForm.NeedsRestart = cbRestart.Checked; + } + + public void Rollback() + { + + } + } +} diff --git a/UpdateLib/UpdateLib/UI/Components/FinishPage.resx b/UpdateLib/UpdateLib/UI/Components/FinishPage.resx new file mode 100644 index 0000000..166646a --- /dev/null +++ b/UpdateLib/UpdateLib/UI/Components/FinishPage.resx @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + %AppName% has been succesfully updated to version %version%. + +%AppName% needs to restart for the changes to take effect. + +If you do not want this you can uncheck the Restart application checkbox. + +Press Finish to close this wizard. + + + + \ No newline at end of file diff --git a/UpdateLib/UpdateLib/UI/Components/IntroPage.Designer.cs b/UpdateLib/UpdateLib/UI/Components/IntroPage.Designer.cs new file mode 100644 index 0000000..8c406d0 --- /dev/null +++ b/UpdateLib/UpdateLib/UI/Components/IntroPage.Designer.cs @@ -0,0 +1,77 @@ +namespace MatthiWare.UpdateLib.UI.Components +{ + partial class IntroPage + { + /// + /// 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 Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(IntroPage)); + this.txtWelcome = new System.Windows.Forms.Label(); + this.txtDesc = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // txtWelcome + // + this.txtWelcome.AutoSize = true; + this.txtWelcome.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.txtWelcome.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(43)))), ((int)(((byte)(129)))), ((int)(((byte)(181))))); + this.txtWelcome.Location = new System.Drawing.Point(12, 12); + this.txtWelcome.Name = "txtWelcome"; + this.txtWelcome.Size = new System.Drawing.Size(360, 25); + this.txtWelcome.TabIndex = 0; + this.txtWelcome.Text = "Welcome to the %AppName% Updater!"; + // + // txtDesc + // + this.txtDesc.AutoSize = true; + this.txtDesc.Location = new System.Drawing.Point(14, 52); + this.txtDesc.Name = "txtDesc"; + this.txtDesc.Size = new System.Drawing.Size(425, 119); + this.txtDesc.TabIndex = 1; + this.txtDesc.Text = resources.GetString("txtDesc.Text"); + // + // IntroPage + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.SystemColors.Window; + this.Controls.Add(this.txtDesc); + this.Controls.Add(this.txtWelcome); + this.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.Name = "IntroPage"; + this.Size = new System.Drawing.Size(515, 232); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label txtWelcome; + private System.Windows.Forms.Label txtDesc; + } +} diff --git a/UpdateLib/UpdateLib/UI/Components/IntroPage.cs b/UpdateLib/UpdateLib/UI/Components/IntroPage.cs new file mode 100644 index 0000000..ad000c8 --- /dev/null +++ b/UpdateLib/UpdateLib/UI/Components/IntroPage.cs @@ -0,0 +1,138 @@ +/* UpdateLib - .Net auto update library + * Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using System; +using System.Windows.Forms; + +namespace MatthiWare.UpdateLib.UI.Components +{ + public partial class IntroPage : UserControl, IWizardPage + { + public IntroPage(UpdaterForm parent) + { + InitializeComponent(); + + _updateForm = parent; + + txtDesc.Text = txtDesc.Text.Replace("%AppName%", parent.ApplicationName); + txtWelcome.Text = txtWelcome.Text.Replace("%AppName%", parent.ApplicationName); + } + + public UserControl Conent + { + get + { + return this; + } + } + + private bool _isbusy; + public bool IsBusy + { + get + { + return _isbusy; + } + + set + { + _isbusy = value; + } + } + + private bool _isdone; + public bool IsDone + { + get + { + return _isdone; + } + + set + { + _isdone = value; + } + } + + public void PageEntered() + { + IsDone = true; + } + + public bool NeedsCancel + { + get + { + return false; + } + } + + public bool NeedsExecution + { + get + { + return false; + } + } + + public string Title + { + get + { + return txtWelcome.Text; + } + } + + private UpdaterForm _updateForm; + public UpdaterForm UpdaterForm + { + get + { + return _updateForm; + } + } + + public bool HasErrors + { + get; set; + } + + public event EventHandler PageUpdate; + + public void UpdateState() + { + + } + + public bool NeedsRollBack { get { return false; } } + + public void Cancel() + { + IsDone = true; + } + + public void Execute() + { + throw new NotImplementedException(); + } + + public void Rollback() + { + + } + } +} diff --git a/UpdateLib/UpdateLib/UI/Components/IntroPage.resx b/UpdateLib/UpdateLib/UI/Components/IntroPage.resx new file mode 100644 index 0000000..94af550 --- /dev/null +++ b/UpdateLib/UpdateLib/UI/Components/IntroPage.resx @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + This wizard will guide you throug the update process of %AppName%. + +To return to the previous screen, click Previous. + +To cancel the update process at any time, click Cancel. + +Click Next to continue. + + \ No newline at end of file diff --git a/UpdateLib/UpdateLib/UI/Components/RollbackPage.Designer.cs b/UpdateLib/UpdateLib/UI/Components/RollbackPage.Designer.cs new file mode 100644 index 0000000..2164900 --- /dev/null +++ b/UpdateLib/UpdateLib/UI/Components/RollbackPage.Designer.cs @@ -0,0 +1,142 @@ +namespace MatthiWare.UpdateLib.UI.Components +{ + partial class RollbackPage + { + /// + /// 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 Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + System.Windows.Forms.ListViewGroup listViewGroup1 = new System.Windows.Forms.ListViewGroup("Installed version", System.Windows.Forms.HorizontalAlignment.Left); + System.Windows.Forms.ListViewGroup listViewGroup2 = new System.Windows.Forms.ListViewGroup("Local versions", System.Windows.Forms.HorizontalAlignment.Left); + System.Windows.Forms.ListViewGroup listViewGroup3 = new System.Windows.Forms.ListViewGroup("Available versions", System.Windows.Forms.HorizontalAlignment.Left); + this.lblHeader = new System.Windows.Forms.Label(); + this.ilIcons = new System.Windows.Forms.ImageList(this.components); + this.lvItems = new System.Windows.Forms.ListView(); + this.clmnVersion = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.clmnStatus = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.clmnProgress = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.clmnDescription = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.clmnPath = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.SuspendLayout(); + // + // lblHeader + // + this.lblHeader.AutoSize = true; + this.lblHeader.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblHeader.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(43)))), ((int)(((byte)(129)))), ((int)(((byte)(181))))); + this.lblHeader.Location = new System.Drawing.Point(17, 18); + this.lblHeader.Name = "lblHeader"; + this.lblHeader.Size = new System.Drawing.Size(359, 25); + this.lblHeader.TabIndex = 3; + this.lblHeader.Text = "Rollback/repair manager %AppName%"; + // + // ilIcons + // + this.ilIcons.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit; + this.ilIcons.ImageSize = new System.Drawing.Size(16, 16); + this.ilIcons.TransparentColor = System.Drawing.Color.Transparent; + // + // lvItems + // + this.lvItems.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.lvItems.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.clmnVersion, + this.clmnStatus, + this.clmnProgress, + this.clmnDescription, + this.clmnPath}); + this.lvItems.FullRowSelect = true; + listViewGroup1.Header = "Installed version"; + listViewGroup1.Name = "lvgInstalled"; + listViewGroup2.Header = "Local versions"; + listViewGroup2.Name = "lvgLocal"; + listViewGroup3.Header = "Available versions"; + listViewGroup3.Name = "lvgAvailable"; + this.lvItems.Groups.AddRange(new System.Windows.Forms.ListViewGroup[] { + listViewGroup1, + listViewGroup2, + listViewGroup3}); + this.lvItems.Location = new System.Drawing.Point(17, 46); + this.lvItems.Name = "lvItems"; + this.lvItems.Size = new System.Drawing.Size(505, 282); + this.lvItems.TabIndex = 4; + this.lvItems.UseCompatibleStateImageBehavior = false; + this.lvItems.View = System.Windows.Forms.View.Details; + // + // clmnVersion + // + this.clmnVersion.Text = "Version"; + this.clmnVersion.Width = 125; + // + // clmnStatus + // + this.clmnStatus.Text = "Status"; + this.clmnStatus.Width = 131; + // + // clmnProgress + // + this.clmnProgress.Text = "Progress"; + this.clmnProgress.Width = 85; + // + // clmnDescription + // + this.clmnDescription.Text = "Description"; + this.clmnDescription.Width = 100; + // + // clmnPath + // + this.clmnPath.Text = "Path"; + this.clmnPath.Width = 350; + // + // RollbackPage + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.SystemColors.Window; + this.Controls.Add(this.lvItems); + this.Controls.Add(this.lblHeader); + this.Font = new System.Drawing.Font("Segoe UI", 9.75F); + this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.Name = "RollbackPage"; + this.Size = new System.Drawing.Size(538, 341); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + private System.Windows.Forms.Label lblHeader; + private System.Windows.Forms.ImageList ilIcons; + private System.Windows.Forms.ListView lvItems; + private System.Windows.Forms.ColumnHeader clmnVersion; + private System.Windows.Forms.ColumnHeader clmnStatus; + private System.Windows.Forms.ColumnHeader clmnProgress; + private System.Windows.Forms.ColumnHeader clmnDescription; + private System.Windows.Forms.ColumnHeader clmnPath; + } +} diff --git a/UpdateLib/UpdateLib/UI/Components/RollbackPage.cs b/UpdateLib/UpdateLib/UI/Components/RollbackPage.cs new file mode 100644 index 0000000..b088ae3 --- /dev/null +++ b/UpdateLib/UpdateLib/UI/Components/RollbackPage.cs @@ -0,0 +1,12 @@ +using System.Windows.Forms; + +namespace MatthiWare.UpdateLib.UI.Components +{ + public partial class RollbackPage : UserControl + { + public RollbackPage() + { + InitializeComponent(); + } + } +} diff --git a/UpdateLib/UpdateLib/UI/Components/RollbackPage.resx b/UpdateLib/UpdateLib/UI/Components/RollbackPage.resx new file mode 100644 index 0000000..be67fa0 --- /dev/null +++ b/UpdateLib/UpdateLib/UI/Components/RollbackPage.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + 17, 17 + + \ No newline at end of file diff --git a/UpdateLib/UpdateLib/UI/Components/UpdatePage.Designer.cs b/UpdateLib/UpdateLib/UI/Components/UpdatePage.Designer.cs new file mode 100644 index 0000000..8aec832 --- /dev/null +++ b/UpdateLib/UpdateLib/UI/Components/UpdatePage.Designer.cs @@ -0,0 +1,142 @@ +namespace MatthiWare.UpdateLib.UI.Components +{ + partial class UpdatePage + { + /// + /// 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 Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.lblHeader = new System.Windows.Forms.Label(); + this.lblSubheader = new System.Windows.Forms.Label(); + this.lvItems = new System.Windows.Forms.ListView(); + this.clmnName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.clmnStatus = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.clmnProgress = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.clmnDescription = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.clmnPath = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.ilIcons = new System.Windows.Forms.ImageList(this.components); + this.SuspendLayout(); + // + // lblHeader + // + this.lblHeader.AutoSize = true; + this.lblHeader.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblHeader.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(43)))), ((int)(((byte)(129)))), ((int)(((byte)(181))))); + this.lblHeader.Location = new System.Drawing.Point(14, 14); + this.lblHeader.Name = "lblHeader"; + this.lblHeader.Size = new System.Drawing.Size(140, 25); + this.lblHeader.TabIndex = 0; + this.lblHeader.Text = "Apply updates"; + // + // lblSubheader + // + this.lblSubheader.AutoSize = true; + this.lblSubheader.Location = new System.Drawing.Point(14, 52); + this.lblSubheader.Name = "lblSubheader"; + this.lblSubheader.Size = new System.Drawing.Size(252, 17); + this.lblSubheader.TabIndex = 1; + this.lblSubheader.Text = "Press Update to start the update process."; + // + // lvItems + // + this.lvItems.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.lvItems.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.clmnName, + this.clmnStatus, + this.clmnProgress, + this.clmnDescription, + this.clmnPath}); + this.lvItems.FullRowSelect = true; + this.lvItems.Location = new System.Drawing.Point(17, 72); + this.lvItems.Name = "lvItems"; + this.lvItems.Size = new System.Drawing.Size(505, 255); + this.lvItems.TabIndex = 2; + this.lvItems.UseCompatibleStateImageBehavior = false; + this.lvItems.View = System.Windows.Forms.View.Details; + // + // clmnName + // + this.clmnName.Text = "File name"; + this.clmnName.Width = 125; + // + // clmnStatus + // + this.clmnStatus.Text = "Status"; + this.clmnStatus.Width = 131; + // + // clmnProgress + // + this.clmnProgress.Text = "Progress"; + this.clmnProgress.Width = 85; + // + // clmnDescription + // + this.clmnDescription.Text = "Description"; + this.clmnDescription.Width = 100; + // + // clmnPath + // + this.clmnPath.Text = "Path"; + this.clmnPath.Width = 350; + // + // ilIcons + // + this.ilIcons.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit; + this.ilIcons.ImageSize = new System.Drawing.Size(16, 16); + this.ilIcons.TransparentColor = System.Drawing.Color.Transparent; + // + // UpdatePage + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.SystemColors.Window; + this.Controls.Add(this.lvItems); + this.Controls.Add(this.lblSubheader); + this.Controls.Add(this.lblHeader); + this.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.Name = "UpdatePage"; + this.Size = new System.Drawing.Size(538, 341); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label lblHeader; + private System.Windows.Forms.Label lblSubheader; + private System.Windows.Forms.ListView lvItems; + private System.Windows.Forms.ImageList ilIcons; + private System.Windows.Forms.ColumnHeader clmnName; + private System.Windows.Forms.ColumnHeader clmnStatus; + private System.Windows.Forms.ColumnHeader clmnProgress; + private System.Windows.Forms.ColumnHeader clmnPath; + private System.Windows.Forms.ColumnHeader clmnDescription; + } +} diff --git a/UpdateLib/UpdateLib/UI/Components/UpdatePage.cs b/UpdateLib/UpdateLib/UI/Components/UpdatePage.cs new file mode 100644 index 0000000..1834367 --- /dev/null +++ b/UpdateLib/UpdateLib/UI/Components/UpdatePage.cs @@ -0,0 +1,374 @@ +/* UpdateLib - .Net auto update library + * Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Windows.Forms; + +using MatthiWare.UpdateLib.Common; +using MatthiWare.UpdateLib.Files; +using MatthiWare.UpdateLib.Properties; +using MatthiWare.UpdateLib.Tasks; +using MatthiWare.UpdateLib.Threading; +using MatthiWare.UpdateLib.Utils; + +namespace MatthiWare.UpdateLib.UI.Components +{ + public partial class UpdatePage : UserControl, IWizardPage + { + + public UpdateMetadataFile UpdateFile { get; set; } + + public event EventHandler PageUpdate; + + private AtomicInteger amountToDownload = new AtomicInteger(); + private Dictionary m_items = new Dictionary(); + private bool hasRegTask = false; + + public UpdatePage(UpdaterForm parent) + { + InitializeComponent(); + + _updaterForm = parent; + + UpdateFile = parent.UpdateInfo; + + ImageList ilItems = MakeImageList(); + lvItems.SmallImageList = ilItems; + + + FillListView(); + + + } + + private ImageList MakeImageList() + { + ImageList imgList = new ImageList(); + + imgList.Images.Add("status_download", Resources.status_download); + imgList.Images.Add("status_done", Resources.status_done); + imgList.Images.Add("status_error", Resources.status_error); + imgList.Images.Add("status_info", Resources.status_info); + imgList.Images.Add("status_update", Resources.status_update); + imgList.Images.Add("status_warning", Resources.status_warning); + + return imgList; + } + + private void FillListView() + { + amountToDownload.Value = UpdateFile.FileCount; + + lvItems.BeginUpdate(); + + AddDirectoryToListView( + UpdateFile.Folders + .SelectMany(dir => dir.GetItems()) + .Select(e => e as FileEntry) + .Distinct() + .NotNull()); + + AddRegistryToListView(UpdateFile.Registry + .SelectMany(dir => dir.GetItems()) + .Select(e => e as RegistryKeyEntry) + .Distinct() + .NotNull()); + + lvItems.Columns[4].Width = -1; + lvItems.Columns[0].Width = -1; + + lvItems.EndUpdate(); + } + + private void AddDirectoryToListView(IEnumerable files) + { + foreach (FileEntry entry in files) + { + ListViewItem item = new ListViewItem(new string[] { entry.Name, "Ready to download", "0%", entry.Description, Updater.Instance.Converter.Convert(entry.DestinationLocation) }); + item.Tag = entry; + + DownloadTask task = new DownloadTask(entry); + task.TaskProgressChanged += Task_TaskProgressChanged; + task.TaskCompleted += Task_TaskCompleted; + + m_items.Add(task, item); + + lvItems.Items.Add(item); + } + } + + private void AddRegistryToListView(IEnumerable keys) + { + if (keys.Count() == 0) + return; + + amountToDownload.Increment(); + hasRegTask = true; + + ListViewItem item = new ListViewItem(new string[] { "Update registry", "Waiting for other tasks to complete", "0%", "Applies changes to the registry" }); + + UpdateRegistryTask task = new UpdateRegistryTask(keys); + task.TaskProgressChanged += Task_TaskProgressChanged; + task.TaskCompleted += Task_TaskCompleted; + + m_items.Add(task, item); + + lvItems.Items.Add(item); + } + + public void StartUpdate() + { + IsBusy = true; + PageUpdate?.Invoke(this, new EventArgs()); + + var items = m_items.Where(x => (x.Key as DownloadTask != null)); + + foreach (var kvp in items) + { + SetImageKey(kvp.Value, "status_download"); + SetSubItemText(kvp.Value.SubItems[1], "Downloading.."); + + kvp.Key.Start(); + } + + + if (hasRegTask && items.Count() == 0) + StartRegUpdate(); + + } + + private void StartRegUpdate() + { + var kvp = m_items.Where(x => (x.Key as UpdateRegistryTask) != null).NotNull().FirstOrDefault(); + + if (kvp.Key == null || kvp.Value == null) + return; + + var view = kvp.Value; + + SetImageKey(view, "status_download"); + SetSubItemText(view.SubItems[1], "Updating.."); + + kvp.Key.Start(); + + } + + private void Task_TaskCompleted(object sender, AsyncCompletedEventArgs e) + { + var task = (UpdatableTask)sender; + var view = m_items[task]; + + if (e.Cancelled) + { + SetSubItemText(view.SubItems[1], "Rolled back"); + SetImageKey(view, "status_warning"); + + return; + } + + if (e.Error != null) + { + HasErrors = true; + PageUpdate?.Invoke(this, EventArgs.Empty); + + Updater.Instance.Logger.Error(nameof(UpdatePage), nameof(StartUpdate), e.Error); + + SetSubItemText(view.SubItems[1], "Error"); + SetImageKey(view, "status_error"); + + return; + } + + SetSubItemText(view.SubItems[1], "Done"); + SetImageKey(view, "status_done"); + + int left = amountToDownload.Decrement(); + + if (left == 1 && hasRegTask) + StartRegUpdate(); + else if (left == 0) + { + IsBusy = false; + IsDone = true; + PageUpdate?.Invoke(this, EventArgs.Empty); + } + } + + private void Task_TaskProgressChanged(object sender, ProgressChangedEventArgs e) + { + UpdatableTask task = (UpdatableTask)sender; + + SetSubItemText(m_items[task].SubItems[2], $"{e.ProgressPercentage}%"); + } + + public void CancelUpdate() + { + + } + + private void StartDownloadItem(ListViewItem item) + { + + //Test(item); + + } + + private void SetImageKey(ListViewItem item, string key) + { + this.InvokeOnUI(() => item.ImageKey = key); + //if (InvokeRequired) + //{ + // Invoke(new Action(SetImageKey), item, key); + // return; + //} + //item.ImageKey = key; + } + + private void SetSubItemText(ListViewItem.ListViewSubItem item, string key) + { + this.InvokeOnUI(() => item.Text = key); + //if (InvokeRequired) + //{ + // Invoke(new Action(SetSubItemText), item, key); + // return; + //} + + //item.Text = key; + } + + public void Cancel() + { + if (NeedsRollBack) + Rollback(); + + IsDone = true; + + + PageUpdate?.Invoke(this, EventArgs.Empty); + } + + public void Execute() + { + StartUpdate(); + } + + private UpdaterForm _updaterForm; + public UpdaterForm UpdaterForm + { + get + { + return _updaterForm; + } + } + + public UserControl Conent + { + get + { + return this; + } + } + + public bool NeedsCancel + { + get + { + return true; + } + } + + public bool NeedsExecution + { + get + { + return true; + } + } + + public bool NeedsRollBack { get { return true; } } + + public bool IsBusy + { + get; set; + + } + + public void PageEntered() + { + + } + + public void UpdateState() + { + + } + + public void Rollback() + { + IsBusy = true; + + foreach (var item in m_items) + { + UpdatableTask task = item.Key; + ListViewItem view = item.Value; + + if (task.IsCancelled || (!task.IsCompleted && !task.IsRunning)) + { + SetSubItemText(view.SubItems[1], "No action"); + + SetImageKey(view, "status_warning"); + + continue; + } + + + task.Cancel(); + + SetSubItemText(view.SubItems[1], "Rolled back"); + + SetImageKey(view, "status_warning"); + } + + IsBusy = false; + HasErrors = false; + IsDone = true; + + PageUpdate?.Invoke(this, EventArgs.Empty); + } + + public bool IsDone + { + get; set; + } + + public string Title + { + get + { + return lblHeader.Text; + } + } + + public bool HasErrors + { + get; set; + } + } +} diff --git a/UpdateLib/UpdateLib/UI/Components/UpdatePage.resx b/UpdateLib/UpdateLib/UI/Components/UpdatePage.resx new file mode 100644 index 0000000..be67fa0 --- /dev/null +++ b/UpdateLib/UpdateLib/UI/Components/UpdatePage.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + 17, 17 + + \ No newline at end of file diff --git a/UpdateLib/UpdateLib/UI/IWizardPage.cs b/UpdateLib/UpdateLib/UI/IWizardPage.cs new file mode 100644 index 0000000..7824d6d --- /dev/null +++ b/UpdateLib/UpdateLib/UI/IWizardPage.cs @@ -0,0 +1,41 @@ +/* UpdateLib - .Net auto update library + * Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using System; +using System.Windows.Forms; + +namespace MatthiWare.UpdateLib.UI +{ + public interface IWizardPage + { + event EventHandler PageUpdate; + UpdaterForm UpdaterForm { get; } + void Cancel(); + void Execute(); + UserControl Conent { get; } + bool NeedsCancel { get; } + bool NeedsExecution { get; } + bool IsBusy { get; set; } + bool IsDone { get; set; } + string Title { get; } + void PageEntered(); + void Rollback(); + bool HasErrors { get; set; } + bool NeedsRollBack { get; } + void UpdateState(); + } +} diff --git a/UpdateLib/UpdateLib/UI/MessageDialog.Designer.cs b/UpdateLib/UpdateLib/UI/MessageDialog.Designer.cs new file mode 100644 index 0000000..ef98053 --- /dev/null +++ b/UpdateLib/UpdateLib/UI/MessageDialog.Designer.cs @@ -0,0 +1,152 @@ +namespace MatthiWare.UpdateLib.UI +{ + partial class MessageDialog + { + /// + /// 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() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MessageDialog)); + this.panel1 = new System.Windows.Forms.Panel(); + this.btn2 = new System.Windows.Forms.Button(); + this.btn1 = new System.Windows.Forms.Button(); + this.btn3 = new System.Windows.Forms.Button(); + this.pbIcon = new System.Windows.Forms.PictureBox(); + this.lblHeader = new System.Windows.Forms.Label(); + this.lblDesc = new System.Windows.Forms.Label(); + this.panel1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pbIcon)).BeginInit(); + this.SuspendLayout(); + // + // panel1 + // + this.panel1.BackColor = System.Drawing.SystemColors.Control; + this.panel1.Controls.Add(this.btn2); + this.panel1.Controls.Add(this.btn1); + this.panel1.Controls.Add(this.btn3); + this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom; + this.panel1.Location = new System.Drawing.Point(0, 100); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(401, 46); + this.panel1.TabIndex = 0; + // + // btn2 + // + this.btn2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btn2.Location = new System.Drawing.Point(227, 11); + this.btn2.Name = "btn2"; + this.btn2.Size = new System.Drawing.Size(75, 23); + this.btn2.TabIndex = 3; + this.btn2.UseVisualStyleBackColor = true; + this.btn2.Visible = false; + // + // btn1 + // + this.btn1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btn1.Location = new System.Drawing.Point(146, 11); + this.btn1.Name = "btn1"; + this.btn1.Size = new System.Drawing.Size(75, 23); + this.btn1.TabIndex = 2; + this.btn1.UseVisualStyleBackColor = true; + this.btn1.Visible = false; + // + // btn3 + // + this.btn3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btn3.Location = new System.Drawing.Point(308, 11); + this.btn3.Name = "btn3"; + this.btn3.Size = new System.Drawing.Size(75, 23); + this.btn3.TabIndex = 1; + this.btn3.UseVisualStyleBackColor = true; + this.btn3.Visible = false; + // + // pbIcon + // + this.pbIcon.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; + this.pbIcon.Location = new System.Drawing.Point(12, 12); + this.pbIcon.Name = "pbIcon"; + this.pbIcon.Size = new System.Drawing.Size(48, 48); + this.pbIcon.TabIndex = 1; + this.pbIcon.TabStop = false; + // + // lblHeader + // + this.lblHeader.AutoSize = true; + this.lblHeader.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblHeader.ForeColor = System.Drawing.Color.MidnightBlue; + this.lblHeader.Location = new System.Drawing.Point(65, 12); + this.lblHeader.Name = "lblHeader"; + this.lblHeader.Size = new System.Drawing.Size(212, 25); + this.lblHeader.TabIndex = 2; + this.lblHeader.Text = "Version 1.0.0.0 available"; + // + // lblDesc + // + this.lblDesc.AutoSize = true; + this.lblDesc.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblDesc.Location = new System.Drawing.Point(67, 46); + this.lblDesc.Name = "lblDesc"; + this.lblDesc.Size = new System.Drawing.Size(218, 34); + this.lblDesc.TabIndex = 3; + this.lblDesc.Text = "Update now?\r\nPress yes to update or no to cancel."; + // + // MessageDialog + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.AutoSize = true; + this.BackColor = System.Drawing.SystemColors.Window; + this.ClientSize = new System.Drawing.Size(401, 146); + this.Controls.Add(this.lblDesc); + this.Controls.Add(this.lblHeader); + this.Controls.Add(this.pbIcon); + this.Controls.Add(this.panel1); + 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.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "MessageDialog"; + this.ShowIcon = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Message Dialog"; + this.panel1.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.pbIcon)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.Button btn3; + private System.Windows.Forms.PictureBox pbIcon; + private System.Windows.Forms.Label lblHeader; + private System.Windows.Forms.Label lblDesc; + private System.Windows.Forms.Button btn1; + private System.Windows.Forms.Button btn2; + } +} \ No newline at end of file diff --git a/UpdateLib/UpdateLib/UI/MessageDialog.cs b/UpdateLib/UpdateLib/UI/MessageDialog.cs new file mode 100644 index 0000000..3d5c384 --- /dev/null +++ b/UpdateLib/UpdateLib/UI/MessageDialog.cs @@ -0,0 +1,119 @@ +/* UpdateLib - .Net auto update library + * Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using System.Drawing; +using System.Windows.Forms; + +namespace MatthiWare.UpdateLib.UI +{ + public partial class MessageDialog : Form + { + public static DialogResult Show(IWin32Window owner, string title, string header, string desc, Icon icon, MessageBoxButtons buttons = MessageBoxButtons.YesNo) + { + return new MessageDialog( + title, + header, + desc, + icon, + buttons).ShowDialog(owner); + } + + public static DialogResult Show(string title, string header, string desc, Icon icon, MessageBoxButtons buttons = MessageBoxButtons.YesNo) + { + return Show(null, title, header, desc, icon, buttons); + } + + public string Header + { + get { return this.lblHeader.Text; } + set { this.lblHeader.Text = value; } + } + + public string Description + { + get { return this.lblDesc.Text; } + set { this.lblDesc.Text = value; } + } + + public Icon DialogIcon + { + set { this.pbIcon.BackgroundImage = value.ToBitmap(); } + } + + public MessageDialog() + { + InitializeComponent(); + } + + public MessageDialog(string title, string header, string desc, Icon icon, MessageBoxButtons buttons = MessageBoxButtons.YesNo) + : this() + { + Header = header; + Description = desc; + Text = title; + DialogIcon = icon; + Icon = icon; + + ShowIcon = true; + + SetUpButtons(buttons); + } + + private void SetUpButtons(MessageBoxButtons buttons) + { + switch (buttons) + { + case MessageBoxButtons.OK: + default: + SetUpButton(btn3, "OK", DialogResult.OK, true); + break; + case MessageBoxButtons.OKCancel: + SetUpButton(btn2, "OK", DialogResult.OK, true); + SetUpButton(btn3, "Cancel", DialogResult.Cancel); + break; + case MessageBoxButtons.AbortRetryIgnore: + SetUpButton(btn3, "Ignore", DialogResult.Ignore); + SetUpButton(btn2, "Retry", DialogResult.Retry); + SetUpButton(btn1, "Abort", DialogResult.Abort, true); + break; + case MessageBoxButtons.YesNoCancel: + SetUpButton(btn3, "Cancel", DialogResult.Cancel); + SetUpButton(btn2, "No", DialogResult.No); + SetUpButton(btn1, "Yes", DialogResult.Yes, true); + break; + case MessageBoxButtons.YesNo: + SetUpButton(btn3, "No", DialogResult.No); + SetUpButton(btn2, "Yes", DialogResult.Yes, true); + break; + case MessageBoxButtons.RetryCancel: + SetUpButton(btn3, "Cancel", DialogResult.Cancel); + SetUpButton(btn2, "Retry", DialogResult.Retry, true); + break; + } + } + + private void SetUpButton(Button button, string text, DialogResult result, bool defaultButton = false) + { + button.Text = text; + button.DialogResult = result; + button.Visible = true; + + if (defaultButton) + button.TabIndex = 0; + } + } +} diff --git a/UpdateLib/UpdateLib/UI/MessageDialog.resx b/UpdateLib/UpdateLib/UI/MessageDialog.resx new file mode 100644 index 0000000..9fe1da0 --- /dev/null +++ b/UpdateLib/UpdateLib/UI/MessageDialog.resx @@ -0,0 +1,306 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + AAABAAIAMDAAAAEAIACoJQAAJgAAABAQAAABACAAaAQAAM4lAAAoAAAAMAAAAGAAAAABACAAAAAAAAAk + AAASCwAAEgsAAAAAAAAAAAAA////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8ANJtQDDOYTkgxlEx2MZJLojCQSs0wkEr0MJBK4zCR + SsswkUuyMZJLmTGTTIAylk1fNJtQDP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AACEIy0UgTKaIIM89iuDQv8pgkD/JoI//yWF + QP8liUD/JYdA/yWHQP8mhED/JoI//yiBP/8qg0H/IIM89hSDM5kAhCMs////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wAAfB9RE30xxxt7Nv8kfjz/IYU8/yWP + Q/88oFb/VKxs/2e2ff9yvIf/abZ+/2K0ev9asXL/VK1t/02pZv82mFH/JYZA/yZ/Pf8bezb/En0wxwqD + K1sAgyMG////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8AAIUjFBN/Ma4ZdzT/In06/x6G + Ov9MqGP/iMaZ/6XUsv+cz6r/lMuk/43Hnf+JxJn/hMKU/4DAkv99vo3/ebyL/3a7if90u4f/abd//0+p + Zf8zkE3/JX49/yd8Pv8ggzrTDYsvIf///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8AMZRMiwCEIw7///8A////AP///wD///8A////AP///wD///8A////AP///wAJgClUHX037iF3 + OP8jiT//YrZ6/57Qq/+l07L/mc2n/5DIoP+KxZr/hsOX/4LBk/9+v4//er2M/3a7iP9yuYX/breC/2q1 + fv9ms3v/ZLJ5/2KyeP9hs3f/WrBy/zqYU/8nez7/HXw38wiCKUv///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8ALYZF/x58OO4WhzVpAIUkAv///wD///8A////AP///wD///8AAIQjAxN/ + MaEXci//Hno2/z6eWP+i06//p9Sz/5vNqf+TyaL/jsee/4vFmv+IxJn/hsOW/4PBlf+AwJP/fL6O/3a7 + iv9xuIT/a7Z//2aze/9isXf/Xq90/1qtcP9Wq23/VKps/1Ora/9Colv/J30+/xp1M/0VgjGDAIQjAf// + /wD///8A////AP///wD///8A////AP///wD///8ALIRE/yd3PP8mdjv/HX031AmBKkH///8A////AP// + /wANiy8EH4M7ryFyNv8fgzr/b7uD/6/au/+i0bD/mM2m/5TLo/+QyKD/kcig/5LJof+FwpX/c7mG/2Ox + eP9Tqmr/Uqlo/1uucv9jsnn/aLV+/2q1ff9isXj/XK5x/1arbf9SqWr/Tqdm/0ulZP9Jp2L/QaJd/y2G + Rv8ndTv/III6ug2MLxD///8A////AP///wD///8A////AP///wD///8ALIND/iyJRv87l1b/GG0u/xVt + LP8QeS2zDo4wIBuVPAUfgTqzHm80/yqHQv+e0qv/rNa4/5/PrP+YzKX/l8yl/5jNpv+UyqP/Z7R8/zme + Vf8llEP/KZZG/yuXSP8tmEr/LZhK/y2YSv8sl0n/K5dI/yuWSf9Co13/WK1u/1arbf9PqGf/SqVj/0ak + X/9Colz/P6JZ/z2jWP8ujUn/JnM7/x5/OccAhSQE////AP///wD///8A////AP///wD///8AK4FC/TKI + Sf/y/vT/f8OR/xt9Nv8Zai//JXU8+yuCQ9MdazL/J4dD/6TWsv+q1rb/nM2q/5nNpv+azqj/mM2n/1es + b/8nlET/KpZH/zCZTP8zm0//NJtQ/zSbUP80m1D/NJtQ/zSbUP80m1D/NJtQ/zObT/8xmk3/LphL/z6f + WP9JpWP/R6Vg/0KiXP8+oFj/Op5V/zadUv81n1L/L49K/yVuOf8SfS+W////AP///wD///8A////AP// + /wD///8AKn9B/SyDRf/f8+T/y+fS/8Hjyv9XrG7/FXQw/xNiKP8phkL/p9az/6rWtv+dz6r/nM6p/57Q + q/9+wJH/MplP/yuXSP8xmk7/NJtQ/zScUP81nVH/NZ5R/zagU/82olP/NqNU/zajVP82olP/NqBS/zWe + Uf80nFD/M5tP/zKaTv8zm1D/QKFb/z+hWf86nlX/NZxS/zObT/80nFD/NqBT/yyERP8XaC7/CH0mXf// + /wD///8A////AP///wD///8AKn1A/C6DRf/V7t3/udzD/7vexf/B4sr/oNOu/0OhXP+k1rL/qta2/53P + qv+czqr/otGv/1etb/8mlET/L5lM/zObT/80nFD/NZ1R/zagU/80nVH/MJFK/yuAQ/8lbzn/I2k2/yVu + OP8mdDv/Kn5B/zGVTf82olT/NZ9S/zScUP8zm0//MppO/zufVv83nFL/M5tP/zSbUP80m1D/NZ1R/zWg + Uv8mdT3/GW0w+QmEKy7///8A////AP///wD///8AKXxA+zGCSP/Q7Nj/tNq//7DYu/+v17r/sdi6/67W + uf+m1LP/nc+q/53Oqv+f0K3/Tahm/ymWRv8xmk7/NJtQ/zScUP81n1L/NZ5R/yp8QP8hZDP/Imc1/xlw + MfkOcSq/Am4gmgFrHrEObijIGW0w+iBlNP8lcDr/L49K/zahU/81nVH/NJtQ/zObUP8zm1D/NJtQ/zSb + UP80m1D/NJtQ/zWeUf80nVH/JGw3/xtzM+MOjjAP////AP///wD///8AKXo/+zGBSf/L6tX/sNi7/63W + uP+p1LT/pdKx/6HQrv+dzqr/ns6r/57Oq/9GpF//KpZH/zKaTv80nFD/NZ1R/zahU/8xlEz/Imo2/xdk + LP0Sei2dDYsvQACHJQb///8A////AP///wD///8AAIglEhN/MHYZbzDfIWEz/yuBQv81oVL/NZ5R/zSc + UP80m1D/NJtQ/zSbUP80m1D/NJxQ/zWdUf83pFX/MJFK/yJkNP8ceDW8AIMjAf///wD///8AKHg++jWC + Sf/I6NH/rda4/6nUtP+l0rH/odCu/53Oqv+bzan/otCu/0+nZ/8qlkf/MptP/zSbUP81nlH/NZ9S/yp/ + Qf8gYDL/GnEy5gqELD////8A////AP///wD///8A////AP///wD///8A////AP///wAAiCUHEHQsqBRc + J/8mcjr/NJ1R/zWeUf80m1D/NJtQ/zSbUP80nFH/Np9S/zWhU/8shET/IGMy/xdmLPoReC2BAHwXBP// + /wD///8AJ3c9+jaBSv/D587/qdW1/6XTsv+h0K7/nc6q/5rMqP+ezqv/cLmE/yeVRf8ymk7/NJtQ/zSb + UP81nlH/J3Q7/x9cL/8ndTz9KZtHTv///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AAZ2I3MUYCj9JG45/zWiU/81nVH/NJxQ/zWeUv83olT/MJJL/yNnNf8SWSb/DXApvgCB + ISL///8A////AP///wD///8AJ3U8+jd/S/++5Mj/pdOy/6HRrv+dz6v/mc6n/5zNqP+KxZr/KJVF/zCZ + Tf80m1D/NJtQ/zSbUP81nVH/NqJU/y2JRv8gYDL/E1om/w9wKbUBiiYg////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wAEdSRvEVYj/yt+Qf83o1T/NqJT/zSeUf8mdDv/HVgt/xlq + LusHfSdW////AP///wD///8A////AP///wD///8AJnM7+Th+TP+54sX/odGu/53Pq/+Zzaf/mc2o/5vM + qP80m1D/LphL/zSbUP80m1D/NJtQ/zSbUP80m1D/NZ1R/zagUv82olP/KX1A/x1ZLv8VYCn7EHcsjgCG + JAv///8A////AP///wD///8A////AP///wD///8A////AP///wD///8ADm8osBxVLf8xkkv/LYZF/x9a + Lv8TWyf9EXUslACJJQv///8A////AP///wD///8A////AP///wD///8AJnI7+Dl+S/+04MD/nc+r/5nN + p/+Xzab/nc+r/0ynZP8rl0j/M5tP/zSbUP80m1D/NJtQ/zSbUP80m1D/NJtQ/zScUP82oVP/OalY/y+P + Sf8eWC3/D1Ag/wRzIqgAdAoB////AP///wD///8A////AP///wD///8A////AP///wD///8AAYkmDBdo + LeIdVCv/HFYt/xltMM0Khywu////AP///wD///8A////AP///wD///8A////AABiEiErgkOkJXA6+Dp8 + Sv+x3r3/ms2o/5bMpf+azqj/a7Z//yiVRv8ymk7/NJtQ/zSbUP80m1D/NJtQ/zSbUP80nFD/NZ5R/zei + VP80m0//JGs2/xpQKP8YZy7lB30oUv///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AAiAKC4JYSDnFH4waACIJQH///8A////AP///wD///8A////AP///wAAaBUID3MphBx3 + Nfgqf0HyJW859zp7S/+s3Ln/lsul/5fLpf+Mx5v/JpVF/zCaTf80m1D/NJtQ/zSbUP80m1D/NJtQ/zWd + Uf82oVP/NaFT/yd3Pv8ZTCf/E1km+BF4LYABiSYG////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wAAfhgC////AP///wD///8A////AP///wD///8A////AABp + GlUUdC7kL4BG/yV5O/8pfEDzJG049jp5TP+n2rb/k8qi/5nNqP9JpmL/LZhK/zSbUP80m1D/NJtQ/zSb + UP80nFH/NqBS/zimVv8rhET/G1Eq/w9NIP4NaiasAYsnGP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wAAYxEpB24jvglsJP9fk2//grSQ/yN6PP8oeT70JGs39jl3Sv+j2LH/k8qj/4PCk/8mlET/MppO/zSb + UP80m1D/NJxQ/zWfUv83pVX/MJFL/x5aLf8YSSb/FmYs0guGLDf///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8AAGIQDQxxJpAPcSn8LHtB/5a1nv/a69//OaVX/yR3Ov8ndj30I2o29Tp2S/+f1q//lsuk/0Cg + Wv8umEv/NJtQ/zScUP81nlH/N6NU/zSdUf8jZjX/FUIh/xJaJu8TfjBkAYkmAf///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wAAahxiE3Mt6xdyMf9jmHL/v9fH/9Hs1/+Lx5v/JppG/yZ0PP8mczv2I2k28jt2 + TP+g2K//eL2K/yiVRf8zm0//NZ1R/zahU/83o1P/J3c9/xZFI/8PUCH8DnIpkQGLJwv///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8AAGcTNAlvJcgKbCX/N4FL/6jFr//J6NH/vuLH/8Piy/8xmk7/MJ9O/yZz + O/8lcDn3I2o28j12Tf+i2bL/OJxU/y+aTP82oFL/OKZV/y2GRf8ZTij/C0Ub/wplJLwAhSMi////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AABhERMNciidEHAr/RxzM/94p4X/y+XQ/8Diyf+z277/ttvA/36/ + j/8llEP/NqJT/yVvOf8kbTj3I2o28UF3Uf96xI//KplI/zakVP8xlk3/Hlwv/xZEI/8VYireCH8pR/// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wAAhyQCD3MqbhZ0L/EWci//SYta/7jVwf/I59H/t93C/63Y + uv+t1rf/r9e5/yyYSP8vmUz/N6NU/yRtOP8jajb4I2o38El9Vf9Cr1//MZ1P/yRrN/8WQiH/Elck9RF5 + LXUBiiYD////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AAFrHj8YdTHSG3Qz/yN2Of+Qu5z/zerU/7zf + xf+v2Lr/qtW2/6XTs/+s1bj/ZLJ5/ymWRv8zm1D/N6RU/yNrN/8iZzX5I2o27zBzQf8ngED/F0ck/w5L + Hv0NbCaiAYwnEv///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wAAYhIbDXEpqRJwLP4Vby7/XJtt/8fj + z//B48z/tNu//6vVtv+m07L/odGu/6LRr/+bzqn/JpRD/zCaTf80m1D/N6RV/yNnNv8hYzP5I2o37xdI + JP8LRBv/CWEhygCDIi7///8A////AP///wD///8A////AP///wD///8AAHoVAv///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8AAFcMBRB1K3sYdDD2GnMy/y5/ + Rf+pzrP/yOfQ/7jdwv+u17n/qNS0/6PRsP+ez6v/ms6o/6HQrf9LpmX/LJdJ/zSbUP80m1D/N6VV/yJl + M/8gYDH5JGs37xRfKOkHeiVZ////AP///wD///8A////AP///wD///8A////AP///wALhy1NGY453QqD + Kkv///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wACbR9LHHk23iF5 + Of8aczL/da+F/8zp1P+94Mf/r9m7/6nUtP+l0rH/oNCt/5vNqf+Wy6X/l8yl/3/Akf8mlET/MppO/zSb + UP80m1D/OKVV/yBiMv8fXTD6MI9KbgCIJQj///8A////AP///wD///8A////AP///wD///8AAIEhHhiO + OLAhkj//L5ZK/yGNPvAJgSkg////AP///wD///8A////AP///wD///8A////AP///wD///8A////AABj + EYobdzT/KXw//zOCSP/L6dT/zuzW/7bcwf+q1bb/pdOy/6HQrv+czqn/mMym/5PKov+QyKD/lsqk/zac + Uv8vmUv/NJtQ/zSbUP80m1D/OKZV/x9fMf8eWi77////AP///wD///8A////AP///wD///8A////AACB + IQQZjjl1IZI/9x+NPP8wlEz/Xaxy/yCKPf8giD3MAIMjBv///wD///8A////AP///wD///8A////AP// + /wD///8A////AABDAAQNbyh2GXEx8h1wNP80fUj/mcWl/7jgw/+o1rX/ntCs/5nMp/+UyqP/j8ie/4zG + nP+Nxp3/YrJ4/yqWR/8zm0//NJtQ/zSbUP80m1D/OKZW/x9dMP8dVy37////AP///wD///8A////AP// + /wD///8AC4gtOySUQtMlkkP/E4c0/4fCl////////////y2RSP8jhj7/E30wmP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8AAFsNFQlmI6IQZCf9E2Uq/0uGWv+cy6j/ndOt/5LJ + of+Mxpz/h8SY/4XClf+EwpT/K5dJ/zGaTf80m1D/NJtQ/zSbUP80m1D/OKdW/x5aLv8dVy38////AP// + /wD///8A////AACBIRMZjjmcI5JC/h+NPv9RpGb/8vn1///////8/v3//////9fs3f8UfS//GHwz/xB3 + LJAAhiQC////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wAacTM7IWw19BNg + KP8RViT/f7KO/4rFmv+EwpX/gMGS/4HBlP9LpmT/LZhK/zSbUP80m1D/NJtQ/zSbUP80m1D/OKdW/x5a + L/8dViz8////AP///wD///8AAIEhYyWUQ+4zmE7/MJVM/0aiYP////////////L49P/r9e7/6vTs//X6 + 9v+t1bn/GX00/yF9Ov8deja/AGgcE////wD///8A////AP///wD///8A////AP///wD///8A////AABf + GTEUZSvXGmMt/yNoNf93s4n/jsyf/4LDk/98vo7/e76O/222gf8qlkf/MptP/zSbUP80m1D/NJtQ/zSb + UP80m1D/OKZW/x5cL/8dViz8////AP///wD///8ACoMqjTKXTv8ylk3/M5xQ/x+RPv+UyqP//////+z2 + 7v/j8ef/3+/j/97u4v/m9Or/v+HI/yGBO/8ddjX/GHQx6g1vKIgAYRAe////AP///wD///8A////AAA7 + AAMAXxdBCWEhlRBdJfsUXCn/RoNW/5TOpP+LyJv/f8CR/3m9i/93u4n/crqH/zKaTv8wmk3/NJtQ/zSb + UP80m1D/NJtQ/zSbUP80m1D/OKZW/x5cL/8dViz9////AP///wD///8AAIIiBSOMQMkxkUv/MpZN/y6a + S/8ckDz/u97E//P69P/f7+P/1+vc/9Lp2P/P59b/1ezc/8no0f9RmmT/Emss/xtvMv8Vayv9C2Qi0ABb + F7gAXBWkCWMhuxRkKfUdZTH/Fl4p/x5hMP9xq4D/kc+i/4LDlf96vYz/dbuI/3O6hf9zuYb/PZ9Y/y+Z + TP80m1D/NZ1R/zWeUf81nlH/NJxQ/zSbUP80m1D/OKZW/x5cL/8dViz9////AP///wD///8A////AAZ6 + JyEihz7yLoxI/zKZT/8smUr/G446/6PRsP/o8+r/1OrZ/8rl0f/F4s3/weDK/8TjzP/L6NL/stq+/0+b + ZP8fcDT/Dl8l/xFgJ/8TXyf/EFwl/xdiLP89gU7/bqh9/47Hn/+HyJr/fcCP/3a7if9yuYX/b7iC/262 + gv9Lp2X/LphL/zObT/81nlL/NqNT/yl8P/81oVL/NqJU/zWeUf80nFD/OKZW/x5cLv8dViz9////AP// + /wD///8A////AP///wAFdSNVIIE6/y2JRf80nFH/LppL/x2QPP+EwpX/2+3g/8vm0f+/38f/uNzC/7Ta + vv+y2b3/stm8/7XdwP+44cP/sNu8/5TKov+CvJH/lMej/57Wrv+Tz6T/iciZ/3/BkP95vYz/c7qG/264 + gv9stn//a7Z//0akX/8umEv/M5tP/zWeUv82pFT/JGo2/xdIJf8aTyn/K39B/zekVf82oVP/OKhX/x5c + MP8dViz+////AP///wD///8A////AP///wD///8AEXgtmSuDRP8shkX/NJ1R/zCbTf8jk0L/QqFc/7fc + wf/E4cv/tdu//63XuP+n07P/o9Gw/57Pq/+Zzaf/l8ul/5TLov+Pyp//iMWa/4PClP9+v4//eb2L/3S6 + h/9vuIP/bLaB/2m2ff9ntH3/P6Ba/y6ZS/8zm0//NZ9S/zalVP8kajf/GUwn/x1XLOkbUyr5GEwn/x1X + Lf8vjEj/O7Bb/x9gMv8cViz+////AP///wD///8A////AP///wD///8AAF0OBh17NrEqfED/K4BB/zOb + UP8znVD/KpdI/yKSQv9rt4D/r9i6/7HZu/+k0bD/m86p/5bLpf+RyaD/jcac/4jEmP+DwpT/fr+Q/3q9 + jP92u4j/cbmE/222gP9ptX7/Z7V8/1etb/81m1H/MJlM/zObT/82n1L/N6RV/yJqNf8ZTCf/Dk0g3Qdb + HRkAUBEgAksVtwxEG/4YSyb/I2o2/yBdMP8cViz+////AP///wD///8A////AP///wD///8A////AACH + JAEMbCibGnEy/yl4Pf8ymU7/NZ9S/zCaTf8plkb/I5JB/1mucf+Xy6X/odGu/5fMpv+PyJ//iMWZ/4HA + kv97vo3/druJ/3O5iP9xuIX/breB/2u1f/9brnH/Op1U/y6YSv8xmk7/NJ1R/zaiU/80nVH/IWQz/xlM + J/8QTyDYAFERFP///wD///8A////AABDAkQBRRLXC0cc/xtTKv8cViz/////AP///wD///8A////AP// + /wD///8A////AP///wD///8AAGQaghdrL/4lcjr/L4pI/zWhUv81n1L/MZtO/yuXSf8klEP/MZlO/1Gp + aP9rtn//er6L/3q+jP97vo3/eL6L/2u1f/9YrG//R6Rg/zmeU/8tmEr/MZpN/zScUP81n1L/OKVV/yyG + Rf8aUCn/CkQa/wFGFM0ARAEQ////AP///wD///8A////AP///wD///8AAEkNbg9OH+4cViz/////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AABfF2kWZy36I2o3/yVxOv8wkkv/N6NU/zWf + Uv80nFD/MZpO/y6YS/8qlkj/KJVG/yiVRv8olUb/KZZG/yuXSP8tmEr/MJlM/zKaTv80nFD/NqBS/zel + Vf81n1D/ImY0/xhLJv8MRxz6AEMKhf///wD///8A////AP///wD///8A////AP///wD///8A////AAA/ + AAwhYzOZ////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wAAVAkjCV0ftRRd + J/4gYTL/J3U9/zGVTP82pVT/N6NU/zagUv81nVH/NJxQ/zSbUP80m1D/NJtQ/zScUP81nlH/NqBS/zej + VP84qFb/L49J/yJmNP8ZSSX/GVAp/xBRIdYATA0v////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AABWE0YTWyfWHlsw/x5aLv8fWy//JnE7/y2KSP82oVP/OalX/zioV/84qFb/OKhX/zeo + Vv8zmk//LolG/yh3Pf8dVSz/GEom/wpEGv8AQhHjAEoMgAAYAAL///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wACjSgBAE8PYwRSGrcQUSH1G1Qr/xpQKf8YSyb/GEkm/xpN + J/8bUyr/HVgt/xhKJv8XSSX/GEom/xhNJ/8MRhz9AUoWwABCAVL///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wAndDwEI2o2TyFi + MqUfXTDRHlsv3R5aLucdWC3xHVgt+B5bL+EgXzG+IWMzlCJmNGQjaTYc////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A///AAf// + AAD//wAAf/8AAP/8AAAP/wAA//AAAAf/AAA/4AAAA/8AAA+AAAAA/wAABwAAAAB/AAAAAAAAAD8AAAAA + AAAAPwAAAAAAAAAfAAAAAAAAAA8AAAAAAAAABwAAAAAB4AADAAAAAA/4AAMAAAAAH/4ADwAAAAAH/wA/ + AAAAAAH/gH8AAAAAAP+B/AAAAAAD/8PwAAAAAAf/7+AAAAAAH///gAAAAAB///4AAAAAAP///AAAAAAD + ///wAAAAAA///8AAAAAAP///AAAAAAB///4AAAAAAf//+AAAAAAH9//gAAAAAB/j/8AAAAAAP4H/gAAA + AAD+AP+AAAAAAPwA/+AAAAAA8AA/+AAAAADgAB/wAAAAAOAAB4AAAAAA4AAAAAAAAADwAAAAAAAAAPgA + AAAAAAAA/AAAAAAAAAD8AAAAAAAAAP4AAAAA4AAA/4AAAAH4AAD/wAAAB/wAAP/gAAAP/wAA//gAAB// + AAD//AAA//8AAP//gAP//wAAKAAAABAAAAAgAAAAAQAgAAAAAAAABAAAEgsAABILAAAAAAAAAAAAAP// + /wD///8A////AP///wA0m1AIMpJMbDOTTt0/mlj4Qpta+TuYVPUyk0zDMJFLIv///wD///8A////AP// + /wAvjEhW////AP///wAAbhkgJIU99Hu4jP+q17b/sdq8/6DRrv+PyZ//cbmF/zOPTf4FeCSi////AP// + /wD///8AQpFY/BB3K+4AbRp8LodG/MHgyf+j1LH/abZ+/0KkW/9BpFz/Wa9w/2W0ev9fsXX/NJVP/wZ0 + I83///8A////AGamd/3h9ef/cbCC/8rn0v9+wpD/I5ZD/yaNQf8mgT77J4FA+yeJQv8smUr/R6dh/0Kk + XP8giDz/AG0alP///wBionP91O3b/77fx/9otn7/JZVD/yV7PP4vhUahKZxJChuVPAQLaSU/G3Qz+DOf + Uf81oVL/IIU8/wJoHd7///8AX51w/cbn0P+ZzKf/I5JB/zKdT/8yl03/KHU8+Q1qJkz///8A////AABi + GiYccjP6Kn1B+R54N3j///8ALIVFFlqZa/3B5cr/O59W/y6bS/81n1H/G3Uz/RBtKb4AZwwK////AP// + /wD///8AAGEYJCCIPAsMXCIEKotEpTKDR/hVlGb9fseR/ymcSP8bdjT/DGIi5ABbDSH///8A////AP// + /wD///8A////AP///wARfS5ZU5Zk96zTtv8sg0T8SY5c/SyOSP8hbDb1GmwwVP///wD///8A////AP// + /wD///8A////AABfCSEQdCvjfrCL/9Lr2f9Wsm//Kn5B/SVuOfYabDGZJptFASOXQwgIiCsg////AP// + /wD///8AAF8HCA14KbdUmWf+weDL/7new/+MyJz/JppF/yl4Pv00m1AM////ABqTO2BLpGP4OplV+wB0 + GS7///8A////AA1uJ0A2hUv4nsiq/6vZt/+WzKX/NpxS/zGgT/8nczv9////AAqHLM9IoWD///////3/ + /v8efzb6AGYaTAFeGgkRaykKGHIwmjR3Rv6Mx5z/V65u/yyYSf83pVT/JnI7/f///wAAeR5jDn8s/ozJ + nf/t+PD/zufV/3ywi/9Bh1T9Sodb/XCqf/+Myp7/XrV1/yudSv8pfj//N6ZW/yZyO/3///8A////AAJy + IIgPeyv/QKRb/5jQqP+y3L3/otWx/5DNoP9zvof/TKtk/yycS/8SXCb9B1QbjghYHfAgYjL9////AP// + /wD///8ABGwfoBRwLfshij7/KZxJ/zmkVf85pFf/K5tJ/ymFQf8TWyX4AEgNNP///wD///8AImU0Zv// + /wD///8A////AP///wAlcDoLKXY+mSdyO/Umcjv7JnE7+ydwO+cmbzqHI2k2EP///wD///8A////AP// + /wDwDwAAYAcAAAADAAAAAQAAAAEAAADCAAAA4AAAA/AAAA/AAAAHAAAAQwAAAIAAAACAAAAAwAAAAOAG + AADwDwAA + + + \ No newline at end of file diff --git a/UpdateLib/UpdateLib/UI/UIExtensions.cs b/UpdateLib/UpdateLib/UI/UIExtensions.cs new file mode 100644 index 0000000..56b18c7 --- /dev/null +++ b/UpdateLib/UpdateLib/UI/UIExtensions.cs @@ -0,0 +1,43 @@ +/* UpdateLib - .Net auto update library + * Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using System; +using System.ComponentModel; + +namespace MatthiWare.UpdateLib.UI +{ + public static class UIExtensions + { + public static void InvokeOnUI(this T control, Action action) where T : ISynchronizeInvoke + { + if (control != null && control.InvokeRequired) + control.Invoke(action, null); + else + action(); + + } + + public static TResult InvokeOnUI(this T control, Func action) where T : ISynchronizeInvoke + { + if (control != null && control.InvokeRequired) + return (TResult)control.Invoke(action, null); + else + return action(); + } + + } +} diff --git a/UpdateLib/UpdateLib/UI/UpdaterForm.Designer.cs b/UpdateLib/UpdateLib/UI/UpdaterForm.Designer.cs new file mode 100644 index 0000000..81839a8 --- /dev/null +++ b/UpdateLib/UpdateLib/UI/UpdaterForm.Designer.cs @@ -0,0 +1,167 @@ +namespace MatthiWare.UpdateLib.UI +{ + partial class UpdaterForm + { + /// + /// 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() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(UpdaterForm)); + this.pnlSide = new System.Windows.Forms.Panel(); + this.label1 = new System.Windows.Forms.Label(); + this.pnlBottom = new System.Windows.Forms.Panel(); + this.btnPrevious = new System.Windows.Forms.Button(); + this.btnNext = new System.Windows.Forms.Button(); + this.btnCancel = new System.Windows.Forms.Button(); + this.pnlContent = new System.Windows.Forms.Panel(); + this.linkSite = new System.Windows.Forms.LinkLabel(); + this.pnlSide.SuspendLayout(); + this.pnlBottom.SuspendLayout(); + this.SuspendLayout(); + // + // pnlSide + // + this.pnlSide.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(43)))), ((int)(((byte)(129)))), ((int)(((byte)(181))))); + this.pnlSide.Controls.Add(this.label1); + this.pnlSide.Dock = System.Windows.Forms.DockStyle.Left; + this.pnlSide.Location = new System.Drawing.Point(0, 0); + this.pnlSide.Name = "pnlSide"; + this.pnlSide.Size = new System.Drawing.Size(149, 376); + this.pnlSide.TabIndex = 0; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Font = new System.Drawing.Font("Segoe UI Semibold", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label1.ForeColor = System.Drawing.SystemColors.Window; + this.label1.Location = new System.Drawing.Point(12, 23); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(115, 21); + this.label1.TabIndex = 0; + this.label1.Text = "Update wizard"; + // + // pnlBottom + // + this.pnlBottom.BackColor = System.Drawing.SystemColors.Control; + this.pnlBottom.Controls.Add(this.linkSite); + this.pnlBottom.Controls.Add(this.btnPrevious); + this.pnlBottom.Controls.Add(this.btnNext); + this.pnlBottom.Controls.Add(this.btnCancel); + this.pnlBottom.Dock = System.Windows.Forms.DockStyle.Bottom; + this.pnlBottom.Location = new System.Drawing.Point(149, 329); + this.pnlBottom.Name = "pnlBottom"; + this.pnlBottom.Size = new System.Drawing.Size(536, 47); + this.pnlBottom.TabIndex = 1; + // + // btnPrevious + // + this.btnPrevious.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnPrevious.Enabled = false; + this.btnPrevious.Location = new System.Drawing.Point(287, 13); + this.btnPrevious.Name = "btnPrevious"; + this.btnPrevious.Size = new System.Drawing.Size(75, 23); + this.btnPrevious.TabIndex = 1; + this.btnPrevious.Text = "< Previous"; + this.btnPrevious.UseVisualStyleBackColor = true; + this.btnPrevious.Click += new System.EventHandler(this.btnPrevious_Click); + // + // btnNext + // + this.btnNext.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnNext.Location = new System.Drawing.Point(368, 13); + this.btnNext.Name = "btnNext"; + this.btnNext.Size = new System.Drawing.Size(75, 23); + this.btnNext.TabIndex = 0; + this.btnNext.Text = "Next >"; + this.btnNext.UseVisualStyleBackColor = true; + this.btnNext.Click += new System.EventHandler(this.btnNext_Click); + // + // btnCancel + // + this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnCancel.Location = new System.Drawing.Point(449, 13); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size(75, 23); + this.btnCancel.TabIndex = 2; + this.btnCancel.Text = "Cancel"; + this.btnCancel.UseVisualStyleBackColor = true; + this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); + // + // pnlContent + // + this.pnlContent.Dock = System.Windows.Forms.DockStyle.Fill; + this.pnlContent.Location = new System.Drawing.Point(149, 0); + this.pnlContent.Name = "pnlContent"; + this.pnlContent.Size = new System.Drawing.Size(536, 329); + this.pnlContent.TabIndex = 2; + // + // linkSite + // + this.linkSite.AutoSize = true; + this.linkSite.Font = new System.Drawing.Font("Segoe UI Semibold", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.linkSite.LinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(43)))), ((int)(((byte)(129)))), ((int)(((byte)(181))))); + this.linkSite.Location = new System.Drawing.Point(6, 17); + this.linkSite.Name = "linkSite"; + this.linkSite.Size = new System.Drawing.Size(126, 15); + this.linkSite.TabIndex = 3; + this.linkSite.TabStop = true; + this.linkSite.Text = "Powered by UpdateLib"; + this.linkSite.VisitedLinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(43)))), ((int)(((byte)(129)))), ((int)(((byte)(181))))); + this.linkSite.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LinkSite_LinkClicked); + // + // UpdaterForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.SystemColors.Window; + this.ClientSize = new System.Drawing.Size(685, 376); + this.Controls.Add(this.pnlContent); + this.Controls.Add(this.pnlBottom); + this.Controls.Add(this.pnlSide); + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.Name = "UpdaterForm"; + this.Text = "Updater"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.UpdaterForm_FormClosing); + this.pnlSide.ResumeLayout(false); + this.pnlSide.PerformLayout(); + this.pnlBottom.ResumeLayout(false); + this.pnlBottom.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Panel pnlSide; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Panel pnlBottom; + private System.Windows.Forms.Button btnPrevious; + private System.Windows.Forms.Button btnNext; + private System.Windows.Forms.Button btnCancel; + private System.Windows.Forms.Panel pnlContent; + private System.Windows.Forms.LinkLabel linkSite; + } +} \ No newline at end of file diff --git a/UpdateLib/UpdateLib/UI/UpdaterForm.cs b/UpdateLib/UpdateLib/UI/UpdaterForm.cs new file mode 100644 index 0000000..0f76d9e --- /dev/null +++ b/UpdateLib/UpdateLib/UI/UpdaterForm.cs @@ -0,0 +1,258 @@ +/* UpdateLib - .Net auto update library + * Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using System; +using System.Diagnostics; +using System.Drawing; +using System.Windows.Forms; +using MatthiWare.UpdateLib.Common; +using MatthiWare.UpdateLib.Files; +using MatthiWare.UpdateLib.UI.Components; + +namespace MatthiWare.UpdateLib.UI +{ + public partial class UpdaterForm : Form + { + public UpdateInfo UpdateInfo { get; internal set; } + public string ApplicationName { get; internal set; } + public bool NeedsRestart { get; internal set; } = true; + public bool HasHadErrors { get; internal set; } = false; + public bool UserCancelled { get; internal set; } = false; + + private WizardPageCollection pages; + + public UpdaterForm(UpdateInfo updateInfo, string appName) + { + InitializeComponent(); + + UpdateInfo = updateInfo ?? throw new ArgumentException(nameof(UpdateInfo)); + ApplicationName = string.IsNullOrEmpty(appName) ? throw new ArgumentException(nameof(appName)) : appName; + + pages = new WizardPageCollection(); + AddPage(new IntroPage(this)); + AddPage(new ChangelogPage(this)); + AddPage(new UpdatePage(this)); + AddPage(new FinishPage(this)); + + SetContentPage(pages.FirstPage); + } + + private void SetContentPage(IWizardPage page) + { + page.PageEntered(); + + for (int i = pnlContent.Controls.Count - 1; i >= 0; i--) + { + IWizardPage item = pnlContent.Controls[i] as IWizardPage; + if (item == null) + continue; + + pnlContent.Controls.RemoveAt(i); + } + + pnlContent.Controls.Add(page.Conent); + } + + private void AddPage(IWizardPage page) + { + page.PageUpdate += Page_PageUpdate; + pages.Add(page); + } + + private void Page_PageUpdate(object sender, EventArgs e) + { + + IWizardPage page = (IWizardPage)sender; + OnPageUpdate(page); + } + + delegate void _OnPageUpdate(IWizardPage page); + private void OnPageUpdate(IWizardPage page) + { + this.InvokeOnUI(() => + { + if (page.IsDone && !page.IsBusy) + { + btnNext.Enabled = true; + if (page == pages.CurrentPage) + btnNext.Focus(); + if (page.NeedsExecution) + btnNext.Text = "Next >"; + } + + if (page.HasErrors && page.NeedsRollBack) + { + HasHadErrors = true; + btnNext.Enabled = true; + btnPrevious.Enabled = false; + btnCancel.Enabled = false; + btnNext.Text = "Rollback"; + } + + if (!pages.CurrentPage.HasErrors && pages.CurrentPage.NeedsRollBack && HasHadErrors) + foreach (IWizardPage wp in pages) + wp.UpdateState(); + + if (pages.AllDone()) + btnCancel.Enabled = false; + + }); + } + + private void btnPrevious_Click(object sender, EventArgs e) + { + IWizardPage currentPage = pages.CurrentPage; + IWizardPage page = pages.Previous(); + + if (page == null) + return; + + if (!btnNext.Enabled) + btnNext.Enabled = true; + + if (page.NeedsExecution) + btnNext.Text = "Next >"; + + if (page == pages.FirstPage) + btnPrevious.Enabled = false; + + SetContentPage(page); + } + + private void btnNext_Click(object sender, EventArgs e) + { + if (pages.CurrentPage.HasErrors && pages.CurrentPage.NeedsRollBack) + { + btnNext.Enabled = false; + pages.CurrentPage.Rollback(); + return; + } + + if (pages.CurrentPage.NeedsExecution && !pages.CurrentPage.IsDone) + { + pages.CurrentPage.Execute(); + btnNext.Enabled = false; + return; + } + + if (pages.CurrentPage == pages.LastPage && pages.CurrentPage.IsDone) + { + ExitUpdater(); + return; + } + + IWizardPage page = pages.Next(); + if (page == null) + return; + + if (!btnPrevious.Enabled) + btnPrevious.Enabled = true; + + if (page.NeedsExecution && !page.IsDone) + btnNext.Text = "Update"; + + if (page.NeedsExecution && !page.IsDone && page.IsBusy) + btnNext.Enabled = false; + + if (page.HasErrors && page.NeedsRollBack) + btnNext.Text = "Rollback"; + + if (page == pages.LastPage) + { + btnNext.Text = "Finish"; + btnCancel.Enabled = false; + } + + + SetContentPage(page); + + } + + private void ExitUpdater() + { + Updater.Instance.GetCache2().Save(); + + if (NeedsRestart) + { + Updater.Instance.RestartApp(); + } + else + { + pages.Clear(); + FinishPage page = new FinishPage(this); + page.UpdateState(); + pages.Add(page); + SetContentPage(page); + btnPrevious.Enabled = false; + btnCancel.Enabled = false; + Close(); + } + } + + private void btnCancel_Click(object sender, EventArgs e) + { + Cancel(); + } + + private void Cancel() + { + bool cancelled = MessageDialog.Show( + this, + "Cancel", + "Cancel updating?", + "Press Yes to cancel the updating process.\nPress No to keep updating.", + SystemIcons.Exclamation) == DialogResult.Yes; + + if (cancelled) + UserCancelled = true; + + if (!cancelled) + return; + + foreach (IWizardPage page in pages) + { + page.Cancel(); + page.UpdateState(); + } + + pages.CurrentPage = pages.LastPage; + SetContentPage(pages.CurrentPage); + + btnNext.Text = "Finish"; + btnPrevious.Enabled = true; + + OnPageUpdate(pages.CurrentPage); + + } + + private void UpdaterForm_FormClosing(object sender, FormClosingEventArgs e) + { + if (pages.AllDone()) + return; + + Cancel(); + + if (e.CloseReason == CloseReason.UserClosing || e.CloseReason == CloseReason.None) + e.Cancel = true; + } + + private void LinkSite_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + { + Process.Start("https://github.com/MatthiWare/UpdateLib"); + } + } +} diff --git a/UpdateLib/UpdateLib/UI/UpdaterForm.resx b/UpdateLib/UpdateLib/UI/UpdaterForm.resx new file mode 100644 index 0000000..9fe1da0 --- /dev/null +++ b/UpdateLib/UpdateLib/UI/UpdaterForm.resx @@ -0,0 +1,306 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + AAABAAIAMDAAAAEAIACoJQAAJgAAABAQAAABACAAaAQAAM4lAAAoAAAAMAAAAGAAAAABACAAAAAAAAAk + AAASCwAAEgsAAAAAAAAAAAAA////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8ANJtQDDOYTkgxlEx2MZJLojCQSs0wkEr0MJBK4zCR + SsswkUuyMZJLmTGTTIAylk1fNJtQDP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AACEIy0UgTKaIIM89iuDQv8pgkD/JoI//yWF + QP8liUD/JYdA/yWHQP8mhED/JoI//yiBP/8qg0H/IIM89hSDM5kAhCMs////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wAAfB9RE30xxxt7Nv8kfjz/IYU8/yWP + Q/88oFb/VKxs/2e2ff9yvIf/abZ+/2K0ev9asXL/VK1t/02pZv82mFH/JYZA/yZ/Pf8bezb/En0wxwqD + K1sAgyMG////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8AAIUjFBN/Ma4ZdzT/In06/x6G + Ov9MqGP/iMaZ/6XUsv+cz6r/lMuk/43Hnf+JxJn/hMKU/4DAkv99vo3/ebyL/3a7if90u4f/abd//0+p + Zf8zkE3/JX49/yd8Pv8ggzrTDYsvIf///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8AMZRMiwCEIw7///8A////AP///wD///8A////AP///wD///8A////AP///wAJgClUHX037iF3 + OP8jiT//YrZ6/57Qq/+l07L/mc2n/5DIoP+KxZr/hsOX/4LBk/9+v4//er2M/3a7iP9yuYX/breC/2q1 + fv9ms3v/ZLJ5/2KyeP9hs3f/WrBy/zqYU/8nez7/HXw38wiCKUv///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8ALYZF/x58OO4WhzVpAIUkAv///wD///8A////AP///wD///8AAIQjAxN/ + MaEXci//Hno2/z6eWP+i06//p9Sz/5vNqf+TyaL/jsee/4vFmv+IxJn/hsOW/4PBlf+AwJP/fL6O/3a7 + iv9xuIT/a7Z//2aze/9isXf/Xq90/1qtcP9Wq23/VKps/1Ora/9Colv/J30+/xp1M/0VgjGDAIQjAf// + /wD///8A////AP///wD///8A////AP///wD///8ALIRE/yd3PP8mdjv/HX031AmBKkH///8A////AP// + /wANiy8EH4M7ryFyNv8fgzr/b7uD/6/au/+i0bD/mM2m/5TLo/+QyKD/kcig/5LJof+FwpX/c7mG/2Ox + eP9Tqmr/Uqlo/1uucv9jsnn/aLV+/2q1ff9isXj/XK5x/1arbf9SqWr/Tqdm/0ulZP9Jp2L/QaJd/y2G + Rv8ndTv/III6ug2MLxD///8A////AP///wD///8A////AP///wD///8ALIND/iyJRv87l1b/GG0u/xVt + LP8QeS2zDo4wIBuVPAUfgTqzHm80/yqHQv+e0qv/rNa4/5/PrP+YzKX/l8yl/5jNpv+UyqP/Z7R8/zme + Vf8llEP/KZZG/yuXSP8tmEr/LZhK/y2YSv8sl0n/K5dI/yuWSf9Co13/WK1u/1arbf9PqGf/SqVj/0ak + X/9Colz/P6JZ/z2jWP8ujUn/JnM7/x5/OccAhSQE////AP///wD///8A////AP///wD///8AK4FC/TKI + Sf/y/vT/f8OR/xt9Nv8Zai//JXU8+yuCQ9MdazL/J4dD/6TWsv+q1rb/nM2q/5nNpv+azqj/mM2n/1es + b/8nlET/KpZH/zCZTP8zm0//NJtQ/zSbUP80m1D/NJtQ/zSbUP80m1D/NJtQ/zObT/8xmk3/LphL/z6f + WP9JpWP/R6Vg/0KiXP8+oFj/Op5V/zadUv81n1L/L49K/yVuOf8SfS+W////AP///wD///8A////AP// + /wD///8AKn9B/SyDRf/f8+T/y+fS/8Hjyv9XrG7/FXQw/xNiKP8phkL/p9az/6rWtv+dz6r/nM6p/57Q + q/9+wJH/MplP/yuXSP8xmk7/NJtQ/zScUP81nVH/NZ5R/zagU/82olP/NqNU/zajVP82olP/NqBS/zWe + Uf80nFD/M5tP/zKaTv8zm1D/QKFb/z+hWf86nlX/NZxS/zObT/80nFD/NqBT/yyERP8XaC7/CH0mXf// + /wD///8A////AP///wD///8AKn1A/C6DRf/V7t3/udzD/7vexf/B4sr/oNOu/0OhXP+k1rL/qta2/53P + qv+czqr/otGv/1etb/8mlET/L5lM/zObT/80nFD/NZ1R/zagU/80nVH/MJFK/yuAQ/8lbzn/I2k2/yVu + OP8mdDv/Kn5B/zGVTf82olT/NZ9S/zScUP8zm0//MppO/zufVv83nFL/M5tP/zSbUP80m1D/NZ1R/zWg + Uv8mdT3/GW0w+QmEKy7///8A////AP///wD///8AKXxA+zGCSP/Q7Nj/tNq//7DYu/+v17r/sdi6/67W + uf+m1LP/nc+q/53Oqv+f0K3/Tahm/ymWRv8xmk7/NJtQ/zScUP81n1L/NZ5R/yp8QP8hZDP/Imc1/xlw + MfkOcSq/Am4gmgFrHrEObijIGW0w+iBlNP8lcDr/L49K/zahU/81nVH/NJtQ/zObUP8zm1D/NJtQ/zSb + UP80m1D/NJtQ/zWeUf80nVH/JGw3/xtzM+MOjjAP////AP///wD///8AKXo/+zGBSf/L6tX/sNi7/63W + uP+p1LT/pdKx/6HQrv+dzqr/ns6r/57Oq/9GpF//KpZH/zKaTv80nFD/NZ1R/zahU/8xlEz/Imo2/xdk + LP0Sei2dDYsvQACHJQb///8A////AP///wD///8AAIglEhN/MHYZbzDfIWEz/yuBQv81oVL/NZ5R/zSc + UP80m1D/NJtQ/zSbUP80m1D/NJxQ/zWdUf83pFX/MJFK/yJkNP8ceDW8AIMjAf///wD///8AKHg++jWC + Sf/I6NH/rda4/6nUtP+l0rH/odCu/53Oqv+bzan/otCu/0+nZ/8qlkf/MptP/zSbUP81nlH/NZ9S/yp/ + Qf8gYDL/GnEy5gqELD////8A////AP///wD///8A////AP///wD///8A////AP///wAAiCUHEHQsqBRc + J/8mcjr/NJ1R/zWeUf80m1D/NJtQ/zSbUP80nFH/Np9S/zWhU/8shET/IGMy/xdmLPoReC2BAHwXBP// + /wD///8AJ3c9+jaBSv/D587/qdW1/6XTsv+h0K7/nc6q/5rMqP+ezqv/cLmE/yeVRf8ymk7/NJtQ/zSb + UP81nlH/J3Q7/x9cL/8ndTz9KZtHTv///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AAZ2I3MUYCj9JG45/zWiU/81nVH/NJxQ/zWeUv83olT/MJJL/yNnNf8SWSb/DXApvgCB + ISL///8A////AP///wD///8AJ3U8+jd/S/++5Mj/pdOy/6HRrv+dz6v/mc6n/5zNqP+KxZr/KJVF/zCZ + Tf80m1D/NJtQ/zSbUP81nVH/NqJU/y2JRv8gYDL/E1om/w9wKbUBiiYg////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wAEdSRvEVYj/yt+Qf83o1T/NqJT/zSeUf8mdDv/HVgt/xlq + LusHfSdW////AP///wD///8A////AP///wD///8AJnM7+Th+TP+54sX/odGu/53Pq/+Zzaf/mc2o/5vM + qP80m1D/LphL/zSbUP80m1D/NJtQ/zSbUP80m1D/NZ1R/zagUv82olP/KX1A/x1ZLv8VYCn7EHcsjgCG + JAv///8A////AP///wD///8A////AP///wD///8A////AP///wD///8ADm8osBxVLf8xkkv/LYZF/x9a + Lv8TWyf9EXUslACJJQv///8A////AP///wD///8A////AP///wD///8AJnI7+Dl+S/+04MD/nc+r/5nN + p/+Xzab/nc+r/0ynZP8rl0j/M5tP/zSbUP80m1D/NJtQ/zSbUP80m1D/NJtQ/zScUP82oVP/OalY/y+P + Sf8eWC3/D1Ag/wRzIqgAdAoB////AP///wD///8A////AP///wD///8A////AP///wD///8AAYkmDBdo + LeIdVCv/HFYt/xltMM0Khywu////AP///wD///8A////AP///wD///8A////AABiEiErgkOkJXA6+Dp8 + Sv+x3r3/ms2o/5bMpf+azqj/a7Z//yiVRv8ymk7/NJtQ/zSbUP80m1D/NJtQ/zSbUP80nFD/NZ5R/zei + VP80m0//JGs2/xpQKP8YZy7lB30oUv///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AAiAKC4JYSDnFH4waACIJQH///8A////AP///wD///8A////AP///wAAaBUID3MphBx3 + Nfgqf0HyJW859zp7S/+s3Ln/lsul/5fLpf+Mx5v/JpVF/zCaTf80m1D/NJtQ/zSbUP80m1D/NJtQ/zWd + Uf82oVP/NaFT/yd3Pv8ZTCf/E1km+BF4LYABiSYG////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wAAfhgC////AP///wD///8A////AP///wD///8A////AABp + GlUUdC7kL4BG/yV5O/8pfEDzJG049jp5TP+n2rb/k8qi/5nNqP9JpmL/LZhK/zSbUP80m1D/NJtQ/zSb + UP80nFH/NqBS/zimVv8rhET/G1Eq/w9NIP4NaiasAYsnGP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wAAYxEpB24jvglsJP9fk2//grSQ/yN6PP8oeT70JGs39jl3Sv+j2LH/k8qj/4PCk/8mlET/MppO/zSb + UP80m1D/NJxQ/zWfUv83pVX/MJFL/x5aLf8YSSb/FmYs0guGLDf///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8AAGIQDQxxJpAPcSn8LHtB/5a1nv/a69//OaVX/yR3Ov8ndj30I2o29Tp2S/+f1q//lsuk/0Cg + Wv8umEv/NJtQ/zScUP81nlH/N6NU/zSdUf8jZjX/FUIh/xJaJu8TfjBkAYkmAf///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wAAahxiE3Mt6xdyMf9jmHL/v9fH/9Hs1/+Lx5v/JppG/yZ0PP8mczv2I2k28jt2 + TP+g2K//eL2K/yiVRf8zm0//NZ1R/zahU/83o1P/J3c9/xZFI/8PUCH8DnIpkQGLJwv///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8AAGcTNAlvJcgKbCX/N4FL/6jFr//J6NH/vuLH/8Piy/8xmk7/MJ9O/yZz + O/8lcDn3I2o28j12Tf+i2bL/OJxU/y+aTP82oFL/OKZV/y2GRf8ZTij/C0Ub/wplJLwAhSMi////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AABhERMNciidEHAr/RxzM/94p4X/y+XQ/8Diyf+z277/ttvA/36/ + j/8llEP/NqJT/yVvOf8kbTj3I2o28UF3Uf96xI//KplI/zakVP8xlk3/Hlwv/xZEI/8VYireCH8pR/// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wAAhyQCD3MqbhZ0L/EWci//SYta/7jVwf/I59H/t93C/63Y + uv+t1rf/r9e5/yyYSP8vmUz/N6NU/yRtOP8jajb4I2o38El9Vf9Cr1//MZ1P/yRrN/8WQiH/Elck9RF5 + LXUBiiYD////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AAFrHj8YdTHSG3Qz/yN2Of+Qu5z/zerU/7zf + xf+v2Lr/qtW2/6XTs/+s1bj/ZLJ5/ymWRv8zm1D/N6RU/yNrN/8iZzX5I2o27zBzQf8ngED/F0ck/w5L + Hv0NbCaiAYwnEv///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wAAYhIbDXEpqRJwLP4Vby7/XJtt/8fj + z//B48z/tNu//6vVtv+m07L/odGu/6LRr/+bzqn/JpRD/zCaTf80m1D/N6RV/yNnNv8hYzP5I2o37xdI + JP8LRBv/CWEhygCDIi7///8A////AP///wD///8A////AP///wD///8AAHoVAv///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8AAFcMBRB1K3sYdDD2GnMy/y5/ + Rf+pzrP/yOfQ/7jdwv+u17n/qNS0/6PRsP+ez6v/ms6o/6HQrf9LpmX/LJdJ/zSbUP80m1D/N6VV/yJl + M/8gYDH5JGs37xRfKOkHeiVZ////AP///wD///8A////AP///wD///8A////AP///wALhy1NGY453QqD + Kkv///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wACbR9LHHk23iF5 + Of8aczL/da+F/8zp1P+94Mf/r9m7/6nUtP+l0rH/oNCt/5vNqf+Wy6X/l8yl/3/Akf8mlET/MppO/zSb + UP80m1D/OKVV/yBiMv8fXTD6MI9KbgCIJQj///8A////AP///wD///8A////AP///wD///8AAIEhHhiO + OLAhkj//L5ZK/yGNPvAJgSkg////AP///wD///8A////AP///wD///8A////AP///wD///8A////AABj + EYobdzT/KXw//zOCSP/L6dT/zuzW/7bcwf+q1bb/pdOy/6HQrv+czqn/mMym/5PKov+QyKD/lsqk/zac + Uv8vmUv/NJtQ/zSbUP80m1D/OKZV/x9fMf8eWi77////AP///wD///8A////AP///wD///8A////AACB + IQQZjjl1IZI/9x+NPP8wlEz/Xaxy/yCKPf8giD3MAIMjBv///wD///8A////AP///wD///8A////AP// + /wD///8A////AABDAAQNbyh2GXEx8h1wNP80fUj/mcWl/7jgw/+o1rX/ntCs/5nMp/+UyqP/j8ie/4zG + nP+Nxp3/YrJ4/yqWR/8zm0//NJtQ/zSbUP80m1D/OKZW/x9dMP8dVy37////AP///wD///8A////AP// + /wD///8AC4gtOySUQtMlkkP/E4c0/4fCl////////////y2RSP8jhj7/E30wmP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8AAFsNFQlmI6IQZCf9E2Uq/0uGWv+cy6j/ndOt/5LJ + of+Mxpz/h8SY/4XClf+EwpT/K5dJ/zGaTf80m1D/NJtQ/zSbUP80m1D/OKdW/x5aLv8dVy38////AP// + /wD///8A////AACBIRMZjjmcI5JC/h+NPv9RpGb/8vn1///////8/v3//////9fs3f8UfS//GHwz/xB3 + LJAAhiQC////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wAacTM7IWw19BNg + KP8RViT/f7KO/4rFmv+EwpX/gMGS/4HBlP9LpmT/LZhK/zSbUP80m1D/NJtQ/zSbUP80m1D/OKdW/x5a + L/8dViz8////AP///wD///8AAIEhYyWUQ+4zmE7/MJVM/0aiYP////////////L49P/r9e7/6vTs//X6 + 9v+t1bn/GX00/yF9Ov8deja/AGgcE////wD///8A////AP///wD///8A////AP///wD///8A////AABf + GTEUZSvXGmMt/yNoNf93s4n/jsyf/4LDk/98vo7/e76O/222gf8qlkf/MptP/zSbUP80m1D/NJtQ/zSb + UP80m1D/OKZW/x5cL/8dViz8////AP///wD///8ACoMqjTKXTv8ylk3/M5xQ/x+RPv+UyqP//////+z2 + 7v/j8ef/3+/j/97u4v/m9Or/v+HI/yGBO/8ddjX/GHQx6g1vKIgAYRAe////AP///wD///8A////AAA7 + AAMAXxdBCWEhlRBdJfsUXCn/RoNW/5TOpP+LyJv/f8CR/3m9i/93u4n/crqH/zKaTv8wmk3/NJtQ/zSb + UP80m1D/NJtQ/zSbUP80m1D/OKZW/x5cL/8dViz9////AP///wD///8AAIIiBSOMQMkxkUv/MpZN/y6a + S/8ckDz/u97E//P69P/f7+P/1+vc/9Lp2P/P59b/1ezc/8no0f9RmmT/Emss/xtvMv8Vayv9C2Qi0ABb + F7gAXBWkCWMhuxRkKfUdZTH/Fl4p/x5hMP9xq4D/kc+i/4LDlf96vYz/dbuI/3O6hf9zuYb/PZ9Y/y+Z + TP80m1D/NZ1R/zWeUf81nlH/NJxQ/zSbUP80m1D/OKZW/x5cL/8dViz9////AP///wD///8A////AAZ6 + JyEihz7yLoxI/zKZT/8smUr/G446/6PRsP/o8+r/1OrZ/8rl0f/F4s3/weDK/8TjzP/L6NL/stq+/0+b + ZP8fcDT/Dl8l/xFgJ/8TXyf/EFwl/xdiLP89gU7/bqh9/47Hn/+HyJr/fcCP/3a7if9yuYX/b7iC/262 + gv9Lp2X/LphL/zObT/81nlL/NqNT/yl8P/81oVL/NqJU/zWeUf80nFD/OKZW/x5cLv8dViz9////AP// + /wD///8A////AP///wAFdSNVIIE6/y2JRf80nFH/LppL/x2QPP+EwpX/2+3g/8vm0f+/38f/uNzC/7Ta + vv+y2b3/stm8/7XdwP+44cP/sNu8/5TKov+CvJH/lMej/57Wrv+Tz6T/iciZ/3/BkP95vYz/c7qG/264 + gv9stn//a7Z//0akX/8umEv/M5tP/zWeUv82pFT/JGo2/xdIJf8aTyn/K39B/zekVf82oVP/OKhX/x5c + MP8dViz+////AP///wD///8A////AP///wD///8AEXgtmSuDRP8shkX/NJ1R/zCbTf8jk0L/QqFc/7fc + wf/E4cv/tdu//63XuP+n07P/o9Gw/57Pq/+Zzaf/l8ul/5TLov+Pyp//iMWa/4PClP9+v4//eb2L/3S6 + h/9vuIP/bLaB/2m2ff9ntH3/P6Ba/y6ZS/8zm0//NZ9S/zalVP8kajf/GUwn/x1XLOkbUyr5GEwn/x1X + Lf8vjEj/O7Bb/x9gMv8cViz+////AP///wD///8A////AP///wD///8AAF0OBh17NrEqfED/K4BB/zOb + UP8znVD/KpdI/yKSQv9rt4D/r9i6/7HZu/+k0bD/m86p/5bLpf+RyaD/jcac/4jEmP+DwpT/fr+Q/3q9 + jP92u4j/cbmE/222gP9ptX7/Z7V8/1etb/81m1H/MJlM/zObT/82n1L/N6RV/yJqNf8ZTCf/Dk0g3Qdb + HRkAUBEgAksVtwxEG/4YSyb/I2o2/yBdMP8cViz+////AP///wD///8A////AP///wD///8A////AACH + JAEMbCibGnEy/yl4Pf8ymU7/NZ9S/zCaTf8plkb/I5JB/1mucf+Xy6X/odGu/5fMpv+PyJ//iMWZ/4HA + kv97vo3/druJ/3O5iP9xuIX/breB/2u1f/9brnH/Op1U/y6YSv8xmk7/NJ1R/zaiU/80nVH/IWQz/xlM + J/8QTyDYAFERFP///wD///8A////AABDAkQBRRLXC0cc/xtTKv8cViz/////AP///wD///8A////AP// + /wD///8A////AP///wD///8AAGQaghdrL/4lcjr/L4pI/zWhUv81n1L/MZtO/yuXSf8klEP/MZlO/1Gp + aP9rtn//er6L/3q+jP97vo3/eL6L/2u1f/9YrG//R6Rg/zmeU/8tmEr/MZpN/zScUP81n1L/OKVV/yyG + Rf8aUCn/CkQa/wFGFM0ARAEQ////AP///wD///8A////AP///wD///8AAEkNbg9OH+4cViz/////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AABfF2kWZy36I2o3/yVxOv8wkkv/N6NU/zWf + Uv80nFD/MZpO/y6YS/8qlkj/KJVG/yiVRv8olUb/KZZG/yuXSP8tmEr/MJlM/zKaTv80nFD/NqBS/zel + Vf81n1D/ImY0/xhLJv8MRxz6AEMKhf///wD///8A////AP///wD///8A////AP///wD///8A////AAA/ + AAwhYzOZ////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wAAVAkjCV0ftRRd + J/4gYTL/J3U9/zGVTP82pVT/N6NU/zagUv81nVH/NJxQ/zSbUP80m1D/NJtQ/zScUP81nlH/NqBS/zej + VP84qFb/L49J/yJmNP8ZSSX/GVAp/xBRIdYATA0v////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AABWE0YTWyfWHlsw/x5aLv8fWy//JnE7/y2KSP82oVP/OalX/zioV/84qFb/OKhX/zeo + Vv8zmk//LolG/yh3Pf8dVSz/GEom/wpEGv8AQhHjAEoMgAAYAAL///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wACjSgBAE8PYwRSGrcQUSH1G1Qr/xpQKf8YSyb/GEkm/xpN + J/8bUyr/HVgt/xhKJv8XSSX/GEom/xhNJ/8MRhz9AUoWwABCAVL///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wAndDwEI2o2TyFi + MqUfXTDRHlsv3R5aLucdWC3xHVgt+B5bL+EgXzG+IWMzlCJmNGQjaTYc////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A///AAf// + AAD//wAAf/8AAP/8AAAP/wAA//AAAAf/AAA/4AAAA/8AAA+AAAAA/wAABwAAAAB/AAAAAAAAAD8AAAAA + AAAAPwAAAAAAAAAfAAAAAAAAAA8AAAAAAAAABwAAAAAB4AADAAAAAA/4AAMAAAAAH/4ADwAAAAAH/wA/ + AAAAAAH/gH8AAAAAAP+B/AAAAAAD/8PwAAAAAAf/7+AAAAAAH///gAAAAAB///4AAAAAAP///AAAAAAD + ///wAAAAAA///8AAAAAAP///AAAAAAB///4AAAAAAf//+AAAAAAH9//gAAAAAB/j/8AAAAAAP4H/gAAA + AAD+AP+AAAAAAPwA/+AAAAAA8AA/+AAAAADgAB/wAAAAAOAAB4AAAAAA4AAAAAAAAADwAAAAAAAAAPgA + AAAAAAAA/AAAAAAAAAD8AAAAAAAAAP4AAAAA4AAA/4AAAAH4AAD/wAAAB/wAAP/gAAAP/wAA//gAAB// + AAD//AAA//8AAP//gAP//wAAKAAAABAAAAAgAAAAAQAgAAAAAAAABAAAEgsAABILAAAAAAAAAAAAAP// + /wD///8A////AP///wA0m1AIMpJMbDOTTt0/mlj4Qpta+TuYVPUyk0zDMJFLIv///wD///8A////AP// + /wAvjEhW////AP///wAAbhkgJIU99Hu4jP+q17b/sdq8/6DRrv+PyZ//cbmF/zOPTf4FeCSi////AP// + /wD///8AQpFY/BB3K+4AbRp8LodG/MHgyf+j1LH/abZ+/0KkW/9BpFz/Wa9w/2W0ev9fsXX/NJVP/wZ0 + I83///8A////AGamd/3h9ef/cbCC/8rn0v9+wpD/I5ZD/yaNQf8mgT77J4FA+yeJQv8smUr/R6dh/0Kk + XP8giDz/AG0alP///wBionP91O3b/77fx/9otn7/JZVD/yV7PP4vhUahKZxJChuVPAQLaSU/G3Qz+DOf + Uf81oVL/IIU8/wJoHd7///8AX51w/cbn0P+ZzKf/I5JB/zKdT/8yl03/KHU8+Q1qJkz///8A////AABi + GiYccjP6Kn1B+R54N3j///8ALIVFFlqZa/3B5cr/O59W/y6bS/81n1H/G3Uz/RBtKb4AZwwK////AP// + /wD///8AAGEYJCCIPAsMXCIEKotEpTKDR/hVlGb9fseR/ymcSP8bdjT/DGIi5ABbDSH///8A////AP// + /wD///8A////AP///wARfS5ZU5Zk96zTtv8sg0T8SY5c/SyOSP8hbDb1GmwwVP///wD///8A////AP// + /wD///8A////AABfCSEQdCvjfrCL/9Lr2f9Wsm//Kn5B/SVuOfYabDGZJptFASOXQwgIiCsg////AP// + /wD///8AAF8HCA14KbdUmWf+weDL/7new/+MyJz/JppF/yl4Pv00m1AM////ABqTO2BLpGP4OplV+wB0 + GS7///8A////AA1uJ0A2hUv4nsiq/6vZt/+WzKX/NpxS/zGgT/8nczv9////AAqHLM9IoWD///////3/ + /v8efzb6AGYaTAFeGgkRaykKGHIwmjR3Rv6Mx5z/V65u/yyYSf83pVT/JnI7/f///wAAeR5jDn8s/ozJ + nf/t+PD/zufV/3ywi/9Bh1T9Sodb/XCqf/+Myp7/XrV1/yudSv8pfj//N6ZW/yZyO/3///8A////AAJy + IIgPeyv/QKRb/5jQqP+y3L3/otWx/5DNoP9zvof/TKtk/yycS/8SXCb9B1QbjghYHfAgYjL9////AP// + /wD///8ABGwfoBRwLfshij7/KZxJ/zmkVf85pFf/K5tJ/ymFQf8TWyX4AEgNNP///wD///8AImU0Zv// + /wD///8A////AP///wAlcDoLKXY+mSdyO/Umcjv7JnE7+ydwO+cmbzqHI2k2EP///wD///8A////AP// + /wDwDwAAYAcAAAADAAAAAQAAAAEAAADCAAAA4AAAA/AAAA/AAAAHAAAAQwAAAIAAAACAAAAAwAAAAOAG + AADwDwAA + + + \ No newline at end of file diff --git a/UpdateLib/UpdateLib/UI/WizardPageCollection.cs b/UpdateLib/UpdateLib/UI/WizardPageCollection.cs new file mode 100644 index 0000000..c676ef0 --- /dev/null +++ b/UpdateLib/UpdateLib/UI/WizardPageCollection.cs @@ -0,0 +1,178 @@ +/* UpdateLib - .Net auto update library + * Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; + +namespace MatthiWare.UpdateLib.UI +{ + public class WizardPageCollection : IList + { + private List store; + + private int index = 0; + + public IWizardPage CurrentPage + { + get + { + return this[index]; + } + set + { + index = store.IndexOf(value); + } + } + + public IWizardPage FirstPage { get { return this.First(); } } + + public IWizardPage LastPage { get { return this.Last(); } } + + + + public WizardPageCollection() { store = new List(5); } + + public void Cancel() + { + + } + + public IWizardPage Next() + { + if (CurrentPage == LastPage) + return null; + + if (CurrentPage.IsBusy || !CurrentPage.IsDone) + return null; + + index++; + return CurrentPage; + } + + public IWizardPage Previous() + { + if (CurrentPage == FirstPage) + return null; + + //if (CurrentPage.IsBusy || !CurrentPage.IsDone) + // return null; + + index--; + return CurrentPage; + } + + public bool AllDone() + { + foreach (IWizardPage page in store) + { + if (!page.IsDone || page.HasErrors) + return false; + } + return true; + } + + #region IList Implementation + + public int Count + { + get + { + return store.Count; + } + } + + public bool IsReadOnly + { + get + { + return false; + } + } + + public IWizardPage this[int index] + { + get + { + return store[index]; + } + + set + { + store[index] = value; + } + } + + public int IndexOf(IWizardPage item) + { + return store.IndexOf(item); + } + + public void Insert(int index, IWizardPage item) + { + store.Insert(index, item); + } + + public void RemoveAt(int index) + { + store.RemoveAt(index); + } + + public void Add(IWizardPage item) + { + if (item == null) + throw new ArgumentNullException("item"); + + item.Conent.Dock = System.Windows.Forms.DockStyle.Fill; + store.Add(item); + } + + public void Clear() + { + index = 0; + store.Clear(); + } + + public bool Contains(IWizardPage item) + { + return store.Contains(item); + } + + public void CopyTo(IWizardPage[] array, int arrayIndex) + { + store.CopyTo(array, arrayIndex); + } + + public bool Remove(IWizardPage item) + { + return store.Remove(item); + } + + public IEnumerator GetEnumerator() + { + return store.GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return store.GetEnumerator(); + } + + #endregion + } +} diff --git a/UpdateLib/UpdateLib/UpdateLib.csproj b/UpdateLib/UpdateLib/UpdateLib.csproj index 084d41f..f04610e 100644 --- a/UpdateLib/UpdateLib/UpdateLib.csproj +++ b/UpdateLib/UpdateLib/UpdateLib.csproj @@ -1,10 +1,256 @@ - + + + - netstandard2.0 + Debug + AnyCPU + {4394BE57-95E2-45B1-A968-1404B0590B35} + Library + Properties MatthiWare.UpdateLib - false + UpdateLib + v3.5 + 512 + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + false + Auto + + + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + false + + + updater.ico + + + + + + + + + + + + + + Properties\SharedAssemblyInfo.cs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + UserControl + + + UpdaterControl.cs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + True + True + Resources.resx + + + + + + + + UserControl + + + ChangelogPage.cs + + + UserControl + + + FinishPage.cs + + + UserControl + + + IntroPage.cs + + + UserControl + + + RollbackPage.cs + + + UserControl + + + UpdatePage.cs + + + + Form + + + MessageDialog.cs + + + + Form + + + UpdaterForm.cs + + + + + + + + + + + + + + + + + + + + + + + + - + + UpdaterControl.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + + + ChangelogPage.cs + + + FinishPage.cs + + + IntroPage.cs + + + RollbackPage.cs + + + UpdatePage.cs + + + MessageDialog.cs + + + UpdaterForm.cs + + + + \ No newline at end of file diff --git a/UpdateLib/UpdateLib/Updater.cs b/UpdateLib/UpdateLib/Updater.cs index bd0c539..da5cf9d 100644 --- a/UpdateLib/UpdateLib/Updater.cs +++ b/UpdateLib/UpdateLib/Updater.cs @@ -24,13 +24,21 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Diagnostics; +using System.Drawing; using System.Linq; using System.Reflection; using System.Security; +using System.Windows.Forms; using MatthiWare.UpdateLib.Common; +using MatthiWare.UpdateLib.Common.Exceptions; using MatthiWare.UpdateLib.Files; +using MatthiWare.UpdateLib.Logging; +using MatthiWare.UpdateLib.Security; +using MatthiWare.UpdateLib.Tasks; +using MatthiWare.UpdateLib.UI; using MatthiWare.UpdateLib.Utils; namespace MatthiWare.UpdateLib @@ -66,8 +74,27 @@ public static Updater Instance private const string m_argWait = "wait"; private const string m_rollback = "rollback"; private Lazy m_lazyPathVarConv = new Lazy(() => new PathVariableConverter()); + private Lazy m_lazyLogger = new Lazy(() => new Logger()); private InstallationMode m_installationMode = InstallationMode.Shared; + private LoadCacheTask m_loadCacheTask; + + private static Lazy m_lazyProductName = new Lazy(() => + { + AssemblyProductAttribute attr = Assembly.GetEntryAssembly()?.GetCustomAttributes(typeof(AssemblyProductAttribute), true).FirstOrDefault() as AssemblyProductAttribute; + + //AssemblyProductAttribute attr = Attribute.GetCustomAttribute(Assembly.GetEntryAssembly(), ) as AssemblyProductAttribute; + return attr?.Product ?? m_strUpdateLib; + }); + + private static Lazy m_lazyUpdaterName = new Lazy(() => + { + AssemblyProductAttribute attr = Assembly.GetAssembly(typeof(Updater))?.GetCustomAttributes(typeof(AssemblyProductAttribute), true).FirstOrDefault() as AssemblyProductAttribute; + + //AssemblyProductAttribute attr = Attribute.GetCustomAttribute(), typeof(AssemblyProductAttribute)) as AssemblyProductAttribute; + return attr?.Product ?? m_strUpdateLib; + }); + #endregion #region Events @@ -75,12 +102,16 @@ public static Updater Instance /// /// Check for updates completed event. /// - //public event EventHandler CheckForUpdatesCompleted; + public event EventHandler CheckForUpdatesCompleted; #endregion #region Properties + internal static string ProductName => m_lazyProductName; + + internal static string UpdaterName => m_lazyUpdaterName; + /// /// Gets the command line parser. Use this to add additional command line arguments that need to be parsed. /// @@ -92,6 +123,11 @@ public static Updater Instance /// If you want to specify an unsafe connection you should enable public IList UpdateURLs { get; } = new List(); + /// + /// Gets the logger for the application. + /// + public ILogger Logger => m_lazyLogger.Value; + /// /// Gets or sets the Updater Installation mode /// @@ -103,6 +139,7 @@ public InstallationMode InstallationMode if (m_installationMode != value) { m_installationMode = value; + IOUtils.ReinitializeAppData(); } } } @@ -134,6 +171,7 @@ public InstallationMode InstallationMode public PathVariableConverter Converter { get { return m_lazyPathVarConv.Value; } + private set { m_lazyPathVarConv.Value = value; } } /// @@ -142,15 +180,15 @@ public PathVariableConverter Converter /// public bool AllowUnsafeConnection { get; set; } = false; - ///// - ///// Gets the clean up task - ///// - //public CleanUpTask CleanUpTask { get; private set; } + /// + /// Gets the clean up task + /// + public CleanUpTask CleanUpTask { get; private set; } - ///// - ///// Gets the update cache task - ///// - //public UpdateCacheTask UpdateCacheTask { get; private set; } + /// + /// Gets the update cache task + /// + public UpdateCacheTask UpdateCacheTask { get; private set; } @@ -195,6 +233,18 @@ public Updater ConfigureAllowUnsafeConnections(bool allow) return this; } + /// + /// Configures the logger + /// + /// Action to perform on the logger + /// + public Updater ConfigureLogger(Action action) + { + action(Logger); + + return this; + } + /// /// Configures the command line parser /// @@ -291,7 +341,7 @@ public void Initialize() IsInitialized = true; - //if (StartUpdating) CheckForUpdates(); + if (StartUpdating) CheckForUpdates(); } /// @@ -299,7 +349,9 @@ public void Initialize() /// private void StartInitializationTasks() { - + CleanUpTask = new CleanUpTask("%appdir%").ConfigureAwait(false).Start(); + UpdateCacheTask = new UpdateCacheTask().ConfigureAwait(false).Start(); + m_loadCacheTask = new LoadCacheTask().ConfigureAwait(false).Start(); } /// @@ -314,11 +366,174 @@ private void WaitForProcessToExit(int pid) process?.WaitForExit(); } + /// + /// Starting the update process + /// + /// Whether or not there is an update available and the latest version + public CheckForUpdatesTask.CheckForUpdatesResult CheckForUpdates() + => CheckForUpdatesAsync().AwaitTask().Result; + + /// + /// Starting the update process + /// + /// The owner window + /// Whether or not there is an update available and the latest version + public CheckForUpdatesTask.CheckForUpdatesResult CheckForUpdates(IWin32Window owner) + => CheckForUpdatesAsync(owner).AwaitTask().Result; + + /// + /// Start the update process asynchronously + /// + /// The update checker task. + public CheckForUpdatesTask CheckForUpdatesAsync() + => CheckForUpdatesAsync(null); + + /// + /// Start the update process asynchronously + /// + /// The owner window + /// The update checker task. + public CheckForUpdatesTask CheckForUpdatesAsync(IWin32Window owner) + { + if (!IsInitialized) throw new InvalidOperationException("The updater needs to be initialized first"); + if (UpdateURLs.Count == 0) throw new ArgumentException("No uri's specified", nameof(UpdateURLs)); + + var urls = UpdateURLs.Where(u => !AllowUnsafeConnection || (AllowUnsafeConnection && u.StartsWith(Uri.UriSchemeHttps))); + + if (AllowUnsafeConnection && urls.Count() == 0) + throw new SecurityException("Using unsafe connections to update from is not allowed"); + + var version = GetCache().CurrentVersion; + + CheckForUpdatesTask task = new CheckForUpdatesTask(urls.ToList(), version); + task.TaskCompleted += (o, e) => + { + bool error = e.Error != null; + bool cancelled = e.Cancelled; + bool update = task.Result.UpdateAvailable; + bool adminReq = task.Result.AdminRightsNeeded; + + CheckForUpdatesCompleted?.Invoke(task, new CheckForUpdatesCompletedEventArgs(task.Result, e)); + + if (!update || cancelled || error) + { + if (error) + HandleException(owner, e.Error); + else if (cancelled) + HandleUserCancelled(owner); + else if (!update) + HandleNoUpdate(owner, task.Result.Version); + + return; + } + + DialogResult result = DialogResult.Yes; + + if (!UpdateSilently && !StartUpdating) + result = MessageDialog.Show( + owner, + "Update available", + $"Version {task.Result.Version} available", + "Update now?\nPress yes to update or no to cancel.", + SystemIcons.Question); + + if (result != DialogResult.Yes) + return; + + if (((!StartUpdating && NeedsRestartBeforeUpdate) || (adminReq && !PermissionUtil.IsProcessElevated)) + && !RestartApp(owner, true, UpdateSilently, true, adminReq)) + return; + + if (UpdateSilently) + UpdateWithoutGUI(task.Result.UpdateInfo, task.Result.DownloadURLs); + else + { + UpdaterForm updateForm = new UpdaterForm(task.Result.UpdateInfo, task.Result.ApplicationName); + updateForm.ShowDialog(owner); + } + }; + + return task.Start(); + } + + private void HandleException(IWin32Window owner, Exception e) + { + if (UpdateSilently) + return; + + if (e is NoInternetException) + MessageDialog.Show( + owner, + $"{ProductName} Updater", + "Error while updating", + "Unable to connect to the update server\nPlease check your internet connection and try again!", + SystemIcons.Error, + MessageBoxButtons.OK); + else if (e is InvalidUpdateServerException) + MessageDialog.Show( + owner, + $"{ProductName} Updater", + "Error while updating", + "No valid update server available\nPlease contact the software vendor!", + SystemIcons.Error, + MessageBoxButtons.OK); + else if (e is Win32Exception) + MessageDialog.Show( + owner, + $"{ProductName} Updater", + "Update cancelled", + "Update got cancelled by the user!", + SystemIcons.Warning, + MessageBoxButtons.OK); + else + MessageDialog.Show( + owner, + $"{ProductName} Updater", + "Error while updating", + "Check the log files for more information!", + SystemIcons.Error, + MessageBoxButtons.OK); + } + + private void HandleNoUpdate(IWin32Window owner, UpdateVersion latest) + { + Logger.Info(nameof(Updater), nameof(CheckForUpdatesAsync), "No update available"); + + if (!UpdateSilently) + MessageDialog.Show( + owner, + $"{ProductName} Updater", + "No Update available", + $"You already have the latest version {latest}", + SystemIcons.Information, + MessageBoxButtons.OK); + } + + private void HandleUserCancelled(IWin32Window owner) + { + Logger.Info(nameof(Updater), nameof(CheckForUpdatesAsync), "Update cancalled"); + + if (!UpdateSilently) + MessageDialog.Show( + owner, + $"{ProductName} Updater", + "Cancelled", + "Update got cancelled", + SystemIcons.Warning, + MessageBoxButtons.OK); + } + + /// + /// Gets the cached index of the current application + /// + /// The of the current application + public HashCacheFile GetCache2() => UpdateCacheTask.AwaitTask().Result; + /// /// Gets the cache of the updater /// /// The loaded of the current application - //public CacheFile GetCache() => m_loadCacheTask.AwaitTask().Result; + public CacheFile GetCache() => m_loadCacheTask.AwaitTask().Result; /// /// Updates without user interaction @@ -326,36 +541,30 @@ private void WaitForProcessToExit(int pid) /// The update specifications file private void UpdateWithoutGUI(UpdateInfo updateInfo, IList urls) { - //var downloadManager = new DownloadManager(updateInfo, urls); + var downloadManager = new DownloadManager(updateInfo, urls); - //downloadManager.Completed += (o, e) => - //{ - // //GetCache2().Save(); - // RestartApp(); - //}; + downloadManager.Completed += (o, e) => + { + GetCache2().Save(); + RestartApp(); + }; - //downloadManager.Download(); + downloadManager.Download(); } - internal bool RestartApp(bool update = false, bool silent = false, bool waitForPidExit = true, bool asAdmin = false) + internal bool RestartApp(IWin32Window owner = null, bool update = false, bool silent = false, bool waitForPid = true, bool asAdmin = false) { - //Logger.Debug(nameof(Updater), nameof(RestartApp), $"Restarting app: [update={update}; silent={silent}; waitForPidExit={waitForPidExit}; asAdmin={asAdmin}]"); - - var args = new List(Environment.GetCommandLineArgs()); + Logger.Debug(nameof(Updater), nameof(RestartApp), $"Restarting app: [update={update}; silent={silent}; waitForPid={waitForPid}; asAdmin={asAdmin}]"); - var cmdUpdate = $"{CommandLine.ParameterPrefix}{m_argUpdate}"; - var cmdSilent = $"{CommandLine.ParameterPrefix}{m_argUpdateSilent}"; - var cmdWait = $"{CommandLine.ParameterPrefix}{m_argWait}"; + List args = new List(Environment.GetCommandLineArgs()); for (int i = 0; i < args.Count; i++) { - var carg = args[i]; - - if ((!update && carg == cmdUpdate) || (!silent && carg == cmdSilent)) + if ((!update && args[i] == CommandLine.ParameterPrefix + m_argUpdate) || (!silent && args[i] == CommandLine.ParameterPrefix + m_argUpdateSilent)) { args[i] = string.Empty; } - else if (carg == cmdWait) + else if (args[i] == CommandLine.ParameterPrefix + m_argWait) { args[i] = string.Empty; if (i + 1 < args.Count) @@ -363,17 +572,17 @@ internal bool RestartApp(bool update = false, bool silent = false, bool waitForP } } - if (waitForPidExit && !args.Contains(cmdWait)) + if (waitForPid && !args.Contains(CommandLine.ParameterPrefix + m_argWait)) { - args.Add(cmdWait); + args.Add(CommandLine.ParameterPrefix + m_argWait); args.Add(Process.GetCurrentProcess().Id.ToString()); } - if (update && !args.Contains(cmdUpdate)) - args.Add(cmdUpdate); + if (update && !args.Contains(CommandLine.ParameterPrefix + m_argUpdate)) + args.Add(CommandLine.ParameterPrefix + m_argUpdate); - if (silent && !args.Contains(cmdSilent)) - args.Add(cmdSilent); + if (silent && !args.Contains(CommandLine.ParameterPrefix + m_argUpdateSilent)) + args.Add(CommandLine.ParameterPrefix + m_argUpdateSilent); string arguments = args.NotEmpty().Distinct().AppendAll(" "); @@ -386,14 +595,15 @@ internal bool RestartApp(bool update = false, bool silent = false, bool waitForP try { - Process.Start(startInfo); + Process proc = Process.Start(startInfo); - // gracefully exit the current process Environment.Exit(0); } catch (Exception e) { - // Logger.Error(nameof(Updater), nameof(RestartApp), e); + Logger.Error(nameof(Updater), nameof(RestartApp), e); + + HandleException(owner, e); return false; } diff --git a/UpdateLib/UpdateLib/UpdaterControl.bmp b/UpdateLib/UpdateLib/UpdaterControl.bmp new file mode 100644 index 0000000000000000000000000000000000000000..b40cc5a9a10e131119577e06603ce1ab0d57c371 GIT binary patch literal 822 zcmZ?rHDhJ~12Z700mK4O%*Y@C76%bW_#hZ2@E-|$`}uA0>2>idioEA1dCgA@Uy{?l zd+PnSkCBx8-+ui7gnR121^+oIMcZ2^o?O^=czV^|p4{z?k!$kpriINpwj8d-d16HL zyxb+n*M-c>n0;<#)1fJ$t8*L|M%yijbXgqdyFAr>NrKt5fcnk75G|=o%huo6owvSW z;l*{yn=6fG`x#F5(eH4#>y*vZ_)Q(-+@v$UflJY5N|xg&ty)ZUav>$ypn(a{>9D7pL>3F#olhiS$;rs zjHdb8GzT2KejH-^=O163+Cpqv12&)A1r&Mx`EB%!?B3&Z&E^CF6$6n@opbkwslb4O zs0We{UOxuv`t|46>_f}!I)lQeWQ4EDGo2f#)#Q{ut>p3Br*M^U#@-u8vX)fMI=)Q1 z+1aN*PPfb9{ zAyZN(9hyJu?26uFa~u~%1AV7nYz>qx-_;qsGW*M~Z>Jt#jF_K&>G5@-;P;>3XY5+! z+!oq+U{dtDB4AJh)vFbO)UUs?Q)iM#--&tWo?qR1Yk$g;QvV4FK7DZ+D=I7Zbth~r zGnpHx)9egV4>ljDrDfYBoqqSQHMx^cE}VIGdDqcd)q8t^>BoOXI#97jiOtmYb9`ze z<&zA7iXmX??)f_PP6pF`Y!-yOFHLk_9BVc|NWa&^wAgL;nf(wo8;@;+ss>XJUOuXt b-{Mdks9j>OTk7cB5It$_%#U9_BC7!aEC2c3 literal 0 HcmV?d00001 diff --git a/UpdateLib/UpdateLib/Utils/IOUtils.cs b/UpdateLib/UpdateLib/Utils/IOUtils.cs new file mode 100644 index 0000000..1298990 --- /dev/null +++ b/UpdateLib/UpdateLib/Utils/IOUtils.cs @@ -0,0 +1,161 @@ +/* UpdateLib - .Net auto update library + * Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using System; +using System.IO; +using System.Text; + +using MatthiWare.UpdateLib.Common; + +namespace MatthiWare.UpdateLib.Utils +{ + public static class IOUtils + { + private static Lazy m_getAppDataPath = new Lazy(GetAppDataPath); + private static Lazy m_getCachePath = new Lazy(() => $"{AppDataPath}\\Cache"); + private static Lazy m_getLogPath = new Lazy(() => $"{AppDataPath}\\Log"); + private static Lazy m_getTempPath = new Lazy(() => $"{AppDataPath}\\Temp"); + + internal static void ReinitializeAppData() => m_getAppDataPath.Reset(); + + public static string AppDataPath => m_getAppDataPath; + public static string CachePath => m_getCachePath; + public static string LogPath => m_getLogPath; + public static string TempPath => m_getTempPath; + + internal static string GetRemoteBasePath(string url) + { + if (string.IsNullOrEmpty(url)) throw new ArgumentNullException(nameof(url)); + + const char slash = '/'; + const char backslash = '\\'; + + StringBuilder builder = new StringBuilder(); + + foreach (var s in url.Split(slash, backslash).SkipLast(1)) + { + builder.Append(s); + builder.Append(slash); + } + + return builder.ToString(); + } + + private static string GetAppDataPath() + { + string path = GetPathPrefix(); + string updaterName = Updater.UpdaterName; + string productName = Updater.ProductName; + + return $@"{path}\{productName}\{updaterName}"; + } + + private static string GetPathPrefix() + { + switch (Updater.Instance.InstallationMode) + { + case InstallationMode.Local: + return Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); + case InstallationMode.Shared: + default: + return Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); + } + } + + internal static byte[] CheckedReadBytes(this Stream stream, int size) + { + byte[] ret = new byte[size]; + int index = 0; + + while (index < size) + { + int read = stream.Read(ret, index, size - index); + + if (read == 0) + throw new EndOfStreamException(); + + index += read; + } + + return ret; + } + + internal static void CheckedReadBytes(this Stream stream, byte[] buffer, int offset, int length) + { + int index = offset; + int size = offset + length; + + while (index < size) + { + int read = stream.Read(buffer, index, size); + + if (read == 0) + throw new EndOfStreamException(); + + index += read; + } + } + + internal static byte CheckedReadByte(this Stream stream) + { + int ret = stream.ReadByte(); + + if (ret == -1) + throw new IOException("Unable to read byte from stream"); + + return (byte)ret; + } + + internal static int ReadBigEndian7BitEncodedInt(this Stream stream) + { + int ret = 0; + + for (int i = 0; i < 5; i++) + { + int b = stream.ReadByte(); + if (b == -1) + throw new EndOfStreamException(); + + ret = (ret << 7) | (b & 0x7f); + if ((b & 0x80) == 0) + return ret; + } + + throw new IOException("Invalid 7-bit encoded integer in stream"); + } + + internal static void Copy(Stream source, Stream dest, byte[] buffer) + { + if (source == null) throw new ArgumentNullException(nameof(source)); + if (dest == null) throw new ArgumentNullException(nameof(dest)); + if (buffer == null) throw new ArgumentNullException(nameof(buffer)); + + bool copying = true; + + while (copying) + { + int bytesRead = source.Read(buffer, 0, buffer.Length); + copying = bytesRead > 0; + + if (copying) + dest.Write(buffer, 0, bytesRead); + else + dest.Flush(); + } + } + } +} diff --git a/UpdateLib/UpdateLib/Utils/Lazy.cs b/UpdateLib/UpdateLib/Utils/Lazy.cs new file mode 100644 index 0000000..9caa64c --- /dev/null +++ b/UpdateLib/UpdateLib/Utils/Lazy.cs @@ -0,0 +1,84 @@ +/* UpdateLib - .Net auto update library + * Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using System; + +namespace MatthiWare.UpdateLib.Utils +{ + /// + /// Threadsafe lazy initialization + /// + /// The return type + public class Lazy + { + private readonly Func m_initFunction; + + private readonly object sync = new object(); + private bool m_initialized = false; + + private T m_storedValue = default(T); + + /// + /// Gets the value and initializes once. + /// + public T Value + { + get + { + if (!m_initialized) + lock (sync) + if (!m_initialized) + { + m_storedValue = m_initFunction(); + m_initialized = true; + } + + return m_storedValue; + } + set + { + lock (sync) + { + m_initialized = true; + m_storedValue = value; + } + } + } + + /// + /// Resets the lazy function + /// + public void Reset() + { + lock (sync) + m_initialized = false; + } + + /// + /// Makes a new instance of an lazy initializer + /// + /// The lazy initialization function + public Lazy(Func initFunction) + { + m_initFunction = initFunction; + } + + public static implicit operator T(Lazy self) + => self.Value; + + } +} diff --git a/UpdateLib/UpdateLib/Utils/NetworkUtils.cs b/UpdateLib/UpdateLib/Utils/NetworkUtils.cs new file mode 100644 index 0000000..b4dc6a7 --- /dev/null +++ b/UpdateLib/UpdateLib/Utils/NetworkUtils.cs @@ -0,0 +1,31 @@ +/* UpdateLib - .Net auto update library + * Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using MatthiWare.UpdateLib.Win32; + +namespace MatthiWare.UpdateLib.Utils +{ + public static class NetworkUtils + { + public static bool HasConnection() + { + int desc; + return NativeMethods.InternetGetConnectedState(out desc, 0); + } + + } +} diff --git a/UpdateLib/UpdateLib/Utils/RegistryHelper.cs b/UpdateLib/UpdateLib/Utils/RegistryHelper.cs new file mode 100644 index 0000000..37bf802 --- /dev/null +++ b/UpdateLib/UpdateLib/Utils/RegistryHelper.cs @@ -0,0 +1,160 @@ +/* UpdateLib - .Net auto update library + * Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using MatthiWare.UpdateLib.Common; +using MatthiWare.UpdateLib.Tasks; +using Microsoft.Win32; +using System; +using System.Linq; +using System.Security.AccessControl; + +namespace MatthiWare.UpdateLib.Utils +{ + public static class RegistryHelper + { + + public static RegistryKey GetOrMakeKey(RegistryKeyEntry key) + { + if (key == null) throw new ArgumentNullException(nameof(key)); + + string pathToKeyRoot = key.Parent.DestinationLocation; + + return GetOrMakeKey(pathToKeyRoot); + } + + public static RegistryKey GetOrMakeKey(string pathToKeyRoot) + { + if (string.IsNullOrEmpty(pathToKeyRoot)) throw new ArgumentNullException(nameof(pathToKeyRoot)); + + string pathToKey = pathToKeyRoot.Split(char.Parse(@"\")).Skip(1).AppendAll(@"\"); + + return OpenSubKey(GetRootKey(pathToKeyRoot), pathToKey); + } + + private static RegistryKey GetRootKey(string pathToKeyRoot) + { + if (pathToKeyRoot.StartsWith("HKEY_LOCAL_MACHINE")) + return Registry.LocalMachine; + else if (pathToKeyRoot.StartsWith("HKEY_CURRENT_USER")) + return Registry.CurrentUser; + else if (pathToKeyRoot.StartsWith("HKEY_CLASSES_ROOT")) + return Registry.ClassesRoot; + else if (pathToKeyRoot.StartsWith("HKEY_USERS")) + return Registry.Users; + else if (pathToKeyRoot.StartsWith("HKEY_CURRENT_CONFIG")) + return Registry.CurrentConfig; + else if (pathToKeyRoot.StartsWith("HKEY_PERFORMANCE_DATA")) + return Registry.PerformanceData; + else if (pathToKeyRoot.StartsWith("HKEY_DYN_DATA")) + return Registry.DynData; + else + return null; + } + + private static RegistryKey OpenSubKey(RegistryKey key, string path) + { + if (key == null) + return null; + + RegistryKey reg = key?.OpenSubKey(path, RegistryKeyPermissionCheck.ReadWriteSubTree, RegistryRights.FullControl); + + if (reg != null) + return reg; + + key.CreateSubKey(path, RegistryKeyPermissionCheck.ReadWriteSubTree); + + return OpenSubKey(key, path); + } + + internal static void InternalOpenSubKey(string root, string keyName) + { + RegistryKey key = GetRootKey(root); + + foreach (string item in root.Split(char.Parse(@"\")).Skip(1).NotEmpty()) + { + RegistryKey tmp = key?.OpenSubKey(item, RegistryKeyPermissionCheck.ReadWriteSubTree, RegistryRights.FullControl); + key?.Close(); + + key = tmp; + } + + key?.Close(); + } + + public static bool IsSame(RegistryKeyEntry key) + { + if (key == null) + return false; + + string path = key.Parent.DestinationLocation; + + try + { + object value = Registry.GetValue(path, key.Name, new NullObject()); + + return key.Value.Equals(value); + + } + catch (Exception e) + { + Updater.Instance.Logger.Error(nameof(RegistryHelper), nameof(IsSame), e); + } + + return false; + } + + public static bool Exists(RegistryKeyEntry key, out object value) + { + value = null; + + if (key == null) + return false; + + string path = key.Parent.DestinationLocation; + + try + { + value = Registry.GetValue(path, key.Name, null); + + return value != null; + } + catch (Exception e) + { + Updater.Instance.Logger.Error(nameof(RegistryHelper), nameof(Exists), e); + } + + return false; + } + + public static void Update(RegistryKeyEntry logicalKey, UpdateRegistryTask.RollbackData rollback) + { + if (logicalKey == null) throw new ArgumentNullException(nameof(logicalKey)); + + RegistryKey key = GetOrMakeKey(logicalKey); + + if (key?.GetValueNames().Contains(logicalKey.Name) ?? false) + rollback.type = key.GetValueKind(logicalKey.Name); + + key.SetValue(logicalKey.Name, logicalKey.Value, logicalKey.Type); + } + + /// + /// We do nothing with this + /// + private class NullObject { } + } +} diff --git a/UpdateLib/UpdateLib/Win32/NativeMethods.cs b/UpdateLib/UpdateLib/Win32/NativeMethods.cs new file mode 100644 index 0000000..5e7ba9f --- /dev/null +++ b/UpdateLib/UpdateLib/Win32/NativeMethods.cs @@ -0,0 +1,28 @@ +/* UpdateLib - .Net auto update library + * Copyright (C) 2016 - MatthiWare (Matthias Beerens) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +using System.Runtime.InteropServices; + +namespace MatthiWare.UpdateLib.Win32 +{ + internal static class NativeMethods + { + [DllImport("wininet.dll")] + internal static extern bool InternetGetConnectedState(out int connDescription, int reservedValue); + + } +} diff --git a/UpdateLib/UpdateLib/updater.ico b/UpdateLib/UpdateLib/updater.ico new file mode 100644 index 0000000000000000000000000000000000000000..c952e49470813cd4e96fa2bcf0bc3e004851c040 GIT binary patch literal 10806 zcmb_i2Urx>79Na=6+uCzw`F%(SYVeby{JgFBKDww*pOZNR>X?2Ym5bZ zPojos@_aEqV~iRs@V|2h)`wW)OWg0fduL~7=KlBGb5HrtaGVm?hLg!S>J7L`A;*b0 zj#E`_`aQ8N$DN~dCUlN2;l@&9*YO`?j_cN`sWqM8H~^od*%S@zY@OfVTb}EmC|~AR zCR^frmf90)cV$a`Yh_FQw$u3n`EvhstGs|q$Z~#WmgNaa zraMHLZV+a>LpYaOPE!-jYC3O{;Re$z53uXiv#bl~e(66M|L@+*CF>7TOOc<@o@oc; zRA(4wJ43j*H=I`oA#ig9ChSf@?EV}~+MSA!oii}9Iu?OjrXpZNIPCHVK{%V{ljZ_; zf43CbiH=!jqqr==7k?Me$KJ7h z<@uI|AB%-uNBTOS*09UR+|wal5~!PE|Ije07X)+N5VCs)N-u1}y35;9aJB+VPOiqh z?pPyHXLpV;^19Rfa_;N->|X&mo!5K9+~9BP&Sm%aMF=5#gVQn3`FbvOA5(9#Wlz zFRS7)a!WLVHcds~#t01AGzFezqaaRkg;s)fL-$O17LBX)E<7#INoVzeILR5JL?@7J zuXM;T^=SD&t!G>PET<~NSUc!vIU;Ib7OKA6hq8;?kbibP>B?GO?n_Db%TBF9_R$rH z+dCVf)zdI!<75opFcG7+#v+vDJ&|NTc~=TT=)cihV|eU?H%vzVig5U?3xiKZ2t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`*(;B&^{uS5s|0B+gzrK#s=O0_gwM%FB z)v+)7@F%I~FQT5u(4yzD)e*XMdf$pJVxzUAi`dh7dD1z3Ldd`~q%8c6laAB%+)Od20lgE|W}@zGc7Je5 zbi+5qv#>mw`F$(m+N@Rvz$C%>Iq~=Y3Y=VsmPjYo`h{tV$8)`D_S4vTX?EWpBMYW9 z9QpY)Se@LW$dCNaAZXKjE~-M;o;@o!@7jRaU?Hp}FA= zsV9~~QtS=wL>qJtG5U$}VZ)a9wLI>cVliS!Uf7?TFYksltIsQ+MWY*}i@aeNVfR!k zLKfKa+Lp&$a0f%xc(c2y+velauiqkQdlaktH_&?&&$J@s1)`$9N`jTW+qa)%X7J{H z?b<6(lk5pBn9z8nt`>W5AH#x^#l&^@rP#@}f%J`kUr%ef(^$Xq(0a#$p)a|3&DUI+ za-`VZF59oZ^yEft`gRXr$70-xeDwf`8KGaE3`@SYFu!l7{j(k5?|^=K0c6Y%uV-m)Ad5Tq)8hWoGQV8>L20Uy{ky3 zd3xjoHu&a@YKY#Lh6Sff@#U@rn3ecKlIjL~%2gHjv-!4(HJGC^(+uvUv-uY)vHj)& zlwGaHlC!H3cQ6P3o5CP1_CvSPqK0;X+Kbu`*L_4>)f;(A+X(&D>e1#e4d=PidiubD zVpfOpVK6K5fh605YL~)#&Rf}rjmMhNc$;v=v7)ECUnfbTYk@e{=_%oRN&fexINIr+ zD9SO1?E71>*CVo-W0^f=wp6LP9i_gGPLXj^IZXD3e)gu8-rNpTU-t#sF1q)>+DCmT literal 0 HcmV?d00001 From 8f6cd329435bf8f23db0a7e853ea1d674685f4a8 Mon Sep 17 00:00:00 2001 From: Matthias Beerens Date: Thu, 16 Aug 2018 18:07:09 +0200 Subject: [PATCH 34/40] real upgrade .NET Standard 2.0 --- UpdateLib/TestApp/Form1.Designer.cs | 400 ------- UpdateLib/TestApp/Form1.cs | 111 -- UpdateLib/TestApp/Form1.resx | 238 ---- .../TestApp/Properties/Resources.Designer.cs | 71 -- UpdateLib/TestApp/Properties/Resources.resx | 117 -- .../TestApp/Properties/Settings.Designer.cs | 30 - .../TestApp/Properties/Settings.settings | 7 - UpdateLib/TestApp/TestApp.csproj | 98 +- UpdateLib/TestApp/app.manifest | 76 -- .../Data/FilesPage/GenFile.cs | 68 -- .../Data/FilesPage/GenFolder.cs | 83 -- .../Data/FilesPage/GenReg.cs | 115 -- .../Data/FilesPage/IGenItem.cs | 34 - .../Data/ListViewFolder.cs | 39 - .../Data/ListViewGenItem.cs | 45 - .../Data/TreeViewFolderNode.cs | 38 - .../UpdateLib.Generator/Files/ProjectFile.cs | 36 - .../UpdateLib.Generator/Generator_logo.ico | Bin 167188 -> 0 bytes .../UpdateLib.Generator/MainForm.Designer.cs | 264 ----- UpdateLib/UpdateLib.Generator/MainForm.cs | 206 ---- UpdateLib/UpdateLib.Generator/MainForm.resx | 202 ---- UpdateLib/UpdateLib.Generator/Program.cs | 10 +- .../Resources/Registry Editor_16px.png | Bin 342 -> 0 bytes .../Resources/Registry Editor_32px.png | Bin 569 -> 0 bytes .../UpdateLib.Generator/Resources/cross.png | Bin 912 -> 0 bytes .../Resources/folder_transparent_16px.png | Bin 436 -> 0 bytes .../UpdateLib.Generator/Resources/gears.png | Bin 446 -> 0 bytes .../Resources/image_transparent_16px.png | Bin 484 -> 0 bytes .../UpdateLib.Generator/Resources/loading.gif | Bin 98823 -> 0 bytes .../Resources/loading_gear.gif | Bin 73023 -> 0 bytes .../Resources/project_16px.png | Bin 244 -> 0 bytes .../Resources/reg_bin_16px.png | Bin 345 -> 0 bytes .../Resources/reg_string_16px.png | Bin 343 -> 0 bytes .../Tasks/LoadDirectoryTask.cs | 104 -- .../Tasks/UpdateGeneratorTask.cs | 158 --- .../UpdateLib.Generator/UI/ElipseComponent.cs | 135 --- .../UpdateLib.Generator/UI/FlatButton.cs | 205 ---- .../UpdateLib.Generator/UI/GradientPanel.cs | 134 --- .../UpdateLib.Generator/UI/HoverPictureBox.cs | 104 -- .../UI/InputDialog.Designer.cs | 138 --- .../UpdateLib.Generator/UI/InputDialog.cs | 108 -- .../UpdateLib.Generator/UI/InputDialog.resx | 306 ----- .../UI/LoaderControl.Designer.cs | 64 - .../UpdateLib.Generator/UI/LoaderControl.cs | 144 --- .../UpdateLib.Generator/UI/LoaderControl.resx | 126 -- .../UpdateLib.Generator/UI/MoveablePanel.cs | 71 -- .../UI/Pages/BuilderPage.Designer.cs | 133 --- .../UI/Pages/BuilderPage.cs | 155 --- .../UI/Pages/BuilderPage.resx | 123 -- .../UI/Pages/FilesPage.Designer.cs | 232 ---- .../UpdateLib.Generator/UI/Pages/FilesPage.cs | 310 ----- .../UI/Pages/FilesPage.resx | 132 --- .../UI/Pages/InformationPage.Designer.cs | 113 -- .../UI/Pages/InformationPage.cs | 59 - .../UI/Pages/InformationPage.resx | 120 -- .../UI/Pages/PageControlBase.cs | 79 -- .../UI/Pages/PageControlBase.resx | 120 -- .../UI/Pages/RegistryPage.Designer.cs | 255 ---- .../UI/Pages/RegistryPage.cs | 256 ---- .../UI/Pages/RegistryPage.resx | 177 --- .../UpdateLib.Generator.csproj | 199 +--- .../UpdateLib.Tests/UpdateLib.Tests.csproj | 117 +- UpdateLib/UpdateLib.Tests/packages.config | 15 - UpdateLib/UpdateLib/Common/DirectoryEntry.cs | 5 - UpdateLib/UpdateLib/Common/HashCacheEntry.cs | 4 +- .../UpdateLib/Common/RegistryKeyEntry.cs | 52 - UpdateLib/UpdateLib/Common/WorkerScheduler.cs | 122 -- .../UpdateLib/Compression/Checksum/Adler32.cs | 209 ---- .../UpdateLib/Compression/Checksum/Crc32.cs | 217 ---- .../Compression/Checksum/IChecksum.cs | 91 -- .../Compression/Deflaters/Deflater.cs | 464 -------- .../Deflaters/DeflaterConstants.cs | 181 --- .../Compression/Deflaters/DeflaterEngine.cs | 850 ------------- .../Compression/Deflaters/DeflaterHuffman.cs | 894 -------------- .../Compression/Deflaters/DeflaterPending.cs | 53 - .../Compression/Deflaters/Inflater.cs | 857 ------------- .../Deflaters/InflaterDynHeader.cs | 207 ---- .../Deflaters/InflaterHuffmanTree.cs | 257 ---- .../Compression/Deflaters/PendingBuffer.cs | 258 ---- UpdateLib/UpdateLib/Compression/GZip/GZip.cs | 62 - .../Compression/GZip/GZipConstants.cs | 86 -- .../Compression/GZip/GZipException.cs | 51 - .../Compression/GZip/GZipInputStream.cs | 382 ------ .../Compression/GZip/GZipOutputStream.cs | 258 ---- .../Streams/DeflaterOutputStream.cs | 388 ------ .../Streams/InflaterInputStream.cs | 642 ---------- .../Compression/Streams/OutputWindow.cs | 233 ---- .../Compression/Streams/StreamManipulator.cs | 282 ----- UpdateLib/UpdateLib/Compression/Zip/Zip.cs | 22 - .../UpdateLib/Compression/Zip/ZipConstants.cs | 470 -------- .../UpdateLib/Compression/Zip/ZipEntry.cs | 1056 ----------------- .../UpdateLib/Compression/Zip/ZipException.cs | 51 - .../UpdateLib/Compression/Zip/ZipExtraData.cs | 970 --------------- .../UpdateLib/Compression/Zip/ZipFile.cs | 566 --------- .../Compression/Zip/ZipHelperStream.cs | 618 ---------- .../Compression/Zip/ZipInputStream.cs | 608 ---------- .../Compression/Zip/ZipOutputStream.cs | 735 ------------ .../Controls/UpdaterControl.Designer.cs | 49 - .../UpdateLib/Controls/UpdaterControl.cs | 288 ----- .../UpdateLib/Controls/UpdaterControl.resx | 120 -- UpdateLib/UpdateLib/Files/CacheFile.cs | 4 +- UpdateLib/UpdateLib/Files/HashCacheFile.cs | 2 +- .../UpdateLib/Files/UpdateCatalogFile.cs | 5 +- .../UpdateLib/Files/UpdateMetadataFile.cs | 5 +- UpdateLib/UpdateLib/Logging/ILogWriter.cs | 28 - UpdateLib/UpdateLib/Logging/ILogger.cs | 35 - UpdateLib/UpdateLib/Logging/Logger.cs | 68 -- .../Logging/Writers/ConsoleLogWriter.cs | 32 - .../Logging/Writers/FileLogWriter.cs | 72 -- .../Properties/Resources.Designer.cs | 133 --- UpdateLib/UpdateLib/Properties/Resources.resx | 142 --- .../UpdateLib/Resources/project_16px.png | Bin 244 -> 0 bytes UpdateLib/UpdateLib/Resources/status_done.png | Bin 454 -> 0 bytes .../UpdateLib/Resources/status_download.png | Bin 493 -> 0 bytes .../UpdateLib/Resources/status_error.png | Bin 912 -> 0 bytes UpdateLib/UpdateLib/Resources/status_info.png | Bin 617 -> 0 bytes .../UpdateLib/Resources/status_update.png | Bin 3169 -> 0 bytes .../UpdateLib/Resources/status_warning.png | Bin 502 -> 0 bytes .../UpdateLib/Resources/status_working.png | Bin 1600 -> 0 bytes .../UpdateLib/Security/PermissionUtil.cs | 133 --- UpdateLib/UpdateLib/Tasks/AsyncTask.cs | 436 ------- UpdateLib/UpdateLib/Tasks/AsyncTaskFactory.cs | 105 -- .../Tasks/CheckForUpdatedItemsTask.cs | 107 -- .../CheckForUpdatesCompletedEventArgs.cs | 49 - .../UpdateLib/Tasks/CheckForUpdatesTask.cs | 134 --- .../Tasks/CheckRequiredPrivilegesTask.cs | 92 -- UpdateLib/UpdateLib/Tasks/CleanUpTask.cs | 60 - UpdateLib/UpdateLib/Tasks/DownloadManager.cs | 118 -- UpdateLib/UpdateLib/Tasks/DownloadTask.cs | 85 -- UpdateLib/UpdateLib/Tasks/LoadCacheTask.cs | 38 - UpdateLib/UpdateLib/Tasks/UpdatableTask.cs | 49 - UpdateLib/UpdateLib/Tasks/UpdateCacheTask.cs | 125 -- .../UpdateLib/Tasks/UpdateRegistryTask.cs | 138 --- .../UI/Components/ChangelogPage.Designer.cs | 83 -- .../UpdateLib/UI/Components/ChangelogPage.cs | 127 -- .../UI/Components/ChangelogPage.resx | 235 ---- .../UI/Components/FinishPage.Designer.cs | 97 -- .../UpdateLib/UI/Components/FinishPage.cs | 170 --- .../UpdateLib/UI/Components/FinishPage.resx | 131 -- .../UI/Components/IntroPage.Designer.cs | 77 -- .../UpdateLib/UI/Components/IntroPage.cs | 138 --- .../UpdateLib/UI/Components/IntroPage.resx | 129 -- .../UI/Components/RollbackPage.Designer.cs | 142 --- .../UpdateLib/UI/Components/RollbackPage.cs | 12 - .../UpdateLib/UI/Components/RollbackPage.resx | 123 -- .../UI/Components/UpdatePage.Designer.cs | 142 --- .../UpdateLib/UI/Components/UpdatePage.cs | 374 ------ .../UpdateLib/UI/Components/UpdatePage.resx | 123 -- UpdateLib/UpdateLib/UI/IWizardPage.cs | 41 - .../UpdateLib/UI/MessageDialog.Designer.cs | 152 --- UpdateLib/UpdateLib/UI/MessageDialog.cs | 119 -- UpdateLib/UpdateLib/UI/MessageDialog.resx | 306 ----- UpdateLib/UpdateLib/UI/UIExtensions.cs | 43 - .../UpdateLib/UI/UpdaterForm.Designer.cs | 167 --- UpdateLib/UpdateLib/UI/UpdaterForm.cs | 258 ---- UpdateLib/UpdateLib/UI/UpdaterForm.resx | 306 ----- .../UpdateLib/UI/WizardPageCollection.cs | 178 --- UpdateLib/UpdateLib/UpdateLib.csproj | 254 +--- UpdateLib/UpdateLib/Updater.cs | 298 +---- UpdateLib/UpdateLib/UpdaterControl.bmp | Bin 822 -> 0 bytes UpdateLib/UpdateLib/Utils/IOUtils.cs | 26 +- UpdateLib/UpdateLib/Utils/Lazy.cs | 84 -- UpdateLib/UpdateLib/Utils/NetworkUtils.cs | 31 - UpdateLib/UpdateLib/Utils/RegistryHelper.cs | 160 --- UpdateLib/UpdateLib/Win32/NativeMethods.cs | 28 - UpdateLib/UpdateLib/updater.ico | Bin 10806 -> 0 bytes 166 files changed, 82 insertions(+), 26005 deletions(-) delete mode 100644 UpdateLib/TestApp/Form1.Designer.cs delete mode 100644 UpdateLib/TestApp/Form1.cs delete mode 100644 UpdateLib/TestApp/Form1.resx delete mode 100644 UpdateLib/TestApp/Properties/Resources.Designer.cs delete mode 100644 UpdateLib/TestApp/Properties/Resources.resx delete mode 100644 UpdateLib/TestApp/Properties/Settings.Designer.cs delete mode 100644 UpdateLib/TestApp/Properties/Settings.settings delete mode 100644 UpdateLib/TestApp/app.manifest delete mode 100644 UpdateLib/UpdateLib.Generator/Data/FilesPage/GenFile.cs delete mode 100644 UpdateLib/UpdateLib.Generator/Data/FilesPage/GenFolder.cs delete mode 100644 UpdateLib/UpdateLib.Generator/Data/FilesPage/GenReg.cs delete mode 100644 UpdateLib/UpdateLib.Generator/Data/FilesPage/IGenItem.cs delete mode 100644 UpdateLib/UpdateLib.Generator/Data/ListViewFolder.cs delete mode 100644 UpdateLib/UpdateLib.Generator/Data/ListViewGenItem.cs delete mode 100644 UpdateLib/UpdateLib.Generator/Data/TreeViewFolderNode.cs delete mode 100644 UpdateLib/UpdateLib.Generator/Files/ProjectFile.cs delete mode 100644 UpdateLib/UpdateLib.Generator/Generator_logo.ico delete mode 100644 UpdateLib/UpdateLib.Generator/MainForm.Designer.cs delete mode 100644 UpdateLib/UpdateLib.Generator/MainForm.cs delete mode 100644 UpdateLib/UpdateLib.Generator/MainForm.resx delete mode 100644 UpdateLib/UpdateLib.Generator/Resources/Registry Editor_16px.png delete mode 100644 UpdateLib/UpdateLib.Generator/Resources/Registry Editor_32px.png delete mode 100644 UpdateLib/UpdateLib.Generator/Resources/cross.png delete mode 100644 UpdateLib/UpdateLib.Generator/Resources/folder_transparent_16px.png delete mode 100644 UpdateLib/UpdateLib.Generator/Resources/gears.png delete mode 100644 UpdateLib/UpdateLib.Generator/Resources/image_transparent_16px.png delete mode 100644 UpdateLib/UpdateLib.Generator/Resources/loading.gif delete mode 100644 UpdateLib/UpdateLib.Generator/Resources/loading_gear.gif delete mode 100644 UpdateLib/UpdateLib.Generator/Resources/project_16px.png delete mode 100644 UpdateLib/UpdateLib.Generator/Resources/reg_bin_16px.png delete mode 100644 UpdateLib/UpdateLib.Generator/Resources/reg_string_16px.png delete mode 100644 UpdateLib/UpdateLib.Generator/Tasks/LoadDirectoryTask.cs delete mode 100644 UpdateLib/UpdateLib.Generator/Tasks/UpdateGeneratorTask.cs delete mode 100644 UpdateLib/UpdateLib.Generator/UI/ElipseComponent.cs delete mode 100644 UpdateLib/UpdateLib.Generator/UI/FlatButton.cs delete mode 100644 UpdateLib/UpdateLib.Generator/UI/GradientPanel.cs delete mode 100644 UpdateLib/UpdateLib.Generator/UI/HoverPictureBox.cs delete mode 100644 UpdateLib/UpdateLib.Generator/UI/InputDialog.Designer.cs delete mode 100644 UpdateLib/UpdateLib.Generator/UI/InputDialog.cs delete mode 100644 UpdateLib/UpdateLib.Generator/UI/InputDialog.resx delete mode 100644 UpdateLib/UpdateLib.Generator/UI/LoaderControl.Designer.cs delete mode 100644 UpdateLib/UpdateLib.Generator/UI/LoaderControl.cs delete mode 100644 UpdateLib/UpdateLib.Generator/UI/LoaderControl.resx delete mode 100644 UpdateLib/UpdateLib.Generator/UI/MoveablePanel.cs delete mode 100644 UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.Designer.cs delete mode 100644 UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.cs delete mode 100644 UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.resx delete mode 100644 UpdateLib/UpdateLib.Generator/UI/Pages/FilesPage.Designer.cs delete mode 100644 UpdateLib/UpdateLib.Generator/UI/Pages/FilesPage.cs delete mode 100644 UpdateLib/UpdateLib.Generator/UI/Pages/FilesPage.resx delete mode 100644 UpdateLib/UpdateLib.Generator/UI/Pages/InformationPage.Designer.cs delete mode 100644 UpdateLib/UpdateLib.Generator/UI/Pages/InformationPage.cs delete mode 100644 UpdateLib/UpdateLib.Generator/UI/Pages/InformationPage.resx delete mode 100644 UpdateLib/UpdateLib.Generator/UI/Pages/PageControlBase.cs delete mode 100644 UpdateLib/UpdateLib.Generator/UI/Pages/PageControlBase.resx delete mode 100644 UpdateLib/UpdateLib.Generator/UI/Pages/RegistryPage.Designer.cs delete mode 100644 UpdateLib/UpdateLib.Generator/UI/Pages/RegistryPage.cs delete mode 100644 UpdateLib/UpdateLib.Generator/UI/Pages/RegistryPage.resx delete mode 100644 UpdateLib/UpdateLib.Tests/packages.config delete mode 100644 UpdateLib/UpdateLib/Common/RegistryKeyEntry.cs delete mode 100644 UpdateLib/UpdateLib/Common/WorkerScheduler.cs delete mode 100644 UpdateLib/UpdateLib/Compression/Checksum/Adler32.cs delete mode 100644 UpdateLib/UpdateLib/Compression/Checksum/Crc32.cs delete mode 100644 UpdateLib/UpdateLib/Compression/Checksum/IChecksum.cs delete mode 100644 UpdateLib/UpdateLib/Compression/Deflaters/Deflater.cs delete mode 100644 UpdateLib/UpdateLib/Compression/Deflaters/DeflaterConstants.cs delete mode 100644 UpdateLib/UpdateLib/Compression/Deflaters/DeflaterEngine.cs delete mode 100644 UpdateLib/UpdateLib/Compression/Deflaters/DeflaterHuffman.cs delete mode 100644 UpdateLib/UpdateLib/Compression/Deflaters/DeflaterPending.cs delete mode 100644 UpdateLib/UpdateLib/Compression/Deflaters/Inflater.cs delete mode 100644 UpdateLib/UpdateLib/Compression/Deflaters/InflaterDynHeader.cs delete mode 100644 UpdateLib/UpdateLib/Compression/Deflaters/InflaterHuffmanTree.cs delete mode 100644 UpdateLib/UpdateLib/Compression/Deflaters/PendingBuffer.cs delete mode 100644 UpdateLib/UpdateLib/Compression/GZip/GZip.cs delete mode 100644 UpdateLib/UpdateLib/Compression/GZip/GZipConstants.cs delete mode 100644 UpdateLib/UpdateLib/Compression/GZip/GZipException.cs delete mode 100644 UpdateLib/UpdateLib/Compression/GZip/GZipInputStream.cs delete mode 100644 UpdateLib/UpdateLib/Compression/GZip/GZipOutputStream.cs delete mode 100644 UpdateLib/UpdateLib/Compression/Streams/DeflaterOutputStream.cs delete mode 100644 UpdateLib/UpdateLib/Compression/Streams/InflaterInputStream.cs delete mode 100644 UpdateLib/UpdateLib/Compression/Streams/OutputWindow.cs delete mode 100644 UpdateLib/UpdateLib/Compression/Streams/StreamManipulator.cs delete mode 100644 UpdateLib/UpdateLib/Compression/Zip/Zip.cs delete mode 100644 UpdateLib/UpdateLib/Compression/Zip/ZipConstants.cs delete mode 100644 UpdateLib/UpdateLib/Compression/Zip/ZipEntry.cs delete mode 100644 UpdateLib/UpdateLib/Compression/Zip/ZipException.cs delete mode 100644 UpdateLib/UpdateLib/Compression/Zip/ZipExtraData.cs delete mode 100644 UpdateLib/UpdateLib/Compression/Zip/ZipFile.cs delete mode 100644 UpdateLib/UpdateLib/Compression/Zip/ZipHelperStream.cs delete mode 100644 UpdateLib/UpdateLib/Compression/Zip/ZipInputStream.cs delete mode 100644 UpdateLib/UpdateLib/Compression/Zip/ZipOutputStream.cs delete mode 100644 UpdateLib/UpdateLib/Controls/UpdaterControl.Designer.cs delete mode 100644 UpdateLib/UpdateLib/Controls/UpdaterControl.cs delete mode 100644 UpdateLib/UpdateLib/Controls/UpdaterControl.resx delete mode 100644 UpdateLib/UpdateLib/Logging/ILogWriter.cs delete mode 100644 UpdateLib/UpdateLib/Logging/ILogger.cs delete mode 100644 UpdateLib/UpdateLib/Logging/Logger.cs delete mode 100644 UpdateLib/UpdateLib/Logging/Writers/ConsoleLogWriter.cs delete mode 100644 UpdateLib/UpdateLib/Logging/Writers/FileLogWriter.cs delete mode 100644 UpdateLib/UpdateLib/Properties/Resources.Designer.cs delete mode 100644 UpdateLib/UpdateLib/Properties/Resources.resx delete mode 100644 UpdateLib/UpdateLib/Resources/project_16px.png delete mode 100644 UpdateLib/UpdateLib/Resources/status_done.png delete mode 100644 UpdateLib/UpdateLib/Resources/status_download.png delete mode 100644 UpdateLib/UpdateLib/Resources/status_error.png delete mode 100644 UpdateLib/UpdateLib/Resources/status_info.png delete mode 100644 UpdateLib/UpdateLib/Resources/status_update.png delete mode 100644 UpdateLib/UpdateLib/Resources/status_warning.png delete mode 100644 UpdateLib/UpdateLib/Resources/status_working.png delete mode 100644 UpdateLib/UpdateLib/Security/PermissionUtil.cs delete mode 100644 UpdateLib/UpdateLib/Tasks/AsyncTask.cs delete mode 100644 UpdateLib/UpdateLib/Tasks/AsyncTaskFactory.cs delete mode 100644 UpdateLib/UpdateLib/Tasks/CheckForUpdatedItemsTask.cs delete mode 100644 UpdateLib/UpdateLib/Tasks/CheckForUpdatesCompletedEventArgs.cs delete mode 100644 UpdateLib/UpdateLib/Tasks/CheckForUpdatesTask.cs delete mode 100644 UpdateLib/UpdateLib/Tasks/CheckRequiredPrivilegesTask.cs delete mode 100644 UpdateLib/UpdateLib/Tasks/CleanUpTask.cs delete mode 100644 UpdateLib/UpdateLib/Tasks/DownloadManager.cs delete mode 100644 UpdateLib/UpdateLib/Tasks/DownloadTask.cs delete mode 100644 UpdateLib/UpdateLib/Tasks/LoadCacheTask.cs delete mode 100644 UpdateLib/UpdateLib/Tasks/UpdatableTask.cs delete mode 100644 UpdateLib/UpdateLib/Tasks/UpdateCacheTask.cs delete mode 100644 UpdateLib/UpdateLib/Tasks/UpdateRegistryTask.cs delete mode 100644 UpdateLib/UpdateLib/UI/Components/ChangelogPage.Designer.cs delete mode 100644 UpdateLib/UpdateLib/UI/Components/ChangelogPage.cs delete mode 100644 UpdateLib/UpdateLib/UI/Components/ChangelogPage.resx delete mode 100644 UpdateLib/UpdateLib/UI/Components/FinishPage.Designer.cs delete mode 100644 UpdateLib/UpdateLib/UI/Components/FinishPage.cs delete mode 100644 UpdateLib/UpdateLib/UI/Components/FinishPage.resx delete mode 100644 UpdateLib/UpdateLib/UI/Components/IntroPage.Designer.cs delete mode 100644 UpdateLib/UpdateLib/UI/Components/IntroPage.cs delete mode 100644 UpdateLib/UpdateLib/UI/Components/IntroPage.resx delete mode 100644 UpdateLib/UpdateLib/UI/Components/RollbackPage.Designer.cs delete mode 100644 UpdateLib/UpdateLib/UI/Components/RollbackPage.cs delete mode 100644 UpdateLib/UpdateLib/UI/Components/RollbackPage.resx delete mode 100644 UpdateLib/UpdateLib/UI/Components/UpdatePage.Designer.cs delete mode 100644 UpdateLib/UpdateLib/UI/Components/UpdatePage.cs delete mode 100644 UpdateLib/UpdateLib/UI/Components/UpdatePage.resx delete mode 100644 UpdateLib/UpdateLib/UI/IWizardPage.cs delete mode 100644 UpdateLib/UpdateLib/UI/MessageDialog.Designer.cs delete mode 100644 UpdateLib/UpdateLib/UI/MessageDialog.cs delete mode 100644 UpdateLib/UpdateLib/UI/MessageDialog.resx delete mode 100644 UpdateLib/UpdateLib/UI/UIExtensions.cs delete mode 100644 UpdateLib/UpdateLib/UI/UpdaterForm.Designer.cs delete mode 100644 UpdateLib/UpdateLib/UI/UpdaterForm.cs delete mode 100644 UpdateLib/UpdateLib/UI/UpdaterForm.resx delete mode 100644 UpdateLib/UpdateLib/UI/WizardPageCollection.cs delete mode 100644 UpdateLib/UpdateLib/UpdaterControl.bmp delete mode 100644 UpdateLib/UpdateLib/Utils/Lazy.cs delete mode 100644 UpdateLib/UpdateLib/Utils/NetworkUtils.cs delete mode 100644 UpdateLib/UpdateLib/Utils/RegistryHelper.cs delete mode 100644 UpdateLib/UpdateLib/Win32/NativeMethods.cs delete mode 100644 UpdateLib/UpdateLib/updater.ico diff --git a/UpdateLib/TestApp/Form1.Designer.cs b/UpdateLib/TestApp/Form1.Designer.cs deleted file mode 100644 index a13e970..0000000 --- a/UpdateLib/TestApp/Form1.Designer.cs +++ /dev/null @@ -1,400 +0,0 @@ -namespace TestApp -{ - partial class Form1 - { - /// - /// 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() - { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1)); - this.menuStrip1 = new System.Windows.Forms.MenuStrip(); - this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator = new System.Windows.Forms.ToolStripSeparator(); - this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); - this.printToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.printPreviewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); - this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.undoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.redoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); - this.cutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.copyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.pasteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); - this.selectAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.customizeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.contentsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.indexToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.searchToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator(); - this.checkForUpdatesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.label1 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); - this.menuStrip1.SuspendLayout(); - this.SuspendLayout(); - // - // menuStrip1 - // - this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.fileToolStripMenuItem, - this.editToolStripMenuItem, - this.toolsToolStripMenuItem, - this.helpToolStripMenuItem}); - this.menuStrip1.Location = new System.Drawing.Point(0, 0); - this.menuStrip1.Name = "menuStrip1"; - this.menuStrip1.Size = new System.Drawing.Size(490, 24); - this.menuStrip1.TabIndex = 0; - this.menuStrip1.Text = "menuStrip1"; - // - // fileToolStripMenuItem - // - this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.newToolStripMenuItem, - this.openToolStripMenuItem, - this.toolStripSeparator, - this.saveToolStripMenuItem, - this.saveAsToolStripMenuItem, - this.toolStripSeparator1, - this.printToolStripMenuItem, - this.printPreviewToolStripMenuItem, - this.toolStripSeparator2, - this.exitToolStripMenuItem}); - this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; - this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); - this.fileToolStripMenuItem.Text = "&File"; - // - // newToolStripMenuItem - // - this.newToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("newToolStripMenuItem.Image"))); - this.newToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta; - this.newToolStripMenuItem.Name = "newToolStripMenuItem"; - this.newToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N))); - this.newToolStripMenuItem.Size = new System.Drawing.Size(146, 22); - this.newToolStripMenuItem.Text = "&New"; - // - // openToolStripMenuItem - // - this.openToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("openToolStripMenuItem.Image"))); - this.openToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta; - this.openToolStripMenuItem.Name = "openToolStripMenuItem"; - this.openToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O))); - this.openToolStripMenuItem.Size = new System.Drawing.Size(146, 22); - this.openToolStripMenuItem.Text = "&Open"; - // - // toolStripSeparator - // - this.toolStripSeparator.Name = "toolStripSeparator"; - this.toolStripSeparator.Size = new System.Drawing.Size(143, 6); - // - // saveToolStripMenuItem - // - this.saveToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("saveToolStripMenuItem.Image"))); - this.saveToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta; - this.saveToolStripMenuItem.Name = "saveToolStripMenuItem"; - this.saveToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S))); - this.saveToolStripMenuItem.Size = new System.Drawing.Size(146, 22); - this.saveToolStripMenuItem.Text = "&Save"; - // - // saveAsToolStripMenuItem - // - this.saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem"; - this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(146, 22); - this.saveAsToolStripMenuItem.Text = "Save &As"; - // - // toolStripSeparator1 - // - this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(143, 6); - // - // printToolStripMenuItem - // - this.printToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("printToolStripMenuItem.Image"))); - this.printToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta; - this.printToolStripMenuItem.Name = "printToolStripMenuItem"; - this.printToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.P))); - this.printToolStripMenuItem.Size = new System.Drawing.Size(146, 22); - this.printToolStripMenuItem.Text = "&Print"; - // - // printPreviewToolStripMenuItem - // - this.printPreviewToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("printPreviewToolStripMenuItem.Image"))); - this.printPreviewToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta; - this.printPreviewToolStripMenuItem.Name = "printPreviewToolStripMenuItem"; - this.printPreviewToolStripMenuItem.Size = new System.Drawing.Size(146, 22); - this.printPreviewToolStripMenuItem.Text = "Print Pre&view"; - // - // toolStripSeparator2 - // - this.toolStripSeparator2.Name = "toolStripSeparator2"; - this.toolStripSeparator2.Size = new System.Drawing.Size(143, 6); - // - // exitToolStripMenuItem - // - this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; - this.exitToolStripMenuItem.Size = new System.Drawing.Size(146, 22); - this.exitToolStripMenuItem.Text = "E&xit"; - // - // editToolStripMenuItem - // - this.editToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.undoToolStripMenuItem, - this.redoToolStripMenuItem, - this.toolStripSeparator3, - this.cutToolStripMenuItem, - this.copyToolStripMenuItem, - this.pasteToolStripMenuItem, - this.toolStripSeparator4, - this.selectAllToolStripMenuItem}); - this.editToolStripMenuItem.Name = "editToolStripMenuItem"; - this.editToolStripMenuItem.Size = new System.Drawing.Size(39, 20); - this.editToolStripMenuItem.Text = "&Edit"; - // - // undoToolStripMenuItem - // - this.undoToolStripMenuItem.Name = "undoToolStripMenuItem"; - this.undoToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Z))); - this.undoToolStripMenuItem.Size = new System.Drawing.Size(144, 22); - this.undoToolStripMenuItem.Text = "&Undo"; - // - // redoToolStripMenuItem - // - this.redoToolStripMenuItem.Name = "redoToolStripMenuItem"; - this.redoToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Y))); - this.redoToolStripMenuItem.Size = new System.Drawing.Size(144, 22); - this.redoToolStripMenuItem.Text = "&Redo"; - // - // toolStripSeparator3 - // - this.toolStripSeparator3.Name = "toolStripSeparator3"; - this.toolStripSeparator3.Size = new System.Drawing.Size(141, 6); - // - // cutToolStripMenuItem - // - this.cutToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("cutToolStripMenuItem.Image"))); - this.cutToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta; - this.cutToolStripMenuItem.Name = "cutToolStripMenuItem"; - this.cutToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.X))); - this.cutToolStripMenuItem.Size = new System.Drawing.Size(144, 22); - this.cutToolStripMenuItem.Text = "Cu&t"; - // - // copyToolStripMenuItem - // - this.copyToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("copyToolStripMenuItem.Image"))); - this.copyToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta; - this.copyToolStripMenuItem.Name = "copyToolStripMenuItem"; - this.copyToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C))); - this.copyToolStripMenuItem.Size = new System.Drawing.Size(144, 22); - this.copyToolStripMenuItem.Text = "&Copy"; - // - // pasteToolStripMenuItem - // - this.pasteToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("pasteToolStripMenuItem.Image"))); - this.pasteToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta; - this.pasteToolStripMenuItem.Name = "pasteToolStripMenuItem"; - this.pasteToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.V))); - this.pasteToolStripMenuItem.Size = new System.Drawing.Size(144, 22); - this.pasteToolStripMenuItem.Text = "&Paste"; - // - // toolStripSeparator4 - // - this.toolStripSeparator4.Name = "toolStripSeparator4"; - this.toolStripSeparator4.Size = new System.Drawing.Size(141, 6); - // - // selectAllToolStripMenuItem - // - this.selectAllToolStripMenuItem.Name = "selectAllToolStripMenuItem"; - this.selectAllToolStripMenuItem.Size = new System.Drawing.Size(144, 22); - this.selectAllToolStripMenuItem.Text = "Select &All"; - // - // toolsToolStripMenuItem - // - this.toolsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.customizeToolStripMenuItem, - this.optionsToolStripMenuItem}); - this.toolsToolStripMenuItem.Name = "toolsToolStripMenuItem"; - this.toolsToolStripMenuItem.Size = new System.Drawing.Size(47, 20); - this.toolsToolStripMenuItem.Text = "&Tools"; - // - // customizeToolStripMenuItem - // - this.customizeToolStripMenuItem.Name = "customizeToolStripMenuItem"; - this.customizeToolStripMenuItem.Size = new System.Drawing.Size(130, 22); - this.customizeToolStripMenuItem.Text = "&Customize"; - // - // optionsToolStripMenuItem - // - this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem"; - this.optionsToolStripMenuItem.Size = new System.Drawing.Size(130, 22); - this.optionsToolStripMenuItem.Text = "&Options"; - // - // helpToolStripMenuItem - // - this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.contentsToolStripMenuItem, - this.indexToolStripMenuItem, - this.searchToolStripMenuItem, - this.toolStripSeparator5, - this.checkForUpdatesToolStripMenuItem, - this.aboutToolStripMenuItem}); - this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; - this.helpToolStripMenuItem.Size = new System.Drawing.Size(44, 20); - this.helpToolStripMenuItem.Text = "&Help"; - // - // contentsToolStripMenuItem - // - this.contentsToolStripMenuItem.Name = "contentsToolStripMenuItem"; - this.contentsToolStripMenuItem.Size = new System.Drawing.Size(173, 22); - this.contentsToolStripMenuItem.Text = "&Contents"; - // - // indexToolStripMenuItem - // - this.indexToolStripMenuItem.Name = "indexToolStripMenuItem"; - this.indexToolStripMenuItem.Size = new System.Drawing.Size(173, 22); - this.indexToolStripMenuItem.Text = "&Index"; - // - // searchToolStripMenuItem - // - this.searchToolStripMenuItem.Name = "searchToolStripMenuItem"; - this.searchToolStripMenuItem.Size = new System.Drawing.Size(173, 22); - this.searchToolStripMenuItem.Text = "&Search"; - // - // toolStripSeparator5 - // - this.toolStripSeparator5.Name = "toolStripSeparator5"; - this.toolStripSeparator5.Size = new System.Drawing.Size(170, 6); - // - // checkForUpdatesToolStripMenuItem - // - this.checkForUpdatesToolStripMenuItem.Name = "checkForUpdatesToolStripMenuItem"; - this.checkForUpdatesToolStripMenuItem.Size = new System.Drawing.Size(173, 22); - this.checkForUpdatesToolStripMenuItem.Text = "Check For &Updates"; - this.checkForUpdatesToolStripMenuItem.Click += new System.EventHandler(this.checkForUpdatesToolStripMenuItem_Click); - // - // aboutToolStripMenuItem - // - this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem"; - this.aboutToolStripMenuItem.Size = new System.Drawing.Size(173, 22); - this.aboutToolStripMenuItem.Text = "&About..."; - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label1.Location = new System.Drawing.Point(24, 53); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(45, 16); - this.label1.TabIndex = 1; - this.label1.Text = "label1"; - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label2.Location = new System.Drawing.Point(24, 105); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(45, 16); - this.label2.TabIndex = 2; - this.label2.Text = "label2"; - // - // label3 - // - this.label3.AutoSize = true; - this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label3.Location = new System.Drawing.Point(27, 161); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(45, 16); - this.label3.TabIndex = 3; - this.label3.Text = "label3"; - // - // Form1 - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(490, 266); - this.Controls.Add(this.label3); - this.Controls.Add(this.label2); - this.Controls.Add(this.label1); - this.Controls.Add(this.menuStrip1); - this.MainMenuStrip = this.menuStrip1; - this.Name = "Form1"; - this.Text = "Test app - Not updated"; - this.Load += new System.EventHandler(this.Form1_Load); - this.menuStrip1.ResumeLayout(false); - this.menuStrip1.PerformLayout(); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.MenuStrip menuStrip1; - private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem newToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator; - private System.Windows.Forms.ToolStripMenuItem saveToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem saveAsToolStripMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; - private System.Windows.Forms.ToolStripMenuItem printToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem printPreviewToolStripMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator2; - private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem undoToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem redoToolStripMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator3; - private System.Windows.Forms.ToolStripMenuItem cutToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem copyToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem pasteToolStripMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator4; - private System.Windows.Forms.ToolStripMenuItem selectAllToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem toolsToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem customizeToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem optionsToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem helpToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem contentsToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem indexToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem searchToolStripMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator5; - private System.Windows.Forms.ToolStripMenuItem checkForUpdatesToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.Label label3; - } -} - diff --git a/UpdateLib/TestApp/Form1.cs b/UpdateLib/TestApp/Form1.cs deleted file mode 100644 index eb7d94c..0000000 --- a/UpdateLib/TestApp/Form1.cs +++ /dev/null @@ -1,111 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using MatthiWare.UpdateLib; -using MatthiWare.UpdateLib.Tasks; -using System; -using System.IO; -using System.Windows.Forms; - -namespace TestApp -{ - public partial class Form1 : Form - { - public Form1() - { - InitializeComponent(); - - Updater.Instance.CheckForUpdatesCompleted += Instance_CheckForUpdatesCompleted; - } - - private void Instance_CheckForUpdatesCompleted(object sender, CheckForUpdatesCompletedEventArgs e) - { - checkForUpdatesToolStripMenuItem.Enabled = true; - - //if (e.Cancelled || e.Error != null) - //{ - // this.InvokeOnUI(() => MessageDialog.Show( - // this, - // "Updater", - // e.Cancelled ? "Cancelled" : "Error", - // e.Cancelled ? "Update got cancelled" : "Please check the logs for more information.", - // e.Cancelled ? SystemIcons.Warning : SystemIcons.Error, - // MessageBoxButtons.OK)); - - // return; - //} - - //if (!e.UpdateAvailable) - //{ - // this.InvokeOnUI(() => - // MessageDialog.Show( - // this, - // "Updater", - // "No update available!", - // $"You already have the latest version ({e.LatestVersion}).", - // SystemIcons.Information, - // MessageBoxButtons.OK)); - - // return; - //} - } - - private void checkForUpdatesToolStripMenuItem_Click(object sender, EventArgs e) - { - checkForUpdatesToolStripMenuItem.Enabled = false; - - AsyncTask task = Updater.Instance.CheckForUpdatesAsync(); - //task.Cancel(); - } - - private void Form1_Load(object sender, EventArgs e) - { - label1.Text = ReadFile("data/testfile1.txt"); - label2.Text = ReadFile("data/testfile2.txt"); - label3.Text = ReadFileAndKeepStreamOpen("data/testfile3.txt"); - } - - private string ReadFile(string file) - { - if (!File.Exists(file)) - return "ERROR: File doesn't exist.."; - - string[] lines = File.ReadAllLines(file); - - return string.Join(", ", lines); - } - - FileStream fs; - /// - /// Bad code that keeps the file open & locked - /// Purpose: to demonstrate the updater still works on locked files. - /// - /// - /// - private string ReadFileAndKeepStreamOpen(string file) - { - if (!File.Exists(file)) - return "ERROR: File doesn't exist.."; - - fs = new FileStream(file, FileMode.Open, FileAccess.ReadWrite, FileShare.None); - StreamReader sr = new StreamReader(fs); - string text = sr.ReadToEnd(); - - return text; - } - } -} diff --git a/UpdateLib/TestApp/Form1.resx b/UpdateLib/TestApp/Form1.resx deleted file mode 100644 index dbd0356..0000000 --- a/UpdateLib/TestApp/Form1.resx +++ /dev/null @@ -1,238 +0,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 - - - 17, 17 - - - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8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iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAJSSURBVDhPtZJrSJNRGMdf6IN9KbpQn/pUEH2JIoLqQ0Zh - FqYZRmJG1iKmUqKyLB2pqSm6vC1Nm5GXoeatEsVJ0RASR3eNzegikRq5lrV3857Fr/d9ddlICoL+8OfA - Oef/e57zcIT/os7WLMw302muSGJ2689qqi7A44q8IzjtNYzarzHQm8tZtT8FmRqu6LToMxN+B8qhCbGR - KVcDE85ajKUaxoaryEuL4UVXIudPB5Ko2oy98xjDptXERuz3hsgAOTzlqqMk6yjdllzE90UM9Wp5azlB - S1kwkeG+1CSv4mmBQPThfd6Ahqq8GYB4A11yBKmaMLQxoZyLDkGjDiZOFUhUuB+FsWsUQFiArzegtlzH - pFjPpMPA2GA2jucx2KqWK7ZWLqO7dBGP9D5KWLbfto3eAKMhi3FHBeP9GYy9PMXos4OIrYvJrzSRbWjm - wuV6EnVG4tLLiEzSExGf4w0oL05nZEDPaK+akceBuO9v4uPtFUrYo6npbzhdE/QPOQmNSiPouHYOUpaf - gvgqA/dDf9wd63G1r2SgUlAqyyq/1anYUGfG2mdXwne7bOwJUc1AinOS+NxzBpd5HWLbUhyNPvRdF5S2 - v05/54tbqvzBifWNHUvPOwLC4/CXwrv2HsB3+w6EwosJOB5ESeElfGpayGD1AmwlArHSm+W2PR1clToo - MrbT0mFTVtlbN6xFuJQar3wQz5Q9VksD+7XyPctrJdx4p5s605M5gKz8lJPSDwtGFbKboJ1blAN52vKb - PdXm80/AfDokTVu+8DfPXv9XCcIPTvjvLQ8YoakAAAAASUVORK5CYII= - - - \ No newline at end of file diff --git a/UpdateLib/TestApp/Properties/Resources.Designer.cs b/UpdateLib/TestApp/Properties/Resources.Designer.cs deleted file mode 100644 index 08bc180..0000000 --- a/UpdateLib/TestApp/Properties/Resources.Designer.cs +++ /dev/null @@ -1,71 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace TestApp.Properties -{ - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // 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")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources - { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() - { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager - { - get - { - if ((resourceMan == null)) - { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("TestApp.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture - { - get - { - return resourceCulture; - } - set - { - resourceCulture = value; - } - } - } -} diff --git a/UpdateLib/TestApp/Properties/Resources.resx b/UpdateLib/TestApp/Properties/Resources.resx deleted file mode 100644 index af7dbeb..0000000 --- a/UpdateLib/TestApp/Properties/Resources.resx +++ /dev/null @@ -1,117 +0,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/UpdateLib/TestApp/Properties/Settings.Designer.cs b/UpdateLib/TestApp/Properties/Settings.Designer.cs deleted file mode 100644 index 361ead0..0000000 --- a/UpdateLib/TestApp/Properties/Settings.Designer.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace TestApp.Properties -{ - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase - { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default - { - get - { - return defaultInstance; - } - } - } -} diff --git a/UpdateLib/TestApp/Properties/Settings.settings b/UpdateLib/TestApp/Properties/Settings.settings deleted file mode 100644 index 3964565..0000000 --- a/UpdateLib/TestApp/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/UpdateLib/TestApp/TestApp.csproj b/UpdateLib/TestApp/TestApp.csproj index 7ebd714..e06bb35 100644 --- a/UpdateLib/TestApp/TestApp.csproj +++ b/UpdateLib/TestApp/TestApp.csproj @@ -1,102 +1,34 @@ - - - + - Debug - AnyCPU - {7C3C0345-6D01-40A6-9F01-60D8D6451FB1} + net472 WinExe - Properties - TestApp - TestApp - v3.5 - 512 + false - AnyCPU - true full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 + bin\$(Configuration)\ Auto - - + - AnyCPU pdbonly - true - bin\Release\ - TRACE - prompt - 4 + bin\$(Configuration)\ - + {7C3C0345-6D01-40A6-9F01-60D8D6451FB1} TestApp.Program - - app.manifest - - - + + + - - - - - - - Properties\SharedAssemblyInfo.cs - - - Form - - - Form1.cs - - - - - - Form1.cs - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - True - Resources.resx - - - Designer - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - Settings.settings - True - - - - - {4394be57-95e2-45b1-a968-1404b0590b35} - UpdateLib - + Always @@ -107,12 +39,4 @@ Always - - \ No newline at end of file diff --git a/UpdateLib/TestApp/app.manifest b/UpdateLib/TestApp/app.manifest deleted file mode 100644 index a6b46bb..0000000 --- a/UpdateLib/TestApp/app.manifest +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/UpdateLib/UpdateLib.Generator/Data/FilesPage/GenFile.cs b/UpdateLib/UpdateLib.Generator/Data/FilesPage/GenFile.cs deleted file mode 100644 index 14edd17..0000000 --- a/UpdateLib/UpdateLib.Generator/Data/FilesPage/GenFile.cs +++ /dev/null @@ -1,68 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.IO; - -namespace MatthiWare.UpdateLib.Generator.Data.FilesPage -{ - public class GenFile : IGenItem - { - public event EventHandler Changed; - - private FileInfo m_fileInfo; - public FileInfo FileInfo - { - get { return m_fileInfo; } - set { m_fileInfo = value; Changed?.Invoke(this, EventArgs.Empty); } - } - - public string Name { get { return FileInfo?.Name ?? string.Empty; } set { Changed?.Invoke(this, EventArgs.Empty); } } - public string RealPath { get { return FileInfo?.FullName ?? string.Empty; } } - public string Extension { get { return FileInfo?.Extension ?? string.Empty; } } - public string Size { get { return ConvertBytesToSizeString(FileInfo?.Length ?? 0); } } - - public GenFolder Parent { get; set; } - - public ListViewGenItem View { get; set; } - - public GenFile(FileInfo file) - { - FileInfo = file; - - View = new ListViewGenItem(this); - } - - private static string ConvertBytesToSizeString(long size) - { - size = Math.Max(0, size); - - double kb = Math.Ceiling(size / 1024.0); - - return $"{kb.ToString("N0")} kB"; - } - - public string[] GetListViewItems() - { - return new string[] { Name, "File", FileInfo.LastWriteTime.ToString(), Size }; - } - public string GetListViewImageKey() - { - return Extension; - } - } -} diff --git a/UpdateLib/UpdateLib.Generator/Data/FilesPage/GenFolder.cs b/UpdateLib/UpdateLib.Generator/Data/FilesPage/GenFolder.cs deleted file mode 100644 index 63ebf75..0000000 --- a/UpdateLib/UpdateLib.Generator/Data/FilesPage/GenFolder.cs +++ /dev/null @@ -1,83 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System.Collections.Generic; -using System.Linq; -using System.Windows.Forms; - -namespace MatthiWare.UpdateLib.Generator.Data.FilesPage -{ - public class GenFolder - { - public string Name { get; set; } - public string PathVariable { get; set; } - public List Items { get; private set; } = new List(); - public List Directories { get; private set; } = new List(); - public GenFolder ParentFolder { get; set; } - public bool IsRoot { get { return ParentFolder == null; } } - public bool ProtectedFolder { get; set; } = false; - - public ListViewFolder FolderListView { get; set; } - public TreeViewFolderNode FolderTreeView { get; set; } - - public int Count - { - get - { - return Items.Count + Directories.Sum(d => d.Count); - } - } - - public GenFolder(string name, ContextMenuStrip menu) - { - Name = name; - - FolderListView = new ListViewFolder(name, this); - FolderTreeView = new TreeViewFolderNode(name, this); - - FolderTreeView.ContextMenuStrip = menu; - - } - - public void Add(IGenItem item) - { - item.Parent = this; - Items.Add(item); - } - - public void Add(GenFolder folder) - { - folder.ParentFolder = this; - Directories.Add(folder); - FolderTreeView.Nodes.Add(folder.FolderTreeView); - } - - public void Remove(IGenItem item) - { - Items.Remove(item); - item.View.Remove(); - } - - public void Remove(GenFolder folder) - { - Directories.Remove(folder); - FolderTreeView.Nodes.Remove(folder.FolderTreeView); - folder.FolderListView.Remove(); - } - - } -} diff --git a/UpdateLib/UpdateLib.Generator/Data/FilesPage/GenReg.cs b/UpdateLib/UpdateLib.Generator/Data/FilesPage/GenReg.cs deleted file mode 100644 index a41064d..0000000 --- a/UpdateLib/UpdateLib.Generator/Data/FilesPage/GenReg.cs +++ /dev/null @@ -1,115 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using Microsoft.Win32; -using System; - -namespace MatthiWare.UpdateLib.Generator.Data.FilesPage -{ - public class GenReg : IGenItem - { - public event EventHandler Changed; - - private RegistryValueKind m_type; - public RegistryValueKind Type - { - get { return m_type; } - set - { - m_type = value; - Changed?.Invoke(this, EventArgs.Empty); - } - } - - private string m_name; - public string Name - { - get { return m_name; } - set - { - m_name = value; - Changed?.Invoke(this, EventArgs.Empty); - } - } - - private object m_value; - public object Value - { - get { return m_value; } - set - { - m_value = value; - Changed?.Invoke(this, EventArgs.Empty); - } - } - - public GenFolder Parent { get; set; } - public ListViewGenItem View { get; set; } - - public GenReg(string name, RegistryValueKind kind = RegistryValueKind.String) - { - Name = name; - Type = kind; - - View = new ListViewGenItem(this); - } - - public string[] GetListViewItems() - { - return new string[] { Name, GetTypeName(), Value?.ToString() ?? string.Empty }; - } - - private string GetTypeName() - { - switch (Type) - { - case RegistryValueKind.ExpandString: - return "REG_EXPANDED_SZ"; - case RegistryValueKind.MultiString: - return "REG_MULTI_SZ"; - case RegistryValueKind.Binary: - return "REG_BINARY"; - case RegistryValueKind.DWord: - return "REG_DWORD"; - case RegistryValueKind.QWord: - return "REG_QWORD"; - case RegistryValueKind.String: - case RegistryValueKind.Unknown: - default: - return "REG_SZ"; - } - } - - public string GetListViewImageKey() - { - switch (Type) - { - case RegistryValueKind.String: - case RegistryValueKind.ExpandString: - case RegistryValueKind.MultiString: - return "REG_SZ"; - case RegistryValueKind.Binary: - case RegistryValueKind.DWord: - case RegistryValueKind.QWord: - case RegistryValueKind.Unknown: - default: - return "REG_BIN"; - } - } - - } -} diff --git a/UpdateLib/UpdateLib.Generator/Data/FilesPage/IGenItem.cs b/UpdateLib/UpdateLib.Generator/Data/FilesPage/IGenItem.cs deleted file mode 100644 index 5ad1db5..0000000 --- a/UpdateLib/UpdateLib.Generator/Data/FilesPage/IGenItem.cs +++ /dev/null @@ -1,34 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; - -namespace MatthiWare.UpdateLib.Generator.Data.FilesPage -{ - public interface IGenItem - { - event EventHandler Changed; - - string Name { get; set; } - GenFolder Parent { get; set; } - ListViewGenItem View { get; set; } - - string[] GetListViewItems(); - string GetListViewImageKey(); - - } -} diff --git a/UpdateLib/UpdateLib.Generator/Data/ListViewFolder.cs b/UpdateLib/UpdateLib.Generator/Data/ListViewFolder.cs deleted file mode 100644 index 8acfcd9..0000000 --- a/UpdateLib/UpdateLib.Generator/Data/ListViewFolder.cs +++ /dev/null @@ -1,39 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using MatthiWare.UpdateLib.Generator.Data.FilesPage; -using System.Windows.Forms; - -namespace MatthiWare.UpdateLib.Generator.Data -{ - public class ListViewFolder : ListViewItem - { - internal const string FOLDER_KEY = "folderimagekey"; - - public GenFolder Folder { get; set; } - - private ListViewFolder(string[] items, string imageKey) - : base(items, imageKey) - { } - - public ListViewFolder(string folderName, GenFolder folder) - : this(new string[] { folderName, "Folder", string.Empty, string.Empty }, FOLDER_KEY) - { - Folder = folder; - } - } -} diff --git a/UpdateLib/UpdateLib.Generator/Data/ListViewGenItem.cs b/UpdateLib/UpdateLib.Generator/Data/ListViewGenItem.cs deleted file mode 100644 index dc4d66f..0000000 --- a/UpdateLib/UpdateLib.Generator/Data/ListViewGenItem.cs +++ /dev/null @@ -1,45 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using MatthiWare.UpdateLib.Generator.Data.FilesPage; -using System; -using System.Windows.Forms; - -namespace MatthiWare.UpdateLib.Generator.Data -{ - public class ListViewGenItem : ListViewItem - { - public IGenItem Item { get; set; } - - public ListViewGenItem(IGenItem item) - : base(item.GetListViewItems(), item.GetListViewImageKey()) - { - Item = item; - Item.Changed += Item_Changed; - } - - private void Item_Changed(object sender, EventArgs e) - { - string[] items = Item.GetListViewItems(); - - for (int i = 0; i < items.Length; i++) - SubItems[i].Text = items[i]; - - ImageKey = Item.GetListViewImageKey(); - } - } -} diff --git a/UpdateLib/UpdateLib.Generator/Data/TreeViewFolderNode.cs b/UpdateLib/UpdateLib.Generator/Data/TreeViewFolderNode.cs deleted file mode 100644 index fbfdfa6..0000000 --- a/UpdateLib/UpdateLib.Generator/Data/TreeViewFolderNode.cs +++ /dev/null @@ -1,38 +0,0 @@ -using MatthiWare.UpdateLib.Generator.Data.FilesPage; -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System.Windows.Forms; - -namespace MatthiWare.UpdateLib.Generator.Data -{ - public class TreeViewFolderNode : TreeNode - { - internal const string FOLDER_KEY = "folderimagekey"; - - public GenFolder Folder { get; set; } - - public TreeViewFolderNode(string folderName, GenFolder folder, string imageKey = FOLDER_KEY) - { - Text = folderName; - ImageKey = imageKey; - SelectedImageKey = imageKey; - Folder = folder; - } - - } -} diff --git a/UpdateLib/UpdateLib.Generator/Files/ProjectFile.cs b/UpdateLib/UpdateLib.Generator/Files/ProjectFile.cs deleted file mode 100644 index 5ef1c4c..0000000 --- a/UpdateLib/UpdateLib.Generator/Files/ProjectFile.cs +++ /dev/null @@ -1,36 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; - -namespace MatthiWare.UpdateLib.Generator.Files -{ - [Serializable] - public class ProjectFile - { - - #region General Info - #endregion - - #region Files - #endregion - - #region Registry - #endregion - - } -} diff --git a/UpdateLib/UpdateLib.Generator/Generator_logo.ico b/UpdateLib/UpdateLib.Generator/Generator_logo.ico deleted file mode 100644 index e51a99254ab13f7ed8d310bb5b58ffa05f5dff2b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 167188 zcmcG$byyVd_dh(l)Y1q@r%Fjncc~~UqKJ|L79i58)Gn=vprW9(AgI&=(zSpRlF~{o z(jhD%EdAU|==<~i{rz|y=9<~rotaaw6ZaV*2nJC@gnuxI2O9E#pdPS~MD8C8B4E&G z&%A)c# zo`dsr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C zR}27ozN=|`Kw}Vo{6Xz8&5@7WGKG!R$gecD-?iOz@ZRKi;CgCcP6@oJZfL5?`jXjxA+ldD;B@m`7e2&Cmvs&X}Y#FHO)l zq^L_xGuiz7Sb!hX@Z)i!hsT5F6J+!8->H+xmqGn->W>S{;Q7iwFPl<+J`gR6%8<>+ zf9Lb^DdED82ZTJ~pO;Pfe8QBcM<^TFeEfG|KH+C!8Io}cpQTVL%p?1m?;8vrJeazO za)WFh;dknX;JLDfax+SPL|HvUJ{5`dJMJ^kEH1CA_uwtQ+;EOM8=L;@?=WIx&pzX; zDO+BwhQBw&h^;)WG!Zij+8Id$Q%Np1Y+Y5Y585H44Kl5j(iy&5XdlehNb#&*?eMms zgMD2(E0@m1Z9N~?Ef@BJHp@60TD#eJ#x0&t+im#>=(%nT^je4Ok;wrte02~|Uv})e ziQv5r&!F8I2>~f+%Zh7`;rr%7%$5Y0x&zl0_b0%jRP1wRZh-A)_QKxGL(=uXV<(QY zwZ3zAFTusjm)M!C)Q=SQAMZUZSkGhrZvOg%wGC7^zxEa7_K~Qq`WnCTfOLQhKmT9N z+CqEGI`wK*t;W_DjZKUU^z|D3TBBLzAE{$(*`{?X^OkirTIl{>A6q7ol{NjKqt#eb zy*jp5qPFd=+qQ0Hrq - /// 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.components = new System.ComponentModel.Container(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); - this.SidebarPanel = new System.Windows.Forms.Panel(); - this.ContentPanel = new System.Windows.Forms.Panel(); - this.btnTabBuild = new MatthiWare.UpdateLib.Generator.UI.FlatButton(); - this.btnTabRegistry = new MatthiWare.UpdateLib.Generator.UI.FlatButton(); - this.btnTabFiles = new MatthiWare.UpdateLib.Generator.UI.FlatButton(); - this.btnTabInformation = new MatthiWare.UpdateLib.Generator.UI.FlatButton(); - this.HeaderPanel = new MatthiWare.UpdateLib.Generator.UI.MoveablePanel(); - this.pbMinimize = new MatthiWare.UpdateLib.Generator.UI.HoverPictureBox(); - this.pbMaximize = new MatthiWare.UpdateLib.Generator.UI.HoverPictureBox(); - this.pbClose = new MatthiWare.UpdateLib.Generator.UI.HoverPictureBox(); - this.pbIcon = new System.Windows.Forms.PictureBox(); - this.lblTitle = new System.Windows.Forms.Label(); - this.elipseComponent1 = new MatthiWare.UpdateLib.Generator.UI.ElipseComponent(this.components); - this.SidebarPanel.SuspendLayout(); - this.HeaderPanel.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pbMinimize)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.pbMaximize)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.pbClose)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.pbIcon)).BeginInit(); - this.SuspendLayout(); - // - // SidebarPanel - // - this.SidebarPanel.BackColor = System.Drawing.Color.DarkGray; - this.SidebarPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.SidebarPanel.Controls.Add(this.btnTabBuild); - this.SidebarPanel.Controls.Add(this.btnTabRegistry); - this.SidebarPanel.Controls.Add(this.btnTabFiles); - this.SidebarPanel.Controls.Add(this.btnTabInformation); - this.SidebarPanel.Dock = System.Windows.Forms.DockStyle.Left; - this.SidebarPanel.Location = new System.Drawing.Point(0, 33); - this.SidebarPanel.Name = "SidebarPanel"; - this.SidebarPanel.Size = new System.Drawing.Size(233, 505); - this.SidebarPanel.TabIndex = 1; - // - // ContentPanel - // - this.ContentPanel.AutoScroll = true; - this.ContentPanel.BackColor = System.Drawing.SystemColors.Control; - this.ContentPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.ContentPanel.Dock = System.Windows.Forms.DockStyle.Fill; - this.ContentPanel.Location = new System.Drawing.Point(233, 33); - this.ContentPanel.Name = "ContentPanel"; - this.ContentPanel.Size = new System.Drawing.Size(806, 505); - this.ContentPanel.TabIndex = 2; - // - // btnTabBuild - // - this.btnTabBuild.ActiveItem = false; - this.btnTabBuild.BackHoverColor = System.Drawing.Color.LightGray; - this.btnTabBuild.BackSelectedColor = System.Drawing.Color.DimGray; - this.btnTabBuild.Dock = System.Windows.Forms.DockStyle.Top; - this.btnTabBuild.Font = new System.Drawing.Font("Century Gothic", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btnTabBuild.InfoImage = ((System.Drawing.Image)(resources.GetObject("btnTabBuild.InfoImage"))); - this.btnTabBuild.Location = new System.Drawing.Point(0, 189); - this.btnTabBuild.Name = "btnTabBuild"; - this.btnTabBuild.Size = new System.Drawing.Size(231, 63); - this.btnTabBuild.TabIndex = 3; - this.btnTabBuild.Text = "Build"; - this.btnTabBuild.Click += new System.EventHandler(this.btnTabBuild_Click); - // - // btnTabRegistry - // - this.btnTabRegistry.ActiveItem = false; - this.btnTabRegistry.BackHoverColor = System.Drawing.Color.LightGray; - this.btnTabRegistry.BackSelectedColor = System.Drawing.Color.DimGray; - this.btnTabRegistry.Dock = System.Windows.Forms.DockStyle.Top; - this.btnTabRegistry.Font = new System.Drawing.Font("Century Gothic", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btnTabRegistry.InfoImage = global::MatthiWare.UpdateLib.Generator.Properties.Resources.Registry_Editor_32px; - this.btnTabRegistry.Location = new System.Drawing.Point(0, 126); - this.btnTabRegistry.Name = "btnTabRegistry"; - this.btnTabRegistry.Size = new System.Drawing.Size(231, 63); - this.btnTabRegistry.TabIndex = 2; - this.btnTabRegistry.Text = "Registry"; - this.btnTabRegistry.Click += new System.EventHandler(this.btnTabRegistry_Click); - // - // btnTabFiles - // - this.btnTabFiles.ActiveItem = false; - this.btnTabFiles.BackHoverColor = System.Drawing.Color.LightGray; - this.btnTabFiles.BackSelectedColor = System.Drawing.Color.DimGray; - this.btnTabFiles.Dock = System.Windows.Forms.DockStyle.Top; - this.btnTabFiles.Font = new System.Drawing.Font("Century Gothic", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btnTabFiles.InfoImage = ((System.Drawing.Image)(resources.GetObject("btnTabFiles.InfoImage"))); - this.btnTabFiles.Location = new System.Drawing.Point(0, 63); - this.btnTabFiles.Name = "btnTabFiles"; - this.btnTabFiles.Size = new System.Drawing.Size(231, 63); - this.btnTabFiles.TabIndex = 1; - this.btnTabFiles.Text = "Files"; - this.btnTabFiles.Click += new System.EventHandler(this.flatButton2_Click); - // - // btnTabInformation - // - this.btnTabInformation.ActiveItem = false; - this.btnTabInformation.BackHoverColor = System.Drawing.Color.LightGray; - this.btnTabInformation.BackSelectedColor = System.Drawing.Color.DimGray; - this.btnTabInformation.Dock = System.Windows.Forms.DockStyle.Top; - this.btnTabInformation.Font = new System.Drawing.Font("Century Gothic", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btnTabInformation.InfoImage = ((System.Drawing.Image)(resources.GetObject("btnTabInformation.InfoImage"))); - this.btnTabInformation.Location = new System.Drawing.Point(0, 0); - this.btnTabInformation.Name = "btnTabInformation"; - this.btnTabInformation.Size = new System.Drawing.Size(231, 63); - this.btnTabInformation.TabIndex = 0; - this.btnTabInformation.Text = "Update Information"; - this.btnTabInformation.Click += new System.EventHandler(this.flatButton1_Click); - // - // HeaderPanel - // - this.HeaderPanel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(78)))), ((int)(((byte)(99)))), ((int)(((byte)(133))))); - this.HeaderPanel.Controls.Add(this.pbMinimize); - this.HeaderPanel.Controls.Add(this.pbMaximize); - this.HeaderPanel.Controls.Add(this.pbClose); - this.HeaderPanel.Controls.Add(this.pbIcon); - this.HeaderPanel.Controls.Add(this.lblTitle); - this.HeaderPanel.Dock = System.Windows.Forms.DockStyle.Top; - this.HeaderPanel.Location = new System.Drawing.Point(0, 0); - this.HeaderPanel.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.HeaderPanel.Name = "HeaderPanel"; - this.HeaderPanel.ParentForm = this; - this.HeaderPanel.Size = new System.Drawing.Size(1039, 33); - this.HeaderPanel.TabIndex = 1; - // - // pbMinimize - // - this.pbMinimize.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.pbMinimize.Image = ((System.Drawing.Image)(resources.GetObject("pbMinimize.Image"))); - this.pbMinimize.Location = new System.Drawing.Point(965, 5); - this.pbMinimize.Name = "pbMinimize"; - this.pbMinimize.Size = new System.Drawing.Size(24, 24); - this.pbMinimize.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; - this.pbMinimize.TabIndex = 4; - this.pbMinimize.TabStop = false; - this.pbMinimize.Click += new System.EventHandler(this.pbMinimize_Click); - // - // pbMaximize - // - this.pbMaximize.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.pbMaximize.BackColor = System.Drawing.Color.Transparent; - this.pbMaximize.Image = ((System.Drawing.Image)(resources.GetObject("pbMaximize.Image"))); - this.pbMaximize.Location = new System.Drawing.Point(988, 5); - this.pbMaximize.Name = "pbMaximize"; - this.pbMaximize.Size = new System.Drawing.Size(24, 24); - this.pbMaximize.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; - this.pbMaximize.TabIndex = 3; - this.pbMaximize.TabStop = false; - this.pbMaximize.Click += new System.EventHandler(this.pbMaximize_Click); - // - // pbClose - // - this.pbClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.pbClose.Image = ((System.Drawing.Image)(resources.GetObject("pbClose.Image"))); - this.pbClose.Location = new System.Drawing.Point(1011, 5); - this.pbClose.Name = "pbClose"; - this.pbClose.Size = new System.Drawing.Size(24, 24); - this.pbClose.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; - this.pbClose.TabIndex = 2; - this.pbClose.TabStop = false; - this.pbClose.Click += new System.EventHandler(this.pbClose_Click); - // - // pbIcon - // - this.pbIcon.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pbIcon.BackgroundImage"))); - this.pbIcon.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.pbIcon.Location = new System.Drawing.Point(5, 5); - this.pbIcon.Name = "pbIcon"; - this.pbIcon.Size = new System.Drawing.Size(24, 24); - this.pbIcon.TabIndex = 1; - this.pbIcon.TabStop = false; - // - // lblTitle - // - this.lblTitle.AutoSize = true; - this.lblTitle.BackColor = System.Drawing.Color.Transparent; - this.lblTitle.Font = new System.Drawing.Font("Century Gothic", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblTitle.ForeColor = System.Drawing.Color.WhiteSmoke; - this.lblTitle.Location = new System.Drawing.Point(31, 6); - this.lblTitle.Name = "lblTitle"; - this.lblTitle.Size = new System.Drawing.Size(157, 21); - this.lblTitle.TabIndex = 0; - this.lblTitle.Text = "Update Generator"; - // - // elipseComponent1 - // - this.elipseComponent1.Control = this; - this.elipseComponent1.Radius = 5; - // - // TestForm - // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.AutoSize = true; - this.BackColor = System.Drawing.SystemColors.ControlLight; - this.ClientSize = new System.Drawing.Size(1039, 538); - this.Controls.Add(this.ContentPanel); - this.Controls.Add(this.SidebarPanel); - this.Controls.Add(this.HeaderPanel); - this.DoubleBuffered = true; - this.Font = new System.Drawing.Font("Century Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; - this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.Name = "TestForm"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "TestForm"; - this.Click += new System.EventHandler(this.TestForm_Click); - this.SidebarPanel.ResumeLayout(false); - this.HeaderPanel.ResumeLayout(false); - this.HeaderPanel.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pbMinimize)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.pbMaximize)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.pbClose)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.pbIcon)).EndInit(); - this.ResumeLayout(false); - - } - - #endregion - - private UI.ElipseComponent elipseComponent1; - private System.Windows.Forms.Label lblTitle; - private System.Windows.Forms.Panel SidebarPanel; - private UI.MoveablePanel HeaderPanel; - private System.Windows.Forms.PictureBox pbIcon; - private UI.HoverPictureBox pbClose; - private UI.HoverPictureBox pbMinimize; - private UI.HoverPictureBox pbMaximize; - private UI.FlatButton btnTabInformation; - private UI.FlatButton btnTabFiles; - private UI.FlatButton btnTabBuild; - internal System.Windows.Forms.Panel ContentPanel; - private UI.FlatButton btnTabRegistry; - } -} \ No newline at end of file diff --git a/UpdateLib/UpdateLib.Generator/MainForm.cs b/UpdateLib/UpdateLib.Generator/MainForm.cs deleted file mode 100644 index 5e39ca6..0000000 --- a/UpdateLib/UpdateLib.Generator/MainForm.cs +++ /dev/null @@ -1,206 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.Collections.Generic; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Windows.Forms; - -using MatthiWare.UpdateLib.Generator.UI; -using MatthiWare.UpdateLib.Generator.UI.Pages; -using MatthiWare.UpdateLib.Tasks; -using MatthiWare.UpdateLib.UI; - -namespace MatthiWare.UpdateLib.Generator -{ - public partial class MainForm : Form - { - private Dictionary pageCache; - private AsyncTask loadTask; - private bool shouldShowNewPage = false; - - public MainForm() - { - InitializeComponent(); - - pageCache = new Dictionary(); - - LoadPagesTask().Start(); - } - - public bool TryGetPage(string key, out PageControlBase page) => pageCache.TryGetValue(key, out page); - - private AsyncTask LoadPagesTask() - { - if (loadTask == null) - { - LoaderControl.Show(ContentPanel); - - Action loadAction = new Action(() => - { - var pageType = typeof(PageControlBase); - var types = AppDomain.CurrentDomain.GetAssemblies() - .SelectMany(asm => asm.GetTypes()) - .Where(type => pageType.IsAssignableFrom(type) && !type.IsAbstract && type.IsClass && pageType != type); - - foreach (Type type in types) - { - var name = type.Name; - - PageControlBase page = Activator.CreateInstance(type) as PageControlBase; - page.TestForm = this; - - pageCache.Add(name, page); - } - }); - - loadTask = AsyncTaskFactory.From(loadAction, null); - - loadTask.TaskCompleted += (o, e) => - { - LoaderControl.Hide(ContentPanel); - - btnTabInformation.PerformClick(); - }; - } - - return loadTask; - } - - private void TestForm_Click(object sender, EventArgs e) - { - WindowState = (WindowState == FormWindowState.Maximized) ? FormWindowState.Normal : FormWindowState.Maximized; - } - - private void pbMinimize_Click(object sender, EventArgs e) - { - WindowState = FormWindowState.Minimized; - } - - private void pbMaximize_Click(object sender, EventArgs e) - { - MaximumSize = Screen.FromControl(this).WorkingArea.Size; - WindowState = (WindowState == FormWindowState.Normal ? FormWindowState.Maximized : FormWindowState.Normal); - } - - private void pbClose_Click(object sender, EventArgs e) => Close(); - - private void flatButton1_Click(object sender, EventArgs e) => LoadPage(nameof(InformationPage)); - - private void flatButton2_Click(object sender, EventArgs e) => LoadPage(nameof(FilesPage)); - - private bool LoadPage(string pageName) - { - loadTask.AwaitTask(); - - bool success = TryGetPage(pageName, out PageControlBase page); - - if (success) - { - shouldShowNewPage = true; - - if (page.IsPageInitialized) - { - AddControlToContentPanel(page); - } - else - { - AddControlToContentPanel(null); - - LoaderControl.Show(ContentPanel); - - page.InitializePage((o, e) => - { - LoaderControl.Hide(ContentPanel); - - if (e.Cancelled) - { - ShowMessageBox( - "Page Load", - "Task cancelled", - "The loading of the page got cancelled.", - SystemIcons.Warning, - MessageBoxButtons.OK); - - return; - } - - if (e.Error != null) - { - ShowMessageBox( - "Page Load", - "Error occured when loading the page", - "Check the log files for more information!", - SystemIcons.Error, - MessageBoxButtons.OK); - - return; - } - - AddControlToContentPanel(page); - }); - } - } - - return success; - } - - private void ShowMessageBox(string title, string header, string desc, Icon icon, MessageBoxButtons buttons = MessageBoxButtons.YesNo) - { - MessageDialog.Show( - this, - title, - header, - desc, - icon, - buttons); - } - - private void AddControlToContentPanel(Control toAdd) - { - if (!shouldShowNewPage) - return; - - ContentPanel.SuspendLayout(); - - ContentPanel.Controls.Clear(); - - if (toAdd != null) - { - toAdd.Dock = DockStyle.Fill; - ContentPanel.Controls.Add(toAdd); - - shouldShowNewPage = false; - } - - ContentPanel.ResumeLayout(); - - } - - private void btnTabBuild_Click(object sender, EventArgs e) - { - LoadPage(nameof(BuilderPage)); - } - - private void btnTabRegistry_Click(object sender, EventArgs e) - { - LoadPage(nameof(RegistryPage)); - } - } -} diff --git a/UpdateLib/UpdateLib.Generator/MainForm.resx b/UpdateLib/UpdateLib.Generator/MainForm.resx deleted file mode 100644 index f6759bb..0000000 --- a/UpdateLib/UpdateLib.Generator/MainForm.resx +++ /dev/null @@ -1,202 +0,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 - - - - - iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAfpJREFUWEft - 1ctLFVEAx/GJjB5UZGkPopAWYYG1cO+/oP4BbiMkLagEV27qP+gPyb3to8iKSlFX4kIUNTUz6KXf7zgH - LsPcuo8zBHF/8GFmzpw758ycx01a+d9yAt0Hp2mu4vDBafm5hc/4lF4lySHMYAnXLSg7bVjFd2xmfmEZ - pX6F27CBCdjgXo5lIziCHkRNJ77BN/+dnT/ARVzGY/zED6xjA8cRLb2YhY37tsPI5ym8ZyecEzcQNY69 - b6mjFuTSBTvgXCglf+vAFdiBlfQqcm5iDs58GxlCPk/gPYdpEs6bhuODFOKEcmLJ8m04D47hFMbg2LsS - 7OQial6SPiDf23wHTB/O4hnC/bxxXIJ1a8o5TGMe1/AI7xDG+i0ewglmnTdwt/Mtd+Fy9Oj1GpwndcU3 - /wB7/yU7FtnJjnbO8bfh5wj5CLdnt+m6cwFbsAEn2gA6MoNYgPescx7GofCrhPjH5B9UQ7kHG3CjOWNB - Lu2wY9a5b0HsvIIP70+viuOXsM7L9CpSfKCcbB5dDdVyGtYJW7GaTnhQ6MBJVEspHQj5Z0MQUs8kHLUg - dlxObiY2EJah88HPXrkMXfuVSy9KXOvvYQNhsynyNTta199Ei5vHC7yGm8zd7NzJJs/vwB3T8yk0vOFU - S61/Rtb501KNmqIOtNJKE0mSfboRqJMj/kopAAAAAElFTkSuQmCC - - - - - iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAUhJREFUWEft - lj1KA1EUhUdJb6VuwEpBXIOlK7ASCwsLtbVzBVZWbkG0cwVWbkAlZdogWFjY+fOd4l2GcS5zr7wEBT/4 -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N9JREFUSEvt - VTkOwjAQzA/gBRQ8hOs/CERDm5Jn8MK4sBO7g11pLY20TrSO24w08ioz40mR2N2GKjjn9jHGcwuHYdjJ - dhre+9s4jr8WUslJttPIBdM0PWi+1pAyL3PBomkGpiyaUkpHequPheytLqD5wrOF7F1dwKvICujBrMga - aMrhEMKX1r5E0doKLGwq4FVkBfRgVmQNNGFYZAX0YFZkDTRhWGQF9GBWZA005bCFqwqIB/pK3hayt7pA - HplRVUC//52MxeN4jpR5mgtauFjAFw6VFI9jKxcvnA0aXfcH9fiuLoI2qioAAAAASUVORK5CYII= - - - - - iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABGdBTUEAALGPC/xhBQAAATNJREFUSEvt - lc1qwkAUhVO79ocudOOzVPR9SqWbbtNi60YUXLizLvs6voHbQkhCyN8yPXc4EUJimMxs/eDg3Js75zhR - EudOJ8IwHOV5PrNREARD2tWJ43iRpmlhI4Q8065OGZBl2SvW8y7CnjftgNahG2jtbRryfX/AZYWiKB48 - z+uzNAtAPUZ9gVw1QMQcvT10LkOMT4B6JT3c443UMO+hPkoP+lRDwDhAQO9L+kmSbPFZmn/wssIqQED/ - m8Y1c8EqgLflh+bqJLx0xTiA5ieau5A6CUJ2HFEYBcD8EUa/NHxXQwA/+LoMkX+U9IwCYDRF/SeGaoCI - KfoH6BJF0ZP0jAIEfMsJlxUkBPNjluYBunQKwC15wWDj4/iWsGepHWCj1gB54SCk8XGsq9YXzp06jvMP - ywAf8wYrhBkAAAAASUVORK5CYII= - - - - - iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAmxJREFUWEft - ljuLFEEUhUdUWNBATXzjnzEUFMUHJiImq4hipIIogomKGomYmGhiJLK+138giOIDVxE0E9dlHjuzMz06 - e/2qOdXWzmxPVycLwhw4dPetc+6tqa7pupURRiiDVss21jt2rNax5/AjnK61bYbrl2rHJmqJnZ2Zs62S - D4DxM7otB5Juocht2IVWwN/VxO5Ot2yT7CmIX3bjeowHyXZjbCq5Zwe+hi/hJKvwimsCQ03DeV0O7q/4 - eJo0FizrKUzz3gzfsYz7f5qtliSDmY3VEzuI50Og7/HKXgTP8RNg9jtdAhl77v1RZLmGc4FmJRM5j+eP - vAso2XD8mrPNiBsyueJ7NBQNJvHYFw2p4eGg4B1vINE5haPBsl8Li4aUJB/Vtm1D6JdviiVdoaEoUPy6 - L7YYJcsHCU54MZM5pHAhmOgyvDfCYotR8nwgeipxt2q2RuFC/DBbhWd7ESXPB6Ip6CbwRqGlBYVnNYEn - Cv3/4Mf419pQaGlB4beawCeF8sE3YG8hzdZKXoi62ToKp4cYn+lHCudDM81nYqcljQJ/5cOBf1zhfATi - QZYs7s4FfJ/l77p+QkP5yIr1s2RxB379xSDHTYWHIzD8Y9vuazgaeI7g9Ud5rdm0DRoajqzoQs6T8FLM - uYBmDP3VwNtrdGyHhosRGI1v+0OuWUPC83tOxwOuiOQZtNvH4Xevhz12/klJ4pCZ9c657uPZfx09E7Vh - k9C1Za496+8XZ2lqdqVJyyA1920415Syoe4xFtOUOs0t19TIXg4s8QXdDoCNtJ7XcJwCD+A36BpR16B+ - hc/g0ejNNsIIKSqVv+0vKJgA+u+XAAAAAElFTkSuQmCC - - - - 17, 17 - - \ No newline at end of file diff --git a/UpdateLib/UpdateLib.Generator/Program.cs b/UpdateLib/UpdateLib.Generator/Program.cs index 5b2e883..5794640 100644 --- a/UpdateLib/UpdateLib.Generator/Program.cs +++ b/UpdateLib/UpdateLib.Generator/Program.cs @@ -15,9 +15,7 @@ * along with this program. If not, see . */ -using MatthiWare.UpdateLib.Logging.Writers; using System; -using System.Windows.Forms; namespace MatthiWare.UpdateLib.Generator { @@ -29,11 +27,11 @@ static class Program [STAThread] static void Main() { - Updater.Instance.ConfigureLogger((logger) => logger.Writers.Add(new ConsoleLogWriter())); + //Updater.Instance.ConfigureLogger((logger) => logger.Writers.Add(new ConsoleLogWriter())); - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new MainForm()); + //Application.EnableVisualStyles(); + //Application.SetCompatibleTextRenderingDefault(false); + //Application.Run(new MainForm()); } } } diff --git a/UpdateLib/UpdateLib.Generator/Resources/Registry Editor_16px.png b/UpdateLib/UpdateLib.Generator/Resources/Registry Editor_16px.png deleted file mode 100644 index c98ba682f74a8e9c8487807d821aef264c2c6b28..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 342 zcmV-c0jd6pP)PyvU_Y<%c87Lrim6W#2nvX>?$Dh;E70U8Kj{E_-zb1@$9=JXjNf o7WG={9qT3VE+sk7%#nYmFYQ)1@8QzLGynhq07*qoM6N<$f(Yu9{Qv*} diff --git a/UpdateLib/UpdateLib.Generator/Resources/Registry Editor_32px.png b/UpdateLib/UpdateLib.Generator/Resources/Registry Editor_32px.png deleted file mode 100644 index edcd6f81df4b24e5a6ed481944d57df3a520f616..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 569 zcmV-90>=G`P)+l@zRsA7^Z*T#1ScWL;JYrAf_=w3lI0X;+ON{w2xzf+W^~yY9@)x+d z-`pD*p#B&_(Ay%`z+6Z(SxaVAO_msRBO~dRx_KUg{&*vrlV-A(%&3|?WAF^lVGvX= zj}7pEAB|{En#o!+@+JU%h(+8S{dPQdyfaRJQpV7Zv`HqiICaKtv|krnC}prUtE zbiEL9IBib74=h-JCyu~%y~h}X2T)0Mri75mS~MQ=n1C8w*JBL-Jnj8S{uy3DDLE|Z zkhP@VP5E0)`~Ekgx$IF-K_NL%hIG>n3TG#YuVEg3gWf8!kZdkP+_XQ0;6JH9#2$#+ zCUL(v#6q%J(q?OE<;}2Y&nD5|2_d}Xp?6G-9%*YiAZeGiwDNXYv`0MfEA=8+e<2o@ z1CkC{ODpdwi|=3u>`fUBB|hn3)x3}MrePlrpaz9i_0V)K9@a%N0HqW+N{8;^rTaAH zzFm`X-$mPBpqBHEz3!Z)!gk)?O&hfR2AbZcQ*>^i9XD_ZM=9n!IB_Zn00000NkvXX Hu0mjf-ev*> diff --git a/UpdateLib/UpdateLib.Generator/Resources/cross.png b/UpdateLib/UpdateLib.Generator/Resources/cross.png deleted file mode 100644 index ecbd604965bfe5179caa0a005a97cfa6b9b50ec3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 912 zcmV;B18@9^P)F7{`yK0V=d$TiSY2XvE5`aId!oK9m-MmRoAuWLY}N5MwluX_%m)ya;H~7!;I9 zG#XvV68B;6$+FCC*{98z=%#Lx857Y)5ap#HZE3wNwKaWw(wJy``6d6HJkNQ4Ip^F< z9yB(t`p;q+xx0Duy>krXVI-1V@*c*G#+>Pzn!ZJ=)%z{O41KOtD$2#;738+nI{cuk zOPCoRhR1Gq_yo%yZ_dw`yeS7wCh0?)ttZgi8;*^Pz*1XVdE25 z@WkT*|KK3_+S``~H*Gp8OH0ck$e3QAD>xjUr(IpogrOmb_V+`wvlITWs+u#2L`~!i zh8dXJy?c57;6a${?S=5MV=&#?8g$e2(a&;nD12H6ba#iAupjH|gQVLHV@_vuTVCGf zOhRm=AUk{2QJwD8?9QFh;DH0M(9r>rLx*6psmXuK;kZ86(lQf6dAX+tVE=x&ZMR2k zGTBcAWsH;%L@5%aoiug!b%725>NnCoQ+NL8!SIgoXx)yIje!+S-UyrTQ5a z9+OGlLeZ(w9Pw`5Iv;X6!EZ7_u%rZ*C<+9X3a%6t1?uGT?{KablTO~pKvh-24VJwT zl*?g3B!YQDAczTPXTz5?Jx;0B+sKE&54GC2efz*8it_oeT*L%kt@C0r+@AFHAxNmc{?bBW zA^2X&36v-F`gjw|{=%(aziXtj^5QJVMQ^32!>_o171w)ZW$~}A*3lBBavc$P-oKcZ zmb!Kf~7%YUK#JLUb-F~iUVn3qRN6?|&E~v6?Dnr_ zc|Po^sQ4RY7dm3{7L{6U!H+!ujkm5Y-pR86=1QfXVq2El?60m~SC7|GWMzGlYJLD) mQIXC?)7>hGWEYllg1iLx?{j!Py0k6;0000Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D02y>eSaefwW^{L9 za%BK;VQFr3E^cLXAT%y8E-^DS16z6k00AUPL_t(IPmPjEPQySDMRPgE7{QV&u;m5_ zF$n|$Ay5zq1SbiEc}k9e@o0yj*wJwhO>@_~uANUkS_1-fG& z_%~dmRU0L6z(ku;s(D%CELnZgN^*fV%mvfju&4jLE#Z>UH%*g`(=1 eou)P?7^Oev)Ia1+K1=NY00009<7rA diff --git a/UpdateLib/UpdateLib.Generator/Resources/gears.png b/UpdateLib/UpdateLib.Generator/Resources/gears.png deleted file mode 100644 index f0fc2163923b7f72feecd3763e3299697cb1d607..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 446 zcmV;v0YUzWP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D02y>eSaefwW^{L9 za%BK;VQFr3E^cLXAT%y8E-^DS16z6k00AyZL_t(IPnFZlD@0KM$MK88U?rhurHE`u zv6F>{HU9v4`~@~j7Iyvs{t*9(4N53QA@5g_*Y|txoN3Cv)16;^ntRSY=bq<8b!M#m zJBr5SF@M_dh6DVdAGuS)CC;&qecWIfxzdVzEXAcLn#3=PaVaGem`WbwOye7S=)(^D zz$z-~h8t7B1zypG2Dsi?e87%cKqun#;0nihL}>JmLp);$+Ze|dI#5XyP7yjf`cqZ; z4(-T{Q?ZkcchLerx>>IKL@!b^2am*tFR*in>pz3PWB+}1Wd&==W35EdAKB+m%5=Nk#{d8T07*qoM6N<$f}{hu^8f$< diff --git a/UpdateLib/UpdateLib.Generator/Resources/image_transparent_16px.png b/UpdateLib/UpdateLib.Generator/Resources/image_transparent_16px.png deleted file mode 100644 index 3e26c140daf90a9e7a06563ad80f28f2b47ab3ab..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 484 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1qucLCF%=h?3y^w370~qEv>0#LT=By}Z;C1rt33 zJwsy?=IAP*sUe;&jv*HQy^~KCH93g5{{5`tS9l=7p&^d*Z|5&ya=4MV{l~2w0T#w41|ulGz@!e6#qw(q#|wAG=GlQ=V;A3P$V(&;!yrQlE#{unI)He z{7zQ+mIRxb2O=C5uU*N`clr;EeR%a-C*s#&sK}^*t-SAD+Y3W%$;1naKW{V ztb+*_B94(+a$Kvv?h-4oeQN)M{ruHgK-SL07@>1B7bk7MX>jdKw(-pN`Ejet8MW;H XtaX0-T$L#t7zqrXu6{1-oD!M<*f7VI diff --git a/UpdateLib/UpdateLib.Generator/Resources/loading.gif b/UpdateLib/UpdateLib.Generator/Resources/loading.gif deleted file mode 100644 index 62d8e4e54726c2634af80e1396191c15e645941c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 98823 zcmafaby!=^vv&eX2<{LdKnN~{;9A_>-L25#ZlwwC?of(rTbyF0!L2RQLZQW7S_-rj zsO9B*-}}4rKKFU={&RNs%}e{mu;xc)8N^>19&BJRx*j=uu8 za*E4-i(5Ox-EG88?&GBEaeA$|uh+P`W!!CH!x8JNnVP658LEj0qVRzL0N}REQqK^f z>J;R3dzDiN^K)`};1+~%cDv{4a~Juw{}mG9>3SDwA+Cqg^HXv2@YIY5a5IU}H+6}4 z;3DmcRFFr=g~^0@`+2(sIU&Nly?g>?!tNrSTz#G0WNz#KbPFL7|3(t@;4V_>pBspO zWUBZExFN&^QFmNW62b@xF+pK5l(d+%073*Mj1m$S5kg7c5k|>~OUj^x5&vG0x6%S! z-DQkb)&E`AZR;-5BPhsEMo1_$G*mEDRM0ozo{+G#w6qXPL`X#B&Mn2Az;K@+r?5Ld zf$aYpLDenLCBV}!$kW#c@z01(&c4AxcagW6{$CTk{q*$yV_=^^!GAMI(8bqVD9p)E zNLUahZh^kR0WNO0qpMcJm3+QoW13?GbeKbd?d85K}@)i3m%pN~sD9tBFb}OQ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6H1Ap9ZsX!_`tzw~Rnw=9YMGMT5vC1_q z%7NdAwBgKIRjs5cqho6`O>5?D>NN87=s4)C?kO#C(9Gmw+N>`8r4fEWGhnhv4^3wa z>|vV?aKk3WJXfbkMf*IrU=UucVQb3;vhT!mDsAkYtsR#N^!u%CZ}O@7;H7be+|4#! zuAH43GBrf-zZEisGugN~YhSCvIA)s!4;$LbqEQ|h$9|jJ7T9M7e-4yQad6S_C1deO hQ7LIj8Z*0sTks~3^G#ggFoQMY8783ce{zh%{{bQyG4%id diff --git a/UpdateLib/UpdateLib.Generator/Resources/loading_gear.gif b/UpdateLib/UpdateLib.Generator/Resources/loading_gear.gif deleted file mode 100644 index fef4ec0a9d9b1cda3d973b603e57ef3ecfeb78d9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 73023 zcmd?xbx<2>yEgg?PzX|jyIb+nqNRcacXtTxR@^-ySa5fD_X4H36}J|5cc-wvtkwOl zz0Y^{dC&f2pZ(38d!7k1A<2K4$#1Ufe#9lk`1ry7Px_x+KlyW>K7IP^*|X=*pCch5 zAtNKBprE{X@d6bU6%7py005w)qhnxTU}9ooVPU;|`4Sr&8wdpA;Nalm;^N`q;p5{I z5D*X&5)u&+5fc-WkdTm)l9G{;k&}~CP*6}(Qc_V-QBzaX(9qD*($dkFDU_{*RB|f7l+&zTUc0FSy?$cI=Z^LdU<*I`S}G0 z2SXqb7z`E>5fL37osf`_oSdARnwpW3k)54gP*6}@TwGRGR#8z=UR|Bn+LF-K88kFt zIX$lYb4KZ(pM_bae|nS`W>pqu)fQ&e7iKjU<}?@Pv=-;I7w2>q=kylm4VQixE&VWE z{%NuN(`seGW@W*4Wx;M`(SCK&adq+Y>XP%?lIz;C``WVC`ik%RO33C~*w%XF)_U~z zM(oaJ{LW_5?pDg~R@&}X`rdZN-geIZPQm_e>A_yb;a=6ze(ljg{qaH5@nPHXVdv37 z_rdmR6mHD;RpBwATTU%>;d+WzXYiFn1XJ?1!=O>7BadCEe zd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v+XWjlxg`H8|>$ zWD7T4Y?|Iryn?NK7^HizQT~uDGAVabJT%I_AID}W8o%2l$7idTin2e}Z+QFG1p=XK zSHP?1(o)vEW3JJ4QR2&6xpj8$p*6KbYRZE5lG-)POUK>>KMvlDhKrWxL=SNlE~{US zE-}dMz%#U#jk4{VN@}AYo!nci=a99r!L)61dJ1rrY=Sy5T>1+!`4N%Q-mLLW*7-SY z2TV)Tp+#O$W%>ItdGey62M)E*!X8Fyvd@PVR4359)KKB~kx2{zp z!U6Qtf_7K*BZOciD}Ib!yP{!9fx*E772U2ZJAp?-;;7`&tW87A&$*;uLa=VyIVaq( zRSA}(_(}(`{cG8;-g6Gg@DmN?Lb=fxf?2#f2e3D8|CdlQ=x299Jkp<+D+&j~l2Ydp z!XdU4`MJ%Meg)?%b=_MF!Oa{dXL8OPexHjEgs60p6eYl+2<|X!`E&qmrLgj_O|N!*x-%KP09c-+flkn zqQ8DgjyShy8cC3cmS_@7;w3E)+&lFi{#1BSQU}3$to8XZ_P4bZyy0ymYqR{-+4G0b zSJw-FFB&}L zr}r4FD&94URnc?zP*z+?AL-OjHnTiG^F=fil>gqjjcS@!glXGK92wS_@@@G>p|p1G zOYj*TQX)M-GUTnqu|d)u+h#y5ncoWy|1(V;fpbf+mgf~4;R;LvNUTj$eDUFgF{$cr zn*0hd-|#KGyjgIhEhUsl(Q(xYA`sPMAq(y)^zxAn#JBcYOR*)EBOE{T%Z~GZP!x>c z67(0;npGF{V2n>;d`N0X*_n?Qo!Oc)?QW&V`0lX}YNFN^5$WAsepodI}G;xVk-j4*I`}?Nh zORs_~URv~vhd~sz?xrM=jay<> z&oIm&-*;XyvS8>|DCkTV>-3g*+{>G+Hu4Qx^pzK=Ecbmz8fa$GvvM((h3{2vrzScj ne6YkBBmG^ObBJOoVX}!XuvvRWLHOYLga7;bzu&-r^$q+t0||%G diff --git a/UpdateLib/UpdateLib.Generator/Resources/project_16px.png b/UpdateLib/UpdateLib.Generator/Resources/project_16px.png deleted file mode 100644 index 25fe53638760c704f3418e4eba29e18e92140f68..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 244 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt^DJzX3_ zECi1R9uz!ez!SXSuz`?|aJkI32EiFCPGtH%*&WB%=Uy77a@+GCY;=hC=^8;`1(tCCNR6^{wxE0GE#x_SCe{z$LSF+fzdfRu-U6Hl+s_Qzw p3#OlR-?k~z0#LT=By}Z;C1rt33 zJwr2>%=KS^icWgEIEGmGFP(In_mBaPgR$UggUG(f#haH{Zg2_YpYo@Z*Kclvg6On) zPvYlScU*{iuI!;%%<0IH%wy7)6novqH&|KlvyHQ%jDm)uM^n=jp(3kzt=j$~0Re@T zO?4lm<&w`_PyOl75W;Ah(Ww7%)+d1(4&sg+{{&R(IZI^Uh~JuXz2UoDCD*CPAMPps zJ`@qhdd{+?ZLy_rM2h@2%k`D~tX?a98qP#n^Kd<|6jIsrE$$)vubZ0#LT=By}Z;C1rt33 zJwr2>%=KS^ijI4_IEGmG&zpLrt8GgcaP0X$U4W^aQ!Hbxu)@sZcLq8q@)t2oEY5FJ(w~ri#LeNsamHJxjVJXy i?!GDdhj|j~Tsy{xvCsOg)Ej|bV(@hJb6Mw<&;$VMH+)0@ diff --git a/UpdateLib/UpdateLib.Generator/Tasks/LoadDirectoryTask.cs b/UpdateLib/UpdateLib.Generator/Tasks/LoadDirectoryTask.cs deleted file mode 100644 index 2177efb..0000000 --- a/UpdateLib/UpdateLib.Generator/Tasks/LoadDirectoryTask.cs +++ /dev/null @@ -1,104 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.Drawing; -using System.IO; -using System.Windows.Forms; - -using MatthiWare.UpdateLib.Tasks; -using MatthiWare.UpdateLib.UI; - -namespace MatthiWare.UpdateLib.Generator.Tasks -{ - public class LoadDirectoryTask : AsyncTask - { - public ListView ItemsListView { get; set; } - public ImageList IconList { get; set; } - public DirectoryInfo DirectoryPath { get; set; } - - public LoadDirectoryTask(ListView lv, ImageList iconCache, DirectoryInfo dirPath) - { - ItemsListView = lv ?? throw new ArgumentNullException(nameof(lv)); - IconList = iconCache ?? throw new ArgumentNullException(nameof(iconCache)); - DirectoryPath = dirPath ?? throw new ArgumentNullException(nameof(dirPath)); - - if (!DirectoryPath.Exists) throw new DirectoryNotFoundException($"The directory '{dirPath.FullName}' was not found."); - } - - protected override void DoWork() - { - BeginUpdate(); - - Clear(); - - foreach (DirectoryInfo subDir in DirectoryPath.GetDirectories()) - { - ListViewItem item = new ListViewItem(new string[] { subDir.Name, subDir.LastWriteTimeUtc.ToString(), subDir.FullName }); - item.Tag = subDir; - item.ImageKey = "folder"; - - AddItem(item); - } - - foreach (FileInfo file in DirectoryPath.GetFiles()) - { - ListViewItem item = new ListViewItem(new string[] { file.Name, file.LastWriteTimeUtc.ToString(), file.FullName }); - item.Tag = file; - - if (!IconList.Images.ContainsKey(file.Extension)) - IconList.Images.Add(file.Extension, Icon.ExtractAssociatedIcon(file.FullName)); - - item.ImageKey = file.Extension; - - AddItem(item); - } - - SetColumnAutoSize(0); - SetColumnAutoSize(1); - SetColumnAutoSize(2); - - EndUpdate(); - - } - - private void SetColumnAutoSize(int clmn) - { - ItemsListView.InvokeOnUI(() => ItemsListView.Columns[clmn].Width = -1); - } - - private void EndUpdate() - { - ItemsListView.InvokeOnUI(() => ItemsListView.EndUpdate()); - } - - private void BeginUpdate() - { - ItemsListView.InvokeOnUI(() => ItemsListView.BeginUpdate()); - } - - private void Clear() - { - ItemsListView.InvokeOnUI(() => ItemsListView.Items.Clear()); - } - - private void AddItem(ListViewItem item) - { - ItemsListView.InvokeOnUI(() => ItemsListView.Items.Add(item)); - } - } -} diff --git a/UpdateLib/UpdateLib.Generator/Tasks/UpdateGeneratorTask.cs b/UpdateLib/UpdateLib.Generator/Tasks/UpdateGeneratorTask.cs deleted file mode 100644 index 5b1e3b7..0000000 --- a/UpdateLib/UpdateLib.Generator/Tasks/UpdateGeneratorTask.cs +++ /dev/null @@ -1,158 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading; - -using MatthiWare.UpdateLib.Common; -using MatthiWare.UpdateLib.Files; -using MatthiWare.UpdateLib.Generator.Data.FilesPage; -using MatthiWare.UpdateLib.Generator.UI.Pages; -using MatthiWare.UpdateLib.Security; -using MatthiWare.UpdateLib.Tasks; - -namespace MatthiWare.UpdateLib.Generator.Tasks -{ - public class UpdateGeneratorTask : AsyncTask - { - private delegate void AddDirRecursiveDelegate(GenFolder dir, DirectoryEntry entry); - - private GenFolder baseDir; - - private int total; - private int done = 0; - - private InformationPage infoPage; - - private IList registryFolders; - - public UpdateGeneratorTask(GenFolder dir, InformationPage info, IList registry) - { - baseDir = dir ?? throw new ArgumentNullException("dir", "The directory cannot be null"); - registryFolders = registry; - - total = dir.Count + registry.Sum(g => g.Count); - - infoPage = info; - - base.Result = new UpdateLib.Files.UpdateInfo(); - } - - protected override void DoWork() - { - foreach (GenFolder subfolder in baseDir.Directories) - { - if (subfolder.Count == 0) - return; - - DirectoryEntry entry = new DirectoryEntry(string.IsNullOrEmpty(subfolder.PathVariable) ? subfolder.Name : subfolder.PathVariable); - - Result.Folders.Add(entry); - - AddDirRecursive(subfolder, entry); - } - - Enqueue(new Action(AddRegistryItems), null); - - // Result.ApplicationName = infoPage.ApplicationName; - Result.Version = infoPage.Version; - } - - private void AddRegistryItems() - { - foreach (GenFolder registry in registryFolders) - { - if (registry.Count == 0) - continue; - - DirectoryEntry dir = new DirectoryEntry(registry.Name); - - Result.Registry.Add(dir); - - AddRegistryRecursive(registry, dir); - } - } - - private void AddRegistryRecursive(GenFolder dir, DirectoryEntry entry) - { - List keys = dir.Items; - foreach (GenReg key in keys) - { - entry.Add(new RegistryKeyEntry(key.Name, key.Type, key.Value)); - - Interlocked.Increment(ref done); - } - - if (keys.Count > 0) - OnTaskProgressChanged(done, total); - - IEnumerable dirsLeft = dir.Directories.Where(g => g.Count > 0); - int left = dirsLeft.Count(); - - foreach (GenFolder subDir in dirsLeft) - { - DirectoryEntry dirEntry = new DirectoryEntry(subDir.Name); - entry.Add(dirEntry); - - left--; - - if (left == 0) - AddRegistryRecursive(subDir, dirEntry); - else - Enqueue(new Action(AddRegistryRecursive), subDir, dirEntry); - } - - } - - private void AddDirRecursive(GenFolder dir, DirectoryEntry entry) - { - List files = dir.Items; - foreach (GenFile genFile in files) - { - System.IO.FileInfo fi = genFile.FileInfo; - FileEntry newEntry = new FileEntry(fi.Name); - newEntry.Hash = HashUtil.GetHash(fi.FullName); - - entry.Add(newEntry); - - Interlocked.Increment(ref done); - } - - if (files.Count > 0) - OnTaskProgressChanged(done, total); - - IEnumerable dirsLeft = dir.Directories.Where(g => g.Count > 0); - int left = dirsLeft.Count(); - - foreach (GenFolder subDir in dirsLeft) - { - DirectoryEntry dirEntry = new DirectoryEntry(string.IsNullOrEmpty(subDir.PathVariable) ? subDir.Name : subDir.PathVariable); - entry.Add(dirEntry); - - left--; - - if (left == 0) - AddDirRecursive(subDir, dirEntry); - else - Enqueue(new Action(AddDirRecursive), subDir, dirEntry); - } - } - } -} diff --git a/UpdateLib/UpdateLib.Generator/UI/ElipseComponent.cs b/UpdateLib/UpdateLib.Generator/UI/ElipseComponent.cs deleted file mode 100644 index 938db33..0000000 --- a/UpdateLib/UpdateLib.Generator/UI/ElipseComponent.cs +++ /dev/null @@ -1,135 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.ComponentModel; -using System.ComponentModel.Design; -using System.Drawing; -using System.Runtime.InteropServices; -using System.Windows.Forms; - -namespace MatthiWare.UpdateLib.Generator.UI -{ - public class ElipseComponent : Component - { - #region PInvoke CreateRoundRectRgn - - [DllImport("gdi32.dll", EntryPoint = "CreateRoundRectRgn")] - private static extern IntPtr CreateRoundRectRgn(int x, int y, int width, int height, int curveX, int curveY); - - private static void MakeRound(Form form, int elipse) - { - if (form == null) - return; - - form.FormBorderStyle = FormBorderStyle.None; - Region region = Region.FromHrgn(CreateRoundRectRgn(0, 0, form.Width, form.Height, elipse, elipse)); - form.Region = region; - } - - #endregion - - private int m_radius; - - public int Radius - { - get { return m_radius; } - set - { - m_radius = value; - ApplyRadius(); - } - } - - private ContainerControl m_control; - - public ContainerControl Control - { - get { return m_control; } - set - { - if (m_control != null && m_control is Form) - { - m_control.Resize -= M_control_Resize; - } - - m_control = value; - - m_control.Resize += M_control_Resize; - - ApplyRadius(); - } - } - - private void M_control_Resize(object sender, EventArgs e) - { - ApplyRadius(); - } - - public ElipseComponent() - { - m_radius = 5; - } - - public ElipseComponent(IContainer container) - : this() - { - container.Add(this); - } - - public void ApplyRadius() - { - if (Control == null) - return; - - if (!(Control is Form)) - return; - - MakeRound(Control as Form, Radius); - } - - public override ISite Site - { - get - { - return base.Site; - } - - set - { - base.Site = value; - - if (value == null) - return; - - IComponent rootComponent; - Type serviceType = typeof(IDesignerHost); - IDesignerHost service = Site.GetService(serviceType) as IDesignerHost; - - if (service == null) - return; - - rootComponent = service.RootComponent; - - if (!(rootComponent is ContainerControl)) - return; - - Control = rootComponent as ContainerControl; - } - } - } -} diff --git a/UpdateLib/UpdateLib.Generator/UI/FlatButton.cs b/UpdateLib/UpdateLib.Generator/UI/FlatButton.cs deleted file mode 100644 index 5f10eba..0000000 --- a/UpdateLib/UpdateLib.Generator/UI/FlatButton.cs +++ /dev/null @@ -1,205 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.ComponentModel; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Drawing.Text; -using System.Windows.Forms; - -namespace MatthiWare.UpdateLib.Generator.UI -{ - [DefaultEvent(nameof(Click))] - public class FlatButton : Control - { - private const float PADDING_WIDTH = 0.0625f; - private const float PADDING_HEIGHT = 0.25f; - private const float IMG_SIZE_WIDTH = 0.125f; - private const float IMG_SIZE_HEIGHT = 0.5f; - private const float TEXT_SIZE_WIDTH = 1f - (PADDING_WIDTH * 3) - IMG_SIZE_WIDTH; - private const float TEXT_SIZE_HEIGHT = 1f - (PADDING_HEIGHT * 2); - - private bool mouseInside = false; - - private Bitmap buffer; - - private bool m_activeItem; - - private Color m_backColor; - - public bool ActiveItem - { - get { return m_activeItem; } - set { m_activeItem = value; UpdateBackgroundColor(); } - } - - private Color m_hoveColor; - - public Color BackHoverColor - { - get { return m_hoveColor; } - set { m_hoveColor = value; } - } - - private Color m_selectedColor; - - public Color BackSelectedColor - { - get { return m_selectedColor; } - set { m_selectedColor = value; } - } - - private Image m_infoImage; - - public Image InfoImage - { - get { return m_infoImage; } - set - { - m_infoImage = value; - - Rectangle rect = new Rectangle( - (int)(Width * PADDING_WIDTH), - (int)(Height * PADDING_HEIGHT), - (int)(Width * IMG_SIZE_WIDTH), - (int)(Height * IMG_SIZE_HEIGHT)); - - Invalidate(rect); - } - } - - - public FlatButton() - : base() - { - SetStyle(ControlStyles.AllPaintingInWmPaint - | ControlStyles.UserPaint - | ControlStyles.ResizeRedraw - | ControlStyles.OptimizedDoubleBuffer - | ControlStyles.SupportsTransparentBackColor, true); - - DoubleBuffered = true; - } - - public void PerformClick() - { - OnClick(EventArgs.Empty); - } - - protected override void OnClick(EventArgs e) - { - ActiveItem = true; - - foreach (Control c in Parent.Controls) - { - FlatButton button = c as FlatButton; - - if (button == null || button == this) - continue; - - button.ActiveItem = false; - } - - base.OnClick(e); - } - - protected override void OnMouseEnter(EventArgs e) - { - base.OnMouseEnter(e); - - if (!mouseInside) - { - mouseInside = true; - UpdateBackgroundColor(); - } - } - - protected override void OnMouseLeave(EventArgs e) - { - base.OnMouseLeave(e); - - if (mouseInside) - { - mouseInside = false; - UpdateBackgroundColor(); - } - } - - private void UpdateBackgroundColor() - { - m_backColor = (m_activeItem ? m_selectedColor : BackColor); - m_backColor = (mouseInside ? m_hoveColor : m_backColor); - - - Invalidate(); - } - - protected override void OnResize(EventArgs e) - { - base.OnResize(e); - - buffer = new Bitmap(Width, Height); - } - - protected override void OnPaint(PaintEventArgs e) - { - Rectangle rect = new Rectangle(0, 0, Width, Height); - - buffer = buffer ?? new Bitmap(Width, Height); - - using (Graphics g = Graphics.FromImage(buffer)) - { - g.SmoothingMode = SmoothingMode.HighQuality; - g.PixelOffsetMode = PixelOffsetMode.HighQuality; - g.TextRenderingHint = TextRenderingHint.ClearTypeGridFit; - - g.Clear(Color.White); - - g.FillRectangle(new SolidBrush(m_backColor), rect); - - float imgSize = Math.Min(Width * IMG_SIZE_WIDTH, Height * IMG_SIZE_HEIGHT); - - RectangleF imgRect = new RectangleF( - Width * PADDING_WIDTH, - Height * PADDING_HEIGHT, - imgSize, - imgSize); - - if (InfoImage != null) - g.DrawImage(InfoImage, imgRect); - - SizeF textSize = g.MeasureString(Text, Font, (int)(Width * TEXT_SIZE_WIDTH)); - - float offsetX = ((Width * PADDING_WIDTH) * 2) + imgRect.Width; - float offsetY = imgRect.Y; - - float availableTextWidth = Width - offsetX - (Width * PADDING_WIDTH); - float availableTextHeight = Height - (offsetY * 2); - - float x = offsetX + (availableTextWidth / 2) - (textSize.Width / 2); - float y = offsetY + (availableTextHeight / 2) - (textSize.Height / 2); - - g.DrawString(Text, Font, new SolidBrush(ForeColor), x, y); - - base.OnPaint(e); - e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic; - e.Graphics.DrawImageUnscaled(buffer, 0, 0); - } - } - } -} diff --git a/UpdateLib/UpdateLib.Generator/UI/GradientPanel.cs b/UpdateLib/UpdateLib.Generator/UI/GradientPanel.cs deleted file mode 100644 index c74349a..0000000 --- a/UpdateLib/UpdateLib.Generator/UI/GradientPanel.cs +++ /dev/null @@ -1,134 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.Drawing; -using System.Windows.Forms; - -namespace MatthiWare.UpdateLib.Generator.UI -{ - public class GradientPanel : Panel - { - - public GradientPanel() - : base() - { - - } - - private int m_quality = 100; - - public int Quality - { - get { return m_quality; } - set { m_quality = value; SetGradient(); } - } - - - private Color m_gradientTopRight = SystemColors.Control; - - public Color GradientTopRight - { - get { return m_gradientTopRight; } - set { m_gradientTopRight = value; SetGradient(); } - } - - private Color m_gradientTopLeft = SystemColors.Control; - - public Color GradientTopLeft - { - get { return m_gradientTopLeft; } - set { m_gradientTopLeft = value; SetGradient(); } - } - - private Color m_gradientBottomLeft = SystemColors.Control; - - public Color GradientBottomLeft - { - get { return m_gradientBottomLeft; } - set { m_gradientBottomLeft = value; SetGradient(); } - } - - private Color m_gradientBottomRight = SystemColors.Control; - - public Color GradientBottomRight - { - get { return m_gradientBottomRight; } - set { m_gradientBottomRight = value; SetGradient(); } - } - - protected override void OnResize(EventArgs eventargs) - { - base.OnResize(eventargs); - - SetGradient(); - } - - private void SetGradient() - { - Bitmap buffer = new Bitmap(Quality, Quality); - for (int x = 0; x < Quality; x++) - { - int percentX = (int)(((double)x / Width) * 100); - - Color c1 = GetColorScale(percentX, GradientTopLeft, GradientTopRight); - - for (int y = 0; y < Quality; y++) - { - int percentY = (int)(((double)y / Height) * 100); - - Color c2 = GetColorScale(percentY, GradientTopLeft, GradientTopRight); - - buffer.SetPixel(x, y, DiffuseColors(c1, c2)); - } - } - - if (BackgroundImageLayout != ImageLayout.Stretch) - BackgroundImageLayout = ImageLayout.Stretch; - - SuspendLayout(); - - BackgroundImage = buffer; - - ResumeLayout(true); - } - - private Color GetColorScale(int percentage, Color start, Color end) - { - byte red = GetByte(percentage, start.R, end.R); - byte green = GetByte(percentage, start.G, end.G); - byte blue = GetByte(percentage, start.B, end.B); - - return Color.FromArgb(red, green, blue); - } - - private byte GetByte(int percentage, byte begin, byte end) - { - return (byte)(Math.Round((begin + ((end - begin) * percentage) * 0.01), 0)); - } - - private Color DiffuseColors(Color a, Color b) - { - int red = (a.R + b.R) / 2; - int green = (a.G + b.G) / 2; - int blue = (a.B + b.B) / 2; - return Color.FromArgb(red, green, blue); - } - - - } -} diff --git a/UpdateLib/UpdateLib.Generator/UI/HoverPictureBox.cs b/UpdateLib/UpdateLib.Generator/UI/HoverPictureBox.cs deleted file mode 100644 index 08cfd31..0000000 --- a/UpdateLib/UpdateLib.Generator/UI/HoverPictureBox.cs +++ /dev/null @@ -1,104 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.Drawing; -using System.Windows.Forms; - -namespace MatthiWare.UpdateLib.Generator.UI -{ - public class HoverPictureBox : PictureBox - { - private int alpha = 255; - private bool mouseInBox = false; - private bool mouseDown = false; - - protected override void OnMouseEnter(EventArgs e) - { - base.OnMouseEnter(e); - - if (!mouseInBox) - { - mouseInBox = true; - SwitchBackgroundColor(); - } - } - - private void SwitchBackgroundColor() - { - alpha = (mouseInBox ? 100 : 0); - alpha = (mouseDown ? 150 : alpha); - BackColor = Color.FromArgb(alpha, Color.WhiteSmoke); - } - - protected override void OnMouseHover(EventArgs e) - { - base.OnMouseHover(e); - - if (!mouseInBox) - { - mouseInBox = true; - SwitchBackgroundColor(); - } - } - - protected override void OnMouseLeave(EventArgs e) - { - base.OnMouseLeave(e); - - if (mouseInBox) - { - mouseInBox = false; - SwitchBackgroundColor(); - } - } - - protected override void OnMouseMove(MouseEventArgs e) - { - base.OnMouseMove(e); - - if (!mouseInBox) - { - mouseInBox = true; - SwitchBackgroundColor(); - } - } - - protected override void OnMouseDown(MouseEventArgs e) - { - base.OnMouseDown(e); - - if (!mouseDown) - { - mouseDown = true; - SwitchBackgroundColor(); - } - } - - protected override void OnMouseUp(MouseEventArgs e) - { - base.OnMouseUp(e); - - if (mouseDown) - { - mouseDown = false; - SwitchBackgroundColor(); - } - } - - } -} diff --git a/UpdateLib/UpdateLib.Generator/UI/InputDialog.Designer.cs b/UpdateLib/UpdateLib.Generator/UI/InputDialog.Designer.cs deleted file mode 100644 index 709c5a0..0000000 --- a/UpdateLib/UpdateLib.Generator/UI/InputDialog.Designer.cs +++ /dev/null @@ -1,138 +0,0 @@ -namespace MatthiWare.UpdateLib.Generator.UI -{ - partial class InputDialog - { - /// - /// 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() - { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(InputDialog)); - this.panel1 = new System.Windows.Forms.Panel(); - this.btn2 = new System.Windows.Forms.Button(); - this.btn1 = new System.Windows.Forms.Button(); - this.btn3 = new System.Windows.Forms.Button(); - this.lblHeader = new System.Windows.Forms.Label(); - this.txtInput = new System.Windows.Forms.TextBox(); - this.panel1.SuspendLayout(); - this.SuspendLayout(); - // - // panel1 - // - this.panel1.BackColor = System.Drawing.SystemColors.Control; - this.panel1.Controls.Add(this.btn2); - this.panel1.Controls.Add(this.btn1); - this.panel1.Controls.Add(this.btn3); - this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom; - this.panel1.Location = new System.Drawing.Point(0, 100); - this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(401, 46); - this.panel1.TabIndex = 0; - // - // btn2 - // - this.btn2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btn2.Location = new System.Drawing.Point(227, 11); - this.btn2.Name = "btn2"; - this.btn2.Size = new System.Drawing.Size(75, 23); - this.btn2.TabIndex = 2; - this.btn2.UseVisualStyleBackColor = true; - this.btn2.Visible = false; - // - // btn1 - // - this.btn1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btn1.Location = new System.Drawing.Point(146, 11); - this.btn1.Name = "btn1"; - this.btn1.Size = new System.Drawing.Size(75, 23); - this.btn1.TabIndex = 1; - this.btn1.UseVisualStyleBackColor = true; - this.btn1.Visible = false; - // - // btn3 - // - this.btn3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btn3.Location = new System.Drawing.Point(308, 11); - this.btn3.Name = "btn3"; - this.btn3.Size = new System.Drawing.Size(75, 23); - this.btn3.TabIndex = 3; - this.btn3.UseVisualStyleBackColor = true; - this.btn3.Visible = false; - // - // lblHeader - // - this.lblHeader.AutoSize = true; - this.lblHeader.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblHeader.ForeColor = System.Drawing.Color.MidnightBlue; - this.lblHeader.Location = new System.Drawing.Point(12, 9); - this.lblHeader.Name = "lblHeader"; - this.lblHeader.Size = new System.Drawing.Size(212, 25); - this.lblHeader.TabIndex = 2; - this.lblHeader.Text = "Version 1.0.0.0 available"; - // - // txtInput - // - this.txtInput.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.txtInput.Location = new System.Drawing.Point(17, 52); - this.txtInput.Name = "txtInput"; - this.txtInput.Size = new System.Drawing.Size(366, 22); - this.txtInput.TabIndex = 0; - this.txtInput.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtInput_KeyDown); - // - // InputDialog - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.AutoSize = true; - this.BackColor = System.Drawing.SystemColors.Window; - this.ClientSize = new System.Drawing.Size(401, 146); - this.Controls.Add(this.txtInput); - this.Controls.Add(this.lblHeader); - this.Controls.Add(this.panel1); - 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.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "InputDialog"; - this.ShowIcon = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Message Dialog"; - this.panel1.ResumeLayout(false); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.Panel panel1; - private System.Windows.Forms.Button btn3; - private System.Windows.Forms.Label lblHeader; - private System.Windows.Forms.Button btn1; - private System.Windows.Forms.Button btn2; - private System.Windows.Forms.TextBox txtInput; - } -} \ No newline at end of file diff --git a/UpdateLib/UpdateLib.Generator/UI/InputDialog.cs b/UpdateLib/UpdateLib.Generator/UI/InputDialog.cs deleted file mode 100644 index 9610f66..0000000 --- a/UpdateLib/UpdateLib.Generator/UI/InputDialog.cs +++ /dev/null @@ -1,108 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System.Windows.Forms; - -namespace MatthiWare.UpdateLib.Generator.UI -{ - public partial class InputDialog : Form - { - public string Header - { - get { return this.lblHeader.Text; } - set { this.lblHeader.Text = value; } - } - - public string Input - { - get { return this.txtInput.Text; } - set { this.txtInput.Text = value; } - } - - public InputDialog() - { - InitializeComponent(); - } - - public InputDialog(string title, string header, MessageBoxButtons buttons = MessageBoxButtons.YesNo) - : this() - { - Header = header; - Text = title; - - SetUpButtons(buttons); - - txtInput.Focus(); - } - - private void SetUpButtons(MessageBoxButtons buttons) - { - switch (buttons) - { - case MessageBoxButtons.OK: - default: - SetUpButton(btn3, "OK", DialogResult.OK, true); - break; - case MessageBoxButtons.OKCancel: - SetUpButton(btn2, "OK", DialogResult.OK, true); - SetUpButton(btn3, "Cancel", DialogResult.Cancel); - break; - case MessageBoxButtons.AbortRetryIgnore: - SetUpButton(btn3, "Ignore", DialogResult.Ignore); - SetUpButton(btn2, "Retry", DialogResult.Retry); - SetUpButton(btn1, "Abort", DialogResult.Abort, true); - break; - case MessageBoxButtons.YesNoCancel: - SetUpButton(btn3, "Cancel", DialogResult.Cancel); - SetUpButton(btn2, "No", DialogResult.No); - SetUpButton(btn1, "Yes", DialogResult.Yes, true); - break; - case MessageBoxButtons.YesNo: - SetUpButton(btn3, "No", DialogResult.No); - SetUpButton(btn2, "Yes", DialogResult.Yes, true); - break; - case MessageBoxButtons.RetryCancel: - SetUpButton(btn3, "Cancel", DialogResult.Cancel); - SetUpButton(btn2, "Retry", DialogResult.Retry, true); - break; - } - } - - private void SetUpButton(Button button, string text, DialogResult result, bool defaultButton = false) - { - button.Text = text; - button.DialogResult = result; - button.Visible = true; - - if (defaultButton) - button.TabIndex = 0; - } - - private void txtInput_KeyDown(object sender, KeyEventArgs e) - { - if (e.KeyCode == Keys.Enter) - { - if (btn1.Visible) - btn1.PerformClick(); - else if (btn2.Visible) - btn2.PerformClick(); - else if (btn3.Visible) - btn3.PerformClick(); - } - } - } -} diff --git a/UpdateLib/UpdateLib.Generator/UI/InputDialog.resx b/UpdateLib/UpdateLib.Generator/UI/InputDialog.resx deleted file mode 100644 index 9fe1da0..0000000 --- a/UpdateLib/UpdateLib.Generator/UI/InputDialog.resx +++ /dev/null @@ -1,306 +0,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 - - - - - AAABAAIAMDAAAAEAIACoJQAAJgAAABAQAAABACAAaAQAAM4lAAAoAAAAMAAAAGAAAAABACAAAAAAAAAk - AAASCwAAEgsAAAAAAAAAAAAA////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8ANJtQDDOYTkgxlEx2MZJLojCQSs0wkEr0MJBK4zCR - SsswkUuyMZJLmTGTTIAylk1fNJtQDP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AACEIy0UgTKaIIM89iuDQv8pgkD/JoI//yWF - QP8liUD/JYdA/yWHQP8mhED/JoI//yiBP/8qg0H/IIM89hSDM5kAhCMs////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wAAfB9RE30xxxt7Nv8kfjz/IYU8/yWP - Q/88oFb/VKxs/2e2ff9yvIf/abZ+/2K0ev9asXL/VK1t/02pZv82mFH/JYZA/yZ/Pf8bezb/En0wxwqD - K1sAgyMG////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8AAIUjFBN/Ma4ZdzT/In06/x6G - Ov9MqGP/iMaZ/6XUsv+cz6r/lMuk/43Hnf+JxJn/hMKU/4DAkv99vo3/ebyL/3a7if90u4f/abd//0+p - Zf8zkE3/JX49/yd8Pv8ggzrTDYsvIf///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8AMZRMiwCEIw7///8A////AP///wD///8A////AP///wD///8A////AP///wAJgClUHX037iF3 - OP8jiT//YrZ6/57Qq/+l07L/mc2n/5DIoP+KxZr/hsOX/4LBk/9+v4//er2M/3a7iP9yuYX/breC/2q1 - fv9ms3v/ZLJ5/2KyeP9hs3f/WrBy/zqYU/8nez7/HXw38wiCKUv///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8ALYZF/x58OO4WhzVpAIUkAv///wD///8A////AP///wD///8AAIQjAxN/ - MaEXci//Hno2/z6eWP+i06//p9Sz/5vNqf+TyaL/jsee/4vFmv+IxJn/hsOW/4PBlf+AwJP/fL6O/3a7 - iv9xuIT/a7Z//2aze/9isXf/Xq90/1qtcP9Wq23/VKps/1Ora/9Colv/J30+/xp1M/0VgjGDAIQjAf// - /wD///8A////AP///wD///8A////AP///wD///8ALIRE/yd3PP8mdjv/HX031AmBKkH///8A////AP// - /wANiy8EH4M7ryFyNv8fgzr/b7uD/6/au/+i0bD/mM2m/5TLo/+QyKD/kcig/5LJof+FwpX/c7mG/2Ox - eP9Tqmr/Uqlo/1uucv9jsnn/aLV+/2q1ff9isXj/XK5x/1arbf9SqWr/Tqdm/0ulZP9Jp2L/QaJd/y2G - Rv8ndTv/III6ug2MLxD///8A////AP///wD///8A////AP///wD///8ALIND/iyJRv87l1b/GG0u/xVt - LP8QeS2zDo4wIBuVPAUfgTqzHm80/yqHQv+e0qv/rNa4/5/PrP+YzKX/l8yl/5jNpv+UyqP/Z7R8/zme - Vf8llEP/KZZG/yuXSP8tmEr/LZhK/y2YSv8sl0n/K5dI/yuWSf9Co13/WK1u/1arbf9PqGf/SqVj/0ak - X/9Colz/P6JZ/z2jWP8ujUn/JnM7/x5/OccAhSQE////AP///wD///8A////AP///wD///8AK4FC/TKI - Sf/y/vT/f8OR/xt9Nv8Zai//JXU8+yuCQ9MdazL/J4dD/6TWsv+q1rb/nM2q/5nNpv+azqj/mM2n/1es - b/8nlET/KpZH/zCZTP8zm0//NJtQ/zSbUP80m1D/NJtQ/zSbUP80m1D/NJtQ/zObT/8xmk3/LphL/z6f - WP9JpWP/R6Vg/0KiXP8+oFj/Op5V/zadUv81n1L/L49K/yVuOf8SfS+W////AP///wD///8A////AP// - /wD///8AKn9B/SyDRf/f8+T/y+fS/8Hjyv9XrG7/FXQw/xNiKP8phkL/p9az/6rWtv+dz6r/nM6p/57Q - q/9+wJH/MplP/yuXSP8xmk7/NJtQ/zScUP81nVH/NZ5R/zagU/82olP/NqNU/zajVP82olP/NqBS/zWe - Uf80nFD/M5tP/zKaTv8zm1D/QKFb/z+hWf86nlX/NZxS/zObT/80nFD/NqBT/yyERP8XaC7/CH0mXf// - /wD///8A////AP///wD///8AKn1A/C6DRf/V7t3/udzD/7vexf/B4sr/oNOu/0OhXP+k1rL/qta2/53P - qv+czqr/otGv/1etb/8mlET/L5lM/zObT/80nFD/NZ1R/zagU/80nVH/MJFK/yuAQ/8lbzn/I2k2/yVu - OP8mdDv/Kn5B/zGVTf82olT/NZ9S/zScUP8zm0//MppO/zufVv83nFL/M5tP/zSbUP80m1D/NZ1R/zWg - Uv8mdT3/GW0w+QmEKy7///8A////AP///wD///8AKXxA+zGCSP/Q7Nj/tNq//7DYu/+v17r/sdi6/67W - uf+m1LP/nc+q/53Oqv+f0K3/Tahm/ymWRv8xmk7/NJtQ/zScUP81n1L/NZ5R/yp8QP8hZDP/Imc1/xlw - MfkOcSq/Am4gmgFrHrEObijIGW0w+iBlNP8lcDr/L49K/zahU/81nVH/NJtQ/zObUP8zm1D/NJtQ/zSb - UP80m1D/NJtQ/zWeUf80nVH/JGw3/xtzM+MOjjAP////AP///wD///8AKXo/+zGBSf/L6tX/sNi7/63W - uP+p1LT/pdKx/6HQrv+dzqr/ns6r/57Oq/9GpF//KpZH/zKaTv80nFD/NZ1R/zahU/8xlEz/Imo2/xdk - LP0Sei2dDYsvQACHJQb///8A////AP///wD///8AAIglEhN/MHYZbzDfIWEz/yuBQv81oVL/NZ5R/zSc - UP80m1D/NJtQ/zSbUP80m1D/NJxQ/zWdUf83pFX/MJFK/yJkNP8ceDW8AIMjAf///wD///8AKHg++jWC - Sf/I6NH/rda4/6nUtP+l0rH/odCu/53Oqv+bzan/otCu/0+nZ/8qlkf/MptP/zSbUP81nlH/NZ9S/yp/ - Qf8gYDL/GnEy5gqELD////8A////AP///wD///8A////AP///wD///8A////AP///wAAiCUHEHQsqBRc - J/8mcjr/NJ1R/zWeUf80m1D/NJtQ/zSbUP80nFH/Np9S/zWhU/8shET/IGMy/xdmLPoReC2BAHwXBP// - /wD///8AJ3c9+jaBSv/D587/qdW1/6XTsv+h0K7/nc6q/5rMqP+ezqv/cLmE/yeVRf8ymk7/NJtQ/zSb - UP81nlH/J3Q7/x9cL/8ndTz9KZtHTv///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AAZ2I3MUYCj9JG45/zWiU/81nVH/NJxQ/zWeUv83olT/MJJL/yNnNf8SWSb/DXApvgCB - ISL///8A////AP///wD///8AJ3U8+jd/S/++5Mj/pdOy/6HRrv+dz6v/mc6n/5zNqP+KxZr/KJVF/zCZ - Tf80m1D/NJtQ/zSbUP81nVH/NqJU/y2JRv8gYDL/E1om/w9wKbUBiiYg////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wAEdSRvEVYj/yt+Qf83o1T/NqJT/zSeUf8mdDv/HVgt/xlq - LusHfSdW////AP///wD///8A////AP///wD///8AJnM7+Th+TP+54sX/odGu/53Pq/+Zzaf/mc2o/5vM - qP80m1D/LphL/zSbUP80m1D/NJtQ/zSbUP80m1D/NZ1R/zagUv82olP/KX1A/x1ZLv8VYCn7EHcsjgCG - JAv///8A////AP///wD///8A////AP///wD///8A////AP///wD///8ADm8osBxVLf8xkkv/LYZF/x9a - Lv8TWyf9EXUslACJJQv///8A////AP///wD///8A////AP///wD///8AJnI7+Dl+S/+04MD/nc+r/5nN - p/+Xzab/nc+r/0ynZP8rl0j/M5tP/zSbUP80m1D/NJtQ/zSbUP80m1D/NJtQ/zScUP82oVP/OalY/y+P - Sf8eWC3/D1Ag/wRzIqgAdAoB////AP///wD///8A////AP///wD///8A////AP///wD///8AAYkmDBdo - LeIdVCv/HFYt/xltMM0Khywu////AP///wD///8A////AP///wD///8A////AABiEiErgkOkJXA6+Dp8 - Sv+x3r3/ms2o/5bMpf+azqj/a7Z//yiVRv8ymk7/NJtQ/zSbUP80m1D/NJtQ/zSbUP80nFD/NZ5R/zei - VP80m0//JGs2/xpQKP8YZy7lB30oUv///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AAiAKC4JYSDnFH4waACIJQH///8A////AP///wD///8A////AP///wAAaBUID3MphBx3 - Nfgqf0HyJW859zp7S/+s3Ln/lsul/5fLpf+Mx5v/JpVF/zCaTf80m1D/NJtQ/zSbUP80m1D/NJtQ/zWd - Uf82oVP/NaFT/yd3Pv8ZTCf/E1km+BF4LYABiSYG////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wAAfhgC////AP///wD///8A////AP///wD///8A////AABp - GlUUdC7kL4BG/yV5O/8pfEDzJG049jp5TP+n2rb/k8qi/5nNqP9JpmL/LZhK/zSbUP80m1D/NJtQ/zSb - UP80nFH/NqBS/zimVv8rhET/G1Eq/w9NIP4NaiasAYsnGP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wAAYxEpB24jvglsJP9fk2//grSQ/yN6PP8oeT70JGs39jl3Sv+j2LH/k8qj/4PCk/8mlET/MppO/zSb - UP80m1D/NJxQ/zWfUv83pVX/MJFL/x5aLf8YSSb/FmYs0guGLDf///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8AAGIQDQxxJpAPcSn8LHtB/5a1nv/a69//OaVX/yR3Ov8ndj30I2o29Tp2S/+f1q//lsuk/0Cg - Wv8umEv/NJtQ/zScUP81nlH/N6NU/zSdUf8jZjX/FUIh/xJaJu8TfjBkAYkmAf///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wAAahxiE3Mt6xdyMf9jmHL/v9fH/9Hs1/+Lx5v/JppG/yZ0PP8mczv2I2k28jt2 - TP+g2K//eL2K/yiVRf8zm0//NZ1R/zahU/83o1P/J3c9/xZFI/8PUCH8DnIpkQGLJwv///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8AAGcTNAlvJcgKbCX/N4FL/6jFr//J6NH/vuLH/8Piy/8xmk7/MJ9O/yZz - O/8lcDn3I2o28j12Tf+i2bL/OJxU/y+aTP82oFL/OKZV/y2GRf8ZTij/C0Ub/wplJLwAhSMi////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AABhERMNciidEHAr/RxzM/94p4X/y+XQ/8Diyf+z277/ttvA/36/ - j/8llEP/NqJT/yVvOf8kbTj3I2o28UF3Uf96xI//KplI/zakVP8xlk3/Hlwv/xZEI/8VYireCH8pR/// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wAAhyQCD3MqbhZ0L/EWci//SYta/7jVwf/I59H/t93C/63Y - uv+t1rf/r9e5/yyYSP8vmUz/N6NU/yRtOP8jajb4I2o38El9Vf9Cr1//MZ1P/yRrN/8WQiH/Elck9RF5 - LXUBiiYD////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AAFrHj8YdTHSG3Qz/yN2Of+Qu5z/zerU/7zf - xf+v2Lr/qtW2/6XTs/+s1bj/ZLJ5/ymWRv8zm1D/N6RU/yNrN/8iZzX5I2o27zBzQf8ngED/F0ck/w5L - Hv0NbCaiAYwnEv///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wAAYhIbDXEpqRJwLP4Vby7/XJtt/8fj - z//B48z/tNu//6vVtv+m07L/odGu/6LRr/+bzqn/JpRD/zCaTf80m1D/N6RV/yNnNv8hYzP5I2o37xdI - JP8LRBv/CWEhygCDIi7///8A////AP///wD///8A////AP///wD///8AAHoVAv///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8AAFcMBRB1K3sYdDD2GnMy/y5/ - Rf+pzrP/yOfQ/7jdwv+u17n/qNS0/6PRsP+ez6v/ms6o/6HQrf9LpmX/LJdJ/zSbUP80m1D/N6VV/yJl - M/8gYDH5JGs37xRfKOkHeiVZ////AP///wD///8A////AP///wD///8A////AP///wALhy1NGY453QqD - Kkv///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wACbR9LHHk23iF5 - Of8aczL/da+F/8zp1P+94Mf/r9m7/6nUtP+l0rH/oNCt/5vNqf+Wy6X/l8yl/3/Akf8mlET/MppO/zSb - UP80m1D/OKVV/yBiMv8fXTD6MI9KbgCIJQj///8A////AP///wD///8A////AP///wD///8AAIEhHhiO - OLAhkj//L5ZK/yGNPvAJgSkg////AP///wD///8A////AP///wD///8A////AP///wD///8A////AABj - EYobdzT/KXw//zOCSP/L6dT/zuzW/7bcwf+q1bb/pdOy/6HQrv+czqn/mMym/5PKov+QyKD/lsqk/zac - Uv8vmUv/NJtQ/zSbUP80m1D/OKZV/x9fMf8eWi77////AP///wD///8A////AP///wD///8A////AACB - IQQZjjl1IZI/9x+NPP8wlEz/Xaxy/yCKPf8giD3MAIMjBv///wD///8A////AP///wD///8A////AP// - /wD///8A////AABDAAQNbyh2GXEx8h1wNP80fUj/mcWl/7jgw/+o1rX/ntCs/5nMp/+UyqP/j8ie/4zG - nP+Nxp3/YrJ4/yqWR/8zm0//NJtQ/zSbUP80m1D/OKZW/x9dMP8dVy37////AP///wD///8A////AP// - /wD///8AC4gtOySUQtMlkkP/E4c0/4fCl////////////y2RSP8jhj7/E30wmP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8AAFsNFQlmI6IQZCf9E2Uq/0uGWv+cy6j/ndOt/5LJ - of+Mxpz/h8SY/4XClf+EwpT/K5dJ/zGaTf80m1D/NJtQ/zSbUP80m1D/OKdW/x5aLv8dVy38////AP// - /wD///8A////AACBIRMZjjmcI5JC/h+NPv9RpGb/8vn1///////8/v3//////9fs3f8UfS//GHwz/xB3 - LJAAhiQC////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wAacTM7IWw19BNg - KP8RViT/f7KO/4rFmv+EwpX/gMGS/4HBlP9LpmT/LZhK/zSbUP80m1D/NJtQ/zSbUP80m1D/OKdW/x5a - L/8dViz8////AP///wD///8AAIEhYyWUQ+4zmE7/MJVM/0aiYP////////////L49P/r9e7/6vTs//X6 - 9v+t1bn/GX00/yF9Ov8deja/AGgcE////wD///8A////AP///wD///8A////AP///wD///8A////AABf - GTEUZSvXGmMt/yNoNf93s4n/jsyf/4LDk/98vo7/e76O/222gf8qlkf/MptP/zSbUP80m1D/NJtQ/zSb - UP80m1D/OKZW/x5cL/8dViz8////AP///wD///8ACoMqjTKXTv8ylk3/M5xQ/x+RPv+UyqP//////+z2 - 7v/j8ef/3+/j/97u4v/m9Or/v+HI/yGBO/8ddjX/GHQx6g1vKIgAYRAe////AP///wD///8A////AAA7 - AAMAXxdBCW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GUwn/x1XLOkbUyr5GEwn/x1X - Lf8vjEj/O7Bb/x9gMv8cViz+////AP///wD///8A////AP///wD///8AAF0OBh17NrEqfED/K4BB/zOb - UP8znVD/KpdI/yKSQv9rt4D/r9i6/7HZu/+k0bD/m86p/5bLpf+RyaD/jcac/4jEmP+DwpT/fr+Q/3q9 - jP92u4j/cbmE/222gP9ptX7/Z7V8/1etb/81m1H/MJlM/zObT/82n1L/N6RV/yJqNf8ZTCf/Dk0g3Qdb - HRkAUBEgAksVtwxEG/4YSyb/I2o2/yBdMP8cViz+////AP///wD///8A////AP///wD///8A////AACH - JAEMbCibGnEy/yl4Pf8ymU7/NZ9S/zCaTf8plkb/I5JB/1mucf+Xy6X/odGu/5fMpv+PyJ//iMWZ/4HA - kv97vo3/druJ/3O5iP9xuIX/breB/2u1f/9brnH/Op1U/y6YSv8xmk7/NJ1R/zaiU/80nVH/IWQz/xlM - J/8QTyDYAFERFP///wD///8A////AABDAkQBRRLXC0cc/xtTKv8cViz/////AP///wD///8A////AP// - /wD///8A////AP///wD///8AAGQaghdrL/4lcjr/L4pI/zWhUv81n1L/MZtO/yuXSf8klEP/MZlO/1Gp - aP9rtn//er6L/3q+jP97vo3/eL6L/2u1f/9YrG//R6Rg/zmeU/8tmEr/MZpN/zScUP81n1L/OKVV/yyG - Rf8aUCn/CkQa/wFGFM0ARAEQ////AP///wD///8A////AP///wD///8AAEkNbg9OH+4cViz/////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AABfF2kWZy36I2o3/yVxOv8wkkv/N6NU/zWf - Uv80nFD/MZpO/y6YS/8qlkj/KJVG/yiVRv8olUb/KZZG/yuXSP8tmEr/MJlM/zKaTv80nFD/NqBS/zel - Vf81n1D/ImY0/xhLJv8MRxz6AEMKhf///wD///8A////AP///wD///8A////AP///wD///8A////AAA/ - AAwhYzOZ////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wAAVAkjCV0ftRRd - J/4gYTL/J3U9/zGVTP82pVT/N6NU/zagUv81nVH/NJxQ/zSbUP80m1D/NJtQ/zScUP81nlH/NqBS/zej - VP84qFb/L49J/yJmNP8ZSSX/GVAp/xBRIdYATA0v////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AABWE0YTWyfWHlsw/x5aLv8fWy//JnE7/y2KSP82oVP/OalX/zioV/84qFb/OKhX/zeo - Vv8zmk//LolG/yh3Pf8dVSz/GEom/wpEGv8AQhHjAEoMgAAYAAL///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wACjSgBAE8PYwRSGrcQUSH1G1Qr/xpQKf8YSyb/GEkm/xpN - J/8bUyr/HVgt/xhKJv8XSSX/GEom/xhNJ/8MRhz9AUoWwABCAVL///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wAndDwEI2o2TyFi - MqUfXTDRHlsv3R5aLucdWC3xHVgt+B5bL+EgXzG+IWMzlCJmNGQjaTYc////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A///AAf// - AAD//wAAf/8AAP/8AAAP/wAA//AAAAf/AAA/4AAAA/8AAA+AAAAA/wAABwAAAAB/AAAAAAAAAD8AAAAA - AAAAPwAAAAAAAAAfAAAAAAAAAA8AAAAAAAAABwAAAAAB4AADAAAAAA/4AAMAAAAAH/4ADwAAAAAH/wA/ - AAAAAAH/gH8AAAAAAP+B/AAAAAAD/8PwAAAAAAf/7+AAAAAAH///gAAAAAB///4AAAAAAP///AAAAAAD - ///wAAAAAA///8AAAAAAP///AAAAAAB///4AAAAAAf//+AAAAAAH9//gAAAAAB/j/8AAAAAAP4H/gAAA - AAD+AP+AAAAAAPwA/+AAAAAA8AA/+AAAAADgAB/wAAAAAOAAB4AAAAAA4AAAAAAAAADwAAAAAAAAAPgA - AAAAAAAA/AAAAAAAAAD8AAAAAAAAAP4AAAAA4AAA/4AAAAH4AAD/wAAAB/wAAP/gAAAP/wAA//gAAB// - AAD//AAA//8AAP//gAP//wAAKAAAABAAAAAgAAAAAQAgAAAAAAAABAAAEgsAABILAAAAAAAAAAAAAP// - /wD///8A////AP///wA0m1AIMpJMbDOTTt0/mlj4Qpta+TuYVPUyk0zDMJFLIv///wD///8A////AP// - /wAvjEhW////AP///wAAbhkgJIU99Hu4jP+q17b/sdq8/6DRrv+PyZ//cbmF/zOPTf4FeCSi////AP// - /wD///8AQpFY/BB3K+4AbRp8LodG/MHgyf+j1LH/abZ+/0KkW/9BpFz/Wa9w/2W0ev9fsXX/NJVP/wZ0 - I83///8A////AGamd/3h9ef/cbCC/8rn0v9+wpD/I5ZD/yaNQf8mgT77J4FA+yeJQv8smUr/R6dh/0Kk - XP8giDz/AG0alP///wBionP91O3b/77fx/9otn7/JZVD/yV7PP4vhUahKZxJChuVPAQLaSU/G3Qz+DOf - Uf81oVL/IIU8/wJoHd7///8AX51w/cbn0P+ZzKf/I5JB/zKdT/8yl03/KHU8+Q1qJkz///8A////AABi - GiYccjP6Kn1B+R54N3j///8ALIVFFlqZa/3B5cr/O59W/y6bS/81n1H/G3Uz/RBtKb4AZwwK////AP// - /wD///8AAGEYJCCIPAsMXCIEKotEpTKDR/hVlGb9fseR/ymcSP8bdjT/DGIi5ABbDSH///8A////AP// - /wD///8A////AP///wARfS5ZU5Zk96zTtv8sg0T8SY5c/SyOSP8hbDb1GmwwVP///wD///8A////AP// - /wD///8A////AABfCSEQdCvjfrCL/9Lr2f9Wsm//Kn5B/SVuOfYabDGZJptFASOXQwgIiCsg////AP// - /wD///8AAF8HCA14KbdUmWf+weDL/7new/+MyJz/JppF/yl4Pv00m1AM////ABqTO2BLpGP4OplV+wB0 - GS7///8A////AA1uJ0A2hUv4nsiq/6vZt/+WzKX/NpxS/zGgT/8nczv9////AAqHLM9IoWD///////3/ - /v8efzb6AGYaTAFeGgkRaykKGHIwmjR3Rv6Mx5z/V65u/yyYSf83pVT/JnI7/f///wAAeR5jDn8s/ozJ - nf/t+PD/zufV/3ywi/9Bh1T9Sodb/XCqf/+Myp7/XrV1/yudSv8pfj//N6ZW/yZyO/3///8A////AAJy - IIgPeyv/QKRb/5jQqP+y3L3/otWx/5DNoP9zvof/TKtk/yycS/8SXCb9B1QbjghYHfAgYjL9////AP// - /wD///8ABGwfoBRwLfshij7/KZxJ/zmkVf85pFf/K5tJ/ymFQf8TWyX4AEgNNP///wD///8AImU0Zv// - /wD///8A////AP///wAlcDoLKXY+mSdyO/Umcjv7JnE7+ydwO+cmbzqHI2k2EP///wD///8A////AP// - /wDwDwAAYAcAAAADAAAAAQAAAAEAAADCAAAA4AAAA/AAAA/AAAAHAAAAQwAAAIAAAACAAAAAwAAAAOAG - AADwDwAA - - - \ No newline at end of file diff --git a/UpdateLib/UpdateLib.Generator/UI/LoaderControl.Designer.cs b/UpdateLib/UpdateLib.Generator/UI/LoaderControl.Designer.cs deleted file mode 100644 index 6b90a43..0000000 --- a/UpdateLib/UpdateLib.Generator/UI/LoaderControl.Designer.cs +++ /dev/null @@ -1,64 +0,0 @@ -namespace MatthiWare.UpdateLib.Generator.UI -{ - partial class LoaderControl - { - /// - /// 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 Component Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.pbLoader = new System.Windows.Forms.PictureBox(); - ((System.ComponentModel.ISupportInitialize)(this.pbLoader)).BeginInit(); - this.SuspendLayout(); - // - // pbLoader - // - this.pbLoader.Anchor = System.Windows.Forms.AnchorStyles.None; - this.pbLoader.BackColor = System.Drawing.Color.Transparent; - this.pbLoader.Image = global::MatthiWare.UpdateLib.Generator.Properties.Resources.loading_gear; - this.pbLoader.Location = new System.Drawing.Point(0, 0); - this.pbLoader.Name = "pbLoader"; - this.pbLoader.Size = new System.Drawing.Size(150, 150); - this.pbLoader.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; - this.pbLoader.TabIndex = 0; - this.pbLoader.TabStop = false; - // - // LoaderControl - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(249)))), ((int)(((byte)(249)))), ((int)(((byte)(249))))); - this.Controls.Add(this.pbLoader); - this.MinimumSize = new System.Drawing.Size(150, 150); - this.Name = "LoaderControl"; - ((System.ComponentModel.ISupportInitialize)(this.pbLoader)).EndInit(); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.PictureBox pbLoader; - } -} diff --git a/UpdateLib/UpdateLib.Generator/UI/LoaderControl.cs b/UpdateLib/UpdateLib.Generator/UI/LoaderControl.cs deleted file mode 100644 index 8cbf791..0000000 --- a/UpdateLib/UpdateLib.Generator/UI/LoaderControl.cs +++ /dev/null @@ -1,144 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Windows.Forms; -using MatthiWare.UpdateLib.UI; - -namespace MatthiWare.UpdateLib.Generator.UI -{ - public partial class LoaderControl : UserControl - { - private static Dictionary loaders = new Dictionary(); - - private const int WS_EX_TRANSPARENT = 0x20; - - private int m_opacity = 100; - - public int Opacity - { - get - { - return m_opacity; - } - set - { - m_opacity = value; - - if (m_opacity > 100) - m_opacity = 100; - - if (m_opacity < 0) - m_opacity = 1; - - var alpha = (m_opacity * 255) / 100; - BackColor = Color.FromArgb(alpha, BackColor); - Invalidate(); - } - } - - - public LoaderControl() - { - InitializeComponent(); - - SetStyle(ControlStyles.SupportsTransparentBackColor, true); - //SetStyle(ControlStyles.Opaque, true); - DoubleBuffered = true; - } - - protected override CreateParams CreateParams - { - get - { - CreateParams cp = base.CreateParams; - cp.ExStyle |= WS_EX_TRANSPARENT; - return cp; - } - } - - public static void Show(Control parent) - { - if (parent == null) - return; - - if (!loaders.ContainsKey(parent)) - loaders.Add(parent, new LoaderControl()); - - loaders[parent].ShowLoader(parent); - } - - public void ShowLoader(Control parent) - { - Parent.InvokeOnUI(() => - { - parent.SuspendLayout(); - - Opacity = 100; - - Size = parent.Size; - //parent.Size = Size; - Location = new Point(0, 0); - - parent.Resize += ParentResize; - - parent.Controls.Add(this); - - BringToFront(); - - parent.ResumeLayout(); - }); - } - - private void ParentResize(object sender, EventArgs e) - { - Control parent = sender as Control; - - if (parent == null) - return; - - Size = parent.Size; - } - - public static void Hide(Control parent) - { - if (parent == null) - return; - - if (!loaders.ContainsKey(parent)) - return; - - loaders[parent].HideLoader(parent); - } - - public void HideLoader(Control parent) - { - Parent.InvokeOnUI(() => - { - parent.SuspendLayout(); - - parent.Resize -= ParentResize; - - parent.Controls.Remove(this); - - parent.ResumeLayout(); - }); - } - } -} diff --git a/UpdateLib/UpdateLib.Generator/UI/LoaderControl.resx b/UpdateLib/UpdateLib.Generator/UI/LoaderControl.resx deleted file mode 100644 index 750e8d2..0000000 --- a/UpdateLib/UpdateLib.Generator/UI/LoaderControl.resx +++ /dev/null @@ -1,126 +0,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 - - - True - - - True - - \ No newline at end of file diff --git a/UpdateLib/UpdateLib.Generator/UI/MoveablePanel.cs b/UpdateLib/UpdateLib.Generator/UI/MoveablePanel.cs deleted file mode 100644 index 5e57ec8..0000000 --- a/UpdateLib/UpdateLib.Generator/UI/MoveablePanel.cs +++ /dev/null @@ -1,71 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.Runtime.InteropServices; -using System.Windows.Forms; - -namespace MatthiWare.UpdateLib.Generator.UI -{ - public class MoveablePanel : Panel - { - public Form ParentForm { get; set; } - - private const int WM_NCLBUTTONDOWN = 0xA1; - private const int HT_CAPTION = 0x2; - - [DllImport("user32.dll")] - private static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam); - - [DllImport("user32.dll")] - private static extern bool ReleaseCapture(); - - protected override void OnMouseMove(MouseEventArgs e) - { - base.OnMouseMove(e); - - MoveParentForm(this, e); - } - - private void MoveParentForm(object sender, MouseEventArgs e) - { - if (ParentForm != null) - { - ReleaseCapture(); - SendMessage(this.ParentForm.Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0); - } - } - - protected override void OnControlAdded(ControlEventArgs e) - { - base.OnControlAdded(e); - - if (typeof(HoverPictureBox) == e.Control.GetType()) - return; - - e.Control.MouseMove += MoveParentForm; - } - - protected override void OnControlRemoved(ControlEventArgs e) - { - base.OnControlRemoved(e); - - e.Control.MouseMove -= MoveParentForm; - } - - } -} diff --git a/UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.Designer.cs b/UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.Designer.cs deleted file mode 100644 index 1a33f59..0000000 --- a/UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.Designer.cs +++ /dev/null @@ -1,133 +0,0 @@ -namespace MatthiWare.UpdateLib.Generator.UI.Pages -{ - partial class BuilderPage - { - /// - /// 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 Component Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.label1 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.btnBuild = new System.Windows.Forms.Button(); - this.lblProgress = new System.Windows.Forms.Label(); - this.pbProgress = new System.Windows.Forms.ProgressBar(); - this.lblStatus = new System.Windows.Forms.Label(); - this.saveFileDialog = new System.Windows.Forms.SaveFileDialog(); - this.SuspendLayout(); - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Font = new System.Drawing.Font("Century Gothic", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label1.Location = new System.Drawing.Point(14, 16); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(143, 20); - this.label1.TabIndex = 1; - this.label1.Text = "Update generator"; - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(15, 59); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(121, 17); - this.label2.TabIndex = 2; - this.label2.Text = "Make new version: "; - // - // btnBuild - // - this.btnBuild.Location = new System.Drawing.Point(142, 56); - this.btnBuild.Name = "btnBuild"; - this.btnBuild.Size = new System.Drawing.Size(75, 23); - this.btnBuild.TabIndex = 3; - this.btnBuild.Text = "Build"; - this.btnBuild.UseVisualStyleBackColor = true; - this.btnBuild.Click += new System.EventHandler(this.btnBuild_Click); - // - // lblProgress - // - this.lblProgress.AutoSize = true; - this.lblProgress.Location = new System.Drawing.Point(139, 100); - this.lblProgress.Name = "lblProgress"; - this.lblProgress.Size = new System.Drawing.Size(79, 17); - this.lblProgress.TabIndex = 4; - this.lblProgress.Text = "Progress: 0%"; - // - // pbProgress - // - this.pbProgress.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.pbProgress.Location = new System.Drawing.Point(17, 139); - this.pbProgress.Name = "pbProgress"; - this.pbProgress.Size = new System.Drawing.Size(593, 23); - this.pbProgress.TabIndex = 5; - // - // lblStatus - // - this.lblStatus.AutoSize = true; - this.lblStatus.Location = new System.Drawing.Point(14, 100); - this.lblStatus.Name = "lblStatus"; - this.lblStatus.Size = new System.Drawing.Size(104, 17); - this.lblStatus.TabIndex = 6; - this.lblStatus.Text = "Status: Waiting.."; - // - // saveFileDialog - // - this.saveFileDialog.FileName = "updatefile"; - this.saveFileDialog.Filter = "Update files (.xml)|*.xml"; - this.saveFileDialog.Title = "Save location"; - // - // BuilderPage - // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.lblStatus); - this.Controls.Add(this.pbProgress); - this.Controls.Add(this.lblProgress); - this.Controls.Add(this.btnBuild); - this.Controls.Add(this.label2); - this.Controls.Add(this.label1); - this.DoubleBuffered = true; - this.Font = new System.Drawing.Font("Century Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.MinimumSize = new System.Drawing.Size(239, 104); - this.Name = "BuilderPage"; - this.Size = new System.Drawing.Size(629, 182); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.Button btnBuild; - private System.Windows.Forms.Label lblProgress; - private System.Windows.Forms.ProgressBar pbProgress; - private System.Windows.Forms.Label lblStatus; - private System.Windows.Forms.SaveFileDialog saveFileDialog; - } -} diff --git a/UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.cs b/UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.cs deleted file mode 100644 index 8f19624..0000000 --- a/UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.cs +++ /dev/null @@ -1,155 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Drawing; -using System.IO; -using System.Windows.Forms; - -using MatthiWare.UpdateLib.Generator.Tasks; -using MatthiWare.UpdateLib.UI; - -namespace MatthiWare.UpdateLib.Generator.UI.Pages -{ - public partial class BuilderPage : PageControlBase - { - private FilesPage filesPage; - private InformationPage infoPage; - private RegistryPage registryPage; - - public BuilderPage() - { - InitializeComponent(); - } - - protected override void OnPageInitialize() - { - saveFileDialog.InitialDirectory = new DirectoryInfo("./Output").FullName; - - PageControlBase page; - if (!TestForm.TryGetPage(nameof(FilesPage), out page)) - { - throw new KeyNotFoundException($"Unable to get {nameof(FilesPage)}"); - } - - filesPage = page as FilesPage; - - if (!TestForm.TryGetPage(nameof(InformationPage), out page)) - { - throw new KeyNotFoundException($"Unable to get {nameof(InformationPage)}"); - } - - infoPage = page as InformationPage; - - if (!TestForm.TryGetPage(nameof(RegistryPage), out page)) - { - throw new KeyNotFoundException($"Unable to get {nameof(RegistryPage)}"); - } - - registryPage = page as RegistryPage; - - if (!filesPage.IsPageInitialized) - filesPage.InitializePage(null); - - if (!infoPage.IsPageInitialized) - infoPage.InitializePage(null); - - if (!registryPage.IsPageInitialized) - registryPage.InitializePage(null); - } - - private void btnBuild_Click(object sender, EventArgs e) - { - if (saveFileDialog.ShowDialog(ParentForm) != DialogResult.OK) - return; - - pbProgress.Value = 0; - lblProgress.Text = "Progress: 0%"; - - Build(saveFileDialog.OpenFile()); - } - - Stopwatch sw = new Stopwatch(); - - private UpdateGeneratorTask Build(Stream s) - { - var task = new UpdateGeneratorTask(filesPage.Root, infoPage, registryPage.Folders); - - btnBuild.Enabled = false; - - task.TaskProgressChanged += (o, e) => - { - lblProgress.Text = $"Progress: {e.ProgressPercentage}%"; - pbProgress.Value = e.ProgressPercentage; - - }; - - task.TaskCompleted += (o, e) => - { - sw.Stop(); - - Updater.Instance.Logger.Debug(nameof(BuilderPage), nameof(Build), $"File generation completed in {sw.ElapsedMilliseconds} ms."); - - btnBuild.Enabled = true; - - if (e.Cancelled) - { - lblStatus.Text = $"Status: Cancelled"; - return; - } - - if (e.Error != null) - { - lblStatus.Text = $"Status: Error"; - - MessageDialog.Show( - ParentForm, - "Builder", - "Build error", - "Check the logs for more information", - SystemIcons.Error, - MessageBoxButtons.OK); - - return; - } - - using (s) - task.Result.Save(s); - - lblStatus.Text = $"Status: Completed"; - - MessageDialog.Show( - ParentForm, - "Builder", - "Build completed", - "The update file has been succesfully generated!\n" + - $"File generation completed in {sw.ElapsedMilliseconds} ms.", - SystemIcons.Information, - MessageBoxButtons.OK); - }; - - lblStatus.Text = "Status: Building.."; - - sw.Reset(); - sw.Start(); - - return task.Start(); - } - } -} diff --git a/UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.resx b/UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.resx deleted file mode 100644 index ff68a6a..0000000 --- a/UpdateLib/UpdateLib.Generator/UI/Pages/BuilderPage.resx +++ /dev/null @@ -1,123 +0,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 - - - 17, 17 - - \ No newline at end of file diff --git a/UpdateLib/UpdateLib.Generator/UI/Pages/FilesPage.Designer.cs b/UpdateLib/UpdateLib.Generator/UI/Pages/FilesPage.Designer.cs deleted file mode 100644 index b5cbc01..0000000 --- a/UpdateLib/UpdateLib.Generator/UI/Pages/FilesPage.Designer.cs +++ /dev/null @@ -1,232 +0,0 @@ -namespace MatthiWare.UpdateLib.Generator.UI.Pages -{ - partial class FilesPage - { - /// - /// 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 Component Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - this.label1 = new System.Windows.Forms.Label(); - this.tvFolders = new System.Windows.Forms.TreeView(); - this.ilIcons = new System.Windows.Forms.ImageList(this.components); - this.contextMenuRightClick = new System.Windows.Forms.ContextMenuStrip(this.components); - this.menuAddFiles = new System.Windows.Forms.ToolStripMenuItem(); - this.menuAddFolder = new System.Windows.Forms.ToolStripMenuItem(); - this.newFolderToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.existingFolderToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); - this.deleteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.lvFiles = new System.Windows.Forms.ListView(); - this.clmnName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.clmnDate = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.clmnType = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.clmnSize = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.folderBrowserDialog = new System.Windows.Forms.FolderBrowserDialog(); - this.openFileDialog = new System.Windows.Forms.OpenFileDialog(); - this.contextMenuRightClick.SuspendLayout(); - this.SuspendLayout(); - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Font = new System.Drawing.Font("Century Gothic", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label1.Location = new System.Drawing.Point(14, 16); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(128, 20); - this.label1.TabIndex = 1; - this.label1.Text = " Files and folders"; - // - // tvFolders - // - this.tvFolders.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left))); - this.tvFolders.ImageIndex = 0; - this.tvFolders.ImageList = this.ilIcons; - this.tvFolders.Location = new System.Drawing.Point(18, 53); - this.tvFolders.Name = "tvFolders"; - this.tvFolders.SelectedImageIndex = 0; - this.tvFolders.Size = new System.Drawing.Size(191, 332); - this.tvFolders.TabIndex = 2; - this.tvFolders.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.tvFolders_NodeMouseClick); - // - // ilIcons - // - this.ilIcons.ColorDepth = System.Windows.Forms.ColorDepth.Depth32Bit; - this.ilIcons.ImageSize = new System.Drawing.Size(16, 16); - this.ilIcons.TransparentColor = System.Drawing.Color.Transparent; - // - // contextMenuRightClick - // - this.contextMenuRightClick.Font = new System.Drawing.Font("Century Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.contextMenuRightClick.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.menuAddFiles, - this.menuAddFolder, - this.toolStripSeparator1, - this.deleteToolStripMenuItem}); - this.contextMenuRightClick.Name = "menuTV"; - this.contextMenuRightClick.Size = new System.Drawing.Size(142, 76); - // - // menuAddFiles - // - this.menuAddFiles.Image = global::MatthiWare.UpdateLib.Generator.Properties.Resources.image_transparent_16px; - this.menuAddFiles.Name = "menuAddFiles"; - this.menuAddFiles.Size = new System.Drawing.Size(141, 22); - this.menuAddFiles.Text = "Add File(s)"; - this.menuAddFiles.Click += new System.EventHandler(this.menuAddFiles_Click); - // - // menuAddFolder - // - this.menuAddFolder.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.newFolderToolStripMenuItem, - this.existingFolderToolStripMenuItem}); - this.menuAddFolder.Image = global::MatthiWare.UpdateLib.Generator.Properties.Resources.folder_transparent_16px; - this.menuAddFolder.Name = "menuAddFolder"; - this.menuAddFolder.Size = new System.Drawing.Size(141, 22); - this.menuAddFolder.Text = "Add Folder"; - // - // newFolderToolStripMenuItem - // - this.newFolderToolStripMenuItem.Name = "newFolderToolStripMenuItem"; - this.newFolderToolStripMenuItem.Size = new System.Drawing.Size(159, 22); - this.newFolderToolStripMenuItem.Text = "New Folder"; - this.newFolderToolStripMenuItem.Click += new System.EventHandler(this.newFolderToolStripMenuItem_Click); - // - // existingFolderToolStripMenuItem - // - this.existingFolderToolStripMenuItem.Name = "existingFolderToolStripMenuItem"; - this.existingFolderToolStripMenuItem.Size = new System.Drawing.Size(159, 22); - this.existingFolderToolStripMenuItem.Text = "Existing Folder"; - this.existingFolderToolStripMenuItem.Click += new System.EventHandler(this.existingFolderToolStripMenuItem_Click); - // - // toolStripSeparator1 - // - this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(138, 6); - // - // deleteToolStripMenuItem - // - this.deleteToolStripMenuItem.Enabled = false; - this.deleteToolStripMenuItem.Image = global::MatthiWare.UpdateLib.Generator.Properties.Resources.cross; - this.deleteToolStripMenuItem.Name = "deleteToolStripMenuItem"; - this.deleteToolStripMenuItem.Size = new System.Drawing.Size(141, 22); - this.deleteToolStripMenuItem.Text = "Delete"; - this.deleteToolStripMenuItem.Click += new System.EventHandler(this.deleteToolStripMenuItem_Click); - // - // lvFiles - // - this.lvFiles.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.lvFiles.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.clmnName, - this.clmnType, - this.clmnDate, - this.clmnSize}); - this.lvFiles.ContextMenuStrip = this.contextMenuRightClick; - this.lvFiles.FullRowSelect = true; - this.lvFiles.Location = new System.Drawing.Point(215, 53); - this.lvFiles.MultiSelect = false; - this.lvFiles.Name = "lvFiles"; - this.lvFiles.Size = new System.Drawing.Size(577, 332); - this.lvFiles.SmallImageList = this.ilIcons; - this.lvFiles.TabIndex = 3; - this.lvFiles.UseCompatibleStateImageBehavior = false; - this.lvFiles.View = System.Windows.Forms.View.Details; - this.lvFiles.SelectedIndexChanged += new System.EventHandler(this.lvFiles_SelectedIndexChanged); - this.lvFiles.DoubleClick += new System.EventHandler(this.lvFiles_DoubleClick); - // - // clmnName - // - this.clmnName.Text = "Name"; - this.clmnName.Width = 109; - // - // clmnDate - // - this.clmnDate.DisplayIndex = 1; - this.clmnDate.Text = "Last Modified"; - this.clmnDate.Width = 147; - // - // clmnType - // - this.clmnType.DisplayIndex = 2; - this.clmnType.Text = "Type"; - this.clmnType.Width = 93; - // - // clmnSize - // - this.clmnSize.Text = "Size"; - this.clmnSize.Width = 71; - // - // folderBrowserDialog - // - this.folderBrowserDialog.ShowNewFolderButton = false; - // - // openFileDialog - // - this.openFileDialog.Multiselect = true; - this.openFileDialog.ReadOnlyChecked = true; - this.openFileDialog.Title = "Add files to be included in the updater"; - // - // FilesPage - // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.lvFiles); - this.Controls.Add(this.tvFolders); - this.Controls.Add(this.label1); - this.DoubleBuffered = true; - this.Font = new System.Drawing.Font("Century Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.MinimumSize = new System.Drawing.Size(589, 233); - this.Name = "FilesPage"; - this.Size = new System.Drawing.Size(810, 403); - this.contextMenuRightClick.ResumeLayout(false); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.Label label1; - private System.Windows.Forms.TreeView tvFolders; - private System.Windows.Forms.ListView lvFiles; - private System.Windows.Forms.ColumnHeader clmnName; - private System.Windows.Forms.ColumnHeader clmnDate; - private System.Windows.Forms.ColumnHeader clmnType; - private System.Windows.Forms.ColumnHeader clmnSize; - private System.Windows.Forms.ImageList ilIcons; - private System.Windows.Forms.ContextMenuStrip contextMenuRightClick; - private System.Windows.Forms.ToolStripMenuItem menuAddFiles; - private System.Windows.Forms.ToolStripMenuItem menuAddFolder; - private System.Windows.Forms.ToolStripMenuItem newFolderToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem existingFolderToolStripMenuItem; - private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog; - private System.Windows.Forms.OpenFileDialog openFileDialog; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; - private System.Windows.Forms.ToolStripMenuItem deleteToolStripMenuItem; - } -} diff --git a/UpdateLib/UpdateLib.Generator/UI/Pages/FilesPage.cs b/UpdateLib/UpdateLib.Generator/UI/Pages/FilesPage.cs deleted file mode 100644 index 526cbba..0000000 --- a/UpdateLib/UpdateLib.Generator/UI/Pages/FilesPage.cs +++ /dev/null @@ -1,310 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Data; -using System.Linq; -using System.Windows.Forms; -using MatthiWare.UpdateLib.Tasks; -using MatthiWare.UpdateLib.Generator.Data; -using System.IO; -using MatthiWare.UpdateLib.UI; -using MatthiWare.UpdateLib.Generator.Data.FilesPage; - -namespace MatthiWare.UpdateLib.Generator.UI.Pages -{ - public partial class FilesPage : PageControlBase - { - private const string PROJECT_IMAGE_KEY = "project_key"; - - public GenFolder Root { get; set; } - - private GenFile _selectedFile; - private GenFile SelectedFile - { - get { return _selectedFile; } - set - { - _selectedFile = value; - if (value != null && !deleteToolStripMenuItem.Enabled) - deleteToolStripMenuItem.Enabled = true; - } - } - private GenFolder _selectedFolder; - private GenFolder SelectedFolder - { - get { return _selectedFolder; } - set - { - _selectedFolder = value; - if (value != null && !deleteToolStripMenuItem.Enabled) - deleteToolStripMenuItem.Enabled = true; - } - } - - public FilesPage() - { - InitializeComponent(); - } - - protected override void OnPageInitialize() - { - SuspendLayout(); - - ilIcons.Images.Add(TreeViewFolderNode.FOLDER_KEY, Properties.Resources.folder_transparent_16px); - ilIcons.Images.Add(PROJECT_IMAGE_KEY, Properties.Resources.project_16px); - - Root = new GenFolder("Update Project", contextMenuRightClick); - Root.ProtectedFolder = true; - Root.FolderTreeView.SelectedImageKey = PROJECT_IMAGE_KEY; - Root.FolderTreeView.ImageKey = PROJECT_IMAGE_KEY; - - GenFolder appFolder = new GenFolder("Application Folder", contextMenuRightClick); - appFolder.ProtectedFolder = true; - appFolder.PathVariable = "%appdir%"; - - Root.Add(appFolder); - - tvFolders.Nodes.Add(Root.FolderTreeView); - - folderBrowserDialog.Description = "Please select the folder to import"; - - UpdateSelectedFolder(Root); - - ResumeLayout(); - } - - private void menuAddFiles_Click(object sender, EventArgs e) - { - if (openFileDialog.ShowDialog(ParentForm) != DialogResult.OK) - return; - - if (SelectedFolder == Root) - return; - - AddExistingFileAsync(openFileDialog.FileNames.Select(file => new FileInfo(file))); - } - - private void existingFolderToolStripMenuItem_Click(object sender, EventArgs e) - { - if (folderBrowserDialog.ShowDialog(ParentForm) != DialogResult.OK) - return; - - if (SelectedFolder == Root) - return; - - AddExistingFolderAsync(new DirectoryInfo(folderBrowserDialog.SelectedPath)); - } - - private AsyncTask AddExistingFolderAsync(DirectoryInfo dir) - { - ShowLoader(); - - AsyncTask task = AsyncTaskFactory.From(new Action(() => - { - this.InvokeOnUI(() => SuspendLayout()); - - AddExistingFolder(dir, SelectedFolder, true); - - this.InvokeOnUI(() => - { - Root.FolderTreeView.Expand(); - ResumeLayout(); - }); - }), null); - - task.TaskCompleted += (o, e) => { HideLoader(); }; - - return task.Start(); - } - - private void AddExistingFolder(DirectoryInfo dir, GenFolder parentFolder, bool addToUI = false) - { - GenFolder folder = new GenFolder(dir.Name, contextMenuRightClick); - - if (addToUI) - this.InvokeOnUI(() => lvFiles.Items.Add(folder.FolderListView)); - - foreach (DirectoryInfo subDir in dir.GetDirectories()) - AddExistingFolder(subDir, folder); - - foreach (FileInfo f in dir.GetFiles()) - AddExistingFile(f, folder); - - this.InvokeOnUI(() => parentFolder.Add(folder)); - } - - private AsyncTask AddExistingFileAsync(IEnumerable files) - { - return AsyncTaskFactory.StartNew(new Action(() => - { - GenFolder s = SelectedFolder; - - foreach (FileInfo file in files) - AddExistingFile(file, s, true); - - }), null); - } - - private void AddExistingFile(FileInfo f, GenFolder folder, bool addToUI = false) - { - GenFile file = new GenFile(f); - - EnsureExtensionIconExists(f); - - folder.Add(file); - - if (addToUI) - this.InvokeOnUI(() => lvFiles.Items.Add(file.View)); - - } - - private void EnsureExtensionIconExists(FileInfo file) - { - if (ilIcons.Images.ContainsKey(file.Extension)) - return; - - Icon extensionIcon = Icon.ExtractAssociatedIcon(file.FullName); - - this.InvokeOnUI(() => ilIcons.Images.Add(file.Extension, extensionIcon)); - } - - private void UpdateSelectedFolder(GenFolder folder) - { - if (folder == null || folder == SelectedFolder) - return; - - SelectedFolder = folder; - SelectedFile = null; - - if (SelectedFolder == Root) - { - deleteToolStripMenuItem.Enabled = false; - menuAddFiles.Enabled = false; - menuAddFolder.Enabled = false; - } - else - { - menuAddFiles.Enabled = true; - menuAddFolder.Enabled = true; - } - - lvFiles.SuspendLayout(); - - lvFiles.Items.Clear(); - - foreach (GenFolder subFolder in folder.Directories) - lvFiles.Items.Add(subFolder.FolderListView); - - foreach (GenFile subFile in folder.Items) - lvFiles.Items.Add(subFile.View); - - lvFiles.ResumeLayout(); - - tvFolders.SelectedNode = folder.FolderTreeView; - folder.FolderTreeView.Expand(); - } - - private void lvFiles_DoubleClick(object sender, EventArgs e) - { - if (lvFiles.SelectedItems.Count == 0) - return; - - ListViewFolder item = lvFiles.SelectedItems[0] as ListViewFolder; - if (item == null) - return; - - UpdateSelectedFolder(item?.Folder); - - } - - private void newFolderToolStripMenuItem_Click(object sender, EventArgs e) - { - if (SelectedFolder == null || SelectedFolder == Root) - return; - - InputDialog inputDlg = new InputDialog("New folder", "Please enter the folder name: ", MessageBoxButtons.OKCancel); - - if (inputDlg.ShowDialog(ParentForm) != DialogResult.OK && SelectedFolder != null) - return; - - var name = inputDlg.Input; - - GenFolder folder = new GenFolder(name, contextMenuRightClick); - - this.InvokeOnUI(() => - { - SelectedFolder.Add(folder); - lvFiles.Items.Add(folder.FolderListView); - }); - } - - private void lvFiles_SelectedIndexChanged(object sender, EventArgs e) - { - if (lvFiles.SelectedItems.Count == 0) - return; - - ListViewItem item = lvFiles.SelectedItems[0]; - - if (item == null) - return; - - if (item is ListViewGenItem) - SelectedFile = (item as ListViewGenItem).Item as GenFile; - else if (item is ListViewFolder) - SelectedFolder = (item as ListViewFolder).Folder; - } - - private void deleteToolStripMenuItem_Click(object sender, EventArgs e) - { - SuspendLayout(); - - deleteToolStripMenuItem.Enabled = false; - - if (SelectedFile != null) - { - SelectedFile.Parent.Remove(SelectedFile); - SelectedFile = null; - } - else if (SelectedFolder != null && SelectedFolder != Root && !SelectedFolder.ProtectedFolder) - { - SelectedFolder.ParentFolder.Remove(SelectedFolder); - - lvFiles.Items.Clear(); - - GenFolder temp = SelectedFolder; - - UpdateSelectedFolder(SelectedFolder.ParentFolder); - - temp = null; - } - ResumeLayout(); - } - - private void tvFolders_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) - { - TreeViewFolderNode node = e.Node as TreeViewFolderNode; - - if (node == null) - return; - - UpdateSelectedFolder(node?.Folder); - } - } -} diff --git a/UpdateLib/UpdateLib.Generator/UI/Pages/FilesPage.resx b/UpdateLib/UpdateLib.Generator/UI/Pages/FilesPage.resx deleted file mode 100644 index 11876ac..0000000 --- a/UpdateLib/UpdateLib.Generator/UI/Pages/FilesPage.resx +++ /dev/null @@ -1,132 +0,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 - - - 17, 17 - - - 103, 17 - - - 281, 17 - - - 444, 17 - - \ No newline at end of file diff --git a/UpdateLib/UpdateLib.Generator/UI/Pages/InformationPage.Designer.cs b/UpdateLib/UpdateLib.Generator/UI/Pages/InformationPage.Designer.cs deleted file mode 100644 index 4b10891..0000000 --- a/UpdateLib/UpdateLib.Generator/UI/Pages/InformationPage.Designer.cs +++ /dev/null @@ -1,113 +0,0 @@ -namespace MatthiWare.UpdateLib.Generator.UI.Pages -{ - partial class InformationPage - { - /// - /// 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 Component Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.label1 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.txtAppName = new System.Windows.Forms.TextBox(); - this.label3 = new System.Windows.Forms.Label(); - this.txtAppVersion = new System.Windows.Forms.TextBox(); - this.SuspendLayout(); - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Font = new System.Drawing.Font("Century Gothic", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label1.Location = new System.Drawing.Point(14, 16); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(153, 20); - this.label1.TabIndex = 0; - this.label1.Text = "Update Information"; - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(15, 59); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(121, 17); - this.label2.TabIndex = 1; - this.label2.Text = "Application name: "; - // - // txtAppName - // - this.txtAppName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.txtAppName.Location = new System.Drawing.Point(160, 56); - this.txtAppName.Name = "txtAppName"; - this.txtAppName.Size = new System.Drawing.Size(212, 22); - this.txtAppName.TabIndex = 3; - // - // label3 - // - this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(15, 97); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(130, 17); - this.label3.TabIndex = 4; - this.label3.Text = "Application version: "; - // - // txtAppVersion - // - this.txtAppVersion.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.txtAppVersion.Location = new System.Drawing.Point(160, 94); - this.txtAppVersion.Name = "txtAppVersion"; - this.txtAppVersion.Size = new System.Drawing.Size(212, 22); - this.txtAppVersion.TabIndex = 5; - // - // InformationPage - // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.SystemColors.Control; - this.Controls.Add(this.txtAppVersion); - this.Controls.Add(this.label3); - this.Controls.Add(this.txtAppName); - this.Controls.Add(this.label2); - this.Controls.Add(this.label1); - this.DoubleBuffered = true; - this.Font = new System.Drawing.Font("Century Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.MinimumSize = new System.Drawing.Size(396, 144); - this.Name = "InformationPage"; - this.Size = new System.Drawing.Size(396, 144); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.TextBox txtAppName; - private System.Windows.Forms.Label label3; - private System.Windows.Forms.TextBox txtAppVersion; - } -} diff --git a/UpdateLib/UpdateLib.Generator/UI/Pages/InformationPage.cs b/UpdateLib/UpdateLib.Generator/UI/Pages/InformationPage.cs deleted file mode 100644 index c501c01..0000000 --- a/UpdateLib/UpdateLib.Generator/UI/Pages/InformationPage.cs +++ /dev/null @@ -1,59 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using MatthiWare.UpdateLib.Common; - -namespace MatthiWare.UpdateLib.Generator.UI.Pages -{ - public partial class InformationPage : PageControlBase - { - - public string ApplicationName - { - get - { - return txtAppName.Text; - } - set - { - txtAppName.Text = value; - } - } - - public UpdateVersion Version - { - get - { - return new UpdateVersion(txtAppVersion.Text); - } - set - { - txtAppVersion.Text = value.ToString(); - } - } - - public InformationPage() - { - InitializeComponent(); - } - - protected override void OnPageInitialize() - { - - } - } -} diff --git a/UpdateLib/UpdateLib.Generator/UI/Pages/InformationPage.resx b/UpdateLib/UpdateLib.Generator/UI/Pages/InformationPage.resx deleted file mode 100644 index 7080a7d..0000000 --- a/UpdateLib/UpdateLib.Generator/UI/Pages/InformationPage.resx +++ /dev/null @@ -1,120 +0,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/UpdateLib/UpdateLib.Generator/UI/Pages/PageControlBase.cs b/UpdateLib/UpdateLib.Generator/UI/Pages/PageControlBase.cs deleted file mode 100644 index 2d47e51..0000000 --- a/UpdateLib/UpdateLib.Generator/UI/Pages/PageControlBase.cs +++ /dev/null @@ -1,79 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using MatthiWare.UpdateLib.Tasks; -using System; -using System.ComponentModel; -using System.Windows.Forms; - -namespace MatthiWare.UpdateLib.Generator.UI.Pages -{ - public class PageControlBase : UserControl - { - internal MainForm TestForm { get; set; } - - public PageControlBase() - { - - } - - public void ShowLoader() - { - LoaderControl.Show(TestForm?.ContentPanel); - } - - public void HideLoader() - { - LoaderControl.Hide(TestForm?.ContentPanel); - } - - public bool IsPageInitialized { get; private set; } = false; - - private AsyncTask taskInitialize; - - public AsyncTask InitializePage(EventHandler callBack) - { - if (IsPageInitialized || (taskInitialize != null && taskInitialize.IsRunning)) - return taskInitialize; - - taskInitialize = AsyncTaskFactory.From(new Action(OnPageInitialize), null); - - taskInitialize.TaskCompleted += (o, e) => - { - IsPageInitialized = !e.Cancelled && e.Error == null; - - callBack?.Invoke(this, e); - }; - - return taskInitialize.Start(); - } - - protected virtual void OnPageInitialize() { } - - private void InitializeComponent() - { - this.SuspendLayout(); - // - // PageControlBase - // - this.DoubleBuffered = true; - this.Name = "PageControlBase"; - this.ResumeLayout(false); - - } - } -} diff --git a/UpdateLib/UpdateLib.Generator/UI/Pages/PageControlBase.resx b/UpdateLib/UpdateLib.Generator/UI/Pages/PageControlBase.resx deleted file mode 100644 index 7080a7d..0000000 --- a/UpdateLib/UpdateLib.Generator/UI/Pages/PageControlBase.resx +++ /dev/null @@ -1,120 +0,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/UpdateLib/UpdateLib.Generator/UI/Pages/RegistryPage.Designer.cs b/UpdateLib/UpdateLib.Generator/UI/Pages/RegistryPage.Designer.cs deleted file mode 100644 index 33f3ba0..0000000 --- a/UpdateLib/UpdateLib.Generator/UI/Pages/RegistryPage.Designer.cs +++ /dev/null @@ -1,255 +0,0 @@ -namespace MatthiWare.UpdateLib.Generator.UI.Pages -{ - partial class RegistryPage - { - /// - /// 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 Component Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RegistryPage)); - this.label1 = new System.Windows.Forms.Label(); - this.tvFolders = new System.Windows.Forms.TreeView(); - this.ilIcons = new System.Windows.Forms.ImageList(this.components); - this.contextMenuRightClick = new System.Windows.Forms.ContextMenuStrip(this.components); - this.menuAddFiles = new System.Windows.Forms.ToolStripMenuItem(); - this.menuAddFolder = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); - this.deleteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.lvRegistry = new System.Windows.Forms.ListView(); - this.clmnName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.clmnType = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.clmnValue = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.stringValueToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.binaryValueToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.dWORDValueToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.qWORDValueToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.multiStringValueToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.expandableStringValueToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.contextMenuRightClick.SuspendLayout(); - this.SuspendLayout(); - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Font = new System.Drawing.Font("Century Gothic", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label1.Location = new System.Drawing.Point(14, 16); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(65, 20); - this.label1.TabIndex = 1; - this.label1.Text = "Registry"; - // - // tvFolders - // - this.tvFolders.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left))); - this.tvFolders.ImageIndex = 0; - this.tvFolders.ImageList = this.ilIcons; - this.tvFolders.Location = new System.Drawing.Point(18, 53); - this.tvFolders.Name = "tvFolders"; - this.tvFolders.SelectedImageIndex = 0; - this.tvFolders.Size = new System.Drawing.Size(191, 332); - this.tvFolders.TabIndex = 2; - this.tvFolders.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.tvFolders_NodeMouseClick); - // - // ilIcons - // - this.ilIcons.ColorDepth = System.Windows.Forms.ColorDepth.Depth32Bit; - this.ilIcons.ImageSize = new System.Drawing.Size(16, 16); - this.ilIcons.TransparentColor = System.Drawing.Color.Transparent; - // - // contextMenuRightClick - // - this.contextMenuRightClick.Font = new System.Drawing.Font("Century Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.contextMenuRightClick.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.menuAddFiles, - this.menuAddFolder, - this.toolStripSeparator1, - this.deleteToolStripMenuItem}); - this.contextMenuRightClick.Name = "menuTV"; - this.contextMenuRightClick.Size = new System.Drawing.Size(153, 98); - // - // menuAddFiles - // - this.menuAddFiles.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.stringValueToolStripMenuItem, - this.binaryValueToolStripMenuItem, - this.dWORDValueToolStripMenuItem, - this.qWORDValueToolStripMenuItem, - this.multiStringValueToolStripMenuItem, - this.expandableStringValueToolStripMenuItem}); - this.menuAddFiles.Image = global::MatthiWare.UpdateLib.Generator.Properties.Resources.image_transparent_16px; - this.menuAddFiles.Name = "menuAddFiles"; - this.menuAddFiles.Size = new System.Drawing.Size(152, 22); - this.menuAddFiles.Text = "Add Value"; - // - // menuAddFolder - // - this.menuAddFolder.Image = global::MatthiWare.UpdateLib.Generator.Properties.Resources.folder_transparent_16px; - this.menuAddFolder.Name = "menuAddFolder"; - this.menuAddFolder.Size = new System.Drawing.Size(152, 22); - this.menuAddFolder.Text = "Add Key"; - this.menuAddFolder.Click += new System.EventHandler(this.menuAddFolder_Click); - // - // toolStripSeparator1 - // - this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(149, 6); - // - // deleteToolStripMenuItem - // - this.deleteToolStripMenuItem.Enabled = false; - this.deleteToolStripMenuItem.Image = global::MatthiWare.UpdateLib.Generator.Properties.Resources.cross; - this.deleteToolStripMenuItem.Name = "deleteToolStripMenuItem"; - this.deleteToolStripMenuItem.Size = new System.Drawing.Size(152, 22); - this.deleteToolStripMenuItem.Text = "Delete"; - this.deleteToolStripMenuItem.Click += new System.EventHandler(this.deleteToolStripMenuItem_Click); - // - // lvRegistry - // - this.lvRegistry.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.lvRegistry.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.clmnName, - this.clmnType, - this.clmnValue}); - this.lvRegistry.ContextMenuStrip = this.contextMenuRightClick; - this.lvRegistry.FullRowSelect = true; - this.lvRegistry.Location = new System.Drawing.Point(215, 53); - this.lvRegistry.MultiSelect = false; - this.lvRegistry.Name = "lvRegistry"; - this.lvRegistry.Size = new System.Drawing.Size(577, 332); - this.lvRegistry.SmallImageList = this.ilIcons; - this.lvRegistry.TabIndex = 3; - this.lvRegistry.UseCompatibleStateImageBehavior = false; - this.lvRegistry.View = System.Windows.Forms.View.Details; - this.lvRegistry.SelectedIndexChanged += new System.EventHandler(this.lvFiles_SelectedIndexChanged); - this.lvRegistry.DoubleClick += new System.EventHandler(this.lvFiles_DoubleClick); - // - // clmnName - // - this.clmnName.Text = "Name"; - this.clmnName.Width = 150; - // - // clmnType - // - this.clmnType.Text = "Type"; - this.clmnType.Width = 93; - // - // clmnValue - // - this.clmnValue.Text = "Value"; - this.clmnValue.Width = 250; - // - // stringValueToolStripMenuItem - // - this.stringValueToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("stringValueToolStripMenuItem.Image"))); - this.stringValueToolStripMenuItem.Name = "stringValueToolStripMenuItem"; - this.stringValueToolStripMenuItem.Size = new System.Drawing.Size(221, 22); - this.stringValueToolStripMenuItem.Text = "String Value"; - this.stringValueToolStripMenuItem.Click += new System.EventHandler(this.stringValueToolStripMenuItem_Click); - // - // binaryValueToolStripMenuItem - // - this.binaryValueToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("binaryValueToolStripMenuItem.Image"))); - this.binaryValueToolStripMenuItem.Name = "binaryValueToolStripMenuItem"; - this.binaryValueToolStripMenuItem.Size = new System.Drawing.Size(221, 22); - this.binaryValueToolStripMenuItem.Text = "Binary Value"; - this.binaryValueToolStripMenuItem.Click += new System.EventHandler(this.binaryValueToolStripMenuItem_Click); - // - // dWORDValueToolStripMenuItem - // - this.dWORDValueToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("dWORDValueToolStripMenuItem.Image"))); - this.dWORDValueToolStripMenuItem.Name = "dWORDValueToolStripMenuItem"; - this.dWORDValueToolStripMenuItem.Size = new System.Drawing.Size(221, 22); - this.dWORDValueToolStripMenuItem.Text = "DWORD (32-bit) Value"; - this.dWORDValueToolStripMenuItem.Click += new System.EventHandler(this.dWORDValueToolStripMenuItem_Click); - // - // qWORDValueToolStripMenuItem - // - this.qWORDValueToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("qWORDValueToolStripMenuItem.Image"))); - this.qWORDValueToolStripMenuItem.Name = "qWORDValueToolStripMenuItem"; - this.qWORDValueToolStripMenuItem.Size = new System.Drawing.Size(221, 22); - this.qWORDValueToolStripMenuItem.Text = "QWORD (64-bit) Value"; - this.qWORDValueToolStripMenuItem.Click += new System.EventHandler(this.qWORDValueToolStripMenuItem_Click); - // - // multiStringValueToolStripMenuItem - // - this.multiStringValueToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("multiStringValueToolStripMenuItem.Image"))); - this.multiStringValueToolStripMenuItem.Name = "multiStringValueToolStripMenuItem"; - this.multiStringValueToolStripMenuItem.Size = new System.Drawing.Size(221, 22); - this.multiStringValueToolStripMenuItem.Text = "Multi String Value"; - this.multiStringValueToolStripMenuItem.Click += new System.EventHandler(this.multiStringValueToolStripMenuItem_Click); - // - // expandableStringValueToolStripMenuItem - // - this.expandableStringValueToolStripMenuItem.Image = global::MatthiWare.UpdateLib.Generator.Properties.Resources.reg_string_16px; - this.expandableStringValueToolStripMenuItem.Name = "expandableStringValueToolStripMenuItem"; - this.expandableStringValueToolStripMenuItem.Size = new System.Drawing.Size(221, 22); - this.expandableStringValueToolStripMenuItem.Text = "Expandable String Value"; - this.expandableStringValueToolStripMenuItem.Click += new System.EventHandler(this.expandableStringValueToolStripMenuItem_Click); - // - // RegistryPage - // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.lvRegistry); - this.Controls.Add(this.tvFolders); - this.Controls.Add(this.label1); - this.DoubleBuffered = true; - this.Font = new System.Drawing.Font("Century Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.MinimumSize = new System.Drawing.Size(589, 233); - this.Name = "RegistryPage"; - this.Size = new System.Drawing.Size(810, 403); - this.contextMenuRightClick.ResumeLayout(false); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.Label label1; - private System.Windows.Forms.TreeView tvFolders; - private System.Windows.Forms.ListView lvRegistry; - private System.Windows.Forms.ColumnHeader clmnName; - private System.Windows.Forms.ColumnHeader clmnType; - private System.Windows.Forms.ColumnHeader clmnValue; - private System.Windows.Forms.ImageList ilIcons; - private System.Windows.Forms.ContextMenuStrip contextMenuRightClick; - private System.Windows.Forms.ToolStripMenuItem menuAddFiles; - private System.Windows.Forms.ToolStripMenuItem menuAddFolder; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; - private System.Windows.Forms.ToolStripMenuItem deleteToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem stringValueToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem binaryValueToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem dWORDValueToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem qWORDValueToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem multiStringValueToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem expandableStringValueToolStripMenuItem; - } -} diff --git a/UpdateLib/UpdateLib.Generator/UI/Pages/RegistryPage.cs b/UpdateLib/UpdateLib.Generator/UI/Pages/RegistryPage.cs deleted file mode 100644 index 8aae329..0000000 --- a/UpdateLib/UpdateLib.Generator/UI/Pages/RegistryPage.cs +++ /dev/null @@ -1,256 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.Collections.Generic; -using System.Windows.Forms; -using MatthiWare.UpdateLib.Generator.Data; -using MatthiWare.UpdateLib.UI; -using MatthiWare.UpdateLib.Generator.Data.FilesPage; -using Microsoft.Win32; - -namespace MatthiWare.UpdateLib.Generator.UI.Pages -{ - public partial class RegistryPage : PageControlBase - { - private const string PROJECT_IMAGE_KEY = "project_key"; - - private GenReg m_selectedRegEntry; - private GenReg SelectedRegEntry - { - get { return m_selectedRegEntry; } - set - { - m_selectedRegEntry = value; - if (value != null && !deleteToolStripMenuItem.Enabled) - deleteToolStripMenuItem.Enabled = true; - } - } - private GenFolder _selectedFolder; - private GenFolder SelectedFolder - { - get { return _selectedFolder; } - set - { - _selectedFolder = value; - if (value != null && !deleteToolStripMenuItem.Enabled) - deleteToolStripMenuItem.Enabled = true; - } - } - - public IList Folders { get; set; } - - public RegistryPage() - { - InitializeComponent(); - } - - protected override void OnPageInitialize() - { - SuspendLayout(); - - Folders = new List(); - - ilIcons.Images.Add("REG_BIN", Properties.Resources.reg_bin_16px); - ilIcons.Images.Add("REG_SZ", Properties.Resources.reg_string_16px); - ilIcons.Images.Add(TreeViewFolderNode.FOLDER_KEY, Properties.Resources.folder_transparent_16px); - - GenFolder hkey_classes_root = new GenFolder("HKEY_CLASSES_ROOT", contextMenuRightClick); - GenFolder hkey_current_user = new GenFolder("HKEY_CURRENT_USER", contextMenuRightClick); - GenFolder hkey_local_machine = new GenFolder("HKEY_LOCAL_MACHINE", contextMenuRightClick); - GenFolder hkey_users = new GenFolder("HKEY_USERS", contextMenuRightClick); - GenFolder hkey_current_config = new GenFolder("HKEY_CURRENT_CONFIG", contextMenuRightClick); - - tvFolders.Nodes.Add(hkey_classes_root.FolderTreeView); - tvFolders.Nodes.Add(hkey_current_user.FolderTreeView); - tvFolders.Nodes.Add(hkey_local_machine.FolderTreeView); - tvFolders.Nodes.Add(hkey_users.FolderTreeView); - tvFolders.Nodes.Add(hkey_current_config.FolderTreeView); - - Folders.Add(hkey_classes_root); - Folders.Add(hkey_current_user); - Folders.Add(hkey_local_machine); - Folders.Add(hkey_users); - Folders.Add(hkey_current_config); - - UpdateSelectedFolder(hkey_classes_root); - - ResumeLayout(); - } - - private void UpdateSelectedFolder(GenFolder folder) - { - if (folder == null || folder == SelectedFolder) - return; - - SelectedFolder = folder; - SelectedRegEntry = null; - - if (SelectedFolder.IsRoot) - deleteToolStripMenuItem.Enabled = false; - - lvRegistry.SuspendLayout(); - - lvRegistry.Items.Clear(); - - foreach (GenFolder subFolder in folder.Directories) - lvRegistry.Items.Add(subFolder.FolderListView); - - foreach (IGenItem subFile in folder.Items) - lvRegistry.Items.Add(subFile.View); - - lvRegistry.ResumeLayout(); - - tvFolders.SelectedNode = folder.FolderTreeView; - folder.FolderTreeView.Expand(); - } - - private void lvFiles_DoubleClick(object sender, EventArgs e) - { - if (lvRegistry.SelectedItems.Count == 0) - return; - - ListViewFolder item = lvRegistry.SelectedItems[0] as ListViewFolder; - if (item == null) - return; - - UpdateSelectedFolder(item?.Folder); - - } - - private void lvFiles_SelectedIndexChanged(object sender, EventArgs e) - { - if (lvRegistry.SelectedItems.Count == 0) - return; - - ListViewItem item = lvRegistry.SelectedItems[0]; - - if (item == null) - return; - - if (item is ListViewGenItem) - SelectedRegEntry = (item as ListViewGenItem).Item as GenReg; - else if (item is ListViewFolder) - SelectedFolder = (item as ListViewFolder).Folder; - } - - private void deleteToolStripMenuItem_Click(object sender, EventArgs e) - { - SuspendLayout(); - - deleteToolStripMenuItem.Enabled = false; - - if (SelectedRegEntry != null) - { - SelectedRegEntry.Parent.Remove(SelectedRegEntry); - lvRegistry.Items.Remove(SelectedRegEntry.View); - SelectedRegEntry = null; - } - else if (SelectedFolder != null && !SelectedFolder.IsRoot) - { - SelectedFolder.ParentFolder.Remove(SelectedFolder); - - lvRegistry.Items.Clear(); - - GenFolder temp = SelectedFolder; - - UpdateSelectedFolder(SelectedFolder.ParentFolder); - - temp = null; - } - - ResumeLayout(); - } - - private void tvFolders_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) - { - TreeViewFolderNode node = e.Node as TreeViewFolderNode; - - if (node == null) - return; - - UpdateSelectedFolder(node?.Folder); - } - - private void menuAddFolder_Click(object sender, EventArgs e) - { - if (SelectedFolder == null) - return; - - InputDialog inputDlg = new InputDialog("New folder", "Please enter the folder name: ", MessageBoxButtons.OKCancel); - - if (inputDlg.ShowDialog(ParentForm) != DialogResult.OK && SelectedFolder != null) - return; - - var name = inputDlg.Input; - - GenFolder folder = new GenFolder(name, contextMenuRightClick); - - this.InvokeOnUI(() => - { - SelectedFolder.Add(folder); - SelectedFolder.FolderTreeView.Expand(); - lvRegistry.Items.Add(folder.FolderListView); - }); - } - - private void stringValueToolStripMenuItem_Click(object sender, EventArgs e) - { - MakeNewEntry(RegistryValueKind.String); - } - - private void binaryValueToolStripMenuItem_Click(object sender, EventArgs e) - { - MakeNewEntry(RegistryValueKind.Binary); - } - - private void dWORDValueToolStripMenuItem_Click(object sender, EventArgs e) - { - MakeNewEntry(RegistryValueKind.DWord); - } - - private void qWORDValueToolStripMenuItem_Click(object sender, EventArgs e) - { - MakeNewEntry(RegistryValueKind.QWord); - } - - private void multiStringValueToolStripMenuItem_Click(object sender, EventArgs e) - { - MakeNewEntry(RegistryValueKind.MultiString); - } - - private void expandableStringValueToolStripMenuItem_Click(object sender, EventArgs e) - { - MakeNewEntry(RegistryValueKind.ExpandString); - } - - private void MakeNewEntry(RegistryValueKind type) - { - if (SelectedFolder == null) - return; - - GenReg item = new GenReg("New Item", type); - item.Value = "Test"; - - this.InvokeOnUI(() => - { - SelectedFolder.Add(item); - lvRegistry.Items.Add(item.View); - }); - } - } -} diff --git a/UpdateLib/UpdateLib.Generator/UI/Pages/RegistryPage.resx b/UpdateLib/UpdateLib.Generator/UI/Pages/RegistryPage.resx deleted file mode 100644 index a8e58e9..0000000 --- a/UpdateLib/UpdateLib.Generator/UI/Pages/RegistryPage.resx +++ /dev/null @@ -1,177 +0,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 - - - 17, 17 - - - 103, 17 - - - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - wwAADsMBx2+oZAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xNkRpr/UAAADHSURBVDhPnZNN - DoMgEIU5US/Tk7nkGp4FXPQSNi5q+VHKjH04jZKqL/kSeEw+NqCMMekMTdOkHAVU13VUHMowDKlt2x+J - stbS5nBIkKMgYcE8z1Ue9xuDkACQ5LQAefb9VoBhYq9DP00TUwQoAIZr6xiFwGRBjIHBwDq4dnKNi74C - Ux2srUMIzCLIjyMEXw4lez11oAi895cQAncJFmitEyCZc+4wLMhvogCRc2+GIi+QZ8RGQODHAdrLM5KM - 44vZFfwDkgWdPgHhXeaPOieBAAAAA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PpZLL - DcIwDEAzEcswWY5Zo7OkObBEUQ+U/IkNTp2AIBWWnuRfn3uI0FrnI0gpcwlBCGMMNIZiXdc8TVMjEfM8 - QzEcICghSIKClBJyOl8qfY9yEBAgqYJ+8VseY8zXZflPAFQBNWiBL/Ga8hCYQBdBCP4QJH8JdB3sF9qc - 14D3HnkKyuPw3iH7wlheBc45hIajORNYZB+2Oa95DwVKqUyAzFo7DArgORIksvZe4Qf62ZsAgL/gH0Dd - z7bthnwU/KI9oPIDaOlC7DAsnWYAAAAASUVORK5CYII= - - - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - wwAADsMBx2+oZAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xNkRpr/UAAADHSURBVDhPnZNN - DoMgEIU5US/Tk7nkGp4FXPQSNi5q+VHKjH04jZKqL/kSeEw+NqCMMekMTdOkHAVU13VUHMowDKlt2x+J - stbS5nBIkKMgYcE8z1Ue9xuDkACQ5LQAefb9VoBhYq9DP00TUwQoAIZr6xiFwGRBjIHBwDq4dnKNi74C - Ux2srUMIzCLIjyMEXw4lez11oAi895cQAncJFmitEyCZc+4wLMhvogCRc2+GIi+QZ8RGQODHAdrLM5KM - 44vZFfwDkgWdPgHhXeaPOieBAAAAAElFTkSuQmCC - - - \ No newline at end of file diff --git a/UpdateLib/UpdateLib.Generator/UpdateLib.Generator.csproj b/UpdateLib/UpdateLib.Generator/UpdateLib.Generator.csproj index d890be0..f9adb81 100644 --- a/UpdateLib/UpdateLib.Generator/UpdateLib.Generator.csproj +++ b/UpdateLib/UpdateLib.Generator/UpdateLib.Generator.csproj @@ -1,200 +1,11 @@ - - - + - Debug - AnyCPU - {5194FF71-49F6-4ADB-9B0E-4BEB418DC6F3} - WinExe - Properties + netcoreapp2.1 MatthiWare.UpdateLib.Generator - UpdateLib.Generator - v3.5 - 512 + Exe + false - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - Generator_logo.ico - - - MatthiWare.UpdateLib.Generator.Program - - - - - - - - - - - - - - - Properties\SharedAssemblyInfo.cs - - - - - - - - - - - - - - - Form - - - MainForm.cs - - - Component - - - Component - - - Component - - - Component - - - UserControl - - - LoaderControl.cs - - - Form - - - InputDialog.cs - - - Component - - - UserControl - - - BuilderPage.cs - - - UserControl - - - RegistryPage.cs - - - UserControl - - - FilesPage.cs - - - UserControl - - - InformationPage.cs - - - UserControl - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - True - Resources.resx - True - - - MainForm.cs - - - LoaderControl.cs - - - InputDialog.cs - - - BuilderPage.cs - - - RegistryPage.cs - - - FilesPage.cs - - - InformationPage.cs - - - PageControlBase.cs - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - Settings.settings - True - - - - - {4394be57-95e2-45b1-a968-1404b0590b35} - UpdateLib - - - - - - - - - - - - - - + - - - \ No newline at end of file diff --git a/UpdateLib/UpdateLib.Tests/UpdateLib.Tests.csproj b/UpdateLib/UpdateLib.Tests/UpdateLib.Tests.csproj index 1a6d8ce..4de1865 100644 --- a/UpdateLib/UpdateLib.Tests/UpdateLib.Tests.csproj +++ b/UpdateLib/UpdateLib.Tests/UpdateLib.Tests.csproj @@ -1,107 +1,44 @@ - - - + - Debug - AnyCPU - {C47B8CC3-ABAB-4F56-8CA2-1323F902D1C3} - Library - Properties - UpdateLib.Tests - UpdateLib.Tests - v4.5 - 512 - + netcoreapp2.1 + false - true full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false + bin\$(Configuration)\ pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false + bin\$(Configuration)\ + + + {C47B8CC3-ABAB-4F56-8CA2-1323F902D1C3} - - ..\packages\Castle.Core.4.0.0\lib\net45\Castle.Core.dll - True - - - ..\packages\Moq.4.7.1\lib\net45\Moq.dll - True - - - ..\packages\NUnit.3.6.1\lib\net45\nunit.framework.dll - True - - - - - - - - - - - - Properties\SharedAssemblyInfo.cs - - - - - - - - - - - - - - - - - - - - - - - - - - + - - + + + all + + + + + + + + + + + - - {4394be57-95e2-45b1-a968-1404b0590b35} - UpdateLib - + + - + + - - \ No newline at end of file diff --git a/UpdateLib/UpdateLib.Tests/packages.config b/UpdateLib/UpdateLib.Tests/packages.config deleted file mode 100644 index 9f7b212..0000000 --- a/UpdateLib/UpdateLib.Tests/packages.config +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/UpdateLib/UpdateLib/Common/DirectoryEntry.cs b/UpdateLib/UpdateLib/Common/DirectoryEntry.cs index 598698e..cdfc04c 100644 --- a/UpdateLib/UpdateLib/Common/DirectoryEntry.cs +++ b/UpdateLib/UpdateLib/Common/DirectoryEntry.cs @@ -49,23 +49,18 @@ public class DirectoryEntry /// /// Gets the list of subdirectories. /// - [XmlArray("Directories"), XmlArrayItem("Directory")] public List Directories { get; set; } = new List(); /// /// Gets the list of files in this directory. /// - [XmlElement(typeof(FileEntry))] - [XmlElement(typeof(RegistryKeyEntry))] public List Items { get; set; } = new List(); /// /// Gets or Sets the Parent of this Directory /// - [XmlIgnore] public DirectoryEntry Parent { get; set; } - [XmlIgnore] public string SourceLocation { get diff --git a/UpdateLib/UpdateLib/Common/HashCacheEntry.cs b/UpdateLib/UpdateLib/Common/HashCacheEntry.cs index 4c4405c..0de28ff 100644 --- a/UpdateLib/UpdateLib/Common/HashCacheEntry.cs +++ b/UpdateLib/UpdateLib/Common/HashCacheEntry.cs @@ -63,14 +63,14 @@ public void Recalculate(string hash = "") Hash = string.IsNullOrEmpty(hash) ? HashUtil.GetHash(FilePath) : hash; Ticks = tick; - Updater.Instance.Logger.Debug(nameof(HashCacheEntry), nameof(Recalculate), $"Recalculated Time: {DateTime.FromBinary(Ticks).ToString()} Name: {FilePath} Hash: {Hash}"); + //Updater.Instance.Logger.Debug(nameof(HashCacheEntry), nameof(Recalculate), $"Recalculated Time: {DateTime.FromBinary(Ticks).ToString()} Name: {FilePath} Hash: {Hash}"); } catch (Exception ex) // file might no longer exist or is in use { Hash = string.Empty; Ticks = -1; - Updater.Instance.Logger.Error(nameof(HashCacheEntry), nameof(Recalculate), ex); + //Updater.Instance.Logger.Error(nameof(HashCacheEntry), nameof(Recalculate), ex); } } diff --git a/UpdateLib/UpdateLib/Common/RegistryKeyEntry.cs b/UpdateLib/UpdateLib/Common/RegistryKeyEntry.cs deleted file mode 100644 index 69994a0..0000000 --- a/UpdateLib/UpdateLib/Common/RegistryKeyEntry.cs +++ /dev/null @@ -1,52 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using MatthiWare.UpdateLib.Common.Abstraction; -using Microsoft.Win32; -using System; -using System.Diagnostics; -using System.Xml.Serialization; - -namespace MatthiWare.UpdateLib.Common -{ - [Serializable] - [DebuggerDisplay("RegistryKeyEntry: {DestinationLocation}")] - public class RegistryKeyEntry : EntryBase - { - /// - /// The type of registry key - /// - [XmlAttribute] - public RegistryValueKind Type { get; set; } - - /// - /// The value of the key - /// - public object Value { get; set; } = "Test"; - - public RegistryKeyEntry() - : this(string.Empty, RegistryValueKind.String, null) - { } - - public RegistryKeyEntry(string name, RegistryValueKind type, object value) - { - Name = name; - Type = type; - Value = value; - } - } -} diff --git a/UpdateLib/UpdateLib/Common/WorkerScheduler.cs b/UpdateLib/UpdateLib/Common/WorkerScheduler.cs deleted file mode 100644 index 62ff183..0000000 --- a/UpdateLib/UpdateLib/Common/WorkerScheduler.cs +++ /dev/null @@ -1,122 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using MatthiWare.UpdateLib.Tasks; -using MatthiWare.UpdateLib.Threading; -using System; -using System.Threading; - -namespace MatthiWare.UpdateLib.Common -{ - internal class WorkerScheduler - { - - #region Singleton - private static volatile WorkerScheduler instance = null; - private static readonly object synclock = new object(); - - /// - /// Gets a thread safe instance of - /// - public static WorkerScheduler Instance - { - get - { - if (instance == null) - lock (synclock) - if (instance == null) - instance = new WorkerScheduler(); - - return instance; - } - } - #endregion - - #region Fields - - private readonly long MAX_WORKERS; - private readonly ConcurrentQueue m_taskQueue; - private readonly AtomicInteger m_currentWorkerCount; - private readonly AsyncTask m_dispatcherTask; - private readonly ManualResetEvent m_waitForAvailableWorker; - private readonly object sync = new object(); - - public const long MIN_WORKERS = 8; - - #endregion - - private WorkerScheduler() - { - MAX_WORKERS = Math.Max(Environment.ProcessorCount, MIN_WORKERS); - m_taskQueue = new ConcurrentQueue(); - m_dispatcherTask = AsyncTaskFactory.From(new Action(Dispatcher), null); - m_waitForAvailableWorker = new ManualResetEvent(true); - m_currentWorkerCount = new AtomicInteger(); - } - - public void Schedule(AsyncTask task) - { - Enqueue(task); - - lock (synclock) - if (!m_dispatcherTask.IsRunning) - m_dispatcherTask.Start(); - } - - private void Dispatcher() - { - AsyncTask task = null; - while (m_taskQueue.TryDequeue(out task)) - { - lock (sync) - { - if (task.IsCompleted || task.IsCancelled || task.HasErrors) - continue; - - SetupTask(task); - - if (m_currentWorkerCount.Value >= MAX_WORKERS) - m_waitForAvailableWorker.Reset(); - - m_waitForAvailableWorker.WaitOne(); - - Updater.Instance.Logger.Debug(nameof(WorkerScheduler), nameof(Dispatcher), $"Current worker count: {m_currentWorkerCount.Increment()} | Current queue count: {m_taskQueue.Count}"); - - task.ConfigureAwait(false).Start(); - } - } - } - - private void SetupTask(AsyncTask task) - { - task.TaskCompleted += (o, e) => - { - - if (m_currentWorkerCount.Decrement() < MAX_WORKERS) - m_waitForAvailableWorker.Set(); - - Updater.Instance.Logger.Debug(nameof(WorkerScheduler), nameof(Dispatcher), $"Current worker count: {m_currentWorkerCount}"); - }; - } - - private void Enqueue(AsyncTask task) - { - m_taskQueue.Enqueue(task); - } - - } -} diff --git a/UpdateLib/UpdateLib/Compression/Checksum/Adler32.cs b/UpdateLib/UpdateLib/Compression/Checksum/Adler32.cs deleted file mode 100644 index 4fa0d86..0000000 --- a/UpdateLib/UpdateLib/Compression/Checksum/Adler32.cs +++ /dev/null @@ -1,209 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -using System; - -namespace MatthiWare.UpdateLib.Compression.Checksum -{ - /// - /// Computes Adler32 checksum for a stream of data. An Adler32 - /// checksum is not as reliable as a CRC32 checksum, but a lot faster to - /// compute. - /// - /// The specification for Adler32 may be found in RFC 1950. - /// ZLIB Compressed Data Format Specification version 3.3) - /// - /// - /// From that document: - /// - /// "ADLER32 (Adler-32 checksum) - /// This contains a checksum value of the uncompressed data - /// (excluding any dictionary data) computed according to Adler-32 - /// algorithm. This algorithm is a 32-bit extension and improvement - /// of the Fletcher algorithm, used in the ITU-T X.224 / ISO 8073 - /// standard. - /// - /// Adler-32 is composed of two sums accumulated per byte: s1 is - /// the sum of all bytes, s2 is the sum of all s1 values. Both sums - /// are done modulo 65521. s1 is initialized to 1, s2 to zero. The - /// Adler-32 checksum is stored as s2*65536 + s1 in most- - /// significant-byte first (network) order." - /// - /// "8.2. The Adler-32 algorithm - /// - /// The Adler-32 algorithm is much faster than the CRC32 algorithm yet - /// still provides an extremely low probability of undetected errors. - /// - /// The modulo on unsigned long accumulators can be delayed for 5552 - /// bytes, so the modulo operation time is negligible. If the bytes - /// are a, b, c, the second sum is 3a + 2b + c + 3, and so is position - /// and order sensitive, unlike the first sum, which is just a - /// checksum. That 65521 is prime is important to avoid a possible - /// large class of two-byte errors that leave the check unchanged. - /// (The Fletcher checksum uses 255, which is not prime and which also - /// makes the Fletcher check insensitive to single byte changes 0 - - /// 255.) - /// - /// The sum s1 is initialized to 1 instead of zero to make the length - /// of the sequence part of s2, so that the length does not have to be - /// checked separately. (Any sequence of zeroes has a Fletcher - /// checksum of zero.)" - /// - public sealed class Adler32 : IChecksum - { - #region Instance Fields - /// - /// largest prime smaller than 65536 - /// - readonly static uint BASE = 65521; - - /// - /// The CRC data checksum so far. - /// - uint checkValue; - #endregion - - /// - /// Initialise a default instance of - /// - public Adler32() - { - Reset(); - } - - /// - /// Resets the Adler32 data checksum as if no update was ever called. - /// - public void Reset() - { - checkValue = 1; - } - - /// - /// Returns the Adler32 data checksum computed so far. - /// - public long Value - { - get - { - return checkValue; - } - } - - /// - /// Updates the checksum with the byte b. - /// - /// - /// The data value to add. The high byte of the int is ignored. - /// - public void Update(int bval) - { - // We could make a length 1 byte array and call update again, but I - // would rather not have that overhead - uint s1 = checkValue & 0xFFFF; - uint s2 = checkValue >> 16; - - s1 = (s1 + ((uint)bval & 0xFF)) % BASE; - s2 = (s1 + s2) % BASE; - - checkValue = (s2 << 16) + s1; - } - - /// - /// Updates the Adler32 data checksum with the bytes taken from - /// a block of data. - /// - /// Contains the data to update the checksum with. - public void Update(byte[] buffer) - { - if (buffer == null) - throw new ArgumentNullException(nameof(buffer)); - - Update(buffer, 0, buffer.Length); - } - - /// - /// Update Adler32 data checksum based on a portion of a block of data - /// - /// Contains the data to update the CRC with. - /// The offset into the buffer where the data starts - /// The number of data bytes to update the CRC with. - public void Update(byte[] buffer, int offset, int count) - { - if (buffer == null) - throw new ArgumentNullException(nameof(buffer)); - - if (offset < 0) - throw new ArgumentOutOfRangeException(nameof(offset), "cannot be less than zero"); - - if (offset >= buffer.Length) - throw new ArgumentOutOfRangeException(nameof(offset), "not a valid index into buffer"); - - if (count < 0) - throw new ArgumentOutOfRangeException(nameof(count), "cannot be less than zero"); - - if (offset + count > buffer.Length) - throw new ArgumentOutOfRangeException(nameof(count), "exceeds buffer size"); - - //(By Per Bothner) - uint s1 = checkValue & 0xFFFF; - uint s2 = checkValue >> 16; - - while (count > 0) - { - // We can defer the modulo operation: - // s1 maximally grows from 65521 to 65521 + 255 * 3800 - // s2 maximally grows by 3800 * median(s1) = 2090079800 < 2^31 - int n = 3800; - - if (n > count) - n = count; - - count -= n; - - while (--n >= 0) - { - s1 = s1 + (uint)(buffer[offset++] & 0xff); - s2 = s2 + s1; - } - - s1 %= BASE; - s2 %= BASE; - } - - checkValue = (s2 << 16) | s1; - } - } -} diff --git a/UpdateLib/UpdateLib/Compression/Checksum/Crc32.cs b/UpdateLib/UpdateLib/Compression/Checksum/Crc32.cs deleted file mode 100644 index f3d70b8..0000000 --- a/UpdateLib/UpdateLib/Compression/Checksum/Crc32.cs +++ /dev/null @@ -1,217 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -using System; - -namespace MatthiWare.UpdateLib.Compression.Checksum -{ - /// - /// CRC-32 with reversed data and unreversed output - /// - /// - /// Generate a table for a byte-wise 32-bit CRC calculation on the polynomial: - /// x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x^1+x^0. - /// - /// Polynomials over GF(2) are represented in binary, one bit per coefficient, - /// with the lowest powers in the most significant bit. Then adding polynomials - /// is just exclusive-or, and multiplying a polynomial by x is a right shift by - /// one. If we call the above polynomial p, and represent a byte as the - /// polynomial q, also with the lowest power in the most significant bit (so the - /// byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p, - /// where a mod b means the remainder after dividing a by b. - /// - /// This calculation is done using the shift-register method of multiplying and - /// taking the remainder. The register is initialized to zero, and for each - /// incoming bit, x^32 is added mod p to the register if the bit is a one (where - /// x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by - /// x (which is shifting right by one and adding x^32 mod p if the bit shifted - /// out is a one). We start with the highest power (least significant bit) of - /// q and repeat for all eight bits of q. - /// - /// The table is simply the CRC of all possible eight bit values. This is all - /// the information needed to generate CRC's on data a byte at a time for all - /// combinations of CRC register values and incoming bytes. - /// - public sealed class Crc32 : IChecksum - { - #region Instance Fields - readonly static uint crcInit = 0xFFFFFFFF; - readonly static uint crcXor = 0xFFFFFFFF; - - readonly static uint[] crcTable = { - 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, - 0x706AF48F, 0xE963A535, 0x9E6495A3, 0x0EDB8832, 0x79DCB8A4, - 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, - 0x90BF1D91, 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, - 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, 0x136C9856, - 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9, - 0xFA0F3D63, 0x8D080DF5, 0x3B6E20C8, 0x4C69105E, 0xD56041E4, - 0xA2677172, 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, - 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, - 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, 0x26D930AC, 0x51DE003A, - 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, - 0xB8BDA50F, 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, - 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, 0x76DC4190, - 0x01DB7106, 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F, - 0x9FBFE4A5, 0xE8B8D433, 0x7807C9A2, 0x0F00F934, 0x9609A88E, - 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01, - 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, 0x6C0695ED, - 0x1B01A57B, 0x8208F4C1, 0xF50FC457, 0x65B0D9C6, 0x12B7E950, - 0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, - 0xFBD44C65, 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, - 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, 0x4369E96A, - 0x346ED9FC, 0xAD678846, 0xDA60B8D0, 0x44042D73, 0x33031DE5, - 0xAA0A4C5F, 0xDD0D7CC9, 0x5005713C, 0x270241AA, 0xBE0B1010, - 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F, - 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, - 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD, 0xEDB88320, 0x9ABFB3B6, - 0x03B6E20C, 0x74B1D29A, 0xEAD54739, 0x9DD277AF, 0x04DB2615, - 0x73DC1683, 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, - 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, 0xF00F9344, - 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB, - 0x196C3671, 0x6E6B06E7, 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, - 0x67DD4ACC, 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, - 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, - 0xA6BC5767, 0x3FB506DD, 0x48B2364B, 0xD80D2BDA, 0xAF0A1B4C, - 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, - 0x4669BE79, 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, - 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, 0xC5BA3BBE, - 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31, - 0x2CD99E8B, 0x5BDEAE1D, 0x9B64C2B0, 0xEC63F226, 0x756AA39C, - 0x026D930A, 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713, - 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, 0x92D28E9B, - 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, 0x86D3D2D4, 0xF1D4E242, - 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, - 0x18B74777, 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, - 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, 0xA00AE278, - 0xD70DD2EE, 0x4E048354, 0x3903B3C2, 0xA7672661, 0xD06016F7, - 0x4969474D, 0x3E6E77DB, 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, - 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, - 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, - 0xCDD70693, 0x54DE5729, 0x23D967BF, 0xB3667A2E, 0xC4614AB8, - 0x5D681B02, 0x2A6F2B94, 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, - 0x2D02EF8D - }; - - /// - /// The CRC data checksum so far. - /// - uint checkValue; - #endregion - - internal static uint ComputeCrc32(uint oldCrc, byte bval) => crcTable[(oldCrc ^ bval) & 0xFF] ^ (oldCrc >> 8); - - - /// - /// Initialise a default instance of - /// - public Crc32() - { - Reset(); - } - - /// - /// Resets the CRC data checksum as if no update was ever called. - /// - public void Reset() - { - checkValue = crcInit; - } - - /// - /// Returns the CRC data checksum computed so far. - /// - /// Reversed Out = false - public long Value - { - get - { - return checkValue ^ crcXor; - } - } - - /// - /// Updates the checksum with the int bval. - /// - /// - /// the byte is taken as the lower 8 bits of bval - /// - /// Reversed Data = true - public void Update(int bval) - { - checkValue = unchecked(crcTable[(checkValue ^ bval) & 0xFF] ^ (checkValue >> 8)); - } - - /// - /// Updates the CRC data checksum with the bytes taken from - /// a block of data. - /// - /// Contains the data to update the CRC with. - public void Update(byte[] buffer) - { - if (buffer == null) - throw new ArgumentNullException(nameof(buffer)); - - Update(buffer, 0, buffer.Length); - } - - /// - /// Update CRC data checksum based on a portion of a block of data - /// - /// Contains the data to update the CRC with. - /// The offset into the buffer where the data starts - /// The number of data bytes to update the CRC with. - public void Update(byte[] buffer, int offset, int count) - { - if (buffer == null) - throw new ArgumentNullException(nameof(buffer)); - - if (offset < 0) - throw new ArgumentOutOfRangeException(nameof(offset), "cannot be less than zero"); - - if (offset >= buffer.Length) - throw new ArgumentOutOfRangeException(nameof(offset), "not a valid index into buffer"); - - if (count < 0) - throw new ArgumentOutOfRangeException(nameof(count), "cannot be less than zero"); - - if (offset + count > buffer.Length) - throw new ArgumentOutOfRangeException(nameof(count), "exceeds buffer size"); - - for (int i = 0; i < count; ++i) - Update(buffer[offset++]); - } - } -} diff --git a/UpdateLib/UpdateLib/Compression/Checksum/IChecksum.cs b/UpdateLib/UpdateLib/Compression/Checksum/IChecksum.cs deleted file mode 100644 index 087ef98..0000000 --- a/UpdateLib/UpdateLib/Compression/Checksum/IChecksum.cs +++ /dev/null @@ -1,91 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - - -namespace MatthiWare.UpdateLib.Compression.Checksum -{ - /// - /// Interface to compute a data checksum used by checked input/output streams. - /// A data checksum can be updated by one byte or with a byte array. After each - /// update the value of the current checksum can be returned by calling - /// getValue. The complete checksum object can also be reset - /// so it can be used again with new data. - /// - public interface IChecksum - { - /// - /// Resets the data checksum as if no update was ever called. - /// - void Reset(); - - /// - /// Returns the data checksum computed so far. - /// - long Value - { - get; - } - - /// - /// Adds one byte to the data checksum. - /// - /// - /// the data value to add. The high byte of the int is ignored. - /// - void Update(int bval); - - /// - /// Updates the data checksum with the bytes taken from the array. - /// - /// - /// buffer an array of bytes - /// - void Update(byte[] buffer); - - /// - /// Adds the byte array to the data checksum. - /// - /// - /// The buffer which contains the data - /// - /// - /// The offset in the buffer where the data starts - /// - /// - /// the number of data bytes to add. - /// - void Update(byte[] buffer, int offset, int count); - } -} diff --git a/UpdateLib/UpdateLib/Compression/Deflaters/Deflater.cs b/UpdateLib/UpdateLib/Compression/Deflaters/Deflater.cs deleted file mode 100644 index 17feee8..0000000 --- a/UpdateLib/UpdateLib/Compression/Deflaters/Deflater.cs +++ /dev/null @@ -1,464 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -using System; - -namespace MatthiWare.UpdateLib.Compression.Deflaters -{ - /// - /// This is the Deflater class. The deflater class compresses input - /// with the deflate algorithm described in RFC 1951. It has several - /// compression levels and three different strategies described below. - /// - /// This class is not thread safe. This is inherent in the API, due - /// to the split of deflate and setInput. - /// - /// author of the original java version : Jochen Hoenicke - /// - public class Deflater - { - #region Public Constants - /// - /// The best and slowest compression level. This tries to find very - /// long and distant string repetitions. - /// - public const int BEST_COMPRESSION = 9; - - /// - /// The worst but fastest compression level. - /// - public const int BEST_SPEED = 1; - - /// - /// The default compression level. - /// - public const int DEFAULT_COMPRESSION = -1; - - /// - /// This level won't compress at all but output uncompressed blocks. - /// - public const int NO_COMPRESSION = 0; - - /// - /// The compression method. This is the only method supported so far. - /// There is no need to use this constant at all. - /// - public const int DEFLATED = 8; - #endregion - #region Local Constants - private const int IS_SETDICT = 0x01; - private const int IS_FLUSHING = 0x04; - private const int IS_FINISHING = 0x08; - - private const int INIT_STATE = 0x00; - private const int SETDICT_STATE = 0x01; - // private static int INIT_FINISHING_STATE = 0x08; - // private static int SETDICT_FINISHING_STATE = 0x09; - private const int BUSY_STATE = 0x10; - private const int FLUSHING_STATE = 0x14; - private const int FINISHING_STATE = 0x1c; - private const int FINISHED_STATE = 0x1e; - private const int CLOSED_STATE = 0x7f; - #endregion - #region Constructors - /// - /// Creates a new deflater with default compression level. - /// - public Deflater() : this(DEFAULT_COMPRESSION, false) - { - - } - - /// - /// Creates a new deflater with given compression level. - /// - /// - /// the compression level, a value between NO_COMPRESSION - /// and BEST_COMPRESSION. - /// - /// - /// true, if we should suppress the Zlib/RFC1950 header at the - /// beginning and the adler checksum at the end of the output. This is - /// useful for the GZIP/PKZIP formats. - /// - /// if lvl is out of range. - public Deflater(int level, bool noZlibHeaderOrFooter_) - { - if (level == DEFAULT_COMPRESSION) - level = 6; - else if (level < NO_COMPRESSION || level > BEST_COMPRESSION) - throw new ArgumentOutOfRangeException(nameof(level)); - - pending = new DeflaterPending(); - engine = new DeflaterEngine(pending); - noZlibHeaderOrFooter = noZlibHeaderOrFooter_; - SetStrategy(DeflateStrategy.Default); - SetLevel(level); - Reset(); - } - #endregion - - /// - /// Resets the deflater. The deflater acts afterwards as if it was - /// just created with the same compression level and strategy as it - /// had before. - /// - public void Reset() - { - state = (noZlibHeaderOrFooter ? BUSY_STATE : INIT_STATE); - totalOut = 0; - pending.Reset(); - engine.Reset(); - } - - /// - /// Gets the number of input bytes processed so far. - /// - public long TotalIn - { - get - { - return engine.TotalIn; - } - } - - /// - /// Gets the number of output bytes so far. - /// - public long TotalOut - { - get - { - return totalOut; - } - } - - /// - /// Flushes the current input block. Further calls to deflate() will - /// produce enough output to inflate everything in the current input - /// block. This is not part of Sun's JDK so I have made it package - /// private. It is used by DeflaterOutputStream to implement - /// flush(). - /// - public void Flush() - { - state |= IS_FLUSHING; - } - - /// - /// Finishes the deflater with the current input block. It is an error - /// to give more input after this method was called. This method must - /// be called to force all bytes to be flushed. - /// - public void Finish() - { - state |= (IS_FLUSHING | IS_FINISHING); - } - - /// - /// Returns true if the stream was finished and no more output bytes - /// are available. - /// - public bool IsFinished - { - get - { - return (state == FINISHED_STATE) && pending.IsFlushed; - } - } - - /// - /// Returns true, if the input buffer is empty. - /// You should then call setInput(). - /// NOTE: This method can also return true when the stream - /// was finished. - /// - public bool IsNeedingInput - { - get - { - return engine.NeedsInput(); - } - } - - /// - /// Sets the data which should be compressed next. This should be - /// only called when needsInput indicates that more input is needed. - /// The given byte array should not be changed, before needsInput() returns - /// true again. - /// - /// - /// the buffer containing the input data. - /// - /// - /// the start of the data. - /// - /// - /// the number of data bytes of input. - /// - /// - /// if the buffer was Finish()ed or if previous input is still pending. - /// - public void SetInput(byte[] input, int offset, int count) - { - if ((state & IS_FINISHING) != 0) - { - throw new InvalidOperationException("Finish() already called"); - } - engine.SetInput(input, offset, count); - } - - /// - /// Sets the compression level. There is no guarantee of the exact - /// position of the change, but if you call this when needsInput is - /// true the change of compression level will occur somewhere near - /// before the end of the so far given input. - /// - /// - /// the new compression level. - /// - public void SetLevel(int level) - { - if (level == DEFAULT_COMPRESSION) - level = 6; - else if (level < NO_COMPRESSION || level > BEST_COMPRESSION) - throw new ArgumentOutOfRangeException(nameof(level)); - - if (this.level != level) - { - this.level = level; - engine.SetLevel(level); - } - } - - /// - /// Get current compression level - /// - /// Returns the current compression level - public int GetLevel() => level; - - /// - /// Sets the compression strategy. Strategy is one of - /// DEFAULT_STRATEGY, HUFFMAN_ONLY and FILTERED. For the exact - /// position where the strategy is changed, the same as for - /// SetLevel() applies. - /// - /// - /// The new compression strategy. - /// - public void SetStrategy(DeflateStrategy strategy) - { - engine.Strategy = strategy; - } - - /// - /// Deflates the current input block to the given array. - /// - /// - /// Buffer to store the compressed data. - /// - /// - /// Offset into the output array. - /// - /// - /// The maximum number of bytes that may be stored. - /// - /// - /// The number of compressed bytes added to the output, or 0 if either - /// needsInput() or finished() returns true or length is zero. - /// - /// - /// If Finish() was previously called. - /// - /// - /// If offset or length don't match the array length. - /// - public int Deflate(byte[] output, int offset, int length) - { - int origLength = length; - - if (state == CLOSED_STATE) - throw new InvalidOperationException("Deflater closed"); - - if (state < BUSY_STATE) - { - // output header - int header = (DEFLATED + - ((DeflaterConstants.MAX_WBITS - 8) << 4)) << 8; - - int level_flags = (level - 1) >> 1; - - if (level_flags < 0 || level_flags > 3) - level_flags = 3; - - header |= level_flags << 6; - - if ((state & IS_SETDICT) != 0) - header |= DeflaterConstants.PRESET_DICT; // Dictionary was set - - header += 31 - (header % 31); - - pending.WriteShortMSB(header); - - if ((state & IS_SETDICT) != 0) - { - int chksum = engine.Adler; - engine.ResetAdler(); - pending.WriteShortMSB(chksum >> 16); - pending.WriteShortMSB(chksum & 0xffff); - } - - state = BUSY_STATE | (state & (IS_FLUSHING | IS_FINISHING)); - } - - for (;;) - { - int count = pending.Flush(output, offset, length); - offset += count; - totalOut += count; - length -= count; - - if (length == 0 || state == FINISHED_STATE) - break; - - if (!engine.Deflate((state & IS_FLUSHING) != 0, (state & IS_FINISHING) != 0)) - { - switch (state) - { - case BUSY_STATE: - // We need more input now - return origLength - length; - - case FLUSHING_STATE: - if (level != NO_COMPRESSION) - { - /* We have to supply some lookahead. 8 bit lookahead - * is needed by the zlib inflater, and we must fill - * the next byte, so that all bits are flushed. - */ - int neededbits = 8 + ((-pending.BitCount) & 7); - while (neededbits > 0) - { - /* write a static tree block consisting solely of - * an EOF: - */ - pending.WriteBits(2, 10); - neededbits -= 10; - } - } - - state = BUSY_STATE; - break; - case FINISHING_STATE: - pending.AlignToByte(); - - // Compressed data is complete. Write footer information if required. - if (!noZlibHeaderOrFooter) - { - int adler = engine.Adler; - pending.WriteShortMSB(adler >> 16); - pending.WriteShortMSB(adler & 0xffff); - } - - state = FINISHED_STATE; - break; - } - } - } - return origLength - length; - } - - /// - /// Sets the dictionary which should be used in the deflate process. - /// The dictionary is a byte array containing strings that are - /// likely to occur in the data which should be compressed. The - /// dictionary is not stored in the compressed output, only a - /// checksum. To decompress the output you need to supply the same - /// dictionary again. - /// - /// - /// The dictionary data - /// - /// - /// The index where dictionary information commences. - /// - /// - /// The number of bytes in the dictionary. - /// - /// - /// If SetInput () or Deflate() were already called or another dictionary was already set. - /// - public void SetDictionary(byte[] dictionary, int index, int count) - { - if (state != INIT_STATE) - throw new InvalidOperationException(); - - state = SETDICT_STATE; - engine.SetDictionary(dictionary, index, count); - } - - #region Instance Fields - /// - /// Compression level. - /// - int level; - - /// - /// If true no Zlib/RFC1950 headers or footers are generated - /// - bool noZlibHeaderOrFooter; - - /// - /// The current state. - /// - int state; - - /// - /// The total bytes of output written. - /// - long totalOut; - - /// - /// The pending output. - /// - DeflaterPending pending; - - /// - /// The deflater engine. - /// - DeflaterEngine engine; - #endregion - } -} diff --git a/UpdateLib/UpdateLib/Compression/Deflaters/DeflaterConstants.cs b/UpdateLib/UpdateLib/Compression/Deflaters/DeflaterConstants.cs deleted file mode 100644 index 965c189..0000000 --- a/UpdateLib/UpdateLib/Compression/Deflaters/DeflaterConstants.cs +++ /dev/null @@ -1,181 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -using System; - -namespace MatthiWare.UpdateLib.Compression.Deflaters -{ - /// - /// This class contains constants used for deflation. - /// - public static class DeflaterConstants - { - /// - /// Set to true to enable debugging - /// - public const bool DEBUGGING = false; - - /// - /// Written to Zip file to identify a stored block - /// - public const int STORED_BLOCK = 0; - - /// - /// Identifies static tree in Zip file - /// - public const int STATIC_TREES = 1; - - /// - /// Identifies dynamic tree in Zip file - /// - public const int DYN_TREES = 2; - - /// - /// Header flag indicating a preset dictionary for deflation - /// - public const int PRESET_DICT = 0x20; - - /// - /// Sets internal buffer sizes for Huffman encoding - /// - public const int DEFAULT_MEM_LEVEL = 8; - - /// - /// Internal compression engine constant - /// - public const int MAX_MATCH = 258; - - /// - /// Internal compression engine constant - /// - public const int MIN_MATCH = 3; - - /// - /// Internal compression engine constant - /// - public const int MAX_WBITS = 15; - - /// - /// Internal compression engine constant - /// - public const int WSIZE = 1 << MAX_WBITS; - - /// - /// Internal compression engine constant - /// - public const int WMASK = WSIZE - 1; - - /// - /// Internal compression engine constant - /// - public const int HASH_BITS = DEFAULT_MEM_LEVEL + 7; - - /// - /// Internal compression engine constant - /// - public const int HASH_SIZE = 1 << HASH_BITS; - - /// - /// Internal compression engine constant - /// - public const int HASH_MASK = HASH_SIZE - 1; - - /// - /// Internal compression engine constant - /// - public const int HASH_SHIFT = (HASH_BITS + MIN_MATCH - 1) / MIN_MATCH; - - /// - /// Internal compression engine constant - /// - public const int MIN_LOOKAHEAD = MAX_MATCH + MIN_MATCH + 1; - - /// - /// Internal compression engine constant - /// - public const int MAX_DIST = WSIZE - MIN_LOOKAHEAD; - - /// - /// Internal compression engine constant - /// - public const int PENDING_BUF_SIZE = 1 << (DEFAULT_MEM_LEVEL + 8); - - /// - /// Internal compression engine constant - /// - public static int MAX_BLOCK_SIZE = Math.Min(65535, PENDING_BUF_SIZE - 5); - - /// - /// Internal compression engine constant - /// - public const int DEFLATE_STORED = 0; - - /// - /// Internal compression engine constant - /// - public const int DEFLATE_FAST = 1; - - /// - /// Internal compression engine constant - /// - public const int DEFLATE_SLOW = 2; - - /// - /// Internal compression engine constant - /// - public static int[] GOOD_LENGTH = { 0, 4, 4, 4, 4, 8, 8, 8, 32, 32 }; - - /// - /// Internal compression engine constant - /// - public static int[] MAX_LAZY = { 0, 4, 5, 6, 4, 16, 16, 32, 128, 258 }; - - /// - /// Internal compression engine constant - /// - public static int[] NICE_LENGTH = { 0, 8, 16, 32, 16, 32, 128, 128, 258, 258 }; - - /// - /// Internal compression engine constant - /// - public static int[] MAX_CHAIN = { 0, 4, 8, 32, 16, 32, 128, 256, 1024, 4096 }; - - /// - /// Internal compression engine constant - /// - public static int[] COMPR_FUNC = { 0, 1, 1, 1, 1, 2, 2, 2, 2, 2 }; - - } -} diff --git a/UpdateLib/UpdateLib/Compression/Deflaters/DeflaterEngine.cs b/UpdateLib/UpdateLib/Compression/Deflaters/DeflaterEngine.cs deleted file mode 100644 index 63f5010..0000000 --- a/UpdateLib/UpdateLib/Compression/Deflaters/DeflaterEngine.cs +++ /dev/null @@ -1,850 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -using MatthiWare.UpdateLib.Compression.Checksum; -using System; - -namespace MatthiWare.UpdateLib.Compression.Deflaters -{ - /// - /// Strategies for deflater - /// - public enum DeflateStrategy - { - /// - /// The default strategy - /// - Default = 0, - - /// - /// This strategy will only allow longer string repetitions. It is - /// useful for random data with a small character set. - /// - Filtered = 1, - - - /// - /// This strategy will not look for string repetitions at all. It - /// only encodes with Huffman trees (which means, that more common - /// characters get a smaller encoding. - /// - HuffmanOnly = 2 - } - - // DEFLATE ALGORITHM: - // - // The uncompressed stream is inserted into the window array. When - // the window array is full the first half is thrown away and the - // second half is copied to the beginning. - // - // The head array is a hash table. Three characters build a hash value - // and they the value points to the corresponding index in window of - // the last string with this hash. The prev array implements a - // linked list of matches with the same hash: prev[index & WMASK] points - // to the previous index with the same hash. - // - - - /// - /// Low level compression engine for deflate algorithm which uses a 32K sliding window - /// with secondary compression from Huffman/Shannon-Fano codes. - /// - public class DeflaterEngine - { - #region Constants - const int TooFar = 4096; - #endregion - - #region Constructors - /// - /// Construct instance with pending buffer - /// - /// - /// Pending buffer to use - /// > - public DeflaterEngine(DeflaterPending pending) - { - this.pending = pending; - huffman = new DeflaterHuffman(pending); - checksum = new Adler32(); - - window = new byte[2 * DeflaterConstants.WSIZE]; - head = new short[DeflaterConstants.HASH_SIZE]; - prev = new short[DeflaterConstants.WSIZE]; - - // We start at index 1, to avoid an implementation deficiency, that - // we cannot build a repeat pattern at index 0. - blockStart = strstart = 1; - } - - #endregion - - /// - /// Deflate drives actual compression of data - /// - /// True to flush input buffers - /// Finish deflation with the current input. - /// Returns true if progress has been made. - public bool Deflate(bool flush, bool finish) - { - bool progress; - do - { - FillWindow(); - bool canFlush = flush && (inputOff == inputEnd); - - switch (compressionFunction) - { - case DeflaterConstants.DEFLATE_STORED: - progress = DeflateStored(canFlush, finish); - break; - case DeflaterConstants.DEFLATE_FAST: - progress = DeflateFast(canFlush, finish); - break; - case DeflaterConstants.DEFLATE_SLOW: - progress = DeflateSlow(canFlush, finish); - break; - default: - throw new InvalidOperationException("unknown compressionFunction"); - } - } while (pending.IsFlushed && progress); // repeat while we have no pending output and progress was made - return progress; - } - - /// - /// Sets input data to be deflated. Should only be called when NeedsInput() - /// returns true - /// - /// The buffer containing input data. - /// The offset of the first byte of data. - /// The number of bytes of data to use as input. - public void SetInput(byte[] buffer, int offset, int count) - { - if (buffer == null) - throw new ArgumentNullException(nameof(buffer)); - - if (offset < 0) - throw new ArgumentOutOfRangeException(nameof(offset)); - - if (count < 0) - throw new ArgumentOutOfRangeException(nameof(count)); - - if (inputOff < inputEnd) - throw new InvalidOperationException("Old input was not completely processed"); - - int end = offset + count; - - /* We want to throw an ArrayIndexOutOfBoundsException early. The - * check is very tricky: it also handles integer wrap around. - */ - if ((offset > end) || (end > buffer.Length)) - throw new ArgumentOutOfRangeException(nameof(count)); - - inputBuf = buffer; - inputOff = offset; - inputEnd = end; - } - - /// - /// Determines if more input is needed. - /// - /// Return true if input is needed via SetInput - public bool NeedsInput() => (inputEnd == inputOff); - - /// - /// Set compression dictionary - /// - /// The buffer containing the dictionary data - /// The offset in the buffer for the first byte of data - /// The length of the dictionary data. - public void SetDictionary(byte[] buffer, int offset, int length) - { - checksum.Update(buffer, offset, length); - if (length < DeflaterConstants.MIN_MATCH) - return; - - if (length > DeflaterConstants.MAX_DIST) - { - offset += length - DeflaterConstants.MAX_DIST; - length = DeflaterConstants.MAX_DIST; - } - - Array.Copy(buffer, offset, window, strstart, length); - - UpdateHash(); - --length; - - while (--length > 0) - { - InsertString(); - strstart++; - } - - strstart += 2; - blockStart = strstart; - } - - /// - /// Reset internal state - /// - public void Reset() - { - huffman.Reset(); - checksum.Reset(); - blockStart = strstart = 1; - lookahead = 0; - totalIn = 0; - prevAvailable = false; - matchLen = DeflaterConstants.MIN_MATCH - 1; - - for (int i = 0; i < DeflaterConstants.HASH_SIZE; i++) - head[i] = 0; - - for (int i = 0; i < DeflaterConstants.WSIZE; i++) - prev[i] = 0; - } - - /// - /// Reset Adler checksum - /// - public void ResetAdler() => checksum.Reset(); - - /// - /// Get current value of Adler checksum - /// - public int Adler - { - get - { - return unchecked((int)checksum.Value); - } - } - - /// - /// Total data processed - /// - public long TotalIn - { - get - { - return totalIn; - } - } - - /// - /// Get/set the deflate strategy - /// - public DeflateStrategy Strategy - { - get - { - return strategy; - } - set - { - strategy = value; - } - } - - /// - /// Set the deflate level (0-9) - /// - /// The value to set the level to. - public void SetLevel(int level) - { - if ((level < 0) || (level > 9)) - throw new ArgumentOutOfRangeException(nameof(level)); - - goodLength = DeflaterConstants.GOOD_LENGTH[level]; - max_lazy = DeflaterConstants.MAX_LAZY[level]; - niceLength = DeflaterConstants.NICE_LENGTH[level]; - max_chain = DeflaterConstants.MAX_CHAIN[level]; - - if (DeflaterConstants.COMPR_FUNC[level] != compressionFunction) - { - switch (compressionFunction) - { - case DeflaterConstants.DEFLATE_STORED: - if (strstart > blockStart) - { - huffman.FlushStoredBlock(window, blockStart, - strstart - blockStart, false); - blockStart = strstart; - } - - UpdateHash(); - break; - - case DeflaterConstants.DEFLATE_FAST: - if (strstart > blockStart) - { - huffman.FlushBlock(window, blockStart, strstart - blockStart, - false); - blockStart = strstart; - } - break; - - case DeflaterConstants.DEFLATE_SLOW: - if (prevAvailable) - huffman.TallyLit(window[strstart - 1] & 0xff); - - if (strstart > blockStart) - { - huffman.FlushBlock(window, blockStart, strstart - blockStart, false); - blockStart = strstart; - } - - prevAvailable = false; - matchLen = DeflaterConstants.MIN_MATCH - 1; - break; - } - - compressionFunction = DeflaterConstants.COMPR_FUNC[level]; - } - } - - /// - /// Fill the window - /// - public void FillWindow() - { - /* If the window is almost full and there is insufficient lookahead, - * move the upper half to the lower one to make room in the upper half. - */ - if (strstart >= DeflaterConstants.WSIZE + DeflaterConstants.MAX_DIST) - SlideWindow(); - - /* If there is not enough lookahead, but still some input left, - * read in the input - */ - if (lookahead < DeflaterConstants.MIN_LOOKAHEAD && inputOff < inputEnd) - { - int more = 2 * DeflaterConstants.WSIZE - lookahead - strstart; - - if (more > inputEnd - inputOff) - more = inputEnd - inputOff; - - Array.Copy(inputBuf, inputOff, window, strstart + lookahead, more); - checksum.Update(inputBuf, inputOff, more); - - inputOff += more; - totalIn += more; - lookahead += more; - } - - if (lookahead >= DeflaterConstants.MIN_MATCH) - UpdateHash(); - } - - void UpdateHash() - { - /* - if (DEBUGGING) { - Console.WriteLine("updateHash: "+strstart); - } - */ - ins_h = (window[strstart] << DeflaterConstants.HASH_SHIFT) ^ window[strstart + 1]; - } - - /// - /// Inserts the current string in the head hash and returns the previous - /// value for this hash. - /// - /// The previous hash value - int InsertString() - { - short match; - int hash = ((ins_h << DeflaterConstants.HASH_SHIFT) ^ window[strstart + (DeflaterConstants.MIN_MATCH - 1)]) & DeflaterConstants.HASH_MASK; - - prev[strstart & DeflaterConstants.WMASK] = match = head[hash]; - head[hash] = unchecked((short)strstart); - ins_h = hash; - - return match & 0xffff; - } - - void SlideWindow() - { - Array.Copy(window, DeflaterConstants.WSIZE, window, 0, DeflaterConstants.WSIZE); - matchStart -= DeflaterConstants.WSIZE; - strstart -= DeflaterConstants.WSIZE; - blockStart -= DeflaterConstants.WSIZE; - - // Slide the hash table (could be avoided with 32 bit values - // at the expense of memory usage). - for (int i = 0; i < DeflaterConstants.HASH_SIZE; ++i) - { - int m = head[i] & 0xffff; - head[i] = (short)(m >= DeflaterConstants.WSIZE ? (m - DeflaterConstants.WSIZE) : 0); - } - - // Slide the prev table. - for (int i = 0; i < DeflaterConstants.WSIZE; i++) - { - int m = prev[i] & 0xffff; - prev[i] = (short)(m >= DeflaterConstants.WSIZE ? (m - DeflaterConstants.WSIZE) : 0); - } - } - - /// - /// Find the best (longest) string in the window matching the - /// string starting at strstart. - /// - /// Preconditions: - /// - /// strstart + DeflaterConstants.MAX_MATCH <= window.length. - /// - /// - /// True if a match greater than the minimum length is found - bool FindLongestMatch(int curMatch) - { - int match; - int scan = strstart; - // scanMax is the highest position that we can look at - int scanMax = scan + Math.Min(DeflaterConstants.MAX_MATCH, lookahead) - 1; - int limit = Math.Max(scan - DeflaterConstants.MAX_DIST, 0); - - byte[] window = this.window; - short[] prev = this.prev; - int chainLength = this.max_chain; - int niceLength = Math.Min(this.niceLength, lookahead); - - matchLen = Math.Max(matchLen, DeflaterConstants.MIN_MATCH - 1); - - if (scan + matchLen > scanMax) return false; - - byte scan_end1 = window[scan + matchLen - 1]; - byte scan_end = window[scan + matchLen]; - - // Do not waste too much time if we already have a good match: - if (matchLen >= this.goodLength) chainLength >>= 2; - - do - { - match = curMatch; - scan = strstart; - - if (window[match + matchLen] != scan_end - || window[match + matchLen - 1] != scan_end1 - || window[match] != window[scan] - || window[++match] != window[++scan]) - continue; - - // scan is set to strstart+1 and the comparison passed, so - // scanMax - scan is the maximum number of bytes we can compare. - // below we compare 8 bytes at a time, so first we compare - // (scanMax - scan) % 8 bytes, so the remainder is a multiple of 8 - - switch ((scanMax - scan) % 8) - { - case 1: - if (window[++scan] == window[++match]) break; - break; - case 2: - if (window[++scan] == window[++match] - && window[++scan] == window[++match]) break; - break; - case 3: - if (window[++scan] == window[++match] - && window[++scan] == window[++match] - && window[++scan] == window[++match]) break; - break; - case 4: - if (window[++scan] == window[++match] - && window[++scan] == window[++match] - && window[++scan] == window[++match] - && window[++scan] == window[++match]) break; - break; - case 5: - if (window[++scan] == window[++match] - && window[++scan] == window[++match] - && window[++scan] == window[++match] - && window[++scan] == window[++match] - && window[++scan] == window[++match]) break; - break; - case 6: - if (window[++scan] == window[++match] - && window[++scan] == window[++match] - && window[++scan] == window[++match] - && window[++scan] == window[++match] - && window[++scan] == window[++match] - && window[++scan] == window[++match]) break; - break; - case 7: - if (window[++scan] == window[++match] - && window[++scan] == window[++match] - && window[++scan] == window[++match] - && window[++scan] == window[++match] - && window[++scan] == window[++match] - && window[++scan] == window[++match] - && window[++scan] == window[++match]) break; - break; - } - - if (window[scan] == window[match]) - { - /* We check for insufficient lookahead only every 8th comparison; - * the 256th check will be made at strstart + 258 unless lookahead is - * exhausted first. - */ - do - { - if (scan == scanMax) - { - ++scan; // advance to first position not matched - ++match; - - break; - } - } - while (window[++scan] == window[++match] - && window[++scan] == window[++match] - && window[++scan] == window[++match] - && window[++scan] == window[++match] - && window[++scan] == window[++match] - && window[++scan] == window[++match] - && window[++scan] == window[++match] - && window[++scan] == window[++match]); - } - - if (scan - strstart > matchLen) - { - matchStart = curMatch; - matchLen = scan - strstart; - - if (matchLen >= niceLength) - break; - - scan_end1 = window[scan - 1]; - scan_end = window[scan]; - } - } while ((curMatch = (prev[curMatch & DeflaterConstants.WMASK] & 0xffff)) > limit && 0 != --chainLength); - - return matchLen >= DeflaterConstants.MIN_MATCH; - } - - bool DeflateStored(bool flush, bool finish) - { - if (!flush && (lookahead == 0)) - return false; - - strstart += lookahead; - lookahead = 0; - - int storedLength = strstart - blockStart; - - if ((storedLength >= DeflaterConstants.MAX_BLOCK_SIZE) || // Block is full - (blockStart < DeflaterConstants.WSIZE && storedLength >= DeflaterConstants.MAX_DIST) || // Block may move out of window - flush) - { - bool lastBlock = finish; - if (storedLength > DeflaterConstants.MAX_BLOCK_SIZE) - { - storedLength = DeflaterConstants.MAX_BLOCK_SIZE; - lastBlock = false; - } - - huffman.FlushStoredBlock(window, blockStart, storedLength, lastBlock); - blockStart += storedLength; - return !lastBlock; - } - - return true; - } - - bool DeflateFast(bool flush, bool finish) - { - if (lookahead < DeflaterConstants.MIN_LOOKAHEAD && !flush) - return false; - - while (lookahead >= DeflaterConstants.MIN_LOOKAHEAD || flush) - { - if (lookahead == 0) - { - // We are flushing everything - huffman.FlushBlock(window, blockStart, strstart - blockStart, finish); - blockStart = strstart; - return false; - } - - if (strstart > 2 * DeflaterConstants.WSIZE - DeflaterConstants.MIN_LOOKAHEAD) - { - /* slide window, as FindLongestMatch needs this. - * This should only happen when flushing and the window - * is almost full. - */ - SlideWindow(); - } - - int hashHead; - if (lookahead >= DeflaterConstants.MIN_MATCH && - (hashHead = InsertString()) != 0 && - strategy != DeflateStrategy.HuffmanOnly && - strstart - hashHead <= DeflaterConstants.MAX_DIST && - FindLongestMatch(hashHead)) - { - // longestMatch sets matchStart and matchLen - - bool full = huffman.TallyDist(strstart - matchStart, matchLen); - - lookahead -= matchLen; - if (matchLen <= max_lazy && lookahead >= DeflaterConstants.MIN_MATCH) - { - while (--matchLen > 0) - { - ++strstart; - InsertString(); - } - - ++strstart; - } - else - { - strstart += matchLen; - - if (lookahead >= DeflaterConstants.MIN_MATCH - 1) - UpdateHash(); - } - matchLen = DeflaterConstants.MIN_MATCH - 1; - - if (!full) - continue; - } - else - { - // No match found - huffman.TallyLit(window[strstart] & 0xff); - - ++strstart; - --lookahead; - } - - if (huffman.IsFull()) - { - bool lastBlock = finish && (lookahead == 0); - - huffman.FlushBlock(window, blockStart, strstart - blockStart, lastBlock); - blockStart = strstart; - - return !lastBlock; - } - } - return true; - } - - bool DeflateSlow(bool flush, bool finish) - { - if (lookahead < DeflaterConstants.MIN_LOOKAHEAD && !flush) - return false; - - while (lookahead >= DeflaterConstants.MIN_LOOKAHEAD || flush) - { - if (lookahead == 0) - { - if (prevAvailable) - huffman.TallyLit(window[strstart - 1] & 0xff); - - prevAvailable = false; - - // We are flushing everything - - huffman.FlushBlock(window, blockStart, strstart - blockStart, - finish); - blockStart = strstart; - return false; - } - - if (strstart >= 2 * DeflaterConstants.WSIZE - DeflaterConstants.MIN_LOOKAHEAD) - { - /* slide window, as FindLongestMatch needs this. - * This should only happen when flushing and the window - * is almost full. - */ - SlideWindow(); - } - - int prevMatch = matchStart; - int prevLen = matchLen; - if (lookahead >= DeflaterConstants.MIN_MATCH) - { - - int hashHead = InsertString(); - - if (strategy != DeflateStrategy.HuffmanOnly && - hashHead != 0 && - strstart - hashHead <= DeflaterConstants.MAX_DIST && - FindLongestMatch(hashHead)) - { - - // longestMatch sets matchStart and matchLen - - // Discard match if too small and too far away - if (matchLen <= 5 && (strategy == DeflateStrategy.Filtered || (matchLen == DeflaterConstants.MIN_MATCH && strstart - matchStart > TooFar))) - matchLen = DeflaterConstants.MIN_MATCH - 1; - } - } - - // previous match was better - if ((prevLen >= DeflaterConstants.MIN_MATCH) && (matchLen <= prevLen)) - { - - huffman.TallyDist(strstart - 1 - prevMatch, prevLen); - prevLen -= 2; - do - { - strstart++; - lookahead--; - if (lookahead >= DeflaterConstants.MIN_MATCH) - InsertString(); - - } while (--prevLen > 0); - - strstart++; - lookahead--; - prevAvailable = false; - matchLen = DeflaterConstants.MIN_MATCH - 1; - } - else - { - if (prevAvailable) - huffman.TallyLit(window[strstart - 1] & 0xff); - - prevAvailable = true; - strstart++; - lookahead--; - } - - if (huffman.IsFull()) - { - int len = strstart - blockStart; - - if (prevAvailable) - len--; - - bool lastBlock = (finish && (lookahead == 0) && !prevAvailable); - huffman.FlushBlock(window, blockStart, len, lastBlock); - blockStart += len; - return !lastBlock; - } - } - return true; - } - - #region Instance Fields - - // Hash index of string to be inserted - int ins_h; - - /// - /// Hashtable, hashing three characters to an index for window, so - /// that window[index]..window[index+2] have this hash code. - /// Note that the array should really be unsigned short, so you need - /// to and the values with 0xffff. - /// - short[] head; - - /// - /// prev[index & WMASK] points to the previous index that has the - /// same hash code as the string starting at index. This way - /// entries with the same hash code are in a linked list. - /// Note that the array should really be unsigned short, so you need - /// to and the values with 0xffff. - /// - short[] prev; - - int matchStart; - // Length of best match - int matchLen; - // Set if previous match exists - bool prevAvailable; - int blockStart; - - /// - /// Points to the current character in the window. - /// - int strstart; - - /// - /// lookahead is the number of characters starting at strstart in - /// window that are valid. - /// So window[strstart] until window[strstart+lookahead-1] are valid - /// characters. - /// - int lookahead; - - /// - /// This array contains the part of the uncompressed stream that - /// is of relevance. The current character is indexed by strstart. - /// - byte[] window; - - DeflateStrategy strategy; - int max_chain, max_lazy, niceLength, goodLength; - - /// - /// The current compression function. - /// - int compressionFunction; - - /// - /// The input data for compression. - /// - byte[] inputBuf; - - /// - /// The total bytes of input read. - /// - long totalIn; - - /// - /// The offset into inputBuf, where input data starts. - /// - int inputOff; - - /// - /// The end offset of the input data. - /// - int inputEnd; - - DeflaterPending pending; - DeflaterHuffman huffman; - - /// - /// The adler checksum - /// - IChecksum checksum; - #endregion - } -} diff --git a/UpdateLib/UpdateLib/Compression/Deflaters/DeflaterHuffman.cs b/UpdateLib/UpdateLib/Compression/Deflaters/DeflaterHuffman.cs deleted file mode 100644 index 41d8c2a..0000000 --- a/UpdateLib/UpdateLib/Compression/Deflaters/DeflaterHuffman.cs +++ /dev/null @@ -1,894 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -using System; - -namespace MatthiWare.UpdateLib.Compression.Deflaters -{ - /// - /// This is the DeflaterHuffman class. - /// - /// This class is not thread safe. This is inherent in the API, due - /// to the split of Deflate and SetInput. - /// - /// author of the original java version : Jochen Hoenicke - /// - public class DeflaterHuffman - { - const int BUFSIZE = 1 << (DeflaterConstants.DEFAULT_MEM_LEVEL + 6); - const int LITERAL_NUM = 286; - - // Number of distance codes - const int DIST_NUM = 30; - // Number of codes used to transfer bit lengths - const int BITLEN_NUM = 19; - - // repeat previous bit length 3-6 times (2 bits of repeat count) - const int REP_3_6 = 16; - // repeat a zero length 3-10 times (3 bits of repeat count) - const int REP_3_10 = 17; - // repeat a zero length 11-138 times (7 bits of repeat count) - const int REP_11_138 = 18; - - const int EOF_SYMBOL = 256; - - // The lengths of the bit length codes are sent in order of decreasing - // probability, to avoid transmitting the lengths for unused bit length codes. - static readonly int[] BL_ORDER = { 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 }; - - static readonly byte[] bit4Reverse = { - 0, - 8, - 4, - 12, - 2, - 10, - 6, - 14, - 1, - 9, - 5, - 13, - 3, - 11, - 7, - 15 - }; - - static short[] staticLCodes; - static byte[] staticLLength; - static short[] staticDCodes; - static byte[] staticDLength; - - class Tree - { - #region Instance Fields - public short[] freqs; - - public byte[] length; - - public int minNumCodes; - - public int numCodes; - - short[] codes; - readonly int[] bl_counts; - readonly int maxLength; - DeflaterHuffman dh; - #endregion - - #region Constructors - public Tree(DeflaterHuffman dh, int elems, int minCodes, int maxLength) - { - this.dh = dh; - this.minNumCodes = minCodes; - this.maxLength = maxLength; - freqs = new short[elems]; - bl_counts = new int[maxLength]; - } - - #endregion - - /// - /// Resets the internal state of the tree - /// - public void Reset() - { - for (int i = 0; i < freqs.Length; i++) - freqs[i] = 0; - - codes = null; - length = null; - } - - public void WriteSymbol(int code) - { - // if (DeflaterConstants.DEBUGGING) { - // freqs[code]--; - // // Console.Write("writeSymbol("+freqs.length+","+code+"): "); - // } - dh.pending.WriteBits(codes[code] & 0xffff, length[code]); - } - - /// - /// Check that all frequencies are zero - /// - /// - /// At least one frequency is non-zero - /// - public void CheckEmpty() - { - bool empty = true; - for (int i = 0; i < freqs.Length; i++) - empty &= freqs[i] == 0; - - if (!empty) - throw new InvalidOperationException("!Empty"); - } - - /// - /// Set static codes and length - /// - /// new codes - /// length for new codes - public void SetStaticCodes(short[] staticCodes, byte[] staticLengths) - { - codes = staticCodes; - length = staticLengths; - } - - /// - /// Build dynamic codes and lengths - /// - public void BuildCodes() - { - int numSymbols = freqs.Length; - int[] nextCode = new int[maxLength]; - int code = 0; - - codes = new short[freqs.Length]; - - // if (DeflaterConstants.DEBUGGING) { - // //Console.WriteLine("buildCodes: "+freqs.Length); - // } - - for (int bits = 0; bits < maxLength; bits++) - { - nextCode[bits] = code; - code += bl_counts[bits] << (15 - bits); - - // if (DeflaterConstants.DEBUGGING) { - // //Console.WriteLine("bits: " + ( bits + 1) + " count: " + bl_counts[bits] - // +" nextCode: "+code); - // } - } - - for (int i = 0; i < numCodes; i++) - { - int bits = length[i]; - if (bits > 0) - { - - // if (DeflaterConstants.DEBUGGING) { - // //Console.WriteLine("codes["+i+"] = rev(" + nextCode[bits-1]+"), - // +bits); - // } - - codes[i] = BitReverse(nextCode[bits - 1]); - nextCode[bits - 1] += 1 << (16 - bits); - } - } - } - - public void BuildTree() - { - int numSymbols = freqs.Length; - - /* heap is a priority queue, sorted by frequency, least frequent - * nodes first. The heap is a binary tree, with the property, that - * the parent node is smaller than both child nodes. This assures - * that the smallest node is the first parent. - * - * The binary tree is encoded in an array: 0 is root node and - * the nodes 2*n+1, 2*n+2 are the child nodes of node n. - */ - int[] heap = new int[numSymbols]; - int heapLen = 0; - int maxCode = 0; - for (int n = 0; n < numSymbols; n++) - { - int freq = freqs[n]; - if (freq != 0) - { - // Insert n into heap - int pos = heapLen++; - int ppos; - - while (pos > 0 && freqs[heap[ppos = (pos - 1) / 2]] > freq) - { - heap[pos] = heap[ppos]; - pos = ppos; - } - - heap[pos] = n; - - maxCode = n; - } - } - - /* We could encode a single literal with 0 bits but then we - * don't see the literals. Therefore we force at least two - * literals to avoid this case. We don't care about order in - * this case, both literals get a 1 bit code. - */ - while (heapLen < 2) - { - int node = maxCode < 2 ? ++maxCode : 0; - heap[heapLen++] = node; - } - - numCodes = Math.Max(maxCode + 1, minNumCodes); - - int numLeafs = heapLen; - int[] childs = new int[4 * heapLen - 2]; - int[] values = new int[2 * heapLen - 1]; - int numNodes = numLeafs; - - for (int i = 0; i < heapLen; i++) - { - int node = heap[i]; - childs[2 * i] = node; - childs[2 * i + 1] = -1; - values[i] = freqs[node] << 8; - heap[i] = i; - } - - /* Construct the Huffman tree by repeatedly combining the least two - * frequent nodes. - */ - do - { - int first = heap[0]; - int last = heap[--heapLen]; - - // Propagate the hole to the leafs of the heap - int ppos = 0; - int path = 1; - - while (path < heapLen) - { - if (path + 1 < heapLen && values[heap[path]] > values[heap[path + 1]]) - path++; - - heap[ppos] = heap[path]; - ppos = path; - path = path * 2 + 1; - } - - /* Now propagate the last element down along path. Normally - * it shouldn't go too deep. - */ - int lastVal = values[last]; - - while ((path = ppos) > 0 && values[heap[ppos = (path - 1) / 2]] > lastVal) - heap[path] = heap[ppos]; - - heap[path] = last; - - - int second = heap[0]; - - // Create a new node father of first and second - last = numNodes++; - childs[2 * last] = first; - childs[2 * last + 1] = second; - int mindepth = Math.Min(values[first] & 0xff, values[second] & 0xff); - values[last] = lastVal = values[first] + values[second] - mindepth + 1; - - // Again, propagate the hole to the leafs - ppos = 0; - path = 1; - - while (path < heapLen) - { - if (path + 1 < heapLen && values[heap[path]] > values[heap[path + 1]]) - path++; - - heap[ppos] = heap[path]; - ppos = path; - path = ppos * 2 + 1; - } - - // Now propagate the new element down along path - while ((path = ppos) > 0 && values[heap[ppos = (path - 1) / 2]] > lastVal) - heap[path] = heap[ppos]; - - heap[path] = last; - } while (heapLen > 1); - - if (heap[0] != childs.Length / 2 - 1) - throw new AccessViolationException("Heap invariant violated"); - - BuildLength(childs); - } - - /// - /// Get encoded length - /// - /// Encoded length, the sum of frequencies * lengths - public int GetEncodedLength() - { - int len = 0; - - for (int i = 0; i < freqs.Length; i++) - len += freqs[i] * length[i]; - - return len; - } - - /// - /// Scan a literal or distance tree to determine the frequencies of the codes - /// in the bit length tree. - /// - public void CalcBLFreq(Tree blTree) - { - int max_count; /* max repeat count */ - int min_count; /* min repeat count */ - int count; /* repeat count of the current code */ - int curlen = -1; /* length of current code */ - - int i = 0; - while (i < numCodes) - { - count = 1; - int nextlen = length[i]; - - if (nextlen == 0) - { - max_count = 138; - min_count = 3; - } - else - { - max_count = 6; - min_count = 3; - if (curlen != nextlen) - { - blTree.freqs[nextlen]++; - count = 0; - } - } - - curlen = nextlen; - i++; - - while (i < numCodes && curlen == length[i]) - { - i++; - if (++count >= max_count) - break; - } - - if (count < min_count) - blTree.freqs[curlen] += (short)count; - else if (curlen != 0) - blTree.freqs[REP_3_6]++; - else if (count <= 10) - blTree.freqs[REP_3_10]++; - else - blTree.freqs[REP_11_138]++; - } - } - - /// - /// Write tree values - /// - /// Tree to write - public void WriteTree(Tree blTree) - { - int max_count; // max repeat count - int min_count; // min repeat count - int count; // repeat count of the current code - int curlen = -1; // length of current code - - int i = 0; - while (i < numCodes) - { - count = 1; - int nextlen = length[i]; - - if (nextlen == 0) - { - max_count = 138; - min_count = 3; - } - else - { - max_count = 6; - min_count = 3; - if (curlen != nextlen) - { - blTree.WriteSymbol(nextlen); - count = 0; - } - } - - curlen = nextlen; - i++; - - while (i < numCodes && curlen == length[i]) - { - i++; - if (++count >= max_count) - break; - } - - if (count < min_count) - { - while (count-- > 0) - blTree.WriteSymbol(curlen); - } - else if (curlen != 0) - { - blTree.WriteSymbol(REP_3_6); - dh.pending.WriteBits(count - 3, 2); - } - else if (count <= 10) - { - blTree.WriteSymbol(REP_3_10); - dh.pending.WriteBits(count - 3, 3); - } - else - { - blTree.WriteSymbol(REP_11_138); - dh.pending.WriteBits(count - 11, 7); - } - } - } - - void BuildLength(int[] childs) - { - length = new byte[freqs.Length]; - int numNodes = childs.Length / 2; - int numLeafs = (numNodes + 1) / 2; - int overflow = 0; - - for (int i = 0; i < maxLength; i++) - bl_counts[i] = 0; - - // First calculate optimal bit lengths - int[] lengths = new int[numNodes]; - lengths[numNodes - 1] = 0; - - for (int i = numNodes - 1; i >= 0; i--) - { - if (childs[2 * i + 1] != -1) - { - int bitLength = lengths[i] + 1; - - if (bitLength > maxLength) - { - bitLength = maxLength; - overflow++; - } - - lengths[childs[2 * i]] = lengths[childs[2 * i + 1]] = bitLength; - } - else - { - // A leaf node - int bitLength = lengths[i]; - bl_counts[bitLength - 1]++; - length[childs[2 * i]] = (byte)lengths[i]; - } - } - - if (overflow == 0) - return; - - int incrBitLen = maxLength - 1; - do - { - // Find the first bit length which could increase: - while (bl_counts[--incrBitLen] == 0) ; - - // Move this node one down and remove a corresponding - // number of overflow nodes. - do - { - bl_counts[incrBitLen]--; - bl_counts[++incrBitLen]++; - overflow -= 1 << (maxLength - 1 - incrBitLen); - } while (overflow > 0 && incrBitLen < maxLength - 1); - } while (overflow > 0); - - /* We may have overshot above. Move some nodes from maxLength to - * maxLength-1 in that case. - */ - bl_counts[maxLength - 1] += overflow; - bl_counts[maxLength - 2] -= overflow; - - /* Now recompute all bit lengths, scanning in increasing - * frequency. It is simpler to reconstruct all lengths instead of - * fixing only the wrong ones. This idea is taken from 'ar' - * written by Haruhiko Okumura. - * - * The nodes were inserted with decreasing frequency into the childs - * array. - */ - int nodePtr = 2 * numLeafs; - for (int bits = maxLength; bits != 0; bits--) - { - int n = bl_counts[bits - 1]; - while (n > 0) - { - int childPtr = 2 * childs[nodePtr++]; - if (childs[childPtr + 1] == -1) - { - // We found another leaf - length[childs[childPtr]] = (byte)bits; - n--; - } - } - } - // if (DeflaterConstants.DEBUGGING) { - // //Console.WriteLine("*** After overflow elimination. ***"); - // for (int i=0; i < numLeafs; i++) { - // //Console.WriteLine("Node "+childs[2*i]+" freq: "+freqs[childs[2*i]] - // + " len: "+length[childs[2*i]]); - // } - // } - } - - } - - #region Instance Fields - /// - /// Pending buffer to use - /// - public DeflaterPending pending; - - Tree literalTree; - Tree distTree; - Tree blTree; - - // Buffer for distances - short[] d_buf; - byte[] l_buf; - int last_lit; - int extra_bits; - #endregion - - static DeflaterHuffman() - { - // See RFC 1951 3.2.6 - // Literal codes - staticLCodes = new short[LITERAL_NUM]; - staticLLength = new byte[LITERAL_NUM]; - - int i = 0; - while (i < 144) - { - staticLCodes[i] = BitReverse((0x030 + i) << 8); - staticLLength[i++] = 8; - } - - while (i < 256) - { - staticLCodes[i] = BitReverse((0x190 - 144 + i) << 7); - staticLLength[i++] = 9; - } - - while (i < 280) - { - staticLCodes[i] = BitReverse((0x000 - 256 + i) << 9); - staticLLength[i++] = 7; - } - - while (i < LITERAL_NUM) - { - staticLCodes[i] = BitReverse((0x0c0 - 280 + i) << 8); - staticLLength[i++] = 8; - } - - // Distance codes - staticDCodes = new short[DIST_NUM]; - staticDLength = new byte[DIST_NUM]; - - for (i = 0; i < DIST_NUM; i++) - { - staticDCodes[i] = BitReverse(i << 11); - staticDLength[i] = 5; - } - } - - /// - /// Construct instance with pending buffer - /// - /// Pending buffer to use - public DeflaterHuffman(DeflaterPending pending) - { - this.pending = pending; - - literalTree = new Tree(this, LITERAL_NUM, 257, 15); - distTree = new Tree(this, DIST_NUM, 1, 15); - blTree = new Tree(this, BITLEN_NUM, 4, 7); - - d_buf = new short[BUFSIZE]; - l_buf = new byte[BUFSIZE]; - } - - /// - /// Reset internal state - /// - public void Reset() - { - last_lit = 0; - extra_bits = 0; - literalTree.Reset(); - distTree.Reset(); - blTree.Reset(); - } - - /// - /// Write all trees to pending buffer - /// - /// The number/rank of treecodes to send. - public void SendAllTrees(int blTreeCodes) - { - blTree.BuildCodes(); - literalTree.BuildCodes(); - distTree.BuildCodes(); - pending.WriteBits(literalTree.numCodes - 257, 5); - pending.WriteBits(distTree.numCodes - 1, 5); - pending.WriteBits(blTreeCodes - 4, 4); - - for (int rank = 0; rank < blTreeCodes; rank++) - pending.WriteBits(blTree.length[BL_ORDER[rank]], 3); - - literalTree.WriteTree(blTree); - distTree.WriteTree(blTree); - } - - /// - /// Compress current buffer writing data to pending buffer - /// - public void CompressBlock() - { - for (int i = 0; i < last_lit; i++) - { - int litlen = l_buf[i] & 0xff; - int dist = d_buf[i]; - if (dist-- != 0) - { - int lc = Lcode(litlen); - literalTree.WriteSymbol(lc); - - int bits = (lc - 261) / 4; - if (bits > 0 && bits <= 5) - pending.WriteBits(litlen & ((1 << bits) - 1), bits); - - int dc = Dcode(dist); - distTree.WriteSymbol(dc); - - bits = dc / 2 - 1; - if (bits > 0) - pending.WriteBits(dist & ((1 << bits) - 1), bits); - } - else - literalTree.WriteSymbol(litlen); - } - - literalTree.WriteSymbol(EOF_SYMBOL); - } - - /// - /// Flush block to output with no compression - /// - /// Data to write - /// Index of first byte to write - /// Count of bytes to write - /// True if this is the last block - public void FlushStoredBlock(byte[] stored, int storedOffset, int storedLength, bool lastBlock) - { - pending.WriteBits((DeflaterConstants.STORED_BLOCK << 1) + (lastBlock ? 1 : 0), 3); - pending.AlignToByte(); - pending.WriteShort(storedLength); - pending.WriteShort(~storedLength); - pending.WriteBlock(stored, storedOffset, storedLength); - Reset(); - } - - /// - /// Flush block to output with compression - /// - /// Data to flush - /// Index of first byte to flush - /// Count of bytes to flush - /// True if this is the last block - public void FlushBlock(byte[] stored, int storedOffset, int storedLength, bool lastBlock) - { - literalTree.freqs[EOF_SYMBOL]++; - - // Build trees - literalTree.BuildTree(); - distTree.BuildTree(); - - // Calculate bitlen frequency - literalTree.CalcBLFreq(blTree); - distTree.CalcBLFreq(blTree); - - // Build bitlen tree - blTree.BuildTree(); - - int blTreeCodes = 4; - for (int i = 18; i > blTreeCodes; i--) - if (blTree.length[BL_ORDER[i]] > 0) - blTreeCodes = i + 1; - - int opt_len = 14 + blTreeCodes * 3 + blTree.GetEncodedLength() + - literalTree.GetEncodedLength() + distTree.GetEncodedLength() + - extra_bits; - - int static_len = extra_bits; - - for (int i = 0; i < LITERAL_NUM; i++) - static_len += literalTree.freqs[i] * staticLLength[i]; - - for (int i = 0; i < DIST_NUM; i++) - static_len += distTree.freqs[i] * staticDLength[i]; - - if (opt_len >= static_len) - opt_len = static_len;// Force static trees - - if (storedOffset >= 0 && storedLength + 4 < opt_len >> 3) - { - // Store Block - - // if (DeflaterConstants.DEBUGGING) { - // //Console.WriteLine("Storing, since " + storedLength + " < " + opt_len - // + " <= " + static_len); - // } - FlushStoredBlock(stored, storedOffset, storedLength, lastBlock); - } - else if (opt_len == static_len) - { - // Encode with static tree - pending.WriteBits((DeflaterConstants.STATIC_TREES << 1) + (lastBlock ? 1 : 0), 3); - literalTree.SetStaticCodes(staticLCodes, staticLLength); - distTree.SetStaticCodes(staticDCodes, staticDLength); - CompressBlock(); - Reset(); - } - else - { - // Encode with dynamic tree - pending.WriteBits((DeflaterConstants.DYN_TREES << 1) + (lastBlock ? 1 : 0), 3); - SendAllTrees(blTreeCodes); - CompressBlock(); - Reset(); - } - } - - /// - /// Get value indicating if internal buffer is full - /// - /// true if buffer is full - public bool IsFull() => last_lit >= BUFSIZE; - - /// - /// Add literal to buffer - /// - /// Literal value to add to buffer. - /// Value indicating internal buffer is full - public bool TallyLit(int literal) - { - d_buf[last_lit] = 0; - l_buf[last_lit++] = (byte)literal; - literalTree.freqs[literal]++; - return IsFull(); - } - - /// - /// Add distance code and length to literal and distance trees - /// - /// Distance code - /// Length - /// Value indicating if internal buffer is full - public bool TallyDist(int distance, int length) - { - - d_buf[last_lit] = (short)distance; - l_buf[last_lit++] = (byte)(length - 3); - - int lc = Lcode(length - 3); - literalTree.freqs[lc]++; - - if (lc >= 265 && lc < 285) - extra_bits += (lc - 261) / 4; - - int dc = Dcode(distance - 1); - distTree.freqs[dc]++; - - if (dc >= 4) - extra_bits += dc / 2 - 1; - - return IsFull(); - } - - - /// - /// Reverse the bits of a 16 bit value. - /// - /// Value to reverse bits - /// Value with bits reversed - public static short BitReverse(int toReverse) - { - return (short)(bit4Reverse[toReverse & 0xF] << 12 | - bit4Reverse[(toReverse >> 4) & 0xF] << 8 | - bit4Reverse[(toReverse >> 8) & 0xF] << 4 | - bit4Reverse[toReverse >> 12]); - } - - static int Lcode(int length) - { - if (length == 255) - return 285; - - int code = 257; - - while (length >= 8) - { - code += 4; - length >>= 1; - } - - return code + length; - } - - static int Dcode(int distance) - { - int code = 0; - - while (distance >= 4) - { - code += 2; - distance >>= 1; - } - - return code + distance; - } - } -} diff --git a/UpdateLib/UpdateLib/Compression/Deflaters/DeflaterPending.cs b/UpdateLib/UpdateLib/Compression/Deflaters/DeflaterPending.cs deleted file mode 100644 index 6376660..0000000 --- a/UpdateLib/UpdateLib/Compression/Deflaters/DeflaterPending.cs +++ /dev/null @@ -1,53 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - - -namespace MatthiWare.UpdateLib.Compression.Deflaters -{ - /// - /// This class stores the pending output of the Deflater. - /// - /// author of the original java version : Jochen Hoenicke - /// - public class DeflaterPending : PendingBuffer - { - /// - /// Construct instance with default buffer size - /// - public DeflaterPending() : base(DeflaterConstants.PENDING_BUF_SIZE) - { - } - } -} diff --git a/UpdateLib/UpdateLib/Compression/Deflaters/Inflater.cs b/UpdateLib/UpdateLib/Compression/Deflaters/Inflater.cs deleted file mode 100644 index df7df7d..0000000 --- a/UpdateLib/UpdateLib/Compression/Deflaters/Inflater.cs +++ /dev/null @@ -1,857 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -using MatthiWare.UpdateLib.Compression.Checksum; -using MatthiWare.UpdateLib.Compression.Streams; -using System; - -namespace MatthiWare.UpdateLib.Compression.Deflaters -{ - /// - /// Inflater is used to decompress data that has been compressed according - /// to the "deflate" standard described in rfc1951. - /// - /// By default Zlib (rfc1950) headers and footers are expected in the input. - /// You can use constructor public Inflater(bool noHeader) passing true - /// if there is no Zlib header information - /// - /// The usage is as following. First you have to set some input with - /// SetInput(), then Inflate() it. If inflate doesn't - /// inflate any bytes there may be three reasons: - ///
    - ///
  • IsNeedingInput() returns true because the input buffer is empty. - /// You have to provide more input with SetInput(). - /// NOTE: IsNeedingInput() also returns true when, the stream is finished. - ///
  • - ///
  • IsNeedingDictionary() returns true, you have to provide a preset - /// dictionary with SetDictionary().
  • - ///
  • IsFinished returns true, the inflater has finished.
  • - ///
- /// Once the first output byte is produced, a dictionary will not be - /// needed at a later stage. - /// - /// author of the original java version : John Leuner, Jochen Hoenicke - ///
- public class Inflater - { - #region Constants/Readonly - /// - /// Copy lengths for literal codes 257..285 - /// - static readonly int[] CPLENS = { - 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, - 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258 - }; - - /// - /// Extra bits for literal codes 257..285 - /// - static readonly int[] CPLEXT = { - 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, - 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0 - }; - - /// - /// Copy offsets for distance codes 0..29 - /// - static readonly int[] CPDIST = { - 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, - 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, - 8193, 12289, 16385, 24577 - }; - - /// - /// Extra bits for distance codes - /// - static readonly int[] CPDEXT = { - 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, - 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, - 12, 12, 13, 13 - }; - - /// - /// These are the possible states for an inflater - /// - const int DECODE_HEADER = 0; - const int DECODE_DICT = 1; - const int DECODE_BLOCKS = 2; - const int DECODE_STORED_LEN1 = 3; - const int DECODE_STORED_LEN2 = 4; - const int DECODE_STORED = 5; - const int DECODE_DYN_HEADER = 6; - const int DECODE_HUFFMAN = 7; - const int DECODE_HUFFMAN_LENBITS = 8; - const int DECODE_HUFFMAN_DIST = 9; - const int DECODE_HUFFMAN_DISTBITS = 10; - const int DECODE_CHKSUM = 11; - const int FINISHED = 12; - #endregion - - #region Instance Fields - /// - /// This variable contains the current state. - /// - int mode; - - /// - /// The adler checksum of the dictionary or of the decompressed - /// stream, as it is written in the header resp. footer of the - /// compressed stream. - /// Only valid if mode is DECODE_DICT or DECODE_CHKSUM. - /// - int readAdler; - - /// - /// The number of bits needed to complete the current state. This - /// is valid, if mode is DECODE_DICT, DECODE_CHKSUM, - /// DECODE_HUFFMAN_LENBITS or DECODE_HUFFMAN_DISTBITS. - /// - int neededBits; - int repLength; - int repDist; - int uncomprLen; - - /// - /// True, if the last block flag was set in the last block of the - /// inflated stream. This means that the stream ends after the - /// current block. - /// - bool isLastBlock; - - /// - /// The total number of inflated bytes. - /// - long totalOut; - - /// - /// The total number of bytes set with setInput(). This is not the - /// value returned by the TotalIn property, since this also includes the - /// unprocessed input. - /// - long totalIn; - - /// - /// This variable stores the noHeader flag that was given to the constructor. - /// True means, that the inflated stream doesn't contain a Zlib header or - /// footer. - /// - bool noHeader; - readonly StreamManipulator input; - OutputWindow outputWindow; - InflaterDynHeader dynHeader; - InflaterHuffmanTree litlenTree, distTree; - IChecksum checksum; - #endregion - - #region Constructors - /// - /// Creates a new inflater or RFC1951 decompressor - /// RFC1950/Zlib headers and footers will be expected in the input data - /// - public Inflater() : this(false) - { - } - - /// - /// Creates a new inflater. - /// - /// - /// True if no RFC1950/Zlib header and footer fields are expected in the input data - /// - /// This is used for GZIPed/Zipped input. - /// - /// For compatibility with - /// Sun JDK you should provide one byte of input more than needed in - /// this case. - /// - public Inflater(bool NoHeader) - { - noHeader = NoHeader; - checksum = new Adler32(); - input = new StreamManipulator(); - outputWindow = new OutputWindow(); - mode = NoHeader ? DECODE_BLOCKS : DECODE_HEADER; - } - #endregion - - /// - /// Resets the inflater so that a new stream can be decompressed. All - /// pending input and output will be discarded. - /// - public void Reset() - { - mode = noHeader ? DECODE_BLOCKS : DECODE_HEADER; - totalIn = 0; - totalOut = 0; - input.Reset(); - outputWindow.Reset(); - dynHeader = null; - litlenTree = null; - distTree = null; - isLastBlock = false; - checksum.Reset(); - } - - /// - /// Decodes a zlib/RFC1950 header. - /// - /// - /// False if more input is needed. - /// - /// - /// The header is invalid. - /// - private bool DecodeHeader() - { - int header = input.PeekBits(16); - - if (header < 0) - return false; - - input.DropBits(16); - - // The header is written in "wrong" byte order - header = ((header << 8) | (header >> 8)) & 0xffff; - if (header % 31 != 0) - throw new NotSupportedException("Header checksum invalid"); - - if ((header & 0x0f00) != (Deflater.DEFLATED << 8)) - throw new NotSupportedException("Compression Method unknown"); - - /* Maximum size of the backwards window in bits. - * We currently ignore this, but we could use it to make the - * inflater window more space efficient. On the other hand the - * full window (15 bits) is needed most times, anyway. - int max_wbits = ((header & 0x7000) >> 12) + 8; - */ - - if ((header & 0x0020) == 0) - mode = DECODE_BLOCKS; // Dictionary flag? - else - { - mode = DECODE_DICT; - neededBits = 32; - } - return true; - } - - /// - /// Decodes the dictionary checksum after the deflate header. - /// - /// - /// False if more input is needed. - /// - private bool DecodeDict() - { - while (neededBits > 0) - { - int dictByte = input.PeekBits(8); - - if (dictByte < 0) - return false; - - input.DropBits(8); - readAdler = (readAdler << 8) | dictByte; - neededBits -= 8; - } - - return false; - } - - /// - /// Decodes the huffman encoded symbols in the input stream. - /// - /// - /// false if more input is needed, true if output window is - /// full or the current block ends. - /// - /// - /// if deflated stream is invalid. - /// - private bool DecodeHuffman() - { - int free = outputWindow.GetFreeSpace(); - while (free >= 258) - { - int symbol; - switch (mode) - { - case DECODE_HUFFMAN: - // This is the inner loop so it is optimized a bit - while (((symbol = litlenTree.GetSymbol(input)) & ~0xff) == 0) - { - outputWindow.Write(symbol); - - if (--free < 258) - return true; - } - - if (symbol < 257) - { - if (symbol < 0) - return false; - else - { - // symbol == 256: end of block - distTree = null; - litlenTree = null; - mode = DECODE_BLOCKS; - return true; - } - } - - try - { - repLength = CPLENS[symbol - 257]; - neededBits = CPLEXT[symbol - 257]; - } - catch (Exception e) - { - throw new Exception("Illegal rep length code", e); - } - goto case DECODE_HUFFMAN_LENBITS; // fall through - - case DECODE_HUFFMAN_LENBITS: - if (neededBits > 0) - { - mode = DECODE_HUFFMAN_LENBITS; - int i = input.PeekBits(neededBits); - - if (i < 0) - return false; - - input.DropBits(neededBits); - repLength += i; - } - - mode = DECODE_HUFFMAN_DIST; - goto case DECODE_HUFFMAN_DIST; // fall through - - case DECODE_HUFFMAN_DIST: - symbol = distTree.GetSymbol(input); - if (symbol < 0) - return false; - - try - { - repDist = CPDIST[symbol]; - neededBits = CPDEXT[symbol]; - } - catch (Exception e) - { - throw new Exception("Illegal rep dist code", e); - } - - goto case DECODE_HUFFMAN_DISTBITS; // fall through - - case DECODE_HUFFMAN_DISTBITS: - if (neededBits > 0) - { - mode = DECODE_HUFFMAN_DISTBITS; - int i = input.PeekBits(neededBits); - if (i < 0) - return false; - - input.DropBits(neededBits); - repDist += i; - } - - outputWindow.Repeat(repLength, repDist); - free -= repLength; - mode = DECODE_HUFFMAN; - break; - - default: - throw new NotSupportedException("Inflater unknown mode"); - } - } - return true; - } - - /// - /// Decodes the adler checksum after the deflate stream. - /// - /// - /// false if more input is needed. - /// - /// - /// If checksum doesn't match. - /// - private bool DecodeChksum() - { - while (neededBits > 0) - { - int chkByte = input.PeekBits(8); - if (chkByte < 0) - return false; - - input.DropBits(8); - readAdler = (readAdler << 8) | chkByte; - neededBits -= 8; - } - - if ((int)checksum.Value != readAdler) - throw new Exception("Adler chksum doesn't match: " + (int)checksum.Value + " vs. " + readAdler); - - mode = FINISHED; - return false; - } - - /// - /// Decodes the deflated stream. - /// - /// - /// false if more input is needed, or if finished. - /// - /// - /// if deflated stream is invalid. - /// - private bool Decode() - { - switch (mode) - { - case DECODE_HEADER: - return DecodeHeader(); - - case DECODE_DICT: - return DecodeDict(); - - case DECODE_CHKSUM: - return DecodeChksum(); - - case DECODE_BLOCKS: - if (isLastBlock) - { - if (noHeader) - { - mode = FINISHED; - return false; - } - else - { - input.SkipToByteBoundary(); - neededBits = 32; - mode = DECODE_CHKSUM; - return true; - } - } - - int type = input.PeekBits(3); - if (type < 0) - return false; - - input.DropBits(3); - - isLastBlock |= (type & 1) != 0; - switch (type >> 1) - { - case DeflaterConstants.STORED_BLOCK: - input.SkipToByteBoundary(); - mode = DECODE_STORED_LEN1; - break; - case DeflaterConstants.STATIC_TREES: - litlenTree = InflaterHuffmanTree.defLitLenTree; - distTree = InflaterHuffmanTree.defDistTree; - mode = DECODE_HUFFMAN; - break; - case DeflaterConstants.DYN_TREES: - dynHeader = new InflaterDynHeader(); - mode = DECODE_DYN_HEADER; - break; - default: - throw new NotSupportedException("Unknown block type " + type); - } - return true; - - case DECODE_STORED_LEN1: - { - if ((uncomprLen = input.PeekBits(16)) < 0) - return false; - - input.DropBits(16); - mode = DECODE_STORED_LEN2; - } - goto case DECODE_STORED_LEN2; // fall through - - case DECODE_STORED_LEN2: - { - int nlen = input.PeekBits(16); - if (nlen < 0) - return false; - - input.DropBits(16); - if (nlen != (uncomprLen ^ 0xffff)) - throw new FormatException("broken uncompressed block"); - - mode = DECODE_STORED; - } - goto case DECODE_STORED; // fall through - - case DECODE_STORED: - { - int more = outputWindow.CopyStored(input, uncomprLen); - uncomprLen -= more; - if (uncomprLen == 0) - { - mode = DECODE_BLOCKS; - return true; - } - return !input.IsNeedingInput; - } - - case DECODE_DYN_HEADER: - if (!dynHeader.Decode(input)) - return false; - - litlenTree = dynHeader.BuildLitLenTree(); - distTree = dynHeader.BuildDistTree(); - mode = DECODE_HUFFMAN; - goto case DECODE_HUFFMAN; // fall through - - case DECODE_HUFFMAN: - case DECODE_HUFFMAN_LENBITS: - case DECODE_HUFFMAN_DIST: - case DECODE_HUFFMAN_DISTBITS: - return DecodeHuffman(); - - case FINISHED: - return false; - - default: - throw new NotSupportedException("Inflater.Decode unknown mode"); - } - } - - /// - /// Sets the preset dictionary. This should only be called, if - /// needsDictionary() returns true and it should set the same - /// dictionary, that was used for deflating. The getAdler() - /// function returns the checksum of the dictionary needed. - /// - /// - /// The dictionary. - /// - public void SetDictionary(byte[] buffer) => SetDictionary(buffer, 0, buffer.Length); - - /// - /// Sets the preset dictionary. This should only be called, if - /// needsDictionary() returns true and it should set the same - /// dictionary, that was used for deflating. The getAdler() - /// function returns the checksum of the dictionary needed. - /// - /// - /// The dictionary. - /// - /// - /// The index into buffer where the dictionary starts. - /// - /// - /// The number of bytes in the dictionary. - /// - /// - /// No dictionary is needed. - /// - /// - /// The adler checksum for the buffer is invalid - /// - public void SetDictionary(byte[] buffer, int index, int count) - { - if (buffer == null) - throw new ArgumentNullException(nameof(buffer)); - - if (index < 0) - throw new ArgumentOutOfRangeException(nameof(index)); - - if (count < 0) - throw new ArgumentOutOfRangeException(nameof(count)); - - if (!IsNeedingDictionary) - throw new InvalidOperationException("Dictionary is not needed"); - - checksum.Update(buffer, index, count); - - if ((int)checksum.Value != readAdler) - throw new InvalidOperationException("Wrong checksum"); - - checksum.Reset(); - outputWindow.CopyDict(buffer, index, count); - mode = DECODE_BLOCKS; - } - - /// - /// Sets the input. This should only be called, if needsInput() - /// returns true. - /// - /// - /// the input. - /// - public void SetInput(byte[] buffer) - { - SetInput(buffer, 0, buffer.Length); - } - - /// - /// Sets the input. This should only be called, if needsInput() - /// returns true. - /// - /// - /// The source of input data - /// - /// - /// The index into buffer where the input starts. - /// - /// - /// The number of bytes of input to use. - /// - /// - /// No input is needed. - /// - /// - /// The index and/or count are wrong. - /// - public void SetInput(byte[] buffer, int index, int count) - { - input.SetInput(buffer, index, count); - totalIn += count; - } - - /// - /// Inflates the compressed stream to the output buffer. If this - /// returns 0, you should check, whether IsNeedingDictionary(), - /// IsNeedingInput() or IsFinished() returns true, to determine why no - /// further output is produced. - /// - /// - /// the output buffer. - /// - /// - /// The number of bytes written to the buffer, 0 if no further - /// output can be produced. - /// - /// - /// if buffer has length 0. - /// - /// - /// if deflated stream is invalid. - /// - public int Inflate(byte[] buffer) - { - if (buffer == null) - throw new ArgumentNullException(nameof(buffer)); - - return Inflate(buffer, 0, buffer.Length); - } - - /// - /// Inflates the compressed stream to the output buffer. If this - /// returns 0, you should check, whether needsDictionary(), - /// needsInput() or finished() returns true, to determine why no - /// further output is produced. - /// - /// - /// the output buffer. - /// - /// - /// the offset in buffer where storing starts. - /// - /// - /// the maximum number of bytes to output. - /// - /// - /// the number of bytes written to the buffer, 0 if no further output can be produced. - /// - /// - /// if count is less than 0. - /// - /// - /// if the index and / or count are wrong. - /// - /// - /// if deflated stream is invalid. - /// - public int Inflate(byte[] buffer, int offset, int count) - { - if (buffer == null) - throw new ArgumentNullException(nameof(buffer)); - - if (count < 0) - throw new ArgumentOutOfRangeException(nameof(count), "count cannot be negative"); - - if (offset < 0) - throw new ArgumentOutOfRangeException(nameof(offset), "offset cannot be negative"); - - if (offset + count > buffer.Length) - throw new ArgumentException("count exceeds buffer bounds"); - - // Special case: count may be zero - if (count == 0) - { - if (!IsFinished) - Decode(); // -jr- 08-Nov-2003 INFLATE_BUG fix.. - - return 0; - } - - int bytesCopied = 0; - - do - { - if (mode != DECODE_CHKSUM) - { - /* Don't give away any output, if we are waiting for the - * checksum in the input stream. - * - * With this trick we have always: - * IsNeedingInput() and not IsFinished() - * implies more output can be produced. - */ - int more = outputWindow.CopyOutput(buffer, offset, count); - - if (more > 0) - { - checksum.Update(buffer, offset, more); - offset += more; - bytesCopied += more; - totalOut += more; - count -= more; - - if (count == 0) - return bytesCopied; - } - } - } while (Decode() || ((outputWindow.GetAvailable() > 0) && (mode != DECODE_CHKSUM))); - return bytesCopied; - } - - /// - /// Returns true, if the input buffer is empty. - /// You should then call setInput(). - /// NOTE: This method also returns true when the stream is finished. - /// - public bool IsNeedingInput - { - get - { - return input.IsNeedingInput; - } - } - - /// - /// Returns true, if a preset dictionary is needed to inflate the input. - /// - public bool IsNeedingDictionary - { - get - { - return mode == DECODE_DICT && neededBits == 0; - } - } - - /// - /// Returns true, if the inflater has finished. This means, that no - /// input is needed and no output can be produced. - /// - public bool IsFinished - { - get - { - return mode == FINISHED && outputWindow.GetAvailable() == 0; - } - } - - /// - /// Gets the adler checksum. This is either the checksum of all - /// uncompressed bytes returned by inflate(), or if needsDictionary() - /// returns true (and thus no output was yet produced) this is the - /// adler checksum of the expected dictionary. - /// - /// - /// the adler checksum. - /// - public int Adler - { - get - { - return IsNeedingDictionary ? readAdler : (int)checksum.Value; - } - } - - /// - /// Gets the total number of output bytes returned by Inflate(). - /// - /// - /// the total number of output bytes. - /// - public long TotalOut - { - get - { - return totalOut; - } - } - - /// - /// Gets the total number of processed compressed input bytes. - /// - /// - /// The total number of bytes of processed input bytes. - /// - public long TotalIn - { - get - { - return totalIn - (long)RemainingInput; - } - } - - /// - /// Gets the number of unprocessed input bytes. Useful, if the end of the - /// stream is reached and you want to further process the bytes after - /// the deflate stream. - /// - /// - /// The number of bytes of the input which have not been processed. - /// - public int RemainingInput - { - // TODO: This should be a long? - get - { - return input.AvailableBytes; - } - - } - } -} diff --git a/UpdateLib/UpdateLib/Compression/Deflaters/InflaterDynHeader.cs b/UpdateLib/UpdateLib/Compression/Deflaters/InflaterDynHeader.cs deleted file mode 100644 index d115e8f..0000000 --- a/UpdateLib/UpdateLib/Compression/Deflaters/InflaterDynHeader.cs +++ /dev/null @@ -1,207 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -using MatthiWare.UpdateLib.Compression.Streams; -using System; - -namespace MatthiWare.UpdateLib.Compression.Deflaters -{ - public class InflaterDynHeader - { - #region Constants - const int LNUM = 0; - const int DNUM = 1; - const int BLNUM = 2; - const int BLLENS = 3; - const int LENS = 4; - const int REPS = 5; - - static readonly int[] repMin = { 3, 3, 11 }; - static readonly int[] repBits = { 2, 3, 7 }; - - static readonly int[] BL_ORDER = - { 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 }; - #endregion - - public bool Decode(StreamManipulator input) - { - decode_loop: - for (;;) - { - switch (mode) - { - case LNUM: - lnum = input.PeekBits(5); - if (lnum < 0) - return false; - - lnum += 257; - input.DropBits(5); - // System.err.println("LNUM: "+lnum); - mode = DNUM; - goto case DNUM; // fall through - case DNUM: - dnum = input.PeekBits(5); - if (dnum < 0) - { - return false; - } - dnum++; - input.DropBits(5); - // System.err.println("DNUM: "+dnum); - num = lnum + dnum; - litdistLens = new byte[num]; - mode = BLNUM; - goto case BLNUM; // fall through - case BLNUM: - blnum = input.PeekBits(4); - if (blnum < 0) - { - return false; - } - blnum += 4; - input.DropBits(4); - blLens = new byte[19]; - ptr = 0; - // System.err.println("BLNUM: "+blnum); - mode = BLLENS; - goto case BLLENS; // fall through - case BLLENS: - while (ptr < blnum) - { - int len = input.PeekBits(3); - if (len < 0) - return false; - - input.DropBits(3); - // System.err.println("blLens["+BL_ORDER[ptr]+"]: "+len); - blLens[BL_ORDER[ptr]] = (byte)len; - ptr++; - } - blTree = new InflaterHuffmanTree(blLens); - blLens = null; - ptr = 0; - mode = LENS; - goto case LENS; // fall through - case LENS: - { - int symbol; - while (((symbol = blTree.GetSymbol(input)) & ~15) == 0) - { - /* Normal case: symbol in [0..15] */ - - // System.err.println("litdistLens["+ptr+"]: "+symbol); - litdistLens[ptr++] = lastLen = (byte)symbol; - - if (ptr == num) - return true; - } - - /* need more input ? */ - if (symbol < 0) - return false; - - /* otherwise repeat code */ - if (symbol >= 17) - lastLen = 0; - else - { - if (ptr == 0) - throw new Exception("Repeating zero"); - } - repSymbol = symbol - 16; - } - mode = REPS; - goto case REPS; // fall through - case REPS: - { - int bits = repBits[repSymbol]; - int count = input.PeekBits(bits); - - if (count < 0) - return false; - - input.DropBits(bits); - count += repMin[repSymbol]; - // System.err.println("litdistLens repeated: "+count); - - if (ptr + count > num) - throw new Exception($"litdistLens repeated: {count}"); - - while (count-- > 0) - litdistLens[ptr++] = lastLen; - - if (ptr == num) - return true; - } - - mode = LENS; - goto decode_loop; - } - } - } - - public InflaterHuffmanTree BuildLitLenTree() - { - byte[] litlenLens = new byte[lnum]; - Array.Copy(litdistLens, 0, litlenLens, 0, lnum); - return new InflaterHuffmanTree(litlenLens); - } - - public InflaterHuffmanTree BuildDistTree() - { - byte[] distLens = new byte[dnum]; - Array.Copy(litdistLens, lnum, distLens, 0, dnum); - return new InflaterHuffmanTree(distLens); - } - - #region Instance Fields - byte[] blLens; - byte[] litdistLens; - - InflaterHuffmanTree blTree; - - /// - /// The current decode mode - /// - int mode; - int lnum, dnum, blnum, num; - int repSymbol; - byte lastLen; - int ptr; - #endregion - - } -} diff --git a/UpdateLib/UpdateLib/Compression/Deflaters/InflaterHuffmanTree.cs b/UpdateLib/UpdateLib/Compression/Deflaters/InflaterHuffmanTree.cs deleted file mode 100644 index c1e838d..0000000 --- a/UpdateLib/UpdateLib/Compression/Deflaters/InflaterHuffmanTree.cs +++ /dev/null @@ -1,257 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -using MatthiWare.UpdateLib.Compression.Streams; -using System; - -namespace MatthiWare.UpdateLib.Compression.Deflaters -{ - /// - /// Huffman tree used for inflation - /// - public class InflaterHuffmanTree - { - #region Constants - const int MAX_BITLEN = 15; - #endregion - - #region Instance Fields - short[] tree; - #endregion - - /// - /// Literal length tree - /// - public static InflaterHuffmanTree defLitLenTree; - - /// - /// Distance tree - /// - public static InflaterHuffmanTree defDistTree; - - static InflaterHuffmanTree() - { - try - { - byte[] codeLengths = new byte[288]; - int i = 0; - - while (i < 144) - codeLengths[i++] = 8; - - while (i < 256) - codeLengths[i++] = 9; - - while (i < 280) - codeLengths[i++] = 7; - - while (i < 288) - codeLengths[i++] = 8; - - defLitLenTree = new InflaterHuffmanTree(codeLengths); - - codeLengths = new byte[32]; - i = 0; - while (i < 32) - codeLengths[i++] = 5; - - defDistTree = new InflaterHuffmanTree(codeLengths); - } - catch (Exception e) - { - throw new Exception("InflaterHuffmanTree: static tree length illegal", e); - } - } - - #region Constructors - /// - /// Constructs a Huffman tree from the array of code lengths. - /// - /// - /// the array of code lengths - /// - public InflaterHuffmanTree(byte[] codeLengths) - { - BuildTree(codeLengths); - } - #endregion - - void BuildTree(byte[] codeLengths) - { - int[] blCount = new int[MAX_BITLEN + 1]; - int[] nextCode = new int[MAX_BITLEN + 1]; - - for (int i = 0; i < codeLengths.Length; i++) - { - int bits = codeLengths[i]; - - if (bits > 0) - blCount[bits]++; - } - - int code = 0; - int treeSize = 512; - for (int bits = 1; bits <= MAX_BITLEN; bits++) - { - nextCode[bits] = code; - code += blCount[bits] << (16 - bits); - if (bits >= 10) - { - /* We need an extra table for bit lengths >= 10. */ - int start = nextCode[bits] & 0x1ff80; - int end = code & 0x1ff80; - treeSize += (end - start) >> (16 - bits); - } - } - - /* -jr comment this out! doesnt work for dynamic trees and pkzip 2.04g - if (code != 65536) - { - throw new SharpZipBaseException("Code lengths don't add up properly."); - } - */ - /* Now create and fill the extra tables from longest to shortest - * bit len. This way the sub trees will be aligned. - */ - tree = new short[treeSize]; - int treePtr = 512; - for (int bits = MAX_BITLEN; bits >= 10; bits--) - { - int end = code & 0x1ff80; - code -= blCount[bits] << (16 - bits); - int start = code & 0x1ff80; - for (int i = start; i < end; i += 1 << 7) - { - tree[DeflaterHuffman.BitReverse(i)] = (short)((-treePtr << 4) | bits); - treePtr += 1 << (bits - 9); - } - } - - for (int i = 0; i < codeLengths.Length; i++) - { - int bits = codeLengths[i]; - if (bits == 0) - continue; - - code = nextCode[bits]; - int revcode = DeflaterHuffman.BitReverse(code); - if (bits <= 9) - { - do - { - tree[revcode] = (short)((i << 4) | bits); - revcode += 1 << bits; - } while (revcode < 512); - } - else - { - int subTree = tree[revcode & 511]; - int treeLen = 1 << (subTree & 15); - subTree = -(subTree >> 4); - do - { - tree[subTree | (revcode >> 9)] = (short)((i << 4) | bits); - revcode += 1 << bits; - } while (revcode < treeLen); - } - - nextCode[bits] = code + (1 << (16 - bits)); - } - - } - - /// - /// Reads the next symbol from input. The symbol is encoded using the - /// huffman tree. - /// - /// - /// input the input source. - /// - /// - /// the next symbol, or -1 if not enough input is available. - /// - public int GetSymbol(StreamManipulator input) - { - int lookahead, symbol; - if ((lookahead = input.PeekBits(9)) >= 0) - { - if ((symbol = tree[lookahead]) >= 0) - { - input.DropBits(symbol & 15); - return symbol >> 4; - } - - int subtree = -(symbol >> 4); - int bitlen = symbol & 15; - - if ((lookahead = input.PeekBits(bitlen)) >= 0) - { - symbol = tree[subtree | (lookahead >> 9)]; - input.DropBits(symbol & 15); - - return symbol >> 4; - } - else - { - int bits = input.AvailableBits; - lookahead = input.PeekBits(bits); - symbol = tree[subtree | (lookahead >> 9)]; - - if ((symbol & 15) <= bits) - { - input.DropBits(symbol & 15); - return symbol >> 4; - } - else - return -1; - } - } - else - { - int bits = input.AvailableBits; - lookahead = input.PeekBits(bits); - symbol = tree[lookahead]; - - if (symbol >= 0 && (symbol & 15) <= bits) - { - input.DropBits(symbol & 15); - return symbol >> 4; - } - else - return -1; - } - } - } -} diff --git a/UpdateLib/UpdateLib/Compression/Deflaters/PendingBuffer.cs b/UpdateLib/UpdateLib/Compression/Deflaters/PendingBuffer.cs deleted file mode 100644 index 30c15a3..0000000 --- a/UpdateLib/UpdateLib/Compression/Deflaters/PendingBuffer.cs +++ /dev/null @@ -1,258 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - - -using System; - -namespace MatthiWare.UpdateLib.Compression.Deflaters -{ - /// - /// This class is general purpose class for writing data to a buffer. - /// - /// It allows you to write bits as well as bytes - /// Based on DeflaterPending.java - /// - /// author of the original java version : Jochen Hoenicke - /// - public class PendingBuffer - { - #region Instance Fields - /// - /// Internal work buffer - /// - readonly byte[] buffer; - - int start; - int end; - - uint bits; - int bitCount; - #endregion - - #region Constructors - /// - /// construct instance using default buffer size of 4096 - /// - public PendingBuffer() : this(4096) - { - } - - /// - /// construct instance using specified buffer size - /// - /// - /// size to use for internal buffer - /// - public PendingBuffer(int bufferSize) - { - buffer = new byte[bufferSize]; - } - - #endregion - - /// - /// Clear internal state/buffers - /// - public void Reset() - { - start = end = bitCount = 0; - } - - /// - /// Write a byte to buffer - /// - /// - /// The value to write - /// - public void WriteByte(int value) - { - buffer[end++] = unchecked((byte)value); - } - - /// - /// Write a short value to buffer LSB first - /// - /// - /// The value to write. - /// - public void WriteShort(int value) - { - buffer[end++] = unchecked((byte)value); - buffer[end++] = unchecked((byte)(value >> 8)); - } - - /// - /// write an integer LSB first - /// - /// The value to write. - public void WriteInt(int value) - { - buffer[end++] = unchecked((byte)value); - buffer[end++] = unchecked((byte)(value >> 8)); - buffer[end++] = unchecked((byte)(value >> 16)); - buffer[end++] = unchecked((byte)(value >> 24)); - } - - /// - /// Write a block of data to buffer - /// - /// data to write - /// offset of first byte to write - /// number of bytes to write - public void WriteBlock(byte[] block, int offset, int length) - { - Array.Copy(block, offset, buffer, end, length); - end += length; - } - - /// - /// The number of bits written to the buffer - /// - public int BitCount - { - get - { - return bitCount; - } - } - - /// - /// Align internal buffer on a byte boundary - /// - public void AlignToByte() - { - if (bitCount > 0) - { - buffer[end++] = unchecked((byte)bits); - if (bitCount > 8) - { - buffer[end++] = unchecked((byte)(bits >> 8)); - } - } - bits = 0; - bitCount = 0; - } - - /// - /// Write bits to internal buffer - /// - /// source of bits - /// number of bits to write - public void WriteBits(int b, int count) - { - bits |= (uint)(b << bitCount); - bitCount += count; - if (bitCount >= 16) - { - buffer[end++] = unchecked((byte)bits); - buffer[end++] = unchecked((byte)(bits >> 8)); - bits >>= 16; - bitCount -= 16; - } - } - - /// - /// Write a short value to internal buffer most significant byte first - /// - /// value to write - public void WriteShortMSB(int s) - { - buffer[end++] = unchecked((byte)(s >> 8)); - buffer[end++] = unchecked((byte)s); - } - - /// - /// Indicates if buffer has been flushed - /// - public bool IsFlushed - { - get - { - return end == 0; - } - } - - /// - /// Flushes the pending buffer into the given output array. If the - /// output array is to small, only a partial flush is done. - /// - /// The output array. - /// The offset into output array. - /// The maximum number of bytes to store. - /// The number of bytes flushed. - public int Flush(byte[] output, int offset, int length) - { - if (bitCount >= 8) - { - buffer[end++] = unchecked((byte)bits); - bits >>= 8; - bitCount -= 8; - } - - if (length > end - start) - { - length = end - start; - Array.Copy(buffer, start, output, offset, length); - start = 0; - end = 0; - } - else - { - Array.Copy(buffer, start, output, offset, length); - start += length; - } - - return length; - } - - /// - /// Convert internal buffer to byte array. - /// Buffer is empty on completion - /// - /// - /// The internal buffer contents converted to a byte array. - /// - public byte[] ToByteArray() - { - AlignToByte(); - - byte[] result = new byte[end - start]; - Array.Copy(buffer, start, result, 0, result.Length); - start = 0; - end = 0; - return result; - } - } -} diff --git a/UpdateLib/UpdateLib/Compression/GZip/GZip.cs b/UpdateLib/UpdateLib/Compression/GZip/GZip.cs deleted file mode 100644 index 3af8332..0000000 --- a/UpdateLib/UpdateLib/Compression/GZip/GZip.cs +++ /dev/null @@ -1,62 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -using MatthiWare.UpdateLib.Utils; -using System; -using System.IO; - -namespace MatthiWare.UpdateLib.Compression.GZip -{ - public static class GZip - { - public static void Decompress(Stream inStream, Stream outStream) - { - if (inStream == null || outStream == null) - throw new ArgumentNullException("Streams"); - - using (var gzip = new GZipInputStream(inStream)) - IOUtils.Copy(gzip, outStream, new byte[4096]); - } - - public static void Decompress(Stream inStream, Stream outStream, int level) - { - if (inStream == null || outStream == null) - throw new ArgumentNullException("Streams"); - - using (var gzip = new GZipOutputStream(outStream, level)) - IOUtils.Copy(inStream, gzip, new byte[4096]); - } - } -} diff --git a/UpdateLib/UpdateLib/Compression/GZip/GZipConstants.cs b/UpdateLib/UpdateLib/Compression/GZip/GZipConstants.cs deleted file mode 100644 index b1fa152..0000000 --- a/UpdateLib/UpdateLib/Compression/GZip/GZipConstants.cs +++ /dev/null @@ -1,86 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - - -namespace MatthiWare.UpdateLib.Compression.GZip -{ - /// - /// This class contains constants used for gzip. - /// - public static class GZipConstants - { - /// - /// Magic number found at start of GZIP header - /// - public const int GZIP_MAGIC = 0x1F8B; - - /* The flag byte is divided into individual bits as follows: - - bit 0 FTEXT - bit 1 FHCRC - bit 2 FEXTRA - bit 3 FNAME - bit 4 FCOMMENT - bit 5 reserved - bit 6 reserved - bit 7 reserved - */ - - /// - /// Flag bit mask for text - /// - public const int FTEXT = 0x1; - - /// - /// Flag bitmask for Crc - /// - public const int FHCRC = 0x2; - - /// - /// Flag bit mask for extra - /// - public const int FEXTRA = 0x4; - - /// - /// flag bitmask for name - /// - public const int FNAME = 0x8; - - /// - /// flag bit mask indicating comment is present - /// - public const int FCOMMENT = 0x10; - } -} diff --git a/UpdateLib/UpdateLib/Compression/GZip/GZipException.cs b/UpdateLib/UpdateLib/Compression/GZip/GZipException.cs deleted file mode 100644 index 2e11775..0000000 --- a/UpdateLib/UpdateLib/Compression/GZip/GZipException.cs +++ /dev/null @@ -1,51 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -using System; - -namespace MatthiWare.UpdateLib.Compression.GZip -{ - - [Serializable] - public class GZipException : Exception - { - public GZipException() { } - public GZipException(string message) : base(message) { } - public GZipException(string message, Exception inner) : base(message, inner) { } - protected GZipException( - System.Runtime.Serialization.SerializationInfo info, - System.Runtime.Serialization.StreamingContext context) : base(info, context) { } - } -} diff --git a/UpdateLib/UpdateLib/Compression/GZip/GZipInputStream.cs b/UpdateLib/UpdateLib/Compression/GZip/GZipInputStream.cs deleted file mode 100644 index 04f0233..0000000 --- a/UpdateLib/UpdateLib/Compression/GZip/GZipInputStream.cs +++ /dev/null @@ -1,382 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -using System; -using System.IO; - -using MatthiWare.UpdateLib.Compression.Checksum; -using MatthiWare.UpdateLib.Compression.Deflaters; -using MatthiWare.UpdateLib.Compression.Streams; - -namespace MatthiWare.UpdateLib.Compression.GZip -{ - - /// - /// This filter stream is used to decompress a "GZIP" format stream. - /// The "GZIP" format is described baseInputStream RFC 1952. - /// - /// author of the original java version : John Leuner - /// - /// This sample shows how to unzip a gzipped file - /// - /// using System; - /// using System.IO; - /// - /// using ICSharpCode.SharpZipLib.Core; - /// using ICSharpCode.SharpZipLib.GZip; - /// - /// class MainClass - /// { - /// public static void Main(string[] args) - /// { - /// using (Stream inStream = new GZipInputStream(File.OpenRead(args[0]))) - /// using (FileStream outStream = File.Create(Path.GetFileNameWithoutExtension(args[0]))) { - /// byte[] buffer = new byte[4096]; - /// StreamUtils.Copy(inStream, outStream, buffer); - /// } - /// } - /// } - /// - /// - public class GZipInputStream : InflaterInputStream - { - #region Instance Fields - /// - /// CRC-32 value for uncompressed data - /// - protected Crc32 crc; - - /// - /// Flag to indicate if we've read the GZIP header yet for the current member (block of compressed data). - /// This is tracked per-block as the file is parsed. - /// - bool readGZIPHeader; - - /// - /// Flag to indicate if at least one block in a stream with concatenated blocks was read successfully. - /// This allows us to exit gracefully if downstream data is not in gzip format. - /// - bool completedLastBlock; - #endregion - - #region Constructors - /// - /// Creates a GZipInputStream with the default buffer size - /// - /// - /// The stream to read compressed data from (baseInputStream GZIP format) - /// - public GZipInputStream(Stream baseInputStream, bool isOwner = true) - : this(baseInputStream, 4096) - { - IsStreamOwner = isOwner; - } - - /// - /// Creates a GZIPInputStream with the specified buffer size - /// - /// - /// The stream to read compressed data from (baseInputStream GZIP format) - /// - /// - /// Size of the buffer to use - /// - public GZipInputStream(Stream baseInputStream, int size) - : base(baseInputStream, new Inflater(true), size) - { - } - #endregion - - #region Stream overrides - /// - /// Reads uncompressed data into an array of bytes - /// - /// - /// The buffer to read uncompressed data into - /// - /// - /// The offset indicating where the data should be placed - /// - /// - /// The number of uncompressed bytes to be read - /// - /// Returns the number of bytes actually read. - public override int Read(byte[] buffer, int offset, int count) - { - // A GZIP file can contain multiple blocks of compressed data, although this is quite rare. - // A compressed block could potentially be empty, so we need to loop until we reach EOF or - // we find data. - while (true) - { - - // If we haven't read the header for this block, read it - if (!readGZIPHeader) - { - - // Try to read header. If there is no header (0 bytes available), this is EOF. If there is - // an incomplete header, this will throw an exception. - try - { - if (!ReadHeader()) - return 0; - } - catch (Exception ex) when (completedLastBlock && (ex is GZipException || ex is EndOfStreamException)) - { - // if we completed the last block (i.e. we're in a stream that has multiple blocks concatenated - // we want to return gracefully from any header parsing exceptions since sometimes there may - // be trailing garbage on a stream - return 0; - } - } - - // Try to read compressed data - int bytesRead = base.Read(buffer, offset, count); - if (bytesRead > 0) - crc.Update(buffer, offset, bytesRead); - - // If this is the end of stream, read the footer - if (inflater.IsFinished) - ReadFooter(); - - if (bytesRead > 0) - return bytesRead; - } - } - #endregion - - #region Support routines - bool ReadHeader() - { - // Initialize CRC for this block - crc = new Crc32(); - - // Make sure there is data in file. We can't rely on ReadLeByte() to fill the buffer, as this could be EOF, - // which is fine, but ReadLeByte() throws an exception if it doesn't find data, so we do this part ourselves. - if (inputBuffer.Available <= 0) - { - inputBuffer.Fill(); - - if (inputBuffer.Available <= 0) - return false; // No header, EOF. - } - - // 1. Check the two magic bytes - var headCRC = new Crc32(); - int magic = inputBuffer.ReadLeByte(); - - if (magic < 0) - throw new EndOfStreamException("EOS reading GZIP header"); - - headCRC.Update(magic); - - if (magic != (GZipConstants.GZIP_MAGIC >> 8)) - throw new GZipException("Error GZIP header, first magic byte doesn't match"); - - //magic = baseInputStream.ReadByte(); - magic = inputBuffer.ReadLeByte(); - - if (magic < 0) - throw new EndOfStreamException("EOS reading GZIP header"); - - if (magic != (GZipConstants.GZIP_MAGIC & 0xFF)) - throw new GZipException("Error GZIP header, second magic byte doesn't match"); - - headCRC.Update(magic); - - // 2. Check the compression type (must be 8) - int compressionType = inputBuffer.ReadLeByte(); - - if (compressionType < 0) - throw new EndOfStreamException("EOS reading GZIP header"); - - if (compressionType != 8) - throw new GZipException("Error GZIP header, data not in deflate format"); - - headCRC.Update(compressionType); - - // 3. Check the flags - int flags = inputBuffer.ReadLeByte(); - if (flags < 0) - throw new EndOfStreamException("EOS reading GZIP header"); - - headCRC.Update(flags); - - /* This flag byte is divided into individual bits as follows: - bit 0 FTEXT - bit 1 FHCRC - bit 2 FEXTRA - bit 3 FNAME - bit 4 FCOMMENT - bit 5 reserved - bit 6 reserved - bit 7 reserved - */ - - // 3.1 Check the reserved bits are zero - - if ((flags & 0xE0) != 0) - throw new GZipException("Reserved flag bits in GZIP header != 0"); - - // 4.-6. Skip the modification time, extra flags, and OS type - for (int i = 0; i < 6; i++) - { - int readByte = inputBuffer.ReadLeByte(); - - if (readByte < 0) - throw new EndOfStreamException("EOS reading GZIP header"); - - headCRC.Update(readByte); - } - - // 7. Read extra field - if ((flags & GZipConstants.FEXTRA) != 0) - { - - // XLEN is total length of extra subfields, we will skip them all - int len1, len2; - len1 = inputBuffer.ReadLeByte(); - len2 = inputBuffer.ReadLeByte(); - - if ((len1 < 0) || (len2 < 0)) - throw new EndOfStreamException("EOS reading GZIP header"); - - headCRC.Update(len1); - headCRC.Update(len2); - - int extraLen = (len2 << 8) | len1; // gzip is LSB first - for (int i = 0; i < extraLen; i++) - { - int readByte = inputBuffer.ReadLeByte(); - if (readByte < 0) - throw new EndOfStreamException("EOS reading GZIP header"); - - headCRC.Update(readByte); - } - } - - // 8. Read file name - if ((flags & GZipConstants.FNAME) != 0) - { - int readByte; - while ((readByte = inputBuffer.ReadLeByte()) > 0) - headCRC.Update(readByte); - - if (readByte < 0) - throw new EndOfStreamException("EOS reading GZIP header"); - - headCRC.Update(readByte); - } - - // 9. Read comment - if ((flags & GZipConstants.FCOMMENT) != 0) - { - int readByte; - while ((readByte = inputBuffer.ReadLeByte()) > 0) - headCRC.Update(readByte); - - if (readByte < 0) - throw new EndOfStreamException("EOS reading GZIP header"); - - headCRC.Update(readByte); - } - - // 10. Read header CRC - if ((flags & GZipConstants.FHCRC) != 0) - { - int tempByte; - int crcval = inputBuffer.ReadLeByte(); - - if (crcval < 0) - throw new EndOfStreamException("EOS reading GZIP header"); - - tempByte = inputBuffer.ReadLeByte(); - - if (tempByte < 0) - throw new EndOfStreamException("EOS reading GZIP header"); - - crcval = (crcval << 8) | tempByte; - - if (crcval != ((int)headCRC.Value & 0xffff)) - throw new GZipException("Header CRC value mismatch"); - } - - readGZIPHeader = true; - return true; - } - - void ReadFooter() - { - byte[] footer = new byte[8]; - - // End of stream; reclaim all bytes from inf, read the final byte count, and reset the inflator - long bytesRead = inflater.TotalOut & 0xffffffff; - inputBuffer.Available += inflater.RemainingInput; - inflater.Reset(); - - // Read footer from inputBuffer - int needed = 8; - while (needed > 0) - { - int count = inputBuffer.ReadClearTextBuffer(footer, 8 - needed, needed); - if (count <= 0) - throw new EndOfStreamException("EOS reading GZIP footer"); - - needed -= count; // Jewel Jan 16 - } - - // Calculate CRC - int crcval = (footer[0] & 0xff) | ((footer[1] & 0xff) << 8) | ((footer[2] & 0xff) << 16) | (footer[3] << 24); - if (crcval != (int)crc.Value) - throw new GZipException("GZIP crc sum mismatch, theirs \"" + crcval + "\" and ours \"" + (int)crc.Value); - - // NOTE The total here is the original total modulo 2 ^ 32. - uint total = - ((uint)footer[4] & 0xff) | - (((uint)footer[5] & 0xff) << 8) | - (((uint)footer[6] & 0xff) << 16) | - ((uint)footer[7] << 24); - - if (bytesRead != total) - throw new GZipException("Number of bytes mismatch in footer"); - - // Mark header read as false so if another header exists, we'll continue reading through the file - readGZIPHeader = false; - - // Indicate that we succeeded on at least one block so we can exit gracefully if there is trailing garbage downstream - completedLastBlock = true; - } - #endregion - } -} diff --git a/UpdateLib/UpdateLib/Compression/GZip/GZipOutputStream.cs b/UpdateLib/UpdateLib/Compression/GZip/GZipOutputStream.cs deleted file mode 100644 index 0e05719..0000000 --- a/UpdateLib/UpdateLib/Compression/GZip/GZipOutputStream.cs +++ /dev/null @@ -1,258 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -using System; -using System.IO; - -using MatthiWare.UpdateLib.Compression.Checksum; -using MatthiWare.UpdateLib.Compression.Deflaters; -using MatthiWare.UpdateLib.Compression.Streams; - -namespace MatthiWare.UpdateLib.Compression.GZip -{ - /// - /// This filter stream is used to compress a stream into a "GZIP" stream. - /// The "GZIP" format is described in RFC 1952. - /// - /// author of the original java version : John Leuner - /// - /// This sample shows how to gzip a file - /// - /// using System; - /// using System.IO; - /// - /// using ICSharpCode.SharpZipLib.GZip; - /// using ICSharpCode.SharpZipLib.Core; - /// - /// class MainClass - /// { - /// public static void Main(string[] args) - /// { - /// using (Stream s = new GZipOutputStream(File.Create(args[0] + ".gz"))) - /// using (FileStream fs = File.OpenRead(args[0])) { - /// byte[] writeData = new byte[4096]; - /// Streamutils.Copy(s, fs, writeData); - /// } - /// } - /// } - /// } - /// - /// - public class GZipOutputStream : DeflaterOutputStream - { - enum OutputState - { - Header, - Footer, - Finished, - Closed, - }; - - #region Instance Fields - /// - /// CRC-32 value for uncompressed data - /// - protected Crc32 crc = new Crc32(); - OutputState state_ = OutputState.Header; - #endregion - - #region Constructors - /// - /// Creates a GzipOutputStream with the default buffer size - /// - /// - /// The stream to read data (to be compressed) from - /// - public GZipOutputStream(Stream baseOutputStream, bool isOwner = true) - : this(baseOutputStream, 4096) - { - IsStreamOwner = isOwner; - } - - /// - /// Creates a GZipOutputStream with the specified buffer size - /// - /// - /// The stream to read data (to be compressed) from - /// - /// - /// Size of the buffer to use - /// - public GZipOutputStream(Stream baseOutputStream, int size) : base(baseOutputStream, new Deflater(Deflater.DEFAULT_COMPRESSION, true), size) - { - } - #endregion - - #region Public API - /// - /// Sets the active compression level (1-9). The new level will be activated - /// immediately. - /// - /// The compression level to set. - /// - /// Level specified is not supported. - /// - /// - public void SetLevel(int level) - { - if (level < Deflater.BEST_SPEED) - throw new ArgumentOutOfRangeException(nameof(level)); - - deflater_.SetLevel(level); - } - - /// - /// Get the current compression level. - /// - /// The current compression level. - public int GetLevel() => deflater_.GetLevel(); - #endregion - - #region Stream overrides - /// - /// Write given buffer to output updating crc - /// - /// Buffer to write - /// Offset of first byte in buf to write - /// Number of bytes to write - public override void Write(byte[] buffer, int offset, int count) - { - if (state_ == OutputState.Header) - WriteHeader(); - - if (state_ != OutputState.Footer) - throw new InvalidOperationException("Write not permitted in current state"); - - crc.Update(buffer, offset, count); - base.Write(buffer, offset, count); - } - - /// - /// Writes remaining compressed output data to the output stream - /// and closes it. - /// - protected override void Dispose(bool disposing) - { - try - { - Finish(); - } - finally - { - if (state_ != OutputState.Closed) - { - state_ = OutputState.Closed; - - if (IsStreamOwner) - baseOutputStream_.Dispose(); - } - } - } - #endregion - - #region DeflaterOutputStream overrides - /// - /// Finish compression and write any footer information required to stream - /// - public override void Finish() - { - // If no data has been written a header should be added. - if (state_ == OutputState.Header) - WriteHeader(); - - if (state_ == OutputState.Footer) - { - state_ = OutputState.Finished; - base.Finish(); - - var totalin = (uint)(deflater_.TotalIn & 0xffffffff); - var crcval = (uint)(crc.Value & 0xffffffff); - - byte[] gzipFooter; - - unchecked - { - gzipFooter = new byte[] { - (byte) crcval, (byte) (crcval >> 8), - (byte) (crcval >> 16), (byte) (crcval >> 24), - - (byte) totalin, (byte) (totalin >> 8), - (byte) (totalin >> 16), (byte) (totalin >> 24) - }; - } - - baseOutputStream_.Write(gzipFooter, 0, gzipFooter.Length); - } - } - #endregion - - #region Support Routines - void WriteHeader() - { - if (state_ == OutputState.Header) - { - state_ = OutputState.Footer; - - var mod_time = (int)((DateTime.Now.Ticks - new DateTime(1970, 1, 1).Ticks) / 10000000L); // Ticks give back 100ns intervals - byte[] gzipHeader = { - // The two magic bytes - (GZipConstants.GZIP_MAGIC >> 8), - (GZipConstants.GZIP_MAGIC & 0xff), - - // The compression type - Deflater.DEFLATED, - - // The flags (not set) - 0, - - // The modification time - (byte) mod_time, - (byte) (mod_time >> 8), - (byte) (mod_time >> 16), - (byte) (mod_time >> 24), - - // The extra flags - 0, - - // The OS type (unknown) - 255 - }; - - baseOutputStream_.Write(gzipHeader, 0, gzipHeader.Length); - } - } - #endregion - } -} diff --git a/UpdateLib/UpdateLib/Compression/Streams/DeflaterOutputStream.cs b/UpdateLib/UpdateLib/Compression/Streams/DeflaterOutputStream.cs deleted file mode 100644 index 4e814c2..0000000 --- a/UpdateLib/UpdateLib/Compression/Streams/DeflaterOutputStream.cs +++ /dev/null @@ -1,388 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -using MatthiWare.UpdateLib.Compression.Deflaters; -using System; -using System.IO; -using System.Security.Cryptography; - -namespace MatthiWare.UpdateLib.Compression.Streams -{ - /// - /// A special stream deflating or compressing the bytes that are - /// written to it. It uses a Deflater to perform actual deflating.
- /// Authors of the original java version : Tom Tromey, Jochen Hoenicke - ///
- public class DeflaterOutputStream : Stream - { - #region Constructors - /// - /// Creates a new DeflaterOutputStream with a default Deflater and default buffer size. - /// - /// - /// the output stream where deflated output should be written. - /// - public DeflaterOutputStream(Stream baseOutputStream) - : this(baseOutputStream, new Deflater(), 512) - { - } - - /// - /// Creates a new DeflaterOutputStream with the given Deflater and - /// default buffer size. - /// - /// - /// the output stream where deflated output should be written. - /// - /// - /// the underlying deflater. - /// - public DeflaterOutputStream(Stream baseOutputStream, Deflater deflater) - : this(baseOutputStream, deflater, 512) - { - } - - /// - /// Creates a new DeflaterOutputStream with the given Deflater and - /// buffer size. - /// - /// - /// The output stream where deflated output is written. - /// - /// - /// The underlying deflater to use - /// - /// - /// The buffer size in bytes to use when deflating (minimum value 512) - /// - /// - /// bufsize is less than or equal to zero. - /// - /// - /// baseOutputStream does not support writing - /// - /// - /// deflater instance is null - /// - public DeflaterOutputStream(Stream baseOutputStream, Deflater deflater, int bufferSize) - { - if (baseOutputStream == null) - throw new ArgumentNullException(nameof(baseOutputStream)); - - if (baseOutputStream.CanWrite == false) - { - throw new ArgumentException("Must support writing", nameof(baseOutputStream)); - } - - if (deflater == null) - throw new ArgumentNullException(nameof(deflater)); - - if (bufferSize < 512) - throw new ArgumentOutOfRangeException(nameof(bufferSize)); - - baseOutputStream_ = baseOutputStream; - buffer_ = new byte[bufferSize]; - deflater_ = deflater; - } - - #endregion - - #region Public API - /// - /// Finishes the stream by calling finish() on the deflater. - /// - /// - /// Not all input is deflated - /// - public virtual void Finish() - { - deflater_.Finish(); - while (!deflater_.IsFinished) - { - int len = deflater_.Deflate(buffer_, 0, buffer_.Length); - if (len <= 0) - break; - - baseOutputStream_.Write(buffer_, 0, len); - } - - if (!deflater_.IsFinished) - throw new IOException("Can't deflate all input?"); - - baseOutputStream_.Flush(); - } - - /// - /// Gets or sets a flag indicating ownership of underlying stream. - /// When the flag is true will close the underlying stream also. - /// - /// The default value is true. - public bool IsStreamOwner { get; set; } = true; - - /// - /// Allows client to determine if an entry can be patched after its added - /// - public bool CanPatchEntries - { - get - { - return baseOutputStream_.CanSeek; - } - } - - #endregion - - #region Deflation Support - /// - /// Deflates everything in the input buffers. This will call - /// def.deflate() until all bytes from the input buffers - /// are processed. - /// - protected void Deflate() - { - while (!deflater_.IsNeedingInput) - { - int deflateCount = deflater_.Deflate(buffer_, 0, buffer_.Length); - - if (deflateCount <= 0) - break; - - baseOutputStream_.Write(buffer_, 0, deflateCount); - } - - if (!deflater_.IsNeedingInput) - throw new IOException("DeflaterOutputStream can't deflate all input?"); - } - #endregion - - #region Stream Overrides - /// - /// Gets value indicating stream can be read from - /// - public override bool CanRead - { - get - { - return false; - } - } - - /// - /// Gets a value indicating if seeking is supported for this stream - /// This property always returns false - /// - public override bool CanSeek - { - get - { - return false; - } - } - - /// - /// Get value indicating if this stream supports writing - /// - public override bool CanWrite - { - get - { - return baseOutputStream_.CanWrite; - } - } - - /// - /// Get current length of stream - /// - public override long Length - { - get - { - return baseOutputStream_.Length; - } - } - - /// - /// Gets the current position within the stream. - /// - /// Any attempt to set position - public override long Position - { - get - { - return baseOutputStream_.Position; - } - set - { - throw new NotSupportedException("Position property not supported"); - } - } - - /// - /// Sets the current position of this stream to the given value. Not supported by this class! - /// - /// The offset relative to the to seek. - /// The to seek from. - /// The new position in the stream. - /// Any access - public override long Seek(long offset, SeekOrigin origin) - { - throw new NotSupportedException("DeflaterOutputStream Seek not supported"); - } - - /// - /// Sets the length of this stream to the given value. Not supported by this class! - /// - /// The new stream length. - /// Any access - public override void SetLength(long value) - { - throw new NotSupportedException("DeflaterOutputStream SetLength not supported"); - } - - /// - /// Read a byte from stream advancing position by one - /// - /// The byte read cast to an int. THe value is -1 if at the end of the stream. - /// Any access - public override int ReadByte() - { - throw new NotSupportedException("DeflaterOutputStream ReadByte not supported"); - } - - /// - /// Read a block of bytes from stream - /// - /// The buffer to store read data in. - /// The offset to start storing at. - /// The maximum number of bytes to read. - /// The actual number of bytes read. Zero if end of stream is detected. - /// Any access - public override int Read(byte[] buffer, int offset, int count) - { - throw new NotSupportedException("DeflaterOutputStream Read not supported"); - } - - /// - /// Flushes the stream by calling Flush on the deflater and then - /// on the underlying stream. This ensures that all bytes are flushed. - /// - public override void Flush() - { - deflater_.Flush(); - Deflate(); - baseOutputStream_.Flush(); - } - - /// - /// Calls and closes the underlying - /// stream when is true. - /// - protected override void Dispose(bool disposing) - { - if (!isClosed_) - { - isClosed_ = true; - - try - { - Finish(); - } - finally - { - if (IsStreamOwner) - baseOutputStream_.Dispose(); - } - } - } - - /// - /// Writes a single byte to the compressed output stream. - /// - /// - /// The byte value. - /// - public override void WriteByte(byte value) - { - byte[] b = new byte[1]; - b[0] = value; - Write(b, 0, 1); - } - - /// - /// Writes bytes from an array to the compressed stream. - /// - /// - /// The byte array - /// - /// - /// The offset into the byte array where to start. - /// - /// - /// The number of bytes to write. - /// - public override void Write(byte[] buffer, int offset, int count) - { - deflater_.SetInput(buffer, offset, count); - Deflate(); - } - #endregion - - #region Instance Fields - /// - /// This buffer is used temporarily to retrieve the bytes from the - /// deflater and write them to the underlying output stream. - /// - byte[] buffer_; - - /// - /// The deflater which is used to deflate the stream. - /// - protected Deflater deflater_; - - /// - /// Base stream the deflater depends on. - /// - protected Stream baseOutputStream_; - - bool isClosed_; - #endregion - - #region Static Fields - - // Static to help ensure that multiple files within a zip will get different random salt - private static RandomNumberGenerator _aesRnd = RandomNumberGenerator.Create(); - #endregion - } -} diff --git a/UpdateLib/UpdateLib/Compression/Streams/InflaterInputStream.cs b/UpdateLib/UpdateLib/Compression/Streams/InflaterInputStream.cs deleted file mode 100644 index c13add9..0000000 --- a/UpdateLib/UpdateLib/Compression/Streams/InflaterInputStream.cs +++ /dev/null @@ -1,642 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -using System; -using System.IO; - -using MatthiWare.UpdateLib.Compression.Deflaters; - -namespace MatthiWare.UpdateLib.Compression.Streams -{ - /// - /// An input buffer customised for use by - /// - /// - /// The buffer supports decryption of incoming data. - /// - public class InflaterInputBuffer - { - #region Constructors - /// - /// Initialise a new instance of with a default buffer size - /// - /// The stream to buffer. - public InflaterInputBuffer(Stream stream) : this(stream, 4096) - { - } - - /// - /// Initialise a new instance of - /// - /// The stream to buffer. - /// The size to use for the buffer - /// A minimum buffer size of 1KB is permitted. Lower sizes are treated as 1KB. - public InflaterInputBuffer(Stream stream, int bufferSize) - { - inputStream = stream; - - if (bufferSize < 1024) - bufferSize = 1024; - - rawData = new byte[bufferSize]; - clearText = rawData; - } - #endregion - - /// - /// Get the length of bytes bytes in the - /// - public int RawLength - { - get - { - return rawLength; - } - } - - /// - /// Get the contents of the raw data buffer. - /// - /// This may contain encrypted data. - public byte[] RawData - { - get - { - return rawData; - } - } - - /// - /// Get the number of useable bytes in - /// - public int ClearTextLength - { - get - { - return clearTextLength; - } - } - - /// - /// Get the contents of the clear text buffer. - /// - public byte[] ClearText - { - get - { - return clearText; - } - } - - /// - /// Get/set the number of bytes available - /// - public int Available - { - get { return available; } - set { available = value; } - } - - /// - /// Call passing the current clear text buffer contents. - /// - /// The inflater to set input for. - public void SetInflaterInput(Inflater inflater) - { - if (available > 0) - { - inflater.SetInput(clearText, clearTextLength - available, available); - available = 0; - } - } - - /// - /// Fill the buffer from the underlying input stream. - /// - public void Fill() - { - rawLength = 0; - int toRead = rawData.Length; - - while (toRead > 0) - { - int count = inputStream.Read(rawData, rawLength, toRead); - if (count <= 0) - break; - - rawLength += count; - toRead -= count; - } - - clearTextLength = rawLength; - - - available = clearTextLength; - } - - /// - /// Read a buffer directly from the input stream - /// - /// The buffer to fill - /// Returns the number of bytes read. - public int ReadRawBuffer(byte[] buffer) => ReadRawBuffer(buffer, 0, buffer.Length); - - /// - /// Read a buffer directly from the input stream - /// - /// The buffer to read into - /// The offset to start reading data into. - /// The number of bytes to read. - /// Returns the number of bytes read. - public int ReadRawBuffer(byte[] outBuffer, int offset, int length) - { - if (length < 0) - throw new ArgumentOutOfRangeException(nameof(length)); - - int currentOffset = offset; - int currentLength = length; - - while (currentLength > 0) - { - if (available <= 0) - { - Fill(); - if (available <= 0) - return 0; - } - - int toCopy = Math.Min(currentLength, available); - - Array.Copy(rawData, rawLength - available, outBuffer, currentOffset, toCopy); - currentOffset += toCopy; - currentLength -= toCopy; - available -= toCopy; - } - return length; - } - - /// - /// Read clear text data from the input stream. - /// - /// The buffer to add data to. - /// The offset to start adding data at. - /// The number of bytes to read. - /// Returns the number of bytes actually read. - public int ReadClearTextBuffer(byte[] outBuffer, int offset, int length) - { - if (length < 0) - throw new ArgumentOutOfRangeException(nameof(length)); - - int currentOffset = offset; - int currentLength = length; - - while (currentLength > 0) - { - if (available <= 0) - { - Fill(); - if (available <= 0) - return 0; - } - - int toCopy = Math.Min(currentLength, available); - Array.Copy(clearText, clearTextLength - available, outBuffer, currentOffset, toCopy); - currentOffset += toCopy; - currentLength -= toCopy; - available -= toCopy; - } - return length; - } - - /// - /// Read a from the input stream. - /// - /// Returns the byte read. - public int ReadLeByte() - { - if (available <= 0) - { - Fill(); - - if (available <= 0) - throw new EndOfStreamException("EOF in header"); - } - - byte result = rawData[rawLength - available]; - available -= 1; - return result; - } - - /// - /// Read an in little endian byte order. - /// - /// The short value read case to an int. - public int ReadLeShort() => ReadLeByte() | (ReadLeByte() << 8); - - /// - /// Read an in little endian byte order. - /// - /// The int value read. - public int ReadLeInt() => ReadLeShort() | (ReadLeShort() << 16); - - /// - /// Read a in little endian byte order. - /// - /// The long value read. - public long ReadLeLong() => (uint)ReadLeInt() | ((long)ReadLeInt() << 32); - - #region Instance Fields - int rawLength; - byte[] rawData; - - int clearTextLength; - byte[] clearText; - - int available; - Stream inputStream; - #endregion - } - - /// - /// This filter stream is used to decompress data compressed using the "deflate" - /// format. The "deflate" format is described in RFC 1951. - /// - /// This stream may form the basis for other decompression filters, such - /// as the GZipInputStream. - /// - /// Author of the original java version : John Leuner. - /// - public class InflaterInputStream : Stream - { - #region Constructors - /// - /// Create an InflaterInputStream with the default decompressor - /// and a default buffer size of 4KB. - /// - /// - /// The InputStream to read bytes from - /// - public InflaterInputStream(Stream baseInputStream) - : this(baseInputStream, new Inflater(), 4096) - { - } - - /// - /// Create an InflaterInputStream with the specified decompressor - /// and a default buffer size of 4KB. - /// - /// - /// The source of input data - /// - /// - /// The decompressor used to decompress data read from baseInputStream - /// - public InflaterInputStream(Stream baseInputStream, Inflater inf) - : this(baseInputStream, inf, 4096) - { - } - - /// - /// Create an InflaterInputStream with the specified decompressor - /// and the specified buffer size. - /// - /// - /// The InputStream to read bytes from - /// - /// - /// The decompressor to use - /// - /// - /// Size of the buffer to use - /// - public InflaterInputStream(Stream baseInputStream, Inflater inflater, int bufferSize) - { - if (bufferSize <= 0) - throw new ArgumentOutOfRangeException(nameof(bufferSize)); - - this.baseInputStream = baseInputStream ?? throw new ArgumentNullException(nameof(baseInputStream)); - this.inflater = inflater ?? throw new ArgumentNullException(nameof(inflater)); - - inputBuffer = new InflaterInputBuffer(baseInputStream, bufferSize); - } - - #endregion - - /// - /// Gets or sets a flag indicating ownership of underlying stream. - /// When the flag is true will close the underlying stream also. - /// - /// The default value is true. - public bool IsStreamOwner { get; set; } = true; - - /// - /// Skip specified number of bytes of uncompressed data - /// - /// - /// Number of bytes to skip - /// - /// - /// The number of bytes skipped, zero if the end of - /// stream has been reached - /// - /// - /// The number of bytes to skip is less than or equal to zero. - /// - public long Skip(long count) - { - if (count <= 0) - throw new ArgumentOutOfRangeException(nameof(count)); - - // v0.80 Skip by seeking if underlying stream supports it... - if (baseInputStream.CanSeek) - { - baseInputStream.Seek(count, SeekOrigin.Current); - return count; - } - else - { - int length = 2048; - if (count < length) - length = (int)count; - - byte[] tmp = new byte[length]; - int readCount = 1; - long toSkip = count; - - while ((toSkip > 0) && (readCount > 0)) - { - if (toSkip < length) - length = (int)toSkip; - - readCount = baseInputStream.Read(tmp, 0, length); - toSkip -= readCount; - } - - return count - toSkip; - } - } - - /// - /// Returns 0 once the end of the stream (EOF) has been reached. - /// Otherwise returns 1. - /// - public virtual int Available - { - get - { - return inflater.IsFinished ? 0 : 1; - } - } - - /// - /// Fills the buffer with more data to decompress. - /// - /// - /// Stream ends early - /// - protected void Fill() - { - // Protect against redundant calls - if (inputBuffer.Available <= 0) - { - inputBuffer.Fill(); - - if (inputBuffer.Available <= 0) - throw new EndOfStreamException("Unexpected EOF"); - } - - inputBuffer.SetInflaterInput(inflater); - } - - #region Stream Overrides - /// - /// Gets a value indicating whether the current stream supports reading - /// - public override bool CanRead - { - get - { - return baseInputStream.CanRead; - } - } - - /// - /// Gets a value of false indicating seeking is not supported for this stream. - /// - public override bool CanSeek - { - get - { - return false; - } - } - - /// - /// Gets a value of false indicating that this stream is not writeable. - /// - public override bool CanWrite - { - get - { - return false; - } - } - - /// - /// A value representing the length of the stream in bytes. - /// - public override long Length - { - get - { - //return inputBuffer.RawLength; - throw new NotSupportedException("InflaterInputStream Length is not supported"); - } - } - - /// - /// The current position within the stream. - /// Throws a NotSupportedException when attempting to set the position - /// - /// Attempting to set the position - public override long Position - { - get - { - return baseInputStream.Position; - } - set - { - throw new NotSupportedException("InflaterInputStream Position not supported"); - } - } - - /// - /// Flushes the baseInputStream - /// - public override void Flush() => baseInputStream.Flush(); - - /// - /// Sets the position within the current stream - /// Always throws a NotSupportedException - /// - /// The relative offset to seek to. - /// The defining where to seek from. - /// The new position in the stream. - /// Any access - public override long Seek(long offset, SeekOrigin origin) - { - throw new NotSupportedException("Seek not supported"); - } - - /// - /// Set the length of the current stream - /// Always throws a NotSupportedException - /// - /// The new length value for the stream. - /// Any access - public override void SetLength(long value) - { - throw new NotSupportedException("InflaterInputStream SetLength not supported"); - } - - /// - /// Writes a sequence of bytes to stream and advances the current position - /// This method always throws a NotSupportedException - /// - /// Thew buffer containing data to write. - /// The offset of the first byte to write. - /// The number of bytes to write. - /// Any access - public override void Write(byte[] buffer, int offset, int count) - { - throw new NotSupportedException("InflaterInputStream Write not supported"); - } - - /// - /// Writes one byte to the current stream and advances the current position - /// Always throws a NotSupportedException - /// - /// The byte to write. - /// Any access - public override void WriteByte(byte value) - { - throw new NotSupportedException("InflaterInputStream WriteByte not supported"); - } - - /// - /// Closes the input stream. When - /// is true the underlying stream is also closed. - /// - protected override void Dispose(bool disposing) - { - if (!isClosed) - { - isClosed = true; - - if (IsStreamOwner) - baseInputStream.Dispose(); - } - } - - /// - /// Reads decompressed data into the provided buffer byte array - /// - /// - /// The array to read and decompress data into - /// - /// - /// The offset indicating where the data should be placed - /// - /// - /// The number of bytes to decompress - /// - /// The number of bytes read. Zero signals the end of stream - /// - /// Inflater needs a dictionary - /// - public override int Read(byte[] buffer, int offset, int count) - { - if (inflater.IsNeedingDictionary) - throw new InvalidOperationException("Need a dictionary"); - - int remainingBytes = count; - while (true) - { - int bytesRead = inflater.Inflate(buffer, offset, remainingBytes); - offset += bytesRead; - remainingBytes -= bytesRead; - - if (remainingBytes == 0 || inflater.IsFinished) - break; - - if (inflater.IsNeedingInput) - Fill(); - else if (bytesRead == 0) - throw new IOException("Nothing reead"); - } - - return count - remainingBytes; - } - #endregion - - #region Instance Fields - /// - /// Decompressor for this stream - /// - protected Inflater inflater; - - /// - /// Input buffer for this stream. - /// - protected InflaterInputBuffer inputBuffer; - - /// - /// Base stream the inflater reads from. - /// - private Stream baseInputStream; - - /// - /// The compressed size - /// - protected long csize; - - /// - /// Flag indicating wether this instance has been closed or not. - /// - bool isClosed; - #endregion - } -} diff --git a/UpdateLib/UpdateLib/Compression/Streams/OutputWindow.cs b/UpdateLib/UpdateLib/Compression/Streams/OutputWindow.cs deleted file mode 100644 index aded4b3..0000000 --- a/UpdateLib/UpdateLib/Compression/Streams/OutputWindow.cs +++ /dev/null @@ -1,233 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -using System; - -namespace MatthiWare.UpdateLib.Compression.Streams -{ - /// - /// Contains the output from the Inflation process. - /// We need to have a window so that we can refer backwards into the output stream - /// to repeat stuff.
- /// Author of the original java version : John Leuner - ///
- public class OutputWindow - { - #region Constants - const int WindowSize = 1 << 15; - const int WindowMask = WindowSize - 1; - #endregion - - #region Instance Fields - byte[] window = new byte[WindowSize]; //The window is 2^15 bytes - int windowEnd; - int windowFilled; - #endregion - - /// - /// Write a byte to this output window - /// - /// value to write - /// - /// if window is full - /// - public void Write(int value) - { - if (windowFilled++ == WindowSize) - throw new InvalidOperationException("Window full"); - - window[windowEnd++] = (byte)value; - windowEnd &= WindowMask; - } - - - private void SlowRepeat(int repStart, int length, int distance) - { - while (length-- > 0) - { - window[windowEnd++] = window[repStart++]; - windowEnd &= WindowMask; - repStart &= WindowMask; - } - } - - /// - /// Append a byte pattern already in the window itself - /// - /// length of pattern to copy - /// distance from end of window pattern occurs - /// - /// If the repeated data overflows the window - /// - public void Repeat(int length, int distance) - { - if ((windowFilled += length) > WindowSize) - throw new InvalidOperationException("Window full"); - - int repStart = (windowEnd - distance) & WindowMask; - int border = WindowSize - length; - - if ((repStart <= border) && (windowEnd < border)) - { - if (length <= distance) - { - Array.Copy(window, repStart, window, windowEnd, length); - windowEnd += length; - } - else - { - // We have to copy manually, since the repeat pattern overlaps. - while (length-- > 0) - window[windowEnd++] = window[repStart++]; - } - } - else - SlowRepeat(repStart, length, distance); - } - - /// - /// Copy from input manipulator to internal window - /// - /// source of data - /// length of data to copy - /// the number of bytes copied - public int CopyStored(StreamManipulator input, int length) - { - length = Math.Min(Math.Min(length, WindowSize - windowFilled), input.AvailableBytes); - int copied; - - int tailLen = WindowSize - windowEnd; - if (length > tailLen) - { - copied = input.CopyBytes(window, windowEnd, tailLen); - - if (copied == tailLen) - copied += input.CopyBytes(window, 0, length - tailLen); - } - else - copied = input.CopyBytes(window, windowEnd, length); - - windowEnd = (windowEnd + copied) & WindowMask; - windowFilled += copied; - - return copied; - } - - /// - /// Copy dictionary to window - /// - /// source dictionary - /// offset of start in source dictionary - /// length of dictionary - /// - /// If window isnt empty - /// - public void CopyDict(byte[] dictionary, int offset, int length) - { - if (dictionary == null) - throw new ArgumentNullException(nameof(dictionary)); - - if (windowFilled > 0) - throw new InvalidOperationException(); - - if (length > WindowSize) - { - offset += length - WindowSize; - length = WindowSize; - } - - Array.Copy(dictionary, offset, window, 0, length); - windowEnd = length & WindowMask; - } - - /// - /// Get remaining unfilled space in window - /// - /// Number of bytes left in window - public int GetFreeSpace()=> WindowSize - windowFilled; - - /// - /// Get bytes available for output in window - /// - /// Number of bytes filled - public int GetAvailable()=>windowFilled; - - /// - /// Copy contents of window to output - /// - /// buffer to copy to - /// offset to start at - /// number of bytes to count - /// The number of bytes copied - /// - /// If a window underflow occurs - /// - public int CopyOutput(byte[] output, int offset, int len) - { - int copyEnd = windowEnd; - - if (len > windowFilled) - len = windowFilled; - else - copyEnd = (windowEnd - windowFilled + len) & WindowMask; - - int copied = len; - int tailLen = len - copyEnd; - - if (tailLen > 0) - { - Array.Copy(window, WindowSize - tailLen, output, offset, tailLen); - offset += tailLen; - len = copyEnd; - } - - Array.Copy(window, copyEnd - len, output, offset, len); - windowFilled -= copied; - - if (windowFilled < 0) - throw new InvalidOperationException(); - - return copied; - } - - /// - /// Reset by clearing window so GetAvailable returns 0 - /// - public void Reset() - { - windowFilled = windowEnd = 0; - } - } -} diff --git a/UpdateLib/UpdateLib/Compression/Streams/StreamManipulator.cs b/UpdateLib/UpdateLib/Compression/Streams/StreamManipulator.cs deleted file mode 100644 index d78211e..0000000 --- a/UpdateLib/UpdateLib/Compression/Streams/StreamManipulator.cs +++ /dev/null @@ -1,282 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -using System; - -namespace MatthiWare.UpdateLib.Compression.Streams -{ - /// - /// This class allows us to retrieve a specified number of bits from - /// the input buffer, as well as copy big byte blocks. - /// - /// It uses an int buffer to store up to 31 bits for direct - /// manipulation. This guarantees that we can get at least 16 bits, - /// but we only need at most 15, so this is all safe. - /// - /// There are some optimizations in this class, for example, you must - /// never peek more than 8 bits more than needed, and you must first - /// peek bits before you may drop them. This is not a general purpose - /// class but optimized for the behaviour of the Inflater. - /// - /// authors of the original java version : John Leuner, Jochen Hoenicke - /// - public class StreamManipulator - { - /// - /// Get the next sequence of bits but don't increase input pointer. bitCount must be - /// less or equal 16 and if this call succeeds, you must drop - /// at least n - 8 bits in the next call. - /// - /// The number of bits to peek. - /// - /// the value of the bits, or -1 if not enough bits available. */ - /// - public int PeekBits(int bitCount) - { - if (bitsInBuffer_ < bitCount) - { - if (windowStart_ == windowEnd_) - return -1; // ok - - buffer_ |= (uint)((window_[windowStart_++] & 0xff | - (window_[windowStart_++] & 0xff) << 8) << bitsInBuffer_); - bitsInBuffer_ += 16; - } - - return (int)(buffer_ & ((1 << bitCount) - 1)); - } - - /// - /// Drops the next n bits from the input. You should have called PeekBits - /// with a bigger or equal n before, to make sure that enough bits are in - /// the bit buffer. - /// - /// The number of bits to drop. - public void DropBits(int bitCount) - { - buffer_ >>= bitCount; - bitsInBuffer_ -= bitCount; - } - - /// - /// Gets the next n bits and increases input pointer. This is equivalent - /// to followed by , except for correct error handling. - /// - /// The number of bits to retrieve. - /// - /// the value of the bits, or -1 if not enough bits available. - /// - public int GetBits(int bitCount) - { - int bits = PeekBits(bitCount); - - if (bits >= 0) - DropBits(bitCount); - - return bits; - } - - /// - /// Gets the number of bits available in the bit buffer. This must be - /// only called when a previous PeekBits() returned -1. - /// - /// - /// the number of bits available. - /// - public int AvailableBits - { - get - { - return bitsInBuffer_; - } - } - - /// - /// Gets the number of bytes available. - /// - /// - /// The number of bytes available. - /// - public int AvailableBytes - { - get - { - return windowEnd_ - windowStart_ + (bitsInBuffer_ >> 3); - } - } - - /// - /// Skips to the next byte boundary. - /// - public void SkipToByteBoundary() - { - buffer_ >>= (bitsInBuffer_ & 7); - bitsInBuffer_ &= ~7; - } - - /// - /// Returns true when SetInput can be called - /// - public bool IsNeedingInput - { - get - { - return windowStart_ == windowEnd_; - } - } - - /// - /// Copies bytes from input buffer to output buffer starting - /// at output[offset]. You have to make sure, that the buffer is - /// byte aligned. If not enough bytes are available, copies fewer - /// bytes. - /// - /// - /// The buffer to copy bytes to. - /// - /// - /// The offset in the buffer at which copying starts - /// - /// - /// The length to copy, 0 is allowed. - /// - /// - /// The number of bytes copied, 0 if no bytes were available. - /// - /// - /// Length is less than zero - /// - /// - /// Bit buffer isnt byte aligned - /// - public int CopyBytes(byte[] output, int offset, int length) - { - if (length < 0) - throw new ArgumentOutOfRangeException(nameof(length)); - - if ((bitsInBuffer_ & 7) != 0) - // bits_in_buffer may only be 0 or a multiple of 8 - throw new InvalidOperationException("Bit buffer is not byte aligned!"); - - int count = 0; - while ((bitsInBuffer_ > 0) && (length > 0)) - { - output[offset++] = (byte)buffer_; - buffer_ >>= 8; - bitsInBuffer_ -= 8; - length--; - count++; - } - - if (length == 0) - return count; - - int avail = windowEnd_ - windowStart_; - - if (length > avail) - length = avail; - - Array.Copy(window_, windowStart_, output, offset, length); - windowStart_ += length; - - if (((windowStart_ - windowEnd_) & 1) != 0) - { - // We always want an even number of bytes in input, see peekBits - buffer_ = (uint)(window_[windowStart_++] & 0xff); - bitsInBuffer_ = 8; - } - - return count + length; - } - - /// - /// Resets state and empties internal buffers - /// - public void Reset() - { - buffer_ = 0; - windowStart_ = windowEnd_ = bitsInBuffer_ = 0; - } - - /// - /// Add more input for consumption. - /// Only call when IsNeedingInput returns true - /// - /// data to be input - /// offset of first byte of input - /// number of bytes of input to add. - public void SetInput(byte[] buffer, int offset, int count) - { - if (buffer == null) - throw new ArgumentNullException(nameof(buffer)); - - if (offset < 0) - throw new ArgumentOutOfRangeException(nameof(offset), "Cannot be negative"); - - if (count < 0) - throw new ArgumentOutOfRangeException(nameof(count), "Cannot be negative"); - - if (windowStart_ < windowEnd_) - throw new InvalidOperationException("Old input was not completely processed"); - - int end = offset + count; - - // We want to throw an ArrayIndexOutOfBoundsException early. - // Note the check also handles integer wrap around. - if ((offset > end) || (end > buffer.Length)) - throw new ArgumentOutOfRangeException(nameof(count)); - - if ((count & 1) != 0) - { - // We always want an even number of bytes in input, see PeekBits - buffer_ |= (uint)((buffer[offset++] & 0xff) << bitsInBuffer_); - bitsInBuffer_ += 8; - } - - window_ = buffer; - windowStart_ = offset; - windowEnd_ = end; - } - - #region Instance Fields - private byte[] window_; - private int windowStart_; - private int windowEnd_; - - private uint buffer_; - private int bitsInBuffer_; - #endregion - } -} diff --git a/UpdateLib/UpdateLib/Compression/Zip/Zip.cs b/UpdateLib/UpdateLib/Compression/Zip/Zip.cs deleted file mode 100644 index 8c8614b..0000000 --- a/UpdateLib/UpdateLib/Compression/Zip/Zip.cs +++ /dev/null @@ -1,22 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -namespace MatthiWare.UpdateLib.Compression.Zip -{ - public static class Zip - { - } -} diff --git a/UpdateLib/UpdateLib/Compression/Zip/ZipConstants.cs b/UpdateLib/UpdateLib/Compression/Zip/ZipConstants.cs deleted file mode 100644 index 3a03c92..0000000 --- a/UpdateLib/UpdateLib/Compression/Zip/ZipConstants.cs +++ /dev/null @@ -1,470 +0,0 @@ -using System; -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -using System.Text; - -namespace MatthiWare.UpdateLib.Compression.Zip -{ - #region Enumerations - - /// - /// Determines how entries are tested to see if they should use Zip64 extensions or not. - /// - public enum UseZip64 - { - /// - /// Zip64 will not be forced on entries during processing. - /// - /// An entry can have this overridden if required - Off, - /// - /// Zip64 should always be used. - /// - On, - /// - /// #ZipLib will determine use based on entry values when added to archive. - /// - Dynamic, - } - - /// - /// The kind of compression used for an entry in an archive - /// - public enum CompressionMethod - { - /// - /// A direct copy of the file contents is held in the archive - /// - Stored = 0, - - /// - /// Common Zip compression method using a sliding dictionary - /// of up to 32KB and secondary compression from Huffman/Shannon-Fano trees - /// - Deflated = 8, - - /// - /// An extension to deflate with a 64KB window. Not supported by #Zip currently - /// - Deflate64 = 9, - - /// - /// BZip2 compression. Not supported by #Zip. - /// - BZip2 = 11 - - } - - /// - /// Defines the contents of the general bit flags field for an archive entry. - /// - [Flags] - public enum GeneralBitFlags - { - /// - /// Bit 0 if set indicates that the file is encrypted - /// - Encrypted = 0x0001, - /// - /// Bits 1 and 2 - Two bits defining the compression method (only for Method 6 Imploding and 8,9 Deflating) - /// - Method = 0x0006, - /// - /// Bit 3 if set indicates a trailing data desciptor is appended to the entry data - /// - Descriptor = 0x0008, - /// - /// Bit 4 is reserved for use with method 8 for enhanced deflation - /// - ReservedPKware4 = 0x0010, - /// - /// Bit 5 if set indicates the file contains Pkzip compressed patched data. - /// Requires version 2.7 or greater. - /// - Patched = 0x0020, - /// - /// Bit 6 if set indicates strong encryption has been used for this entry. - /// - StrongEncryption = 0x0040, - /// - /// Bit 7 is currently unused - /// - Unused7 = 0x0080, - /// - /// Bit 8 is currently unused - /// - Unused8 = 0x0100, - /// - /// Bit 9 is currently unused - /// - Unused9 = 0x0200, - /// - /// Bit 10 is currently unused - /// - Unused10 = 0x0400, - /// - /// Bit 11 if set indicates the filename and - /// comment fields for this file must be encoded using UTF-8. - /// - UnicodeText = 0x0800, - /// - /// Bit 12 is documented as being reserved by PKware for enhanced compression. - /// - EnhancedCompress = 0x1000, - /// - /// Bit 13 if set indicates that values in the local header are masked to hide - /// their actual values, and the central directory is encrypted. - /// - /// - /// Used when encrypting the central directory contents. - /// - HeaderMasked = 0x2000, - /// - /// Bit 14 is documented as being reserved for use by PKware - /// - ReservedPkware14 = 0x4000, - /// - /// Bit 15 is documented as being reserved for use by PKware - /// - ReservedPkware15 = 0x8000 - } - - #endregion - - /// - /// This class contains constants used for Zip format files - /// - public static class ZipConstants - { - #region Versions - /// - /// The version made by field for entries in the central header when created by this library - /// - /// - /// This is also the Zip version for the library when comparing against the version required to extract - /// for an entry. See . - /// - public const int VersionMadeBy = 51; // was 45 before AES - - /// - /// The version required for Zip64 extensions (4.5 or higher) - /// - public const int VersionZip64 = 45; - #endregion - - #region Header Sizes - /// - /// Size of local entry header (excluding variable length fields at end) - /// - public const int LocalHeaderBaseSize = 30; - - /// - /// Size of Zip64 data descriptor - /// - public const int Zip64DataDescriptorSize = 24; - - /// - /// Size of data descriptor - /// - public const int DataDescriptorSize = 16; - - /// - /// Size of central header entry (excluding variable fields) - /// - public const int CentralHeaderBaseSize = 46; - - /// - /// Size of end of central record (excluding variable fields) - /// - public const int EndOfCentralRecordBaseSize = 22; - - /// - /// Size of 'classic' cryptographic header stored before any entry data - /// - public const int CryptoHeaderSize = 12; - #endregion - - #region Header Signatures - - /// - /// Signature for local entry header - /// - public const int LocalHeaderSignature = 'P' | ('K' << 8) | (3 << 16) | (4 << 24); - - /// - /// Signature for local entry header - /// - [Obsolete("Use LocalHeaderSignature instead")] - public const int LOCSIG = 'P' | ('K' << 8) | (3 << 16) | (4 << 24); - - /// - /// Signature for spanning entry - /// - public const int SpanningSignature = 'P' | ('K' << 8) | (7 << 16) | (8 << 24); - - /// - /// Signature for spanning entry - /// - [Obsolete("Use SpanningSignature instead")] - public const int SPANNINGSIG = 'P' | ('K' << 8) | (7 << 16) | (8 << 24); - - /// - /// Signature for temporary spanning entry - /// - public const int SpanningTempSignature = 'P' | ('K' << 8) | ('0' << 16) | ('0' << 24); - - /// - /// Signature for temporary spanning entry - /// - [Obsolete("Use SpanningTempSignature instead")] - public const int SPANTEMPSIG = 'P' | ('K' << 8) | ('0' << 16) | ('0' << 24); - - /// - /// Signature for data descriptor - /// - /// - /// This is only used where the length, Crc, or compressed size isnt known when the - /// entry is created and the output stream doesnt support seeking. - /// The local entry cannot be 'patched' with the correct values in this case - /// so the values are recorded after the data prefixed by this header, as well as in the central directory. - /// - public const int DataDescriptorSignature = 'P' | ('K' << 8) | (7 << 16) | (8 << 24); - - /// - /// Signature for data descriptor - /// - /// - /// This is only used where the length, Crc, or compressed size isnt known when the - /// entry is created and the output stream doesnt support seeking. - /// The local entry cannot be 'patched' with the correct values in this case - /// so the values are recorded after the data prefixed by this header, as well as in the central directory. - /// - [Obsolete("Use DataDescriptorSignature instead")] - public const int EXTSIG = 'P' | ('K' << 8) | (7 << 16) | (8 << 24); - - /// - /// Signature for central header - /// - [Obsolete("Use CentralHeaderSignature instead")] - public const int CENSIG = 'P' | ('K' << 8) | (1 << 16) | (2 << 24); - - /// - /// Signature for central header - /// - public const int CentralHeaderSignature = 'P' | ('K' << 8) | (1 << 16) | (2 << 24); - - /// - /// Signature for Zip64 central file header - /// - public const int Zip64CentralFileHeaderSignature = 'P' | ('K' << 8) | (6 << 16) | (6 << 24); - - /// - /// Signature for Zip64 central file header - /// - [Obsolete("Use Zip64CentralFileHeaderSignature instead")] - public const int CENSIG64 = 'P' | ('K' << 8) | (6 << 16) | (6 << 24); - - /// - /// Signature for Zip64 central directory locator - /// - public const int Zip64CentralDirLocatorSignature = 'P' | ('K' << 8) | (6 << 16) | (7 << 24); - - /// - /// Signature for archive extra data signature (were headers are encrypted). - /// - public const int ArchiveExtraDataSignature = 'P' | ('K' << 8) | (6 << 16) | (7 << 24); - - /// - /// Central header digitial signature - /// - public const int CentralHeaderDigitalSignature = 'P' | ('K' << 8) | (5 << 16) | (5 << 24); - - /// - /// Central header digitial signature - /// - [Obsolete("Use CentralHeaderDigitalSignaure instead")] - public const int CENDIGITALSIG = 'P' | ('K' << 8) | (5 << 16) | (5 << 24); - - /// - /// End of central directory record signature - /// - public const int EndOfCentralDirectorySignature = 'P' | ('K' << 8) | (5 << 16) | (6 << 24); - - /// - /// End of central directory record signature - /// - [Obsolete("Use EndOfCentralDirectorySignature instead")] - public const int ENDSIG = 'P' | ('K' << 8) | (5 << 16) | (6 << 24); - #endregion - - /// - /// The original Zip specification (https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT) states - /// that file names should only be encoded with IBM Code Page 437 or UTF-8. - /// In practice, most zip apps use OEM or system encoding (typically cp437 on Windows). - /// Let's be good citizens and default to UTF-8 http://utf8everywhere.org/ - /// - static int defaultCodePage = Encoding.UTF8.CodePage; - - /// - /// Default encoding used for string conversion. 0 gives the default system OEM code page. - /// Using the default code page isnt the full solution neccessarily - /// there are many variable factors, codepage 850 is often a good choice for - /// European users, however be careful about compatability. - /// - public static int DefaultCodePage - { - get - { - return defaultCodePage; - } - set - { - if ((value < 0) || (value > 65535) || - (value == 1) || (value == 2) || (value == 3) || (value == 42)) - throw new ArgumentOutOfRangeException(nameof(value)); - - defaultCodePage = value; - } - } - - /// - /// Convert a portion of a byte array to a string. - /// - /// - /// Data to convert to string - /// - /// - /// Number of bytes to convert starting from index 0 - /// - /// - /// data[0]..data[count - 1] converted to a string - /// - public static string ConvertToString(byte[] data, int count) - { - if (data == null) - return string.Empty; - - return Encoding.GetEncoding(DefaultCodePage).GetString(data, 0, count); - } - - /// - /// Convert a byte array to string - /// - /// - /// Byte array to convert - /// - /// - /// dataconverted to a string - /// - public static string ConvertToString(byte[] data) - { - if (data == null) - return string.Empty; - - return ConvertToString(data, data.Length); - } - - /// - /// Convert a byte array to string - /// - /// The applicable general purpose bits flags - /// - /// Byte array to convert - /// - /// The number of bytes to convert. - /// - /// dataconverted to a string - /// - public static string ConvertToStringExt(int flags, byte[] data, int count) - { - if (data == null) - return string.Empty; - - return (flags & (int)GeneralBitFlags.UnicodeText) != 0 ? - Encoding.UTF8.GetString(data, 0, count) : - ConvertToString(data, count); - } - - /// - /// Convert a byte array to string - /// - /// - /// Byte array to convert - /// - /// The applicable general purpose bits flags - /// - /// dataconverted to a string - /// - public static string ConvertToStringExt(int flags, byte[] data) - { - if (data == null) - return string.Empty; - - return ((flags & (int)GeneralBitFlags.UnicodeText) != 0) ? Encoding.UTF8.GetString(data, 0, data.Length) : ConvertToString(data, data.Length); - } - - /// - /// Convert a string to a byte array - /// - /// - /// String to convert to an array - /// - /// Converted array - public static byte[] ConvertToArray(string str) - { - if (str == null) - return new byte[0]; - - return Encoding.GetEncoding(DefaultCodePage).GetBytes(str); - } - - /// - /// Convert a string to a byte array - /// - /// The applicable general purpose bits flags - /// - /// String to convert to an array - /// - /// Converted array - public static byte[] ConvertToArray(int flags, string str) - { - if (str == null) - return new byte[0]; - - return ((flags & (int)GeneralBitFlags.UnicodeText) != 0) ? Encoding.UTF8.GetBytes(str) : ConvertToArray(str); - } - } -} diff --git a/UpdateLib/UpdateLib/Compression/Zip/ZipEntry.cs b/UpdateLib/UpdateLib/Compression/Zip/ZipEntry.cs deleted file mode 100644 index 9c0831e..0000000 --- a/UpdateLib/UpdateLib/Compression/Zip/ZipEntry.cs +++ /dev/null @@ -1,1056 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -using System; -using System.IO; - -namespace MatthiWare.UpdateLib.Compression.Zip -{ - /// - /// Defines known values for the property. - /// - public enum HostSystemID - { - /// - /// Host system = MSDOS - /// - Msdos = 0, - /// - /// Host system = Amiga - /// - Amiga = 1, - /// - /// Host system = Open VMS - /// - OpenVms = 2, - /// - /// Host system = Unix - /// - Unix = 3, - /// - /// Host system = VMCms - /// - VMCms = 4, - /// - /// Host system = Atari ST - /// - AtariST = 5, - /// - /// Host system = OS2 - /// - OS2 = 6, - /// - /// Host system = Macintosh - /// - Macintosh = 7, - /// - /// Host system = ZSystem - /// - ZSystem = 8, - /// - /// Host system = Cpm - /// - Cpm = 9, - /// - /// Host system = Windows NT - /// - WindowsNT = 10, - /// - /// Host system = MVS - /// - MVS = 11, - /// - /// Host system = VSE - /// - Vse = 12, - /// - /// Host system = Acorn RISC - /// - AcornRisc = 13, - /// - /// Host system = VFAT - /// - Vfat = 14, - /// - /// Host system = Alternate MVS - /// - AlternateMvs = 15, - /// - /// Host system = BEOS - /// - BeOS = 16, - /// - /// Host system = Tandem - /// - Tandem = 17, - /// - /// Host system = OS400 - /// - OS400 = 18, - /// - /// Host system = OSX - /// - OSX = 19, - /// - /// Host system = WinZIP AES - /// - WinZipAES = 99, - } - - /// - /// This class represents an entry in a zip archive. This can be a file - /// or a directory - /// ZipFile and ZipInputStream will give you instances of this class as - /// information about the members in an archive. ZipOutputStream - /// uses an instance of this class when creating an entry in a Zip file. - ///
- ///
Author of the original java version : Jochen Hoenicke - ///
- public class ZipEntry - { - [Flags] - enum Known : byte - { - None = 0, - Size = 0x01, - CompressedSize = 0x02, - Crc = 0x04, - Time = 0x08, - ExternalAttributes = 0x10, - } - - #region Constructors - /// - /// Creates a zip entry with the given name. - /// - /// - /// The name for this entry. Can include directory components. - /// The convention for names is 'unix' style paths with relative names only. - /// There are with no device names and path elements are separated by '/' characters. - /// - /// - /// The name passed is null - /// - public ZipEntry(string name) - : this(name, 0, ZipConstants.VersionMadeBy, CompressionMethod.Deflated) - { - } - - /// - /// Creates a zip entry with the given name and version required to extract - /// - /// - /// The name for this entry. Can include directory components. - /// The convention for names is 'unix' style paths with no device names and - /// path elements separated by '/' characters. This is not enforced see CleanName - /// on how to ensure names are valid if this is desired. - /// - /// - /// The minimum 'feature version' required this entry - /// - /// - /// The name passed is null - /// - internal ZipEntry(string name, int versionRequiredToExtract) - : this(name, versionRequiredToExtract, ZipConstants.VersionMadeBy, - CompressionMethod.Deflated) - { - } - - /// - /// Initializes an entry with the given name and made by information - /// - /// Name for this entry - /// Version and HostSystem Information - /// Minimum required zip feature version required to extract this entry - /// Compression method for this entry. - /// - /// The name passed is null - /// - /// - /// versionRequiredToExtract should be 0 (auto-calculate) or > 10 - /// - /// - /// This constructor is used by the ZipFile class when reading from the central header - /// It is not generally useful, use the constructor specifying the name only. - /// - internal ZipEntry(string name, int versionRequiredToExtract, int madeByInfo, - CompressionMethod method) - { - if (name == null) - throw new ArgumentNullException(nameof(name)); - - if (name.Length > 0xffff) - throw new ArgumentException("Name is too long", nameof(name)); - - if ((versionRequiredToExtract != 0) && (versionRequiredToExtract < 10)) - throw new ArgumentOutOfRangeException(nameof(versionRequiredToExtract)); - - - DateTime = DateTime.Now; - this.name = CleanName(name); - versionMadeBy = (ushort)madeByInfo; - versionToExtract = (ushort)versionRequiredToExtract; - this.method = method; - } - - #endregion - - /// - /// Get a value indicating wether the entry has a CRC value available. - /// - public bool HasCrc - { - get - { - return (known & Known.Crc) != 0; - } - } - - /// - /// Get / set a flag indicating wether entry name and comment text are - /// encoded in unicode UTF8. - /// - /// This is an assistant that interprets the flags property. - public bool IsUnicodeText - { - get - { - return (flags & (int)GeneralBitFlags.UnicodeText) != 0; - } - set - { - if (value) - { - flags |= (int)GeneralBitFlags.UnicodeText; - } - else - { - flags &= ~(int)GeneralBitFlags.UnicodeText; - } - } - } - - /// - /// Get/Set general purpose bit flag for entry - /// - /// - /// General purpose bit flag
- ///
- /// Bit 0: If set, indicates the file is encrypted
- /// Bit 1-2 Only used for compression type 6 Imploding, and 8, 9 deflating
- /// Imploding:
- /// Bit 1 if set indicates an 8K sliding dictionary was used. If clear a 4k dictionary was used
- /// Bit 2 if set indicates 3 Shannon-Fanno trees were used to encode the sliding dictionary, 2 otherwise
- ///
- /// Deflating:
- /// Bit 2 Bit 1
- /// 0 0 Normal compression was used
- /// 0 1 Maximum compression was used
- /// 1 0 Fast compression was used
- /// 1 1 Super fast compression was used
- ///
- /// Bit 3: If set, the fields crc-32, compressed size - /// and uncompressed size are were not able to be written during zip file creation - /// The correct values are held in a data descriptor immediately following the compressed data.
- /// Bit 4: Reserved for use by PKZIP for enhanced deflating
- /// Bit 5: If set indicates the file contains compressed patch data
- /// Bit 6: If set indicates strong encryption was used.
- /// Bit 7-10: Unused or reserved
- /// Bit 11: If set the name and comments for this entry are in unicode.
- /// Bit 12-15: Unused or reserved
- ///
- /// - /// - public int Flags - { - get - { - return flags; - } - set - { - flags = value; - } - } - - /// - /// Get/Set index of this entry in Zip file - /// - /// This is only valid when the entry is part of a - public long ZipFileIndex - { - get - { - return zipFileIndex; - } - set - { - zipFileIndex = value; - } - } - - /// - /// Get/set offset for use in central header - /// - public long Offset - { - get - { - return offset; - } - set - { - offset = value; - } - } - - /// - /// Get/Set external file attributes as an integer. - /// The values of this are operating system dependant see - /// HostSystem for details - /// - public int ExternalFileAttributes - { - get - { - return ((known & Known.ExternalAttributes) == 0) ? -1 : externalFileAttributes; - } - - set - { - externalFileAttributes = value; - known |= Known.ExternalAttributes; - } - } - - /// - /// Get the version made by for this entry or zero if unknown. - /// The value / 10 indicates the major version number, and - /// the value mod 10 is the minor version number - /// - public int VersionMadeBy - { - get - { - return (versionMadeBy & 0xff); - } - } - - /// - /// Get a value indicating this entry is for a DOS/Windows system. - /// - public bool IsDOSEntry - { - get - { - return ((HostSystem == (int)HostSystemID.Msdos) || - (HostSystem == (int)HostSystemID.WindowsNT)); - } - } - - /// - /// Test the external attributes for this to - /// see if the external attributes are Dos based (including WINNT and variants) - /// and match the values - /// - /// The attributes to test. - /// Returns true if the external attributes are known to be DOS/Windows - /// based and have the same attributes set as the value passed. - bool HasDosAttributes(int attributes) - { - bool result = false; - - if ((known & Known.ExternalAttributes) != 0) - result |= (((HostSystem == (int)HostSystemID.Msdos) || - (HostSystem == (int)HostSystemID.WindowsNT)) && - (ExternalFileAttributes & attributes) == attributes); - - return result; - } - - /// - /// Gets the compatability information for the external file attribute - /// If the external file attributes are compatible with MS-DOS and can be read - /// by PKZIP for DOS version 2.04g then this value will be zero. Otherwise the value - /// will be non-zero and identify the host system on which the attributes are compatible. - /// - /// - /// - /// The values for this as defined in the Zip File format and by others are shown below. The values are somewhat - /// misleading in some cases as they are not all used as shown. You should consult the relevant documentation - /// to obtain up to date and correct information. The modified appnote by the infozip group is - /// particularly helpful as it documents a lot of peculiarities. The document is however a little dated. - /// - /// 0 - MS-DOS and OS/2 (FAT / VFAT / FAT32 file systems) - /// 1 - Amiga - /// 2 - OpenVMS - /// 3 - Unix - /// 4 - VM/CMS - /// 5 - Atari ST - /// 6 - OS/2 HPFS - /// 7 - Macintosh - /// 8 - Z-System - /// 9 - CP/M - /// 10 - Windows NTFS - /// 11 - MVS (OS/390 - Z/OS) - /// 12 - VSE - /// 13 - Acorn Risc - /// 14 - VFAT - /// 15 - Alternate MVS - /// 16 - BeOS - /// 17 - Tandem - /// 18 - OS/400 - /// 19 - OS/X (Darwin) - /// 99 - WinZip AES - /// remainder - unused - /// - /// - public int HostSystem - { - get - { - return (versionMadeBy >> 8) & 0xff; - } - - set - { - versionMadeBy &= 0xff; - versionMadeBy |= (ushort)((value & 0xff) << 8); - } - } - - /// - /// Get minimum Zip feature version required to extract this entry - /// - /// - /// Minimum features are defined as:
- /// 1.0 - Default value
- /// 1.1 - File is a volume label
- /// 2.0 - File is a folder/directory
- /// 2.0 - File is compressed using Deflate compression
- /// 2.0 - File is encrypted using traditional encryption
- /// 2.1 - File is compressed using Deflate64
- /// 2.5 - File is compressed using PKWARE DCL Implode
- /// 2.7 - File is a patch data set
- /// 4.5 - File uses Zip64 format extensions
- /// 4.6 - File is compressed using BZIP2 compression
- /// 5.0 - File is encrypted using DES
- /// 5.0 - File is encrypted using 3DES
- /// 5.0 - File is encrypted using original RC2 encryption
- /// 5.0 - File is encrypted using RC4 encryption
- /// 5.1 - File is encrypted using AES encryption
- /// 5.1 - File is encrypted using corrected RC2 encryption
- /// 5.1 - File is encrypted using corrected RC2-64 encryption
- /// 6.1 - File is encrypted using non-OAEP key wrapping
- /// 6.2 - Central directory encryption (not confirmed yet)
- /// 6.3 - File is compressed using LZMA
- /// 6.3 - File is compressed using PPMD+
- /// 6.3 - File is encrypted using Blowfish
- /// 6.3 - File is encrypted using Twofish
- ///
- /// - public int Version - { - get - { - // Return recorded version if known. - if (versionToExtract != 0) - return versionToExtract & 0x00ff; // Only lower order byte. High order is O/S file system. - else - { - int result = 10; - - if (CentralHeaderRequiresZip64) - result = ZipConstants.VersionZip64; - else if (CompressionMethod.Deflated == method) - result = 20; - else if (IsDirectory == true) - result = 20; - else if (HasDosAttributes(0x08)) - result = 11; - - return result; - } - } - } - - /// - /// Get a value indicating whether this entry can be decompressed by the library. - /// - /// This is based on the and - /// wether the compression method is supported. - public bool CanDecompress - { - get - { - return (Version <= ZipConstants.VersionMadeBy) && - ((Version == 10) || - (Version == 11) || - (Version == 20) || - (Version == 45) || - (Version == 51)) && - IsCompressionMethodSupported(); - } - } - - /// - /// Force this entry to be recorded using Zip64 extensions. - /// - public void ForceZip64() - { - forceZip64_ = true; - } - - /// - /// Get a value indicating wether Zip64 extensions were forced. - /// - /// A value of true if Zip64 extensions have been forced on; false if not. - public bool IsZip64Forced() => forceZip64_; - - /// - /// Gets a value indicating if the entry requires Zip64 extensions - /// to store the full entry values. - /// - /// A value of true if a local header requires Zip64 extensions; false if not. - public bool LocalHeaderRequiresZip64 - { - get - { - bool result = forceZip64_; - - if (!result) - { - // TODO: A better estimation of the true limit based on compression overhead should be used - // to determine when an entry should use Zip64. - result = - ((size >= uint.MaxValue) || (compressedSize >= uint.MaxValue)) && - ((versionToExtract == 0) || (versionToExtract >= ZipConstants.VersionZip64)); - } - - return result; - } - } - - /// - /// Get a value indicating wether the central directory entry requires Zip64 extensions to be stored. - /// - public bool CentralHeaderRequiresZip64 - { - get - { - return LocalHeaderRequiresZip64 || (offset >= uint.MaxValue); - } - } - - /// - /// Get/Set DosTime value. - /// - /// - /// The MS-DOS date format can only represent dates between 1/1/1980 and 12/31/2107. - /// - public long DosTime - { - get - { - return ((known & Known.Time) == 0) ? 0 : dosTime; - } - - set - { - unchecked - { - dosTime = (uint)value; - } - - known |= Known.Time; - } - } - - /// - /// Gets/Sets the time of last modification of the entry. - /// - /// - /// The property is updated to match this as far as possible. - /// - public DateTime DateTime - { - get - { - uint sec = Math.Min(59, 2 * (dosTime & 0x1f)); - uint min = Math.Min(59, (dosTime >> 5) & 0x3f); - uint hrs = Math.Min(23, (dosTime >> 11) & 0x1f); - uint mon = Math.Max(1, Math.Min(12, ((dosTime >> 21) & 0xf))); - uint year = ((dosTime >> 25) & 0x7f) + 1980; - int day = Math.Max(1, Math.Min(DateTime.DaysInMonth((int)year, (int)mon), (int)((dosTime >> 16) & 0x1f))); - return new System.DateTime((int)year, (int)mon, day, (int)hrs, (int)min, (int)sec); - } - - set - { - var year = (uint)value.Year; - var month = (uint)value.Month; - var day = (uint)value.Day; - var hour = (uint)value.Hour; - var minute = (uint)value.Minute; - var second = (uint)value.Second; - - if (year < 1980) - { - year = 1980; - month = 1; - day = 1; - hour = 0; - minute = 0; - second = 0; - } - else if (year > 2107) - { - year = 2107; - month = 12; - day = 31; - hour = 23; - minute = 59; - second = 59; - } - - DosTime = ((year - 1980) & 0x7f) << 25 | - (month << 21) | - (day << 16) | - (hour << 11) | - (minute << 5) | - (second >> 1); - } - } - - /// - /// Returns the entry name. - /// - /// - /// The unix naming convention is followed. - /// Path components in the entry should always separated by forward slashes ('/'). - /// Dos device names like C: should also be removed. - /// See the class, or - /// - public string Name - { - get - { - return name; - } - } - - /// - /// Gets/Sets the size of the uncompressed data. - /// - /// - /// The size or -1 if unknown. - /// - /// Setting the size before adding an entry to an archive can help - /// avoid compatability problems with some archivers which dont understand Zip64 extensions. - public long Size - { - get - { - return (known & Known.Size) != 0 ? (long)size : -1L; - } - set - { - size = (ulong)value; - known |= Known.Size; - } - } - - /// - /// Gets/Sets the size of the compressed data. - /// - /// - /// The compressed entry size or -1 if unknown. - /// - public long CompressedSize - { - get - { - return (known & Known.CompressedSize) != 0 ? (long)compressedSize : -1L; - } - set - { - compressedSize = (ulong)value; - known |= Known.CompressedSize; - } - } - - /// - /// Gets/Sets the crc of the uncompressed data. - /// - /// - /// Crc is not in the range 0..0xffffffffL - /// - /// - /// The crc value or -1 if unknown. - /// - public long Crc - { - get - { - return (known & Known.Crc) != 0 ? crc & 0xffffffffL : -1L; - } - set - { - if ((crc & 0xffffffff00000000L) != 0) - throw new ArgumentOutOfRangeException(nameof(value)); - - crc = (uint)value; - known |= Known.Crc; - } - } - - /// - /// Gets/Sets the compression method. Only Deflated and Stored are supported. - /// - /// - /// The compression method for this entry - /// - /// - /// - public CompressionMethod CompressionMethod - { - get - { - return method; - } - - set - { - if (!IsCompressionMethodSupported(value)) - throw new NotSupportedException("Compression method not supported"); - - method = value; - } - } - - /// - /// Gets/Sets the extra data. - /// - /// - /// Extra data is longer than 64KB (0xffff) bytes. - /// - /// - /// Extra data or null if not set. - /// - public byte[] ExtraData - { - - get - { - // TODO: This is slightly safer but less efficient. Think about wether it should change. - // return (byte[]) extra.Clone(); - return extra; - } - - set - { - if (value == null) - extra = null; - else - { - if (value.Length > 0xffff) - throw new ArgumentOutOfRangeException(nameof(value)); - - extra = new byte[value.Length]; - Array.Copy(value, 0, extra, 0, value.Length); - } - } - } - - /// - /// Process extra data fields updating the entry based on the contents. - /// - /// True if the extra data fields should be handled - /// for a local header, rather than for a central header. - /// - internal void ProcessExtraData(bool localHeader) - { - var extraData = new ZipExtraData(extra); - - if (extraData.Find(0x0001)) - { - // Version required to extract is ignored here as some archivers dont set it correctly - // in theory it should be version 45 or higher - - // The recorded size will change but remember that this is zip64. - forceZip64_ = true; - - if (extraData.ValueLength < 4) - throw new ZipException("Extra data extended Zip64 information length is invalid"); - - // (localHeader ||) was deleted, because actually there is no specific difference with reading sizes between local header & central directory - // https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT - // ... - // 4.4 Explanation of fields - // ... - // 4.4.8 compressed size: (4 bytes) - // 4.4.9 uncompressed size: (4 bytes) - // - // The size of the file compressed (4.4.8) and uncompressed, - // (4.4.9) respectively. When a decryption header is present it - // will be placed in front of the file data and the value of the - // compressed file size will include the bytes of the decryption - // header. If bit 3 of the general purpose bit flag is set, - // these fields are set to zero in the local header and the - // correct values are put in the data descriptor and - // in the central directory. If an archive is in ZIP64 format - // and the value in this field is 0xFFFFFFFF, the size will be - // in the corresponding 8 byte ZIP64 extended information - // extra field. When encrypting the central directory, if the - // local header is not in ZIP64 format and general purpose bit - // flag 13 is set indicating masking, the value stored for the - // uncompressed size in the Local Header will be zero. - // - // Othewise there is problem with minizip implementation - if (size == uint.MaxValue) - size = (ulong)extraData.ReadLong(); - - if (compressedSize == uint.MaxValue) - compressedSize = (ulong)extraData.ReadLong(); - - if (!localHeader && (offset == uint.MaxValue)) - offset = extraData.ReadLong(); - - // Disk number on which file starts is ignored - } - else if (((versionToExtract & 0xff) >= ZipConstants.VersionZip64) && - (size == uint.MaxValue || compressedSize == uint.MaxValue)) - throw new ZipException("Zip64 Extended information required but is missing."); - - DateTime = GetDateTime(extraData); - } - - private DateTime GetDateTime(ZipExtraData extraData) - { - // Check for Unix timestamp - ExtendedUnixData unixData = extraData.GetData(); - if (unixData != null && - // Only apply modification time, but require all other values to be present - // This is done to match InfoZIP's behaviour - ((unixData.Include & ExtendedUnixData.Flags.ModificationTime) != 0) && - ((unixData.Include & ExtendedUnixData.Flags.AccessTime) != 0) && - ((unixData.Include & ExtendedUnixData.Flags.CreateTime) != 0)) - return unixData.ModificationTime; - - // Fall back to DOS time - uint sec = Math.Min(59, 2 * (dosTime & 0x1f)); - uint min = Math.Min(59, (dosTime >> 5) & 0x3f); - uint hrs = Math.Min(23, (dosTime >> 11) & 0x1f); - uint mon = Math.Max(1, Math.Min(12, ((dosTime >> 21) & 0xf))); - uint year = ((dosTime >> 25) & 0x7f) + 1980; - int day = Math.Max(1, Math.Min(DateTime.DaysInMonth((int)year, (int)mon), (int)((dosTime >> 16) & 0x1f))); - return new DateTime((int)year, (int)mon, day, (int)hrs, (int)min, (int)sec, DateTimeKind.Utc); - } - - /// - /// Gets/Sets the entry comment. - /// - /// - /// If comment is longer than 0xffff. - /// - /// - /// The comment or null if not set. - /// - /// - /// A comment is only available for entries when read via the class. - /// The class doesnt have the comment data available. - /// - public string Comment - { - get - { - return comment; - } - set - { - // This test is strictly incorrect as the length is in characters - // while the storage limit is in bytes. - // While the test is partially correct in that a comment of this length or greater - // is definitely invalid, shorter comments may also have an invalid length - // where there are multi-byte characters - // The full test is not possible here however as the code page to apply conversions with - // isnt available. - if ((value != null) && (value.Length > 0xffff)) - throw new ArgumentOutOfRangeException(nameof(value), "cannot exceed 65535"); - - comment = value; - } - } - - /// - /// Gets a value indicating if the entry is a directory. - /// however. - /// - /// - /// A directory is determined by an entry name with a trailing slash '/'. - /// The external file attributes can also indicate an entry is for a directory. - /// Currently only dos/windows attributes are tested in this manner. - /// The trailing slash convention should always be followed. - /// - public bool IsDirectory - { - get - { - int nameLength = name.Length; - return ((nameLength > 0) && - ((name[nameLength - 1] == '/') || (name[nameLength - 1] == '\\'))) || - HasDosAttributes(16); - } - } - - /// - /// Get a value of true if the entry appears to be a file; false otherwise - /// - /// - /// This only takes account of DOS/Windows attributes. Other operating systems are ignored. - /// For linux and others the result may be incorrect. - /// - public bool IsFile - { - get - { - return !IsDirectory && !HasDosAttributes(8); - } - } - - /// - /// Test entry to see if data can be extracted. - /// - /// Returns true if data can be extracted for this entry; false otherwise. - public bool IsCompressionMethodSupported() => IsCompressionMethodSupported(CompressionMethod); - - #region ICloneable Members - /// - /// Creates a copy of this zip entry. - /// - /// An that is a copy of the current instance. - public object Clone() - { - var result = (ZipEntry)MemberwiseClone(); - - // Ensure extra data is unique if it exists. - if (extra != null) - { - result.extra = new byte[extra.Length]; - Array.Copy(extra, 0, result.extra, 0, extra.Length); - } - - return result; - } - - #endregion - - /// - /// Gets a string representation of this ZipEntry. - /// - /// A readable textual representation of this - public override string ToString() => name; - - /// - /// Test a compression method to see if this library - /// supports extracting data compressed with that method - /// - /// The compression method to test. - /// Returns true if the compression method is supported; false otherwise - public static bool IsCompressionMethodSupported(CompressionMethod method) - { - return - (method == CompressionMethod.Deflated) || - (method == CompressionMethod.Stored); - } - - /// - /// Cleans a name making it conform to Zip file conventions. - /// Devices names ('c:\') and UNC share names ('\\server\share') are removed - /// and forward slashes ('\') are converted to back slashes ('/'). - /// Names are made relative by trimming leading slashes which is compatible - /// with the ZIP naming convention. - /// - /// The name to clean - /// The 'cleaned' name. - /// - /// The Zip name transform class is more flexible. - /// - public static string CleanName(string name) - { - if (name == null) - return string.Empty; - - if (Path.IsPathRooted(name)) - // NOTE: - // for UNC names... \\machine\share\zoom\beet.txt gives \zoom\beet.txt - name = name.Substring(Path.GetPathRoot(name).Length); - - name = name.Replace(@"\", "/"); - - while ((name.Length > 0) && (name[0] == '/')) - name = name.Remove(0, 1); - - return name; - } - - #region Instance Fields - Known known; - int externalFileAttributes = -1; // contains external attributes (O/S dependant) - - ushort versionMadeBy; // Contains host system and version information - // only relevant for central header entries - - string name; - ulong size; - ulong compressedSize; - ushort versionToExtract; // Version required to extract (library handles <= 2.0) - uint crc; - uint dosTime; - - CompressionMethod method = CompressionMethod.Deflated; - byte[] extra; - string comment; - - int flags; // general purpose bit flags - - long zipFileIndex = -1; // used by ZipFile - long offset; // used by ZipFile and ZipOutputStream - - bool forceZip64_; - #endregion - } -} diff --git a/UpdateLib/UpdateLib/Compression/Zip/ZipException.cs b/UpdateLib/UpdateLib/Compression/Zip/ZipException.cs deleted file mode 100644 index 646fbdc..0000000 --- a/UpdateLib/UpdateLib/Compression/Zip/ZipException.cs +++ /dev/null @@ -1,51 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -using System; - -namespace MatthiWare.UpdateLib.Compression.Zip -{ - - [Serializable] - public class ZipException : Exception - { - public ZipException() { } - public ZipException(string message) : base(message) { } - public ZipException(string message, Exception inner) : base(message, inner) { } - protected ZipException( - System.Runtime.Serialization.SerializationInfo info, - System.Runtime.Serialization.StreamingContext context) : base(info, context) { } - } -} diff --git a/UpdateLib/UpdateLib/Compression/Zip/ZipExtraData.cs b/UpdateLib/UpdateLib/Compression/Zip/ZipExtraData.cs deleted file mode 100644 index 627bbda..0000000 --- a/UpdateLib/UpdateLib/Compression/Zip/ZipExtraData.cs +++ /dev/null @@ -1,970 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -using System; -using System.IO; - -namespace MatthiWare.UpdateLib.Compression.Zip -{ - // TODO: Sort out wether tagged data is useful and what a good implementation might look like. - // Its just a sketch of an idea at the moment. - - /// - /// ExtraData tagged value interface. - /// - public interface ITaggedData - { - /// - /// Get the ID for this tagged data value. - /// - short TagID { get; } - - /// - /// Set the contents of this instance from the data passed. - /// - /// The data to extract contents from. - /// The offset to begin extracting data from. - /// The number of bytes to extract. - void SetData(byte[] data, int offset, int count); - - /// - /// Get the data representing this instance. - /// - /// Returns the data for this instance. - byte[] GetData(); - } - - /// - /// A raw binary tagged value - /// - public class RawTaggedData : ITaggedData - { - /// - /// Initialise a new instance. - /// - /// The tag ID. - public RawTaggedData(short tag) - { - _tag = tag; - } - - #region ITaggedData Members - - /// - /// Get the ID for this tagged data value. - /// - public short TagID - { - get { return _tag; } - set { _tag = value; } - } - - /// - /// Set the data from the raw values provided. - /// - /// The raw data to extract values from. - /// The index to start extracting values from. - /// The number of bytes available. - public void SetData(byte[] data, int offset, int count) - { - if (data == null) - throw new ArgumentNullException(nameof(data)); - - _data = new byte[count]; - Array.Copy(data, offset, _data, 0, count); - } - - /// - /// Get the binary data representing this instance. - /// - /// The raw binary data representing this instance. - public byte[] GetData() => _data; - - #endregion - - /// - /// Get /set the binary data representing this instance. - /// - /// The raw binary data representing this instance. - public byte[] Data - { - get { return _data; } - set { _data = value; } - } - - #region Instance Fields - /// - /// The tag ID for this instance. - /// - short _tag; - - byte[] _data; - #endregion - } - - /// - /// Class representing extended unix date time values. - /// - public class ExtendedUnixData : ITaggedData - { - /// - /// Flags indicate which values are included in this instance. - /// - [Flags] - public enum Flags : byte - { - /// - /// The modification time is included - /// - ModificationTime = 0x01, - - /// - /// The access time is included - /// - AccessTime = 0x02, - - /// - /// The create time is included. - /// - CreateTime = 0x04, - } - - #region ITaggedData Members - - /// - /// Get the ID - /// - public short TagID - { - get { return 0x5455; } - } - - /// - /// Set the data from the raw values provided. - /// - /// The raw data to extract values from. - /// The index to start extracting values from. - /// The number of bytes available. - public void SetData(byte[] data, int index, int count) - { - using (MemoryStream ms = new MemoryStream(data, index, count, false)) - using (ZipHelperStream helperStream = new ZipHelperStream(ms)) - { - // bit 0 if set, modification time is present - // bit 1 if set, access time is present - // bit 2 if set, creation time is present - - _flags = (Flags)helperStream.ReadByte(); - if (((_flags & Flags.ModificationTime) != 0)) - { - int iTime = helperStream.ReadLEInt(); - - _modificationTime = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc) + - new TimeSpan(0, 0, 0, iTime, 0); - - // Central-header version is truncated after modification time - if (count <= 5) return; - } - - if ((_flags & Flags.AccessTime) != 0) - { - int iTime = helperStream.ReadLEInt(); - - _lastAccessTime = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc) + - new TimeSpan(0, 0, 0, iTime, 0); - } - - if ((_flags & Flags.CreateTime) != 0) - { - int iTime = helperStream.ReadLEInt(); - - _createTime = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc) + - new TimeSpan(0, 0, 0, iTime, 0); - } - } - } - - /// - /// Get the binary data representing this instance. - /// - /// The raw binary data representing this instance. - public byte[] GetData() - { - using (MemoryStream ms = new MemoryStream()) - using (ZipHelperStream helperStream = new ZipHelperStream(ms)) - { - helperStream.IsStreamOwner = false; - helperStream.WriteByte((byte)_flags); // Flags - - if ((_flags & Flags.ModificationTime) != 0) - { - TimeSpan span = _modificationTime - new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc); - var seconds = (int)span.TotalSeconds; - helperStream.WriteLEInt(seconds); - } - - if ((_flags & Flags.AccessTime) != 0) - { - TimeSpan span = _lastAccessTime - new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc); - var seconds = (int)span.TotalSeconds; - helperStream.WriteLEInt(seconds); - } - - if ((_flags & Flags.CreateTime) != 0) - { - TimeSpan span = _createTime - new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc); - var seconds = (int)span.TotalSeconds; - helperStream.WriteLEInt(seconds); - } - - return ms.ToArray(); - } - } - - #endregion - - /// - /// Test a value to see if is valid and can be represented here. - /// - /// The value to test. - /// Returns true if the value is valid and can be represented; false if not. - /// The standard Unix time is a signed integer data type, directly encoding the Unix time number, - /// which is the number of seconds since 1970-01-01. - /// Being 32 bits means the values here cover a range of about 136 years. - /// The minimum representable time is 1901-12-13 20:45:52, - /// and the maximum representable time is 2038-01-19 03:14:07. - /// - public static bool IsValidValue(DateTime value) - { - return ((value >= new DateTime(1901, 12, 13, 20, 45, 52)) || - (value <= new DateTime(2038, 1, 19, 03, 14, 07))); - } - - /// - /// Get /set the Modification Time - /// - /// - /// - public DateTime ModificationTime - { - get { return _modificationTime; } - set - { - if (!IsValidValue(value)) - throw new ArgumentOutOfRangeException(nameof(value)); - - _flags |= Flags.ModificationTime; - _modificationTime = value; - } - } - - /// - /// Get / set the Access Time - /// - /// - /// - public DateTime AccessTime - { - get { return _lastAccessTime; } - set - { - if (!IsValidValue(value)) - throw new ArgumentOutOfRangeException(nameof(value)); - - _flags |= Flags.AccessTime; - _lastAccessTime = value; - } - } - - /// - /// Get / Set the Create Time - /// - /// - /// - public DateTime CreateTime - { - get { return _createTime; } - set - { - if (!IsValidValue(value)) - throw new ArgumentOutOfRangeException(nameof(value)); - - _flags |= Flags.CreateTime; - _createTime = value; - } - } - - /// - /// Get/set the values to include. - /// - public Flags Include - { - get { return _flags; } - set { _flags = value; } - } - - #region Instance Fields - Flags _flags; - DateTime _modificationTime = new DateTime(1970, 1, 1); - DateTime _lastAccessTime = new DateTime(1970, 1, 1); - DateTime _createTime = new DateTime(1970, 1, 1); - #endregion - } - - /// - /// Class handling NT date time values. - /// - public class NTTaggedData : ITaggedData - { - /// - /// Get the ID for this tagged data value. - /// - public short TagID - { - get { return 10; } - } - - /// - /// Set the data from the raw values provided. - /// - /// The raw data to extract values from. - /// The index to start extracting values from. - /// The number of bytes available. - public void SetData(byte[] data, int index, int count) - { - using (MemoryStream ms = new MemoryStream(data, index, count, false)) - using (ZipHelperStream helperStream = new ZipHelperStream(ms)) - { - helperStream.ReadLEInt(); // Reserved - while (helperStream.Position < helperStream.Length) - { - int ntfsTag = helperStream.ReadLEShort(); - int ntfsLength = helperStream.ReadLEShort(); - - if (ntfsTag == 1) - { - if (ntfsLength >= 24) - { - long lastModificationTicks = helperStream.ReadLELong(); - _lastModificationTime = DateTime.FromFileTimeUtc(lastModificationTicks); - - long lastAccessTicks = helperStream.ReadLELong(); - _lastAccessTime = DateTime.FromFileTimeUtc(lastAccessTicks); - - long createTimeTicks = helperStream.ReadLELong(); - _createTime = DateTime.FromFileTimeUtc(createTimeTicks); - } - - break; - } - else - { - // An unknown NTFS tag so simply skip it. - helperStream.Seek(ntfsLength, SeekOrigin.Current); - } - } - } - } - - /// - /// Get the binary data representing this instance. - /// - /// The raw binary data representing this instance. - public byte[] GetData() - { - using (MemoryStream ms = new MemoryStream()) - using (ZipHelperStream helperStream = new ZipHelperStream(ms)) - { - helperStream.IsStreamOwner = false; - helperStream.WriteLEInt(0); // Reserved - helperStream.WriteLEShort(1); // Tag - helperStream.WriteLEShort(24); // Length = 3 x 8. - helperStream.WriteLELong(_lastModificationTime.ToFileTimeUtc()); - helperStream.WriteLELong(_lastAccessTime.ToFileTimeUtc()); - helperStream.WriteLELong(_createTime.ToFileTimeUtc()); - - return ms.ToArray(); - } - } - - /// - /// Test a valuie to see if is valid and can be represented here. - /// - /// The value to test. - /// Returns true if the value is valid and can be represented; false if not. - /// - /// NTFS filetimes are 64-bit unsigned integers, stored in Intel - /// (least significant byte first) byte order. They determine the - /// number of 1.0E-07 seconds (1/10th microseconds!) past WinNT "epoch", - /// which is "01-Jan-1601 00:00:00 UTC". 28 May 60056 is the upper limit - /// - public static bool IsValidValue(DateTime value) - { - bool result = true; - - try - { - value.ToFileTimeUtc(); - } - catch - { - result = false; - } - - return result; - } - - /// - /// Get/set the last modification time. - /// - public DateTime LastModificationTime - { - get { return _lastModificationTime; } - set - { - if (!IsValidValue(value)) - throw new ArgumentOutOfRangeException(nameof(value)); - - _lastModificationTime = value; - } - } - - /// - /// Get /set the create time - /// - public DateTime CreateTime - { - get { return _createTime; } - set - { - if (!IsValidValue(value)) - throw new ArgumentOutOfRangeException(nameof(value)); - - _createTime = value; - } - } - - /// - /// Get /set the last access time. - /// - public DateTime LastAccessTime - { - get { return _lastAccessTime; } - set - { - if (!IsValidValue(value)) - throw new ArgumentOutOfRangeException(nameof(value)); - - _lastAccessTime = value; - } - } - - #region Instance Fields - DateTime _lastAccessTime = DateTime.FromFileTimeUtc(0); - DateTime _lastModificationTime = DateTime.FromFileTimeUtc(0); - DateTime _createTime = DateTime.FromFileTimeUtc(0); - #endregion - } - - /// - /// A factory that creates tagged data instances. - /// - interface ITaggedDataFactory - { - /// - /// Get data for a specific tag value. - /// - /// The tag ID to find. - /// The data to search. - /// The offset to begin extracting data from. - /// The number of bytes to extract. - /// The located value found, or null if not found. - ITaggedData Create(short tag, byte[] data, int offset, int count); - } - - /// - /// - /// A class to handle the extra data field for Zip entries - /// - /// - /// Extra data contains 0 or more values each prefixed by a header tag and length. - /// They contain zero or more bytes of actual data. - /// The data is held internally using a copy on write strategy. This is more efficient but - /// means that for extra data created by passing in data can have the values modified by the caller - /// in some circumstances. - /// - sealed public class ZipExtraData : IDisposable - { - #region Constructors - /// - /// Initialise a default instance. - /// - public ZipExtraData() - { - Clear(); - } - - /// - /// Initialise with known extra data. - /// - /// The extra data. - public ZipExtraData(byte[] data) - { - _data = data ?? new byte[0]; - } - #endregion - - /// - /// Get the raw extra data value - /// - /// Returns the raw byte[] extra data this instance represents. - public byte[] GetEntryData() - { - if (Length > ushort.MaxValue) - throw new ZipException("Data exceeds maximum length"); - - return (byte[])_data.Clone(); - } - - /// - /// Clear the stored data. - /// - public void Clear() - { - if ((_data == null) || (_data.Length != 0)) - _data = new byte[0]; - } - - /// - /// Gets the current extra data length. - /// - public int Length - { - get { return _data.Length; } - } - - /// - /// Get a read-only for the associated tag. - /// - /// The tag to locate data for. - /// Returns a containing tag data or null if no tag was found. - public Stream GetStreamForTag(int tag) - { - Stream result = null; - - if (Find(tag)) - result = new MemoryStream(_data, _index, _readValueLength, false); - - return result; - } - - /// - /// Get the tagged data for a tag. - /// - /// The tag to search for. - /// Returns a tagged value or null if none found. - public T GetData() - where T : class, ITaggedData, new() - { - T result = new T(); - - if (!Find(result.TagID)) - return default(T); - - result.SetData(_data, _readValueStart, _readValueLength); - - return result; - } - - /// - /// Get the length of the last value found by - /// - /// This is only valid if has previously returned true. - public int ValueLength - { - get { return _readValueLength; } - } - - /// - /// Get the index for the current read value. - /// - /// This is only valid if has previously returned true. - /// Initially the result will be the index of the first byte of actual data. The value is updated after calls to - /// , and . - public int CurrentReadIndex - { - get { return _index; } - } - - /// - /// Get the number of bytes remaining to be read for the current value; - /// - public int UnreadCount - { - get - { - if ((_readValueStart > _data.Length) || - (_readValueStart < 4)) - throw new ZipException("Find must be called before calling a Read method"); - - return _readValueStart + _readValueLength - _index; - } - } - - /// - /// Find an extra data value - /// - /// The identifier for the value to find. - /// Returns true if the value was found; false otherwise. - public bool Find(int headerID) - { - _readValueStart = _data.Length; - _readValueLength = 0; - _index = 0; - - int localLength = _readValueStart; - int localTag = headerID - 1; - - // Trailing bytes that cant make up an entry (as there arent enough - // bytes for a tag and length) are ignored! - while ((localTag != headerID) && (_index < _data.Length - 3)) - { - localTag = ReadShortInternal(); - localLength = ReadShortInternal(); - - if (localTag != headerID) - _index += localLength; - } - - bool result = (localTag == headerID) && ((_index + localLength) <= _data.Length); - - if (result) - { - _readValueStart = _index; - _readValueLength = localLength; - } - - return result; - } - - /// - /// Add a new entry to extra data. - /// - /// The value to add. - public void AddEntry(ITaggedData taggedData) - { - if (taggedData == null) - throw new ArgumentNullException(nameof(taggedData)); - - AddEntry(taggedData.TagID, taggedData.GetData()); - } - - /// - /// Add a new entry to extra data - /// - /// The ID for this entry. - /// The data to add. - /// If the ID already exists its contents are replaced. - public void AddEntry(int headerID, byte[] fieldData) - { - if ((headerID > ushort.MaxValue) || (headerID < 0)) - throw new ArgumentOutOfRangeException(nameof(headerID)); - - int addLength = (fieldData == null) ? 0 : fieldData.Length; - - if (addLength > ushort.MaxValue) - throw new ArgumentOutOfRangeException(nameof(fieldData), "exceeds maximum length"); - - // Test for new length before adjusting data. - int newLength = _data.Length + addLength + 4; - - if (Find(headerID)) - newLength -= (ValueLength + 4); - - if (newLength > ushort.MaxValue) - throw new ZipException("Data exceeds maximum length"); - - Delete(headerID); - - byte[] newData = new byte[newLength]; - _data.CopyTo(newData, 0); - - int index = _data.Length; - _data = newData; - - SetShort(ref index, headerID); - SetShort(ref index, addLength); - - if (fieldData != null) - fieldData.CopyTo(newData, index); - } - - /// - /// Start adding a new entry. - /// - /// Add data using , , , or . - /// The new entry is completed and actually added by calling - /// - public void StartNewEntry() - { - _newEntry = new MemoryStream(); - } - - /// - /// Add entry data added since using the ID passed. - /// - /// The identifier to use for this entry. - public void AddNewEntry(int headerID) - { - byte[] newData = _newEntry.ToArray(); - _newEntry = null; - AddEntry(headerID, newData); - } - - /// - /// Add a byte of data to the pending new entry. - /// - /// The byte to add. - /// - public void AddData(byte data) - { - _newEntry.WriteByte(data); - } - - /// - /// Add data to a pending new entry. - /// - /// The data to add. - /// - public void AddData(byte[] data) - { - if (data == null) - throw new ArgumentNullException(nameof(data)); - - _newEntry.Write(data, 0, data.Length); - } - - /// - /// Add a short value in little endian order to the pending new entry. - /// - /// The data to add. - /// - public void AddLeShort(int toAdd) - { - unchecked - { - _newEntry.WriteByte((byte)toAdd); - _newEntry.WriteByte((byte)(toAdd >> 8)); - } - } - - /// - /// Add an integer value in little endian order to the pending new entry. - /// - /// The data to add. - /// - public void AddLeInt(int toAdd) - { - unchecked - { - AddLeShort((short)toAdd); - AddLeShort((short)(toAdd >> 16)); - } - } - - /// - /// Add a long value in little endian order to the pending new entry. - /// - /// The data to add. - /// - public void AddLeLong(long toAdd) - { - unchecked - { - AddLeInt((int)(toAdd & 0xffffffff)); - AddLeInt((int)(toAdd >> 32)); - } - } - - /// - /// Delete an extra data field. - /// - /// The identifier of the field to delete. - /// Returns true if the field was found and deleted. - public bool Delete(int headerID) - { - bool result = false; - - if (Find(headerID)) - { - result = true; - int trueStart = _readValueStart - 4; - - byte[] newData = new byte[_data.Length - (ValueLength + 4)]; - Array.Copy(_data, 0, newData, 0, trueStart); - - int trueEnd = trueStart + ValueLength + 4; - Array.Copy(_data, trueEnd, newData, trueStart, _data.Length - trueEnd); - _data = newData; - } - - return result; - } - - #region Reading Support - /// - /// Read a long in little endian form from the last found data value - /// - /// Returns the long value read. - public long ReadLong() - { - ReadCheck(8); - return (ReadInt() & 0xffffffff) | (((long)ReadInt()) << 32); - } - - /// - /// Read an integer in little endian form from the last found data value. - /// - /// Returns the integer read. - public int ReadInt() - { - ReadCheck(4); - - int result = _data[_index] + (_data[_index + 1] << 8) + - (_data[_index + 2] << 16) + (_data[_index + 3] << 24); - - _index += 4; - - return result; - } - - /// - /// Read a short value in little endian form from the last found data value. - /// - /// Returns the short value read. - public int ReadShort() - { - ReadCheck(2); - - int result = _data[_index] + (_data[_index + 1] << 8); - _index += 2; - - return result; - } - - /// - /// Read a byte from an extra data - /// - /// The byte value read or -1 if the end of data has been reached. - public int ReadByte() - { - int result = -1; - - if ((_index < _data.Length) && (_readValueStart + _readValueLength > _index)) - result = _data[_index++]; - - return result; - } - - /// - /// Skip data during reading. - /// - /// The number of bytes to skip. - public void Skip(int amount) - { - ReadCheck(amount); - _index += amount; - } - - void ReadCheck(int length) - { - if ((_readValueStart > _data.Length) || - (_readValueStart < 4)) - throw new ZipException("Find must be called before calling a Read method"); - - if (_index > _readValueStart + _readValueLength - length) - throw new ZipException("End of extra data"); - - if (_index + length < 4) - throw new ZipException("Cannot read before start of tag"); - } - - /// - /// Internal form of that reads data at any location. - /// - /// Returns the short value read. - int ReadShortInternal() - { - if (_index > _data.Length - 2) - throw new ZipException("End of extra data"); - - int result = _data[_index++] + (_data[_index++] << 8); - - return result; - } - - void SetShort(ref int index, int source) - { - _data[index++] = (byte)source; - _data[index++] = (byte)(source >> 8); - } - - #endregion - - #region IDisposable Members - - /// - /// Dispose of this instance. - /// - public void Dispose() - { - if (_newEntry != null) - { - _newEntry.Dispose(); - } - } - - #endregion - - #region Instance Fields - int _index; - int _readValueStart; - int _readValueLength; - - MemoryStream _newEntry; - byte[] _data; - #endregion - } -} diff --git a/UpdateLib/UpdateLib/Compression/Zip/ZipFile.cs b/UpdateLib/UpdateLib/Compression/Zip/ZipFile.cs deleted file mode 100644 index 44140ef..0000000 --- a/UpdateLib/UpdateLib/Compression/Zip/ZipFile.cs +++ /dev/null @@ -1,566 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors -* -* Permission is hereby granted, free of charge, to any person obtaining a copy of this -* software and associated documentation files (the "Software"), to deal in the Software -* without restriction, including without limitation the rights to use, copy, modify, merge, -* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -* to whom the Software is furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in all copies or -* substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -* PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -* FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -* DEALINGS IN THE SOFTWARE. -*/ - -using System; -using System.Collections; -using System.IO; -using System.Runtime.CompilerServices; - -using MatthiWare.UpdateLib.Utils; - -namespace MatthiWare.UpdateLib.Compression.Zip -{ - #region ZipFile Class - /// - /// This class represents a Zip archive. You can ask for the contained - /// entries, or get an input stream for a file entry. The entry is - /// automatically decompressed. - /// - /// You can also update the archive adding or deleting entries. - /// - /// This class is thread safe for input: You can open input streams for arbitrary - /// entries in different threads. - ///
- ///
Author of the original java version : Jochen Hoenicke - ///
- /// - /// - /// using System; - /// using System.Text; - /// using System.Collections; - /// using System.IO; - /// - /// using ICSharpCode.SharpZipLib.Zip; - /// - /// class MainClass - /// { - /// static public void Main(string[] args) - /// { - /// using (ZipFile zFile = new ZipFile(args[0])) { - /// Console.WriteLine("Listing of : " + zFile.Name); - /// Console.WriteLine(""); - /// Console.WriteLine("Raw Size Size Date Time Name"); - /// Console.WriteLine("-------- -------- -------- ------ ---------"); - /// foreach (ZipEntry e in zFile) { - /// if ( e.IsFile ) { - /// DateTime d = e.DateTime; - /// Console.WriteLine("{0, -10}{1, -10}{2} {3} {4}", e.Size, e.CompressedSize, - /// d.ToString("dd-MM-yy"), d.ToString("HH:mm"), - /// e.Name); - /// } - /// } - /// } - /// } - /// } - /// - /// - public class ZipFile : IEnumerable, IDisposable - { - #region Constructors - - /// - /// Opens a Zip file reading the given . - /// - /// The to read archive data from. - /// The supplied argument is null. - /// - /// An i/o error occurs. - /// - /// - /// The file doesn't contain a valid zip archive. - /// - public ZipFile(FileStream file) - { - if (file == null) - throw new ArgumentNullException(nameof(file)); - - if (!file.CanSeek) - throw new ArgumentException("Stream is not seekable", nameof(file)); - - baseStream_ = file; - name_ = file.Name; - isStreamOwner = true; - - try - { - ReadEntries(); - } - catch - { - DisposeInternal(true); - throw; - } - } - - #endregion - - #region Destructors and Closing - /// - /// Finalize this instance. - /// - ~ZipFile() - { - Dispose(false); - } - - /// - /// Closes the ZipFile. If the stream is owned then this also closes the underlying input stream. - /// Once closed, no further instance methods should be called. - /// - /// - /// An i/o error occurs. - /// - public void Close() - { - DisposeInternal(true); - GC.SuppressFinalize(this); - } - - #endregion - - #region Properties - /// - /// Get/set a flag indicating if the underlying stream is owned by the ZipFile instance. - /// If the flag is true then the stream will be closed when Close is called. - /// - /// - /// The default value is true in all cases. - /// - public bool IsStreamOwner - { - get { return isStreamOwner; } - set { isStreamOwner = value; } - } - - /// - /// Get the number of entries contained in this . - /// - public long Count - { - get - { - return entries_.Length; - } - } - - /// - /// Indexer property for ZipEntries - /// - [IndexerName("EntryByIndex")] - public ZipEntry this[int index] - { - get - { - return (ZipEntry)entries_[index].Clone(); - } - } - - #endregion - - #region Input Handling - /// - /// Gets an enumerator for the Zip entries in this Zip file. - /// - /// Returns an for this archive. - /// - /// The Zip file has been closed. - /// - public IEnumerator GetEnumerator() - { - if (isDisposed_) - { - throw new ObjectDisposedException("ZipFile"); - } - - return new ZipEntryEnumerator(entries_); - } - - /// - /// Return the index of the entry with a matching name - /// - /// Entry name to find - /// If true the comparison is case insensitive - /// The index position of the matching entry or -1 if not found - /// - /// The Zip file has been closed. - /// - public int FindEntry(string name, bool ignoreCase) - { - if (isDisposed_) - { - throw new ObjectDisposedException("ZipFile"); - } - - // TODO: This will be slow as the next ice age for huge archives! - for (int i = 0; i < entries_.Length; i++) - { - if (string.Compare(name, entries_[i].Name, ignoreCase ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal) == 0) - { - return i; - } - } - return -1; - } - - /// - /// Searches for a zip entry in this archive with the given name. - /// String comparisons are case insensitive - /// - /// - /// The name to find. May contain directory components separated by slashes ('/'). - /// - /// - /// A clone of the zip entry, or null if no entry with that name exists. - /// - /// - /// The Zip file has been closed. - /// - public ZipEntry GetEntry(string name) - { - if (isDisposed_) - { - throw new ObjectDisposedException("ZipFile"); - } - - int index = FindEntry(name, true); - return (index >= 0) ? (ZipEntry)entries_[index].Clone() : null; - } - - #endregion - - #endregion - - #region Disposing - - #region IDisposable Members - void IDisposable.Dispose() - { - Close(); - } - #endregion - - void DisposeInternal(bool disposing) - { - if (!isDisposed_) - { - isDisposed_ = true; - entries_ = new ZipEntry[0]; - - if (IsStreamOwner && (baseStream_ != null)) - lock (baseStream_) - baseStream_.Dispose(); - } - } - - /// - /// Releases the unmanaged resources used by the this instance and optionally releases the managed resources. - /// - /// true to release both managed and unmanaged resources; - /// false to release only unmanaged resources. - protected virtual void Dispose(bool disposing) - { - DisposeInternal(disposing); - } - - #endregion - - #region Internal routines - #region Reading - /// - /// Read an unsigned short in little endian byte order. - /// - /// Returns the value read. - /// - /// The stream ends prematurely - /// - ushort ReadLEUshort() - { - int data1 = baseStream_.ReadByte(); - - if (data1 < 0) - { - throw new EndOfStreamException("End of stream"); - } - - int data2 = baseStream_.ReadByte(); - - if (data2 < 0) - { - throw new EndOfStreamException("End of stream"); - } - - - return unchecked((ushort)((ushort)data1 | (ushort)(data2 << 8))); - } - - /// - /// Read a uint in little endian byte order. - /// - /// Returns the value read. - /// - /// An i/o error occurs. - /// - /// - /// The file ends prematurely - /// - uint ReadLEUint() - { - return (uint)(ReadLEUshort() | (ReadLEUshort() << 16)); - } - - ulong ReadLEUlong() - { - return ReadLEUint() | ((ulong)ReadLEUint() << 32); - } - - #endregion - // NOTE this returns the offset of the first byte after the signature. - long LocateBlockWithSignature(int signature, long endLocation, int minimumBlockSize, int maximumVariableData) - { - using (ZipHelperStream les = new ZipHelperStream(baseStream_)) - { - return les.LocateBlockWithSignature(signature, endLocation, minimumBlockSize, maximumVariableData); - } - } - - /// - /// Search for and read the central directory of a zip file filling the entries array. - /// - /// - /// An i/o error occurs. - /// - /// - /// The central directory is malformed or cannot be found - /// - void ReadEntries() - { - // Search for the End Of Central Directory. When a zip comment is - // present the directory will start earlier - // - // The search is limited to 64K which is the maximum size of a trailing comment field to aid speed. - // This should be compatible with both SFX and ZIP files but has only been tested for Zip files - // If a SFX file has the Zip data attached as a resource and there are other resources occuring later then - // this could be invalid. - // Could also speed this up by reading memory in larger blocks. - - if (baseStream_.CanSeek == false) - throw new ZipException("ZipFile stream must be seekable"); - - long locatedEndOfCentralDir = LocateBlockWithSignature(ZipConstants.EndOfCentralDirectorySignature, - baseStream_.Length, ZipConstants.EndOfCentralRecordBaseSize, 0xffff); - - if (locatedEndOfCentralDir < 0) - throw new ZipException("Cannot find central directory"); - - // Read end of central directory record - ushort thisDiskNumber = ReadLEUshort(); - ushort startCentralDirDisk = ReadLEUshort(); - ulong entriesForThisDisk = ReadLEUshort(); - ulong entriesForWholeCentralDir = ReadLEUshort(); - ulong centralDirSize = ReadLEUint(); - long offsetOfCentralDir = ReadLEUint(); - uint commentSize = ReadLEUshort(); - - comment_ = (commentSize > 0) ? - ZipConstants.ConvertToString(baseStream_.CheckedReadBytes((int)commentSize)) : - string.Empty; - - bool isZip64 = false; - - // Check if zip64 header information is required. - if ((thisDiskNumber == 0xffff) || - (startCentralDirDisk == 0xffff) || - (entriesForThisDisk == 0xffff) || - (entriesForWholeCentralDir == 0xffff) || - (centralDirSize == 0xffffffff) || - (offsetOfCentralDir == 0xffffffff)) - { - isZip64 = true; - - long offset = LocateBlockWithSignature(ZipConstants.Zip64CentralDirLocatorSignature, locatedEndOfCentralDir, 0, 0x1000); - if (offset < 0) - throw new ZipException("Cannot find Zip64 locator"); - - // number of the disk with the start of the zip64 end of central directory 4 bytes - // relative offset of the zip64 end of central directory record 8 bytes - // total number of disks 4 bytes - ReadLEUint(); // startDisk64 is not currently used - ulong offset64 = ReadLEUlong(); - uint totalDisks = ReadLEUint(); - - baseStream_.Position = (long)offset64; - long sig64 = ReadLEUint(); - - if (sig64 != ZipConstants.Zip64CentralFileHeaderSignature) - throw new ZipException(string.Format("Invalid Zip64 Central directory signature at {0:X}", offset64)); - - // NOTE: Record size = SizeOfFixedFields + SizeOfVariableData - 12. - ulong recordSize = ReadLEUlong(); - int versionMadeBy = ReadLEUshort(); - int versionToExtract = ReadLEUshort(); - uint thisDisk = ReadLEUint(); - uint centralDirDisk = ReadLEUint(); - entriesForThisDisk = ReadLEUlong(); - entriesForWholeCentralDir = ReadLEUlong(); - centralDirSize = ReadLEUlong(); - offsetOfCentralDir = (long)ReadLEUlong(); - - // NOTE: zip64 extensible data sector (variable size) is ignored. - } - - entries_ = new ZipEntry[entriesForThisDisk]; - - // SFX/embedded support, find the offset of the first entry vis the start of the stream - // This applies to Zip files that are appended to the end of an SFX stub. - // Or are appended as a resource to an executable. - // Zip files created by some archivers have the offsets altered to reflect the true offsets - // and so dont require any adjustment here... - // TODO: Difficulty with Zip64 and SFX offset handling needs resolution - maths? - if (!isZip64 && (offsetOfCentralDir < locatedEndOfCentralDir - (4 + (long)centralDirSize))) - { - offsetOfFirstEntry = locatedEndOfCentralDir - (4 + (long)centralDirSize + offsetOfCentralDir); - - if (offsetOfFirstEntry <= 0) - throw new ZipException("Invalid embedded zip archive"); - } - - baseStream_.Seek(offsetOfFirstEntry + offsetOfCentralDir, SeekOrigin.Begin); - - for (ulong i = 0; i < entriesForThisDisk; i++) - { - if (ReadLEUint() != ZipConstants.CentralHeaderSignature) - throw new ZipException("Wrong Central Directory signature"); - - int versionMadeBy = ReadLEUshort(); - int versionToExtract = ReadLEUshort(); - int bitFlags = ReadLEUshort(); - int method = ReadLEUshort(); - uint dostime = ReadLEUint(); - uint crc = ReadLEUint(); - var csize = (long)ReadLEUint(); - var size = (long)ReadLEUint(); - int nameLen = ReadLEUshort(); - int extraLen = ReadLEUshort(); - int commentLen = ReadLEUshort(); - - int diskStartNo = ReadLEUshort(); // Not currently used - int internalAttributes = ReadLEUshort(); // Not currently used - - uint externalAttributes = ReadLEUint(); - long offset = ReadLEUint(); - - byte[] buffer = new byte[Math.Max(nameLen, commentLen)]; - - baseStream_.CheckedReadBytes(buffer, 0, nameLen); - string name = ZipConstants.ConvertToStringExt(bitFlags, buffer, nameLen); - - var entry = new ZipEntry(name, versionToExtract, versionMadeBy, (CompressionMethod)method); - entry.Crc = crc & 0xffffffffL; - entry.Size = size & 0xffffffffL; - entry.CompressedSize = csize & 0xffffffffL; - entry.Flags = bitFlags; - entry.DosTime = dostime; - entry.ZipFileIndex = (long)i; - entry.Offset = offset; - entry.ExternalFileAttributes = (int)externalAttributes; - - if (extraLen > 0) - entry.ExtraData = baseStream_.CheckedReadBytes(extraLen); - - entry.ProcessExtraData(false); - - if (commentLen > 0) - { - baseStream_.CheckedReadBytes(buffer, 0, commentLen); - entry.Comment = ZipConstants.ConvertToStringExt(bitFlags, buffer, commentLen); - } - - entries_[i] = entry; - } - } - - #endregion - - #region Instance Fields - bool isDisposed_; - string name_; - string comment_; - Stream baseStream_; - bool isStreamOwner; - long offsetOfFirstEntry; - ZipEntry[] entries_; - #endregion - - #region Support Classes - - /// - /// An enumerator for Zip entries - /// - class ZipEntryEnumerator : IEnumerator - { - #region Constructors - public ZipEntryEnumerator(ZipEntry[] entries) - { - array = entries; - } - - #endregion - #region IEnumerator Members - public object Current - { - get - { - return array[index]; - } - } - - public void Reset() - { - index = -1; - } - - public bool MoveNext() - { - return (++index < array.Length); - } - #endregion - #region Instance Fields - ZipEntry[] array; - int index = -1; - #endregion - } - #endregion - } -} diff --git a/UpdateLib/UpdateLib/Compression/Zip/ZipHelperStream.cs b/UpdateLib/UpdateLib/Compression/Zip/ZipHelperStream.cs deleted file mode 100644 index 9ae6de7..0000000 --- a/UpdateLib/UpdateLib/Compression/Zip/ZipHelperStream.cs +++ /dev/null @@ -1,618 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -using System; -using System.IO; - -namespace MatthiWare.UpdateLib.Compression.Zip -{ - /// - /// Holds data pertinent to a data descriptor. - /// - public class DescriptorData - { - /// - /// Get /set the compressed size of data. - /// - public long CompressedSize - { - get { return compressedSize; } - set { compressedSize = value; } - } - - /// - /// Get / set the uncompressed size of data - /// - public long Size - { - get { return size; } - set { size = value; } - } - - /// - /// Get /set the crc value. - /// - public long Crc - { - get { return crc; } - set { crc = (value & 0xffffffff); } - } - - #region Instance Fields - long size; - long compressedSize; - long crc; - #endregion - } - - class EntryPatchData - { - public long SizePatchOffset - { - get { return sizePatchOffset_; } - set { sizePatchOffset_ = value; } - } - - public long CrcPatchOffset - { - get { return crcPatchOffset_; } - set { crcPatchOffset_ = value; } - } - - #region Instance Fields - long sizePatchOffset_; - long crcPatchOffset_; - #endregion - } - - /// - /// This class assists with writing/reading from Zip files. - /// - internal class ZipHelperStream : Stream - { - #region Constructors - /// - /// Initialise an instance of this class. - /// - /// The name of the file to open. - public ZipHelperStream(string name) - { - stream_ = new FileStream(name, FileMode.Open, FileAccess.ReadWrite); - isOwner_ = true; - } - - /// - /// Initialise a new instance of . - /// - /// The stream to use. - public ZipHelperStream(Stream stream) - { - stream_ = stream; - } - #endregion - - /// - /// Get / set a value indicating wether the the underlying stream is owned or not. - /// - /// If the stream is owned it is closed when this instance is closed. - public bool IsStreamOwner - { - get { return isOwner_; } - set { isOwner_ = value; } - } - - #region Base Stream Methods - public override bool CanRead - { - get { return stream_.CanRead; } - } - - public override bool CanSeek - { - get { return stream_.CanSeek; } - } - - public override bool CanTimeout - { - get { return stream_.CanTimeout; } - } - - public override long Length - { - get { return stream_.Length; } - } - - public override long Position - { - get { return stream_.Position; } - set { stream_.Position = value; } - } - - public override bool CanWrite - { - get { return stream_.CanWrite; } - } - - public override void Flush() - { - stream_.Flush(); - } - - public override long Seek(long offset, SeekOrigin origin) - { - return stream_.Seek(offset, origin); - } - - public override void SetLength(long value) - { - stream_.SetLength(value); - } - - public override int Read(byte[] buffer, int offset, int count) - { - return stream_.Read(buffer, offset, count); - } - - public override void Write(byte[] buffer, int offset, int count) - { - stream_.Write(buffer, offset, count); - } - - /// - /// Close the stream. - /// - /// - /// The underlying stream is closed only if is true. - /// - protected override void Dispose(bool disposing) - { - Stream toClose = stream_; - stream_ = null; - if (isOwner_ && (toClose != null)) - { - isOwner_ = false; - toClose.Dispose(); - } - } - - #endregion - - // Write the local file header - // TODO: ZipHelperStream.WriteLocalHeader is not yet used and needs checking for ZipFile and ZipOuptutStream usage - void WriteLocalHeader(ZipEntry entry, EntryPatchData patchData) - { - CompressionMethod method = entry.CompressionMethod; - bool headerInfoAvailable = true; // How to get this? - bool patchEntryHeader = false; - - WriteLEInt(ZipConstants.LocalHeaderSignature); - - WriteLEShort(entry.Version); - WriteLEShort(entry.Flags); - WriteLEShort((byte)method); - WriteLEInt((int)entry.DosTime); - - if (headerInfoAvailable) - { - WriteLEInt((int)entry.Crc); - - if (entry.LocalHeaderRequiresZip64) - { - WriteLEInt(-1); - WriteLEInt(-1); - } - else - { - WriteLEInt((int)entry.CompressedSize); - WriteLEInt((int)entry.Size); - } - } - else - { - if (patchData != null) - { - patchData.CrcPatchOffset = stream_.Position; - } - WriteLEInt(0); // Crc - - if (patchData != null) - { - patchData.SizePatchOffset = stream_.Position; - } - - // For local header both sizes appear in Zip64 Extended Information - if (entry.LocalHeaderRequiresZip64 && patchEntryHeader) - { - WriteLEInt(-1); - WriteLEInt(-1); - } - else - { - WriteLEInt(0); // Compressed size - WriteLEInt(0); // Uncompressed size - } - } - - byte[] name = ZipConstants.ConvertToArray(entry.Flags, entry.Name); - - if (name.Length > 0xFFFF) - throw new ZipException("Entry name too long."); - - var ed = new ZipExtraData(entry.ExtraData); - - if (entry.LocalHeaderRequiresZip64 && (headerInfoAvailable || patchEntryHeader)) - { - ed.StartNewEntry(); - - if (headerInfoAvailable) - { - ed.AddLeLong(entry.Size); - ed.AddLeLong(entry.CompressedSize); - } - else - { - ed.AddLeLong(-1); - ed.AddLeLong(-1); - } - - ed.AddNewEntry(1); - - if (!ed.Find(1)) - throw new ZipException("Internal error cant find extra data"); - - if (patchData != null) - patchData.SizePatchOffset = ed.CurrentReadIndex; - } - else - { - ed.Delete(1); - } - - byte[] extra = ed.GetEntryData(); - - WriteLEShort(name.Length); - WriteLEShort(extra.Length); - - if (name.Length > 0) - stream_.Write(name, 0, name.Length); - - if (entry.LocalHeaderRequiresZip64 && patchEntryHeader) - patchData.SizePatchOffset += stream_.Position; - - if (extra.Length > 0) - stream_.Write(extra, 0, extra.Length); - } - - /// - /// Locates a block with the desired . - /// - /// The signature to find. - /// Location, marking the end of block. - /// Minimum size of the block. - /// The maximum variable data. - /// Eeturns the offset of the first byte after the signature; -1 if not found - public long LocateBlockWithSignature(int signature, long endLocation, int minimumBlockSize, int maximumVariableData) - { - long pos = endLocation - minimumBlockSize; - if (pos < 0) - return -1; - - long giveUpMarker = Math.Max(pos - maximumVariableData, 0); - - // TODO: This loop could be optimised for speed. - do - { - if (pos < giveUpMarker) - return -1; - - Seek(pos--, SeekOrigin.Begin); - - } while (ReadLEInt() != signature); - - return Position; - } - - /// - /// Write Zip64 end of central directory records (File header and locator). - /// - /// The number of entries in the central directory. - /// The size of entries in the central directory. - /// The offset of the dentral directory. - public void WriteZip64EndOfCentralDirectory(long noOfEntries, long sizeEntries, long centralDirOffset) - { - long centralSignatureOffset = stream_.Position; - WriteLEInt(ZipConstants.Zip64CentralFileHeaderSignature); - WriteLELong(44); // Size of this record (total size of remaining fields in header or full size - 12) - WriteLEShort(ZipConstants.VersionMadeBy); // Version made by - WriteLEShort(ZipConstants.VersionZip64); // Version to extract - WriteLEInt(0); // Number of this disk - WriteLEInt(0); // number of the disk with the start of the central directory - WriteLELong(noOfEntries); // No of entries on this disk - WriteLELong(noOfEntries); // Total No of entries in central directory - WriteLELong(sizeEntries); // Size of the central directory - WriteLELong(centralDirOffset); // offset of start of central directory - // zip64 extensible data sector not catered for here (variable size) - - // Write the Zip64 end of central directory locator - WriteLEInt(ZipConstants.Zip64CentralDirLocatorSignature); - - // no of the disk with the start of the zip64 end of central directory - WriteLEInt(0); - - // relative offset of the zip64 end of central directory record - WriteLELong(centralSignatureOffset); - - // total number of disks - WriteLEInt(1); - } - - /// - /// Write the required records to end the central directory. - /// - /// The number of entries in the directory. - /// The size of the entries in the directory. - /// The start of the central directory. - /// The archive comment. (This can be null). - public void WriteEndOfCentralDirectory(long noOfEntries, long sizeEntries, - long startOfCentralDirectory, byte[] comment) - { - - if ((noOfEntries >= 0xffff) || - (startOfCentralDirectory >= 0xffffffff) || - (sizeEntries >= 0xffffffff)) - WriteZip64EndOfCentralDirectory(noOfEntries, sizeEntries, startOfCentralDirectory); - - WriteLEInt(ZipConstants.EndOfCentralDirectorySignature); - - // TODO: ZipFile Multi disk handling not done - WriteLEShort(0); // number of this disk - WriteLEShort(0); // no of disk with start of central dir - - - // Number of entries - if (noOfEntries >= 0xffff) - { - WriteLEUshort(0xffff); // Zip64 marker - WriteLEUshort(0xffff); - } - else - { - WriteLEShort((short)noOfEntries); // entries in central dir for this disk - WriteLEShort((short)noOfEntries); // total entries in central directory - } - - // Size of the central directory - if (sizeEntries >= 0xffffffff) - WriteLEUint(0xffffffff); // Zip64 marker - else - WriteLEInt((int)sizeEntries); - - - // offset of start of central directory - if (startOfCentralDirectory >= 0xffffffff) - WriteLEUint(0xffffffff); // Zip64 marker - else - WriteLEInt((int)startOfCentralDirectory); - - int commentLength = (comment != null) ? comment.Length : 0; - - if (commentLength > 0xffff) - throw new ZipException(string.Format("Comment length({0}) is too long can only be 64K", commentLength)); - - WriteLEShort(commentLength); - - if (commentLength > 0) - Write(comment, 0, comment.Length); - } - - #region LE value reading/writing - /// - /// Read an unsigned short in little endian byte order. - /// - /// Returns the value read. - /// - /// An i/o error occurs. - /// - /// - /// The file ends prematurely - /// - public int ReadLEShort() - { - int byteValue1 = stream_.ReadByte(); - - if (byteValue1 < 0) - throw new EndOfStreamException(); - - int byteValue2 = stream_.ReadByte(); - if (byteValue2 < 0) - throw new EndOfStreamException(); - - return byteValue1 | (byteValue2 << 8); - } - - /// - /// Read an int in little endian byte order. - /// - /// Returns the value read. - /// - /// An i/o error occurs. - /// - /// - /// The file ends prematurely - /// - public int ReadLEInt() => ReadLEShort() | (ReadLEShort() << 16); - - /// - /// Read a long in little endian byte order. - /// - /// The value read. - public long ReadLELong() => (uint)ReadLEInt() | ((long)ReadLEInt() << 32); - - /// - /// Write an unsigned short in little endian byte order. - /// - /// The value to write. - public void WriteLEShort(int value) - { - stream_.WriteByte((byte)(value & 0xff)); - stream_.WriteByte((byte)((value >> 8) & 0xff)); - } - - /// - /// Write a ushort in little endian byte order. - /// - /// The value to write. - public void WriteLEUshort(ushort value) - { - stream_.WriteByte((byte)(value & 0xff)); - stream_.WriteByte((byte)(value >> 8)); - } - - /// - /// Write an int in little endian byte order. - /// - /// The value to write. - public void WriteLEInt(int value) - { - WriteLEShort(value); - WriteLEShort(value >> 16); - } - - /// - /// Write a uint in little endian byte order. - /// - /// The value to write. - public void WriteLEUint(uint value) - { - WriteLEUshort((ushort)(value & 0xffff)); - WriteLEUshort((ushort)(value >> 16)); - } - - /// - /// Write a long in little endian byte order. - /// - /// The value to write. - public void WriteLELong(long value) - { - WriteLEInt((int)value); - WriteLEInt((int)(value >> 32)); - } - - /// - /// Write a ulong in little endian byte order. - /// - /// The value to write. - public void WriteLEUlong(ulong value) - { - WriteLEUint((uint)(value & 0xffffffff)); - WriteLEUint((uint)(value >> 32)); - } - - #endregion - - /// - /// Write a data descriptor. - /// - /// The entry to write a descriptor for. - /// Returns the number of descriptor bytes written. - public int WriteDataDescriptor(ZipEntry entry) - { - if (entry == null) - throw new ArgumentNullException(nameof(entry)); - - int result = 0; - - // Add data descriptor if flagged as required - if ((entry.Flags & (int)GeneralBitFlags.Descriptor) != 0) - { - // The signature is not PKZIP originally but is now described as optional - // in the PKZIP Appnote documenting trhe format. - WriteLEInt(ZipConstants.DataDescriptorSignature); - WriteLEInt(unchecked((int)(entry.Crc))); - - result += 8; - - if (entry.LocalHeaderRequiresZip64) - { - WriteLELong(entry.CompressedSize); - WriteLELong(entry.Size); - result += 16; - } - else - { - WriteLEInt((int)entry.CompressedSize); - WriteLEInt((int)entry.Size); - result += 8; - } - } - - return result; - } - - /// - /// Read data descriptor at the end of compressed data. - /// - /// if set to true [zip64]. - /// The data to fill in. - /// Returns the number of bytes read in the descriptor. - public void ReadDataDescriptor(bool zip64, DescriptorData data) - { - int intValue = ReadLEInt(); - - // In theory this may not be a descriptor according to PKZIP appnote. - // In practise its always there. - if (intValue != ZipConstants.DataDescriptorSignature) - throw new ZipException("Data descriptor signature not found"); - - data.Crc = ReadLEInt(); - - if (zip64) - { - data.CompressedSize = ReadLELong(); - data.Size = ReadLELong(); - } - else - { - data.CompressedSize = ReadLEInt(); - data.Size = ReadLEInt(); - } - } - - #region Instance Fields - bool isOwner_; - Stream stream_; - #endregion - } -} diff --git a/UpdateLib/UpdateLib/Compression/Zip/ZipInputStream.cs b/UpdateLib/UpdateLib/Compression/Zip/ZipInputStream.cs deleted file mode 100644 index 995a5c6..0000000 --- a/UpdateLib/UpdateLib/Compression/Zip/ZipInputStream.cs +++ /dev/null @@ -1,608 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -using MatthiWare.UpdateLib.Compression.Checksum; -using MatthiWare.UpdateLib.Compression.Deflaters; -using MatthiWare.UpdateLib.Compression.Streams; -using System; -using System.IO; - -namespace MatthiWare.UpdateLib.Compression.Zip -{ - /// - /// This is an InflaterInputStream that reads the files baseInputStream an zip archive - /// one after another. It has a special method to get the zip entry of - /// the next file. The zip entry contains information about the file name - /// size, compressed size, Crc, etc. - /// It includes support for Stored and Deflated entries. - ///
- ///
Author of the original java version : Jochen Hoenicke - ///
- /// - /// This sample shows how to read a zip file - /// - /// using System; - /// using System.Text; - /// using System.IO; - /// - /// using ICSharpCode.SharpZipLib.Zip; - /// - /// class MainClass - /// { - /// public static void Main(string[] args) - /// { - /// using ( ZipInputStream s = new ZipInputStream(File.OpenRead(args[0]))) { - /// - /// ZipEntry theEntry; - /// const int size = 2048; - /// byte[] data = new byte[2048]; - /// - /// while ((theEntry = s.GetNextEntry()) != null) { - /// if ( entry.IsFile ) { - /// Console.Write("Show contents (y/n) ?"); - /// if (Console.ReadLine() == "y") { - /// while (true) { - /// size = s.Read(data, 0, data.Length); - /// if (size > 0) { - /// Console.Write(new ASCIIEncoding().GetString(data, 0, size)); - /// } else { - /// break; - /// } - /// } - /// } - /// } - /// } - /// } - /// } - /// } - /// - /// - public class ZipInputStream : InflaterInputStream - { - #region Instance Fields - - /// - /// Delegate for reading bytes from a stream. - /// - delegate int ReadDataHandler(byte[] b, int offset, int length); - - /// - /// The current reader this instance. - /// - ReadDataHandler internalReader; - - IChecksum checksum = new Crc32(); - ZipEntry entry; - - long size; - int method; - int flags; - string password; - #endregion - - #region Constructors - /// - /// Creates a new Zip input stream, for reading a zip archive. - /// - /// The underlying providing data. - public ZipInputStream(Stream baseInputStream) - : base(baseInputStream, new Inflater(true)) - { - internalReader = new ReadDataHandler(ReadingNotAvailable); - } - - /// - /// Creates a new Zip input stream, for reading a zip archive. - /// - /// The underlying providing data. - /// Size of the buffer. - public ZipInputStream(Stream baseInputStream, int bufferSize) - : base(baseInputStream, new Inflater(true), bufferSize) - { - internalReader = new ReadDataHandler(ReadingNotAvailable); - } - #endregion - - /// - /// Optional password used for encryption when non-null - /// - /// A password for all encrypted entries in this - public string Password - { - get - { - return password; - } - set - { - password = value; - } - } - - - /// - /// Gets a value indicating if there is a current entry and it can be decompressed - /// - /// - /// The entry can only be decompressed if the library supports the zip features required to extract it. - /// See the ZipEntry Version property for more details. - /// - public bool CanDecompressEntry - { - get - { - return (entry != null) && entry.CanDecompress; - } - } - - /// - /// Advances to the next entry in the archive - /// - /// - /// The next entry in the archive or null if there are no more entries. - /// - /// - /// If the previous entry is still open CloseEntry is called. - /// - /// - /// Input stream is closed - /// - /// - /// Password is not set, password is invalid, compression method is invalid, - /// version required to extract is not supported - /// - public ZipEntry GetNextEntry() - { - if (checksum == null) - throw new InvalidOperationException("Closed."); - - if (entry != null) - CloseEntry(); - - int header = inputBuffer.ReadLeInt(); - - if (header == ZipConstants.CentralHeaderSignature || - header == ZipConstants.EndOfCentralDirectorySignature || - header == ZipConstants.CentralHeaderDigitalSignature || - header == ZipConstants.ArchiveExtraDataSignature || - header == ZipConstants.Zip64CentralFileHeaderSignature) - { - // No more individual entries exist - Dispose(); - return null; - } - - // -jr- 07-Dec-2003 Ignore spanning temporary signatures if found - // Spanning signature is same as descriptor signature and is untested as yet. - if ((header == ZipConstants.SpanningTempSignature) || (header == ZipConstants.SpanningSignature)) - header = inputBuffer.ReadLeInt(); - - if (header != ZipConstants.LocalHeaderSignature) - throw new ZipException("Wrong Local header signature: 0x" + string.Format("{0:X}", header)); - - var versionRequiredToExtract = (short)inputBuffer.ReadLeShort(); - - flags = inputBuffer.ReadLeShort(); - method = inputBuffer.ReadLeShort(); - var dostime = (uint)inputBuffer.ReadLeInt(); - int crc2 = inputBuffer.ReadLeInt(); - csize = inputBuffer.ReadLeInt(); - size = inputBuffer.ReadLeInt(); - int nameLen = inputBuffer.ReadLeShort(); - int extraLen = inputBuffer.ReadLeShort(); - - byte[] buffer = new byte[nameLen]; - inputBuffer.ReadRawBuffer(buffer); - - string name = ZipConstants.ConvertToStringExt(flags, buffer); - - entry = new ZipEntry(name, versionRequiredToExtract) - { - Flags = flags, - CompressionMethod = (CompressionMethod)method - }; - - if ((flags & 8) == 0) - { - entry.Crc = crc2 & 0xFFFFFFFFL; - entry.Size = size & 0xFFFFFFFFL; - entry.CompressedSize = csize & 0xFFFFFFFFL; - } - else - { - - // This allows for GNU, WinZip and possibly other archives, the PKZIP spec - // says these values are zero under these circumstances. - if (crc2 != 0) - entry.Crc = crc2 & 0xFFFFFFFFL; - - if (size != 0) - entry.Size = size & 0xFFFFFFFFL; - - if (csize != 0) - entry.CompressedSize = csize & 0xFFFFFFFFL; - } - - entry.DosTime = dostime; - - // If local header requires Zip64 is true then the extended header should contain - // both values. - - // Handle extra data if present. This can set/alter some fields of the entry. - if (extraLen > 0) - { - byte[] extra = new byte[extraLen]; - inputBuffer.ReadRawBuffer(extra); - entry.ExtraData = extra; - } - - entry.ProcessExtraData(true); - if (entry.CompressedSize >= 0) - csize = entry.CompressedSize; - - if (entry.Size >= 0) - size = entry.Size; - - if (method == (int)CompressionMethod.Stored && csize != size) - throw new ZipException("Stored, but compressed != uncompressed"); - - // Determine how to handle reading of data if this is attempted. - if (entry.IsCompressionMethodSupported()) - internalReader = new ReadDataHandler(InitialRead); - else - internalReader = new ReadDataHandler(ReadingNotSupported); - - return entry; - } - - /// - /// Read data descriptor at the end of compressed data. - /// - void ReadDataDescriptor() - { - if (inputBuffer.ReadLeInt() != ZipConstants.DataDescriptorSignature) - throw new ZipException("Data descriptor signature not found"); - - entry.Crc = inputBuffer.ReadLeInt() & 0xFFFFFFFFL; - - if (entry.LocalHeaderRequiresZip64) - { - csize = inputBuffer.ReadLeLong(); - size = inputBuffer.ReadLeLong(); - } - else - { - csize = inputBuffer.ReadLeInt(); - size = inputBuffer.ReadLeInt(); - } - - entry.CompressedSize = csize; - entry.Size = size; - } - - /// - /// Complete cleanup as the final part of closing. - /// - /// True if the crc value should be tested - void CompleteCloseEntry(bool testCrc) - { - if ((flags & 8) != 0) - ReadDataDescriptor(); - - size = 0; - - if (testCrc && - ((checksum.Value & 0xFFFFFFFFL) != entry.Crc) && - (entry.Crc != -1)) - throw new ZipException("CRC mismatch"); - - checksum.Reset(); - - if (method == (int)CompressionMethod.Deflated) - inflater.Reset(); - - entry = null; - } - - /// - /// Closes the current zip entry and moves to the next one. - /// - /// - /// The stream is closed - /// - /// - /// The Zip stream ends early - /// - public void CloseEntry() - { - if (checksum == null) - throw new InvalidOperationException("Closed"); - - if (entry == null) - return; - - if (method == (int)CompressionMethod.Deflated) - { - if ((flags & 8) != 0) - { - // We don't know how much we must skip, read until end. - byte[] tmp = new byte[4096]; - - // Read will close this entry - while (Read(tmp, 0, tmp.Length) > 0) ; - - return; - } - - csize -= inflater.TotalIn; - inputBuffer.Available += inflater.RemainingInput; - } - - if ((inputBuffer.Available > csize) && (csize >= 0)) - inputBuffer.Available = (int)(inputBuffer.Available - csize); - else - { - csize -= inputBuffer.Available; - inputBuffer.Available = 0; - while (csize != 0) - { - long skipped = Skip(csize); - - if (skipped <= 0) - throw new ZipException("Zip archive ends early."); - - csize -= skipped; - } - } - - CompleteCloseEntry(false); - } - - /// - /// Returns 1 if there is an entry available - /// Otherwise returns 0. - /// - public override int Available - { - get - { - return entry != null ? 1 : 0; - } - } - - /// - /// Returns the current size that can be read from the current entry if available - /// - /// Thrown if the entry size is not known. - /// Thrown if no entry is currently available. - public override long Length - { - get - { - if (entry == null) - throw new InvalidOperationException("No current entry"); - - if (entry.Size < 0) - throw new ZipException("Length not available for the current entry"); - - return entry.Size; - } - - } - - /// - /// Reads a byte from the current zip entry. - /// - /// - /// The byte or -1 if end of stream is reached. - /// - public override int ReadByte() - { - byte[] b = new byte[1]; - - return (Read(b, 0, 1) <= 0) ? -1 : b[0] & 0xff; - } - - /// - /// Handle attempts to read by throwing an . - /// - /// The destination array to store data in. - /// The offset at which data read should be stored. - /// The maximum number of bytes to read. - /// Returns the number of bytes actually read. - int ReadingNotAvailable(byte[] destination, int offset, int count) - { - throw new IOException("Unable to read from this stream"); - } - - /// - /// Handle attempts to read from this entry by throwing an exception - /// - int ReadingNotSupported(byte[] destination, int offset, int count) - { - throw new ZipException("The compression method for this entry is not supported"); - } - - /// - /// Perform the initial read on an entry which may include - /// reading encryption headers and setting up inflation. - /// - /// The destination to fill with data read. - /// The offset to start reading at. - /// The maximum number of bytes to read. - /// The actual number of bytes read. - int InitialRead(byte[] destination, int offset, int count) - { - if (!CanDecompressEntry) - throw new ZipException($"Library cannot extract this entry. Version required is ({entry.Version})"); - - if ((csize > 0) || ((flags & (int)GeneralBitFlags.Descriptor) != 0)) - { - if ((method == (int)CompressionMethod.Deflated) && (inputBuffer.Available > 0)) - inputBuffer.SetInflaterInput(inflater); - - internalReader = new ReadDataHandler(BodyRead); - return BodyRead(destination, offset, count); - } - else - { - internalReader = new ReadDataHandler(ReadingNotAvailable); - return 0; - } - } - - /// - /// Read a block of bytes from the stream. - /// - /// The destination for the bytes. - /// The index to start storing data. - /// The number of bytes to attempt to read. - /// Returns the number of bytes read. - /// Zero bytes read means end of stream. - public override int Read(byte[] buffer, int offset, int count) - { - if (buffer == null) - throw new ArgumentNullException(nameof(buffer)); - - if (offset < 0) - throw new ArgumentOutOfRangeException(nameof(offset), "Cannot be negative"); - - if (count < 0) - throw new ArgumentOutOfRangeException(nameof(count), "Cannot be negative"); - - if ((buffer.Length - offset) < count) - throw new ArgumentException("Invalid offset/count combination"); - - return internalReader(buffer, offset, count); - } - - /// - /// Reads a block of bytes from the current zip entry. - /// - /// - /// The number of bytes read (this may be less than the length requested, even before the end of stream), or 0 on end of stream. - /// - /// - /// An i/o error occured. - /// - /// - /// The deflated stream is corrupted. - /// - /// - /// The stream is not open. - /// - int BodyRead(byte[] buffer, int offset, int count) - { - if (checksum == null) - throw new InvalidOperationException("Closed"); - - if ((entry == null) || (count <= 0)) - return 0; - - if (offset + count > buffer.Length) - throw new ArgumentException("Offset + count exceeds buffer size"); - - bool finished = false; - - switch (method) - { - case (int)CompressionMethod.Deflated: - - count = base.Read(buffer, offset, count); - - if (count <= 0) - { - if (!inflater.IsFinished) - throw new ZipException("Inflater not finished!"); - - inputBuffer.Available = inflater.RemainingInput; - - // A csize of -1 is from an unpatched local header - if ((flags & 8) == 0 && - (inflater.TotalIn != csize && csize != 0xFFFFFFFF && csize != -1 || inflater.TotalOut != size)) - throw new ZipException("Size mismatch: " + csize + ";" + size + " <-> " + inflater.TotalIn + ";" + inflater.TotalOut); - - inflater.Reset(); - finished = true; - } - break; - - case (int)CompressionMethod.Stored: - - if ((count > csize) && (csize >= 0)) - count = (int)csize; - - if (count > 0) - { - count = inputBuffer.ReadClearTextBuffer(buffer, offset, count); - - if (count > 0) - { - csize -= count; - size -= count; - } - } - - if (csize == 0) - finished = true; - else - if (count < 0) - throw new ZipException("EOF in stored block"); - - break; - } - - if (count > 0) - checksum.Update(buffer, offset, count); - - if (finished) - CompleteCloseEntry(true); - - return count; - } - - /// - /// Closes the zip input stream - /// - protected override void Dispose(bool disposing) - { - internalReader = new ReadDataHandler(ReadingNotAvailable); - checksum = null; - entry = null; - - base.Dispose(disposing); - } - } -} diff --git a/UpdateLib/UpdateLib/Compression/Zip/ZipOutputStream.cs b/UpdateLib/UpdateLib/Compression/Zip/ZipOutputStream.cs deleted file mode 100644 index 3ca7c4c..0000000 --- a/UpdateLib/UpdateLib/Compression/Zip/ZipOutputStream.cs +++ /dev/null @@ -1,735 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -/* Copyright © 2000-2016 SharpZipLib Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this - * software and associated documentation files (the "Software"), to deal in the Software - * without restriction, including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons - * to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -using MatthiWare.UpdateLib.Compression.Checksum; -using MatthiWare.UpdateLib.Compression.Deflaters; -using MatthiWare.UpdateLib.Compression.Streams; -using System; -using System.Collections.Generic; -using System.IO; - -namespace MatthiWare.UpdateLib.Compression.Zip -{ - /// - /// This is a DeflaterOutputStream that writes the files into a zip - /// archive one after another. It has a special method to start a new - /// zip entry. The zip entries contains information about the file name - /// size, compressed size, CRC, etc. - /// - /// It includes support for Stored and Deflated entries. - /// This class is not thread safe. - ///
- ///
Author of the original java version : Jochen Hoenicke - ///
- /// This sample shows how to create a zip file - /// - /// using System; - /// using System.IO; - /// - /// using ICSharpCode.SharpZipLib.Core; - /// using ICSharpCode.SharpZipLib.Zip; - /// - /// class MainClass - /// { - /// public static void Main(string[] args) - /// { - /// string[] filenames = Directory.GetFiles(args[0]); - /// byte[] buffer = new byte[4096]; - /// - /// using ( ZipOutputStream s = new ZipOutputStream(File.Create(args[1])) ) { - /// - /// s.SetLevel(9); // 0 - store only to 9 - means best compression - /// - /// foreach (string file in filenames) { - /// ZipEntry entry = new ZipEntry(file); - /// s.PutNextEntry(entry); - /// - /// using (FileStream fs = File.OpenRead(file)) { - /// StreamUtils.Copy(fs, s, buffer); - /// } - /// } - /// } - /// } - /// } - /// - /// - public class ZipOutputStream : DeflaterOutputStream - { - #region Constructors - /// - /// Creates a new Zip output stream, writing a zip archive. - /// - /// - /// The output stream to which the archive contents are written. - /// - public ZipOutputStream(Stream baseOutputStream) - : base(baseOutputStream, new Deflater(Deflater.DEFAULT_COMPRESSION, true)) - { - } - - /// - /// Creates a new Zip output stream, writing a zip archive. - /// - /// The output stream to which the archive contents are written. - /// Size of the buffer to use. - public ZipOutputStream(Stream baseOutputStream, int bufferSize) - : base(baseOutputStream, new Deflater(Deflater.DEFAULT_COMPRESSION, true), bufferSize) - { - } - #endregion - - /// - /// Gets a flag value of true if the central header has been added for this archive; false if it has not been added. - /// - /// No further entries can be added once this has been done. - public bool IsFinished - { - get - { - return entries == null; - } - } - - /// - /// Set the zip file comment. - /// - /// - /// The comment text for the entire archive. - /// - /// - /// The converted comment is longer than 0xffff bytes. - /// - public void SetComment(string comment) - { - // TODO: Its not yet clear how to handle unicode comments here. - byte[] commentBytes = ZipConstants.ConvertToArray(comment); - - if (commentBytes.Length > 0xffff) - throw new ArgumentOutOfRangeException(nameof(comment)); - - zipComment = commentBytes; - } - - /// - /// Sets the compression level. The new level will be activated - /// immediately. - /// - /// The new compression level (1 to 9). - /// - /// Level specified is not supported. - /// - /// - public void SetLevel(int level) - { - deflater_.SetLevel(level); - defaultCompressionLevel = level; - } - - /// - /// Get the current deflater compression level - /// - /// The current compression level - public int GetLevel() - { - return deflater_.GetLevel(); - } - - /// - /// Get / set a value indicating how Zip64 Extension usage is determined when adding entries. - /// - /// Older archivers may not understand Zip64 extensions. - /// If backwards compatability is an issue be careful when adding entries to an archive. - /// Setting this property to off is workable but less desirable as in those circumstances adding a file - /// larger then 4GB will fail. - public UseZip64 UseZip64 - { - get { return useZip64_; } - set { useZip64_ = value; } - } - - /// - /// Write an unsigned short in little endian byte order. - /// - private void WriteLeShort(int value) - { - unchecked - { - baseOutputStream_.WriteByte((byte)(value & 0xff)); - baseOutputStream_.WriteByte((byte)((value >> 8) & 0xff)); - } - } - - /// - /// Write an int in little endian byte order. - /// - private void WriteLeInt(int value) - { - unchecked - { - WriteLeShort(value); - WriteLeShort(value >> 16); - } - } - - /// - /// Write an int in little endian byte order. - /// - private void WriteLeLong(long value) - { - unchecked - { - WriteLeInt((int)value); - WriteLeInt((int)(value >> 32)); - } - } - - /// - /// Starts a new Zip entry. It automatically closes the previous - /// entry if present. - /// All entry elements bar name are optional, but must be correct if present. - /// If the compression method is stored and the output is not patchable - /// the compression for that entry is automatically changed to deflate level 0 - /// - /// - /// the entry. - /// - /// - /// if entry passed is null. - /// - /// - /// if an I/O error occured. - /// - /// - /// if stream was finished - /// - /// - /// Too many entries in the Zip file
- /// Entry name is too long
- /// Finish has already been called
- ///
- public void PutNextEntry(ZipEntry entry) - { - if (entry == null) - throw new ArgumentNullException(nameof(entry)); - - if (entries == null) - throw new InvalidOperationException("ZipOutputStream was finished"); - - if (curEntry != null) - CloseEntry(); - - if (entries.Count == int.MaxValue) - throw new ZipException("Too many entries for Zip file"); - - CompressionMethod method = entry.CompressionMethod; - int compressionLevel = defaultCompressionLevel; - - // Clear flags that the library manages internally - entry.Flags &= (int)GeneralBitFlags.UnicodeText; - patchEntryHeader = false; - - bool headerInfoAvailable; - - // No need to compress - definitely no data. - if (entry.Size == 0) - { - entry.CompressedSize = entry.Size; - entry.Crc = 0; - method = CompressionMethod.Stored; - headerInfoAvailable = true; - } - else - { - headerInfoAvailable = (entry.Size >= 0) && entry.HasCrc && entry.CompressedSize >= 0; - - // Switch to deflation if storing isnt possible. - if (method == CompressionMethod.Stored) - { - if (!headerInfoAvailable) - { - if (!CanPatchEntries) - { - // Can't patch entries so storing is not possible. - method = CompressionMethod.Deflated; - compressionLevel = 0; - } - } - else // entry.size must be > 0 - { - entry.CompressedSize = entry.Size; - headerInfoAvailable = entry.HasCrc; - } - } - } - - if (headerInfoAvailable == false) - { - if (CanPatchEntries == false) - { - // Only way to record size and compressed size is to append a data descriptor - // after compressed data. - - // Stored entries of this form have already been converted to deflating. - entry.Flags |= 8; - } - else - { - patchEntryHeader = true; - } - } - - entry.Offset = offset; - entry.CompressionMethod = method; - - curMethod = method; - sizePatchPos = -1; - - if ((useZip64_ == UseZip64.On) || ((entry.Size < 0) && (useZip64_ == UseZip64.Dynamic))) - entry.ForceZip64(); - - // Write the local file header - WriteLeInt(ZipConstants.LocalHeaderSignature); - - WriteLeShort(entry.Version); - WriteLeShort(entry.Flags); - WriteLeShort((byte)entry.CompressionMethod); - WriteLeInt((int)entry.DosTime); - - // TODO: Refactor header writing. Its done in several places. - if (headerInfoAvailable) - { - WriteLeInt((int)entry.Crc); - - if (entry.LocalHeaderRequiresZip64) - { - WriteLeInt(-1); - WriteLeInt(-1); - } - else - { - WriteLeInt((int)entry.CompressedSize); - WriteLeInt((int)entry.Size); - } - } - else - { - if (patchEntryHeader) - crcPatchPos = baseOutputStream_.Position; - - WriteLeInt(0); // Crc - - if (patchEntryHeader) - sizePatchPos = baseOutputStream_.Position; - - // For local header both sizes appear in Zip64 Extended Information - if (entry.LocalHeaderRequiresZip64 || patchEntryHeader) - { - WriteLeInt(-1); - WriteLeInt(-1); - } - else - { - WriteLeInt(0); // Compressed size - WriteLeInt(0); // Uncompressed size - } - } - - byte[] name = ZipConstants.ConvertToArray(entry.Flags, entry.Name); - - if (name.Length > 0xFFFF) - throw new ZipException("Entry name too long."); - - var ed = new ZipExtraData(entry.ExtraData); - - if (entry.LocalHeaderRequiresZip64) - { - ed.StartNewEntry(); - - if (headerInfoAvailable) - { - ed.AddLeLong(entry.Size); - ed.AddLeLong(entry.CompressedSize); - } - else - { - ed.AddLeLong(-1); - ed.AddLeLong(-1); - } - - ed.AddNewEntry(1); - - if (!ed.Find(1)) - throw new ZipException("Internal error cant find extra data"); - - if (patchEntryHeader) - sizePatchPos = ed.CurrentReadIndex; - } - else - ed.Delete(1); - - byte[] extra = ed.GetEntryData(); - - WriteLeShort(name.Length); - WriteLeShort(extra.Length); - - if (name.Length > 0) - baseOutputStream_.Write(name, 0, name.Length); - - if (entry.LocalHeaderRequiresZip64 && patchEntryHeader) - sizePatchPos += baseOutputStream_.Position; - - if (extra.Length > 0) - baseOutputStream_.Write(extra, 0, extra.Length); - - offset += ZipConstants.LocalHeaderBaseSize + name.Length + extra.Length; - - // Activate the entry. - curEntry = entry; - checksum.Reset(); - - if (method == CompressionMethod.Deflated) - { - deflater_.Reset(); - deflater_.SetLevel(compressionLevel); - } - - size = 0; - } - - /// - /// Closes the current entry, updating header and footer information as required - /// - /// - /// An I/O error occurs. - /// - /// - /// No entry is active. - /// - public void CloseEntry() - { - if (curEntry == null) - throw new InvalidOperationException("No open entry"); - - long csize = size; - - // First finish the deflater, if appropriate - if (curMethod == CompressionMethod.Deflated) - { - if (size >= 0) - { - base.Finish(); - csize = deflater_.TotalOut; - } - else - deflater_.Reset(); - } - - if (curEntry.Size < 0) - curEntry.Size = size; - else if (curEntry.Size != size) - throw new ZipException("size was " + size + ", but I expected " + curEntry.Size); - - if (curEntry.CompressedSize < 0) - curEntry.CompressedSize = csize; - else if (curEntry.CompressedSize != csize) - throw new ZipException("compressed size was " + csize + ", but I expected " + curEntry.CompressedSize); - - if (curEntry.Crc < 0) - curEntry.Crc = checksum.Value; - else if (curEntry.Crc != checksum.Value) - throw new ZipException("crc was " + checksum.Value + ", but I expected " + curEntry.Crc); - - offset += csize; - - // Patch the header if possible - if (patchEntryHeader) - { - patchEntryHeader = false; - - long curPos = baseOutputStream_.Position; - baseOutputStream_.Seek(crcPatchPos, SeekOrigin.Begin); - WriteLeInt((int)curEntry.Crc); - - if (curEntry.LocalHeaderRequiresZip64) - { - if (sizePatchPos == -1) - throw new ZipException("Entry requires zip64 but this has been turned off"); - - baseOutputStream_.Seek(sizePatchPos, SeekOrigin.Begin); - WriteLeLong(curEntry.Size); - WriteLeLong(curEntry.CompressedSize); - } - else - { - WriteLeInt((int)curEntry.CompressedSize); - WriteLeInt((int)curEntry.Size); - } - - baseOutputStream_.Seek(curPos, SeekOrigin.Begin); - } - - // Add data descriptor if flagged as required - if ((curEntry.Flags & 8) != 0) - { - WriteLeInt(ZipConstants.DataDescriptorSignature); - WriteLeInt(unchecked((int)curEntry.Crc)); - - if (curEntry.LocalHeaderRequiresZip64) - { - WriteLeLong(curEntry.CompressedSize); - WriteLeLong(curEntry.Size); - offset += ZipConstants.Zip64DataDescriptorSize; - } - else - { - WriteLeInt((int)curEntry.CompressedSize); - WriteLeInt((int)curEntry.Size); - offset += ZipConstants.DataDescriptorSize; - } - } - - entries.Add(curEntry); - curEntry = null; - } - - /// - /// Writes the given buffer to the current entry. - /// - /// The buffer containing data to write. - /// The offset of the first byte to write. - /// The number of bytes to write. - /// Archive size is invalid - /// No entry is active. - public override void Write(byte[] buffer, int offset, int count) - { - if (curEntry == null) - throw new InvalidOperationException("No open entry."); - - if (buffer == null) - throw new ArgumentNullException(nameof(buffer)); - - if (offset < 0) - throw new ArgumentOutOfRangeException(nameof(offset), "Cannot be negative"); - - if (count < 0) - throw new ArgumentOutOfRangeException(nameof(count), "Cannot be negative"); - - if ((buffer.Length - offset) < count) - throw new ArgumentException("Invalid offset/count combination"); - - checksum.Update(buffer, offset, count); - size += count; - - switch (curMethod) - { - case CompressionMethod.Deflated: - base.Write(buffer, offset, count); - break; - - case CompressionMethod.Stored: - baseOutputStream_.Write(buffer, offset, count); - break; - } - } - - /// - /// Finishes the stream. This will write the central directory at the - /// end of the zip file and flush the stream. - /// - /// - /// This is automatically called when the stream is closed. - /// - /// - /// An I/O error occurs. - /// - /// - /// Comment exceeds the maximum length
- /// Entry name exceeds the maximum length - ///
- public override void Finish() - { - if (entries == null) - return; - - if (curEntry != null) - CloseEntry(); - - long numEntries = entries.Count; - long sizeEntries = 0; - - foreach (ZipEntry entry in entries) - { - WriteLeInt(ZipConstants.CentralHeaderSignature); - WriteLeShort(ZipConstants.VersionMadeBy); - WriteLeShort(entry.Version); - WriteLeShort(entry.Flags); - WriteLeShort((short)entry.CompressionMethod); - WriteLeInt((int)entry.DosTime); - WriteLeInt((int)entry.Crc); - - WriteLeInt(entry.IsZip64Forced() || (entry.CompressedSize >= uint.MaxValue) ? - -1 : - (int)entry.CompressedSize); - - WriteLeInt(entry.IsZip64Forced() || (entry.Size >= uint.MaxValue) ? - -1 : - (int)entry.Size); - - byte[] name = ZipConstants.ConvertToArray(entry.Flags, entry.Name); - - if (name.Length > 0xffff) - throw new ZipException("Name too long."); - - var ed = new ZipExtraData(entry.ExtraData); - - if (entry.CentralHeaderRequiresZip64) - { - ed.StartNewEntry(); - if (entry.IsZip64Forced() || - (entry.Size >= 0xffffffff)) - ed.AddLeLong(entry.Size); - - if (entry.IsZip64Forced() || - (entry.CompressedSize >= 0xffffffff)) - ed.AddLeLong(entry.CompressedSize); - - if (entry.Offset >= 0xffffffff) - ed.AddLeLong(entry.Offset); - - ed.AddNewEntry(1); - } - else - ed.Delete(1); - - byte[] extra = ed.GetEntryData(); - - byte[] entryComment = - (entry.Comment != null) ? - ZipConstants.ConvertToArray(entry.Flags, entry.Comment) : - new byte[0]; - - if (entryComment.Length > 0xffff) - throw new ZipException("Comment too long."); - - WriteLeShort(name.Length); - WriteLeShort(extra.Length); - WriteLeShort(entryComment.Length); - WriteLeShort(0); // disk number - WriteLeShort(0); // internal file attributes - // external file attributes - - if (entry.ExternalFileAttributes != -1) - WriteLeInt(entry.ExternalFileAttributes); - else - WriteLeInt(entry.IsDirectory ? 16 : 0); // mark entry as directory (from nikolam.AT.perfectinfo.com) - - WriteLeInt(entry.Offset >= uint.MaxValue ? -1 : (int)entry.Offset); - - if (name.Length > 0) - baseOutputStream_.Write(name, 0, name.Length); - - if (extra.Length > 0) - baseOutputStream_.Write(extra, 0, extra.Length); - - if (entryComment.Length > 0) - baseOutputStream_.Write(entryComment, 0, entryComment.Length); - - sizeEntries += ZipConstants.CentralHeaderBaseSize + name.Length + extra.Length + entryComment.Length; - } - - using (ZipHelperStream zhs = new ZipHelperStream(baseOutputStream_)) - zhs.WriteEndOfCentralDirectory(numEntries, sizeEntries, offset, zipComment); - - entries = null; - } - - #region Instance Fields - /// - /// The entries for the archive. - /// - List entries = new List(); - - /// - /// Used to track the crc of data added to entries. - /// - IChecksum checksum = new Crc32(); - - /// - /// The current entry being added. - /// - ZipEntry curEntry; - - int defaultCompressionLevel = Deflater.DEFAULT_COMPRESSION; - - CompressionMethod curMethod = CompressionMethod.Deflated; - - /// - /// Used to track the size of data for an entry during writing. - /// - long size; - - /// - /// Offset to be recorded for each entry in the central header. - /// - long offset; - - /// - /// Comment for the entire archive recorded in central header. - /// - byte[] zipComment = new byte[0]; - - /// - /// Flag indicating that header patching is required for the current entry. - /// - bool patchEntryHeader; - - /// - /// Position to patch crc - /// - long crcPatchPos = -1; - - /// - /// Position to patch size. - /// - long sizePatchPos = -1; - - // Default is dynamic which is not backwards compatible and can cause problems - // with XP's built in compression which cant read Zip64 archives. - // However it does avoid the situation were a large file is added and cannot be completed correctly. - // NOTE: Setting the size for entries before they are added is the best solution! - UseZip64 useZip64_ = UseZip64.On; - #endregion - } -} diff --git a/UpdateLib/UpdateLib/Controls/UpdaterControl.Designer.cs b/UpdateLib/UpdateLib/Controls/UpdaterControl.Designer.cs deleted file mode 100644 index 46bf967..0000000 --- a/UpdateLib/UpdateLib/Controls/UpdaterControl.Designer.cs +++ /dev/null @@ -1,49 +0,0 @@ -namespace MatthiWare.UpdateLib.Controls -{ - partial class UpdaterControl - { - /// - /// 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 Component Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.SuspendLayout(); - // - // UpdaterControl - // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.Color.Transparent; - this.DoubleBuffered = true; - this.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.Name = "UpdaterControl"; - this.Size = new System.Drawing.Size(369, 77); - this.ResumeLayout(false); - - } - - #endregion - } -} diff --git a/UpdateLib/UpdateLib/Controls/UpdaterControl.cs b/UpdateLib/UpdateLib/Controls/UpdaterControl.cs deleted file mode 100644 index 919c063..0000000 --- a/UpdateLib/UpdateLib/Controls/UpdaterControl.cs +++ /dev/null @@ -1,288 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Windows.Forms; -using MatthiWare.UpdateLib.Properties; - -namespace MatthiWare.UpdateLib.Controls -{ - [ToolboxBitmap(typeof(UpdaterControl), "UpdaterControl.bmp")] - [Obsolete("We will no longer be supporting the UpdaterControl")] - public partial class UpdaterControl : UserControl - { - private const int ICON_SIZE = 16; - private const int XY_OFFSET = 2; - private const int PROGRESS_SPEED = 200; - - private Brush brush; - private float x_text, y_text; - - private const string CHECK_FOR_UPDATES = "Please check for updates"; - - private Point oldLocation; - private ToolTip tooltip = new ToolTip(); - - private Dictionary cachedMeasure = new Dictionary(); - private string _text = CHECK_FOR_UPDATES; - public override string Text - { - get { return _text; } - set - { - if (_text != value) - { - _text = value; - Invalidate(); - } - - } - } - - private int progressIndex = 0; - private Bitmap[] progressImages = new Bitmap[50]; - - private Dictionary cachedImages = new Dictionary(); - - private Timer timer; - - private UpdaterIcon _icon = UpdaterIcon.Info; - private UpdaterIcon Icon - { - get { return _icon; } - set - { - if (_icon != value) - { - _icon = value; - Invalidate(); - } - - } - } - - public enum UpdaterIcon : byte - { - Info = 0, - Error = 1, - Done = 2, - Update = 3, - Progress = 4 - } - - public UpdaterControl() - { - InitializeComponent(); - - SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor | ControlStyles.UserPaint, true); - SetStyle(ControlStyles.ContainerControl, false); - - Size = new Size(XY_OFFSET * 2 + ICON_SIZE, XY_OFFSET * 2 + ICON_SIZE); - timer = new Timer(); - timer.Interval = PROGRESS_SPEED; - timer.Tick += update_progress; - - // caching - LoadImages(); - MakeBrushFromForeColor(); - CalcFont(); - - } - - private void update_progress(object sender, EventArgs e) - { - Invalidate(); - if (++progressIndex >= progressImages.Length) - progressIndex = 0; - } - - private void StartProgress() - { - progressIndex = 0; - timer.Start(); - } - - private void StopProgress() - { - timer.Stop(); - } - - public override Font Font - { - get - { - return base.Font; - } - - set - { - base.Font = value; - // invalidate the cache - cachedMeasure.Clear(); - CalcFont(); - } - } - - private void CalcFont() - { - SizeF size = GetAndCacheSize(); - - int height = XY_OFFSET * 2 + ICON_SIZE; - - x_text = XY_OFFSET * 2 + ICON_SIZE; - y_text = (height / 2) - (size.Height / 2); - } - - private SizeF GetAndCacheSize() - { - if (!cachedMeasure.ContainsKey(Text)) - { - Graphics g = Graphics.FromImage(new Bitmap(1,1)); - SizeF size = g.MeasureString(Text, base.Font); - - cachedMeasure.Add(Text, size); - } - - return cachedMeasure[Text]; - } - - public override Color ForeColor - { - get - { - return base.ForeColor; - } - - set - { - base.ForeColor = value; - MakeBrushFromForeColor(); - } - } - - private void MakeBrushFromForeColor() - { - brush = new SolidBrush(base.ForeColor); - } - - private void LoadImages() - { - Resources.status_download.RotateFlip(RotateFlipType.RotateNoneFlipY); - cachedImages.Add(UpdaterIcon.Info, Resources.status_info); - cachedImages.Add(UpdaterIcon.Error, Resources.status_error); - cachedImages.Add(UpdaterIcon.Done, Resources.status_done); - cachedImages.Add(UpdaterIcon.Update, Resources.status_update); - - Bitmap spritesheet = Resources.status_working; - - int i = 0; - for (int x = 0; x < 10; x++) - { - for (int y = 0; y < 5; y++) - { - Bitmap bmp = new Bitmap(16, 16); - Graphics g = Graphics.FromImage(bmp); - - Rectangle dest = new Rectangle(0, 0, 16, 16); - Rectangle src = new Rectangle(x * 16, y * 16, 16, 16); - - g.DrawImage(spritesheet, dest, src, GraphicsUnit.Pixel); - - g.Dispose(); - - progressImages[i++] = bmp; - } - } - - } - - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); - - DrawIcon(e.Graphics); - DrawText(e.Graphics); - } - - private void DrawIcon(Graphics g) - { - g.DrawImage((Icon == UpdaterIcon.Progress) ? progressImages[progressIndex] : cachedImages[Icon], - XY_OFFSET, - XY_OFFSET, - ICON_SIZE, - ICON_SIZE); - } - - private void DrawText(Graphics g) - { - g.DrawString(Text, Font, brush, x_text, y_text); - } - - protected override void OnMouseEnter(EventArgs e) - { - base.OnMouseEnter(e); - - oldLocation = Location; - int newWidth = CalcNewWidth(); - Width = newWidth; - - if (Location.X + newWidth > ParentForm.Width) - { - int amountToRemove = ParentForm.Width - (Location.X + newWidth) - (XY_OFFSET * 2 + ICON_SIZE); - Point x = Location; - x.X += amountToRemove; - Location = x; - } - } - - protected override void OnMouseLeave(EventArgs e) - { - base.OnMouseLeave(e); - - Location = oldLocation; - Width = XY_OFFSET * 2 + ICON_SIZE; - - tooltip.Active = false; - } - - protected override void OnMouseHover(EventArgs e) - { - base.OnMouseHover(e); - - - tooltip.ToolTipIcon = ToolTipIcon.Info; - tooltip.ToolTipTitle = Text; - tooltip.UseAnimation = true; - tooltip.Active = true; - tooltip.Show("Please click here to start checking for updates", Parent, Location.X + Width + (ICON_SIZE), Location.Y + Height); - - } - - protected override void OnClick(EventArgs e) - { - base.OnClick(e); - - Text = "Checking for updates.."; - Icon = UpdaterIcon.Progress; - - int currWidth = Width; - int newWidth = CalcNewWidth(); - - int offset = currWidth - newWidth; - Point x = Location; - x.X += offset; - Location = x; - Width = newWidth; - - StartProgress(); - - - } - - private int CalcNewWidth() - { - SizeF size = GetAndCacheSize(); - return (int)size.Width + (XY_OFFSET * 2 + ICON_SIZE); - } - - } -} diff --git a/UpdateLib/UpdateLib/Controls/UpdaterControl.resx b/UpdateLib/UpdateLib/Controls/UpdaterControl.resx deleted file mode 100644 index 7080a7d..0000000 --- a/UpdateLib/UpdateLib/Controls/UpdaterControl.resx +++ /dev/null @@ -1,120 +0,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/UpdateLib/UpdateLib/Files/CacheFile.cs b/UpdateLib/UpdateLib/Files/CacheFile.cs index dc0584d..ef30f2c 100644 --- a/UpdateLib/UpdateLib/Files/CacheFile.cs +++ b/UpdateLib/UpdateLib/Files/CacheFile.cs @@ -14,9 +14,9 @@ public class CacheFile : FileBase public UpdateVersion CurrentVersion { get; set; } public override CacheFile Load() - => Load(m_filePath); + => Load(m_filePath.Value); public override void Save() - => Save(m_filePath); + => Save(m_filePath.Value); } } diff --git a/UpdateLib/UpdateLib/Files/HashCacheFile.cs b/UpdateLib/UpdateLib/Files/HashCacheFile.cs index 132a3d3..b1beb82 100644 --- a/UpdateLib/UpdateLib/Files/HashCacheFile.cs +++ b/UpdateLib/UpdateLib/Files/HashCacheFile.cs @@ -61,7 +61,7 @@ public void AddOrUpdateEntry(string fullPath, string hash = "") Items.Add(entry); } - Updater.Instance.Logger.Debug(nameof(HashCacheFile), nameof(AddOrUpdateEntry), $"Cache updated for file -> '{entry.FilePath}'"); + //Updater.Instance.Logger.Debug(nameof(HashCacheFile), nameof(AddOrUpdateEntry), $"Cache updated for file -> '{entry.FilePath}'"); } } diff --git a/UpdateLib/UpdateLib/Files/UpdateCatalogFile.cs b/UpdateLib/UpdateLib/Files/UpdateCatalogFile.cs index 43827a8..9e55b5c 100644 --- a/UpdateLib/UpdateLib/Files/UpdateCatalogFile.cs +++ b/UpdateLib/UpdateLib/Files/UpdateCatalogFile.cs @@ -31,7 +31,6 @@ using MatthiWare.UpdateLib.Common; using MatthiWare.UpdateLib.Common.Abstraction; -using MatthiWare.UpdateLib.Compression.GZip; namespace MatthiWare.UpdateLib.Files { @@ -71,11 +70,11 @@ public UpdateInfo GetLatestUpdateForVersion(UpdateVersion currentVersion) public override UpdateCatalogFile Load() => throw new NotImplementedException(); public override UpdateCatalogFile Load(Stream stream) - => base.Load(new GZipInputStream(stream, false)); + => base.Load(stream); public override void Save() => throw new NotImplementedException(); public override void Save(Stream stream) - => base.Save(new GZipOutputStream(stream, false)); + => base.Save(stream); } } diff --git a/UpdateLib/UpdateLib/Files/UpdateMetadataFile.cs b/UpdateLib/UpdateLib/Files/UpdateMetadataFile.cs index 6a9a96e..18473d3 100644 --- a/UpdateLib/UpdateLib/Files/UpdateMetadataFile.cs +++ b/UpdateLib/UpdateLib/Files/UpdateMetadataFile.cs @@ -7,7 +7,6 @@ using MatthiWare.UpdateLib.Common; using MatthiWare.UpdateLib.Common.Abstraction; -using MatthiWare.UpdateLib.Compression.GZip; namespace MatthiWare.UpdateLib.Files { @@ -41,11 +40,11 @@ public UpdateMetadataFile() { } public override UpdateMetadataFile Load() => throw new NotImplementedException(); public override UpdateMetadataFile Load(Stream stream) - => base.Load(new GZipInputStream(stream, false)); + => base.Load(stream); public override void Save() => throw new NotImplementedException(); public override void Save(Stream stream) - => base.Save(new GZipOutputStream(stream, false)); + => base.Save(stream); } } diff --git a/UpdateLib/UpdateLib/Logging/ILogWriter.cs b/UpdateLib/UpdateLib/Logging/ILogWriter.cs deleted file mode 100644 index d5a50b2..0000000 --- a/UpdateLib/UpdateLib/Logging/ILogWriter.cs +++ /dev/null @@ -1,28 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using MatthiWare.UpdateLib.Common; - -namespace MatthiWare.UpdateLib.Logging -{ - public interface ILogWriter - { - LoggingLevel LoggingLevel { get; } - - void Log(string text); - } -} diff --git a/UpdateLib/UpdateLib/Logging/ILogger.cs b/UpdateLib/UpdateLib/Logging/ILogger.cs deleted file mode 100644 index 0699618..0000000 --- a/UpdateLib/UpdateLib/Logging/ILogger.cs +++ /dev/null @@ -1,35 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using MatthiWare.UpdateLib.Common; -using System; -using System.Collections.Generic; - -namespace MatthiWare.UpdateLib.Logging -{ - public interface ILogger - { - LoggingLevel LogLevel { get; set; } - ICollection Writers { get; } - void Log(string tag, string msg, LoggingLevel level); - void Debug(string className, string methodName, string msg); - void Info(string className, string methodName, string msg); - void Warn(string className, string methodName, string msg); - void Error(string className, string methodName, string msg); - void Error(string className, string methodName, Exception e); - } -} diff --git a/UpdateLib/UpdateLib/Logging/Logger.cs b/UpdateLib/UpdateLib/Logging/Logger.cs deleted file mode 100644 index d93d950..0000000 --- a/UpdateLib/UpdateLib/Logging/Logger.cs +++ /dev/null @@ -1,68 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.Collections.Generic; -using System.Linq; -using MatthiWare.UpdateLib.Common; - -namespace MatthiWare.UpdateLib.Logging -{ - public class Logger : ILogger - { - public LoggingLevel LogLevel { get; set; } = LoggingLevel.Debug; - - public ICollection Writers { get; } = new List(); - - private const string TEMPLATE = "[{0}][{1}][{2}]: {3}"; - - public void Log(string tag, string msg, LoggingLevel level) - { - if (level < LogLevel) return; - - Writers - .Where(w => w.LoggingLevel >= LogLevel && level >= w.LoggingLevel) - .ToList() - .ForEach(w => w.Log(string.Format(TEMPLATE, DateTime.Now, level, tag, msg))); - } - - public void Debug(string className, string methodName, string msg) - { - Log($"{className}::{methodName}", msg, LoggingLevel.Debug); - } - - public void Info(string className, string methodName, string msg) - { - Log($"{className}::{methodName}", msg, LoggingLevel.Info); - } - - public void Warn(string className, string methodName, string msg) - { - Log($"{className}::{methodName}", msg, LoggingLevel.Warn); - } - - public void Error(string className, string methodName, string msg) - { - Log($"{className}::{methodName}", msg, LoggingLevel.Error); - } - - public void Error(string className, string methodName, Exception e) - { - Error(className, string.IsNullOrEmpty(methodName) ? e.TargetSite.Name : methodName, e.ToString()); - } - } -} diff --git a/UpdateLib/UpdateLib/Logging/Writers/ConsoleLogWriter.cs b/UpdateLib/UpdateLib/Logging/Writers/ConsoleLogWriter.cs deleted file mode 100644 index 102f0d5..0000000 --- a/UpdateLib/UpdateLib/Logging/Writers/ConsoleLogWriter.cs +++ /dev/null @@ -1,32 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using MatthiWare.UpdateLib.Common; -using System.Diagnostics; - -namespace MatthiWare.UpdateLib.Logging.Writers -{ - public class ConsoleLogWriter : ILogWriter - { - public LoggingLevel LoggingLevel { get { return LoggingLevel.Debug; } } - - public void Log(string text) - { - Debug.WriteLine(text); - } - } -} diff --git a/UpdateLib/UpdateLib/Logging/Writers/FileLogWriter.cs b/UpdateLib/UpdateLib/Logging/Writers/FileLogWriter.cs deleted file mode 100644 index c7db11e..0000000 --- a/UpdateLib/UpdateLib/Logging/Writers/FileLogWriter.cs +++ /dev/null @@ -1,72 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.IO; - -using MatthiWare.UpdateLib.Common; -using MatthiWare.UpdateLib.Tasks; -using MatthiWare.UpdateLib.Threading; -using MatthiWare.UpdateLib.Utils; - -namespace MatthiWare.UpdateLib.Logging.Writers -{ - public class FileLogWriter : ILogWriter - { - public LoggingLevel LoggingLevel { get { return LoggingLevel.Debug; } } - - private Lazy m_logFile = new Lazy(GetLogFile); - - private ConcurrentQueue m_logQueue = new ConcurrentQueue(); - private AsyncTask m_logTask; - - public FileLogWriter() - { - m_logTask = AsyncTaskFactory.From(new Action(Log)); - } - - private static FileInfo GetLogFile() - { - FileInfo m_logFile = new FileInfo($@"{IOUtils.LogPath}\log_{DateTime.Now.ToString("yyyyMMdd")}.log"); - - if (!m_logFile.Directory.Exists) - m_logFile.Directory.Create(); - - return m_logFile; - } - - public void Log(string text) - { - m_logQueue.Enqueue(text); - - if (!m_logTask.IsRunning) - m_logTask.Start(); - } - - private void Log() - { - using (StreamWriter writer = new StreamWriter(m_logFile.Value.Open(FileMode.OpenOrCreate, FileAccess.Write))) - while (m_logQueue.TryDequeue(out string text)) - { - writer.BaseStream.Seek(0, SeekOrigin.End); - writer.WriteLine(text); - } - - } - } -} - diff --git a/UpdateLib/UpdateLib/Properties/Resources.Designer.cs b/UpdateLib/UpdateLib/Properties/Resources.Designer.cs deleted file mode 100644 index dc9696e..0000000 --- a/UpdateLib/UpdateLib/Properties/Resources.Designer.cs +++ /dev/null @@ -1,133 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace MatthiWare.UpdateLib.Properties { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // 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")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MatthiWare.UpdateLib.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap status_done { - get { - object obj = ResourceManager.GetObject("status_done", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap status_download { - get { - object obj = ResourceManager.GetObject("status_download", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap status_error { - get { - object obj = ResourceManager.GetObject("status_error", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap status_info { - get { - object obj = ResourceManager.GetObject("status_info", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap status_update { - get { - object obj = ResourceManager.GetObject("status_update", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap status_warning { - get { - object obj = ResourceManager.GetObject("status_warning", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap status_working { - get { - object obj = ResourceManager.GetObject("status_working", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - } -} diff --git a/UpdateLib/UpdateLib/Properties/Resources.resx b/UpdateLib/UpdateLib/Properties/Resources.resx deleted file mode 100644 index acdb544..0000000 --- a/UpdateLib/UpdateLib/Properties/Resources.resx +++ /dev/null @@ -1,142 +0,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 - - - - ..\Resources\status_done.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\status_download.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\status_error.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\status_info.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\status_update.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\status_warning.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\status_working.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - \ No newline at end of file diff --git a/UpdateLib/UpdateLib/Resources/project_16px.png b/UpdateLib/UpdateLib/Resources/project_16px.png deleted file mode 100644 index 25fe53638760c704f3418e4eba29e18e92140f68..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 244 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt^DJzX3_ zECi1R9uz!ez!SXSuz`?|aJkI32EiFCPGtH%*&WB%=Uy77a@+GCY;=hC=^8;`1(tCCNR6^{wxE0GE#x_SCe{z$LSF+fzdfRu-U6Hl+s_Qzw p3#OlR-?k~zzN+O#cVex$S(_g z71~H}%hr{<9anm^oa;XLa-t2`$eB+b>haJx_-sbGEpCBX9PpL2PngktQ|BFhx1wP= z{{s9#3g02uRI}Avn%ziESjpE9 zOq{Xzp2prM8Z-K3OU&ZJPogwJ%64IR7=CR*`!)5JV3pWvodw5Tw>4O?nd9LQpn%`- zQ-ksvPKxh3-3ByYl34F5MCvpTMMWVF@RcBwD5^YAc`FZ9NIDgmHW}?=b_B2yQ5tMf w?<8Q>dJG08aZT_S0xi!f&<2b#$%Fs)3CHe%gtRvDcmMzZ07*qoM6N<$g7{I%`Tzg` diff --git a/UpdateLib/UpdateLib/Resources/status_download.png b/UpdateLib/UpdateLib/Resources/status_download.png deleted file mode 100644 index f94bfe7311824d2896bda232ae8df1b12b49d637..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 493 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61SBU+%rFB|Ea{HEjtmSN`)Ym%P6qN7l0AZa z85r9685nwi_%BdXqXPp&Z6yQ4%Weh+o2Lv6l4pu-TFZfIISV`@iy0XB4ude`@%$Aj zKtah8*NBqf{Irtt#G+J&g2c?c61}|C5(N`I13g1y6XxhD1_nkuPZ!4!3;*OF{z?lX znD;*q;&}8qPFG+Hr-zej0z)kG>hnbpyH-!yy8Ws2`-=0`in9wvv>2HqOio;nxtg<& z)8(ah=Y<2}n}k+`tbeN~AevvbcuF}FP{j)=mP6NPmEGO=W-q@>?{2#l;`3X*4ls!E z_6f`H@ULca`O9wq_)0>2ZI^vnf5MlrrAw~PyDZ0Ywwl@H=IeX6%kPHi*{KH?T-*Jh z%SAQh@Z<9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2X zK~y+TrII^H13?gm|2*(OP!R;1U?nkN6q}T`R?$K`v9qzX5EQHg3(+PB3YKhz5lSd8mm51VIzyC6{~T*7a^lOxy#-4~E^Dx%+o#W^IIme_&@Tm+cD)>!A`{8x9urEy-1af%|BY`y5ruuN6k?JC=2!=~9rNdzN}Ec>7N{L3C#6GF#?;hrRM7_F<*>x6FDH0s4UAauWeG=N%F zS6g?x_d?LwC+HmD3t^p$m4H^OVd}3w%=h)9b6Ty2`7b~chmmuhpuK}qXDD@sZtqeQ zex-{gfYvqBeElAAH`Sq=vN?E%*7YS93xM)=A!xS2URQ#h5;Py;T(RV00pN0PI)hUr zpFlpYgnW$H3Ejad&U&*Fki=nRttV(`$Wz3o^CHPp$W!!2fXx@*Vh)(5nR#;f2C*rU zUm;lqAWxB5hW%r%)66UYk~oa4^K5KwLY9IZmwDeoR_23N4d*Hs8sOLH*6i;0z>bl5 zo5FrR1`*^Q3>4j+9>0Gk22eVQ!)SClrSqtP*eMDrhgKB9+l%rOKK1W<0eIZgjDD0Z z^yRmSd49MJ?gmf@f|{+>_uRrvVRruX*%p`ICq@^AfH)|Mxy8HYe7Ie{LGh=835Wvm smcn`T!OPCc#h0s0cB?36?D9p1poj507*qoM6N<$f`snslK=n! diff --git a/UpdateLib/UpdateLib/Resources/status_working.png b/UpdateLib/UpdateLib/Resources/status_working.png deleted file mode 100644 index 6003cee9e14bbbe11ce52b62bffff9b1e695c252..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1600 zcmX|>2{crD9LHy4W{j~-WeLN~B#&Y&Gjq+*@It(V7jwKp*&<7pLX2aZXqhO_6Irsp zSM-jhrp0n9TgsNS7^NZ}DM_f1N%Q`7&+$9w{_f}ge&6r^_dEC8b4Bj1yNC)}3J3&( z=l?xofeRiA1h5j$pbqR{A`E~5fLIp;ULVTi@qnF1 zqk$r@fPhy5E*O9k1nh+wv;crTe;oRA7M$TOSQ{3cK3|CkuUine*VO}opm4ApJet8V zVOT;~G*u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wrP8my`TjRl!3~1 zCSST;. - */ - -using System; -using System.Diagnostics; -using System.IO; -using System.Runtime.InteropServices; -using System.Security.AccessControl; -using System.Security.Principal; - -using MatthiWare.UpdateLib.Common; -using MatthiWare.UpdateLib.Utils; - -using Microsoft.Win32; - -namespace MatthiWare.UpdateLib.Security -{ - public static class PermissionUtil - { - private const string uacRegistryKey = "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System"; - private const string uacRegistryValue = "EnableLUA"; - - private static uint STANDARD_RIGHTS_READ = 0x00020000; - private static uint TOKEN_QUERY = 0x0008; - private static uint TOKEN_READ = (STANDARD_RIGHTS_READ | TOKEN_QUERY); - - [DllImport("advapi32.dll", SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - private static extern bool OpenProcessToken(IntPtr ProcessHandle, UInt32 DesiredAccess, out IntPtr TokenHandle); - - [DllImport("advapi32.dll", SetLastError = true)] - private static extern bool GetTokenInformation(IntPtr TokenHandle, TOKEN_INFORMATION_CLASS TokenInformationClass, IntPtr TokenInformation, uint TokenInformationLength, out uint ReturnLength); - - public static bool IsUacEnabled => m_lazyIsUacEnabled; - - public static bool IsProcessElevated => m_lazyIsElevated; - - private static Lazy m_lazyIsUacEnabled = new Lazy(() => - { - RegistryKey uacKey = Registry.LocalMachine.OpenSubKey(uacRegistryKey, false); - bool result = uacKey.GetValue(uacRegistryValue).Equals(1); - return result; - }); - - private static Lazy m_lazyIsElevated = new Lazy(() => - { - if (IsUacEnabled) - { - IntPtr tokenHandle; - if (!OpenProcessToken(Process.GetCurrentProcess().Handle, TOKEN_READ, out tokenHandle)) - { - Updater.Instance.Logger.Warn(nameof(PermissionUtil), nameof(IsProcessElevated), "Could not get process token. Win32 Error Code: " + Marshal.GetLastWin32Error()); - return false; - } - - TOKEN_ELEVATION_TYPE elevationResult = TOKEN_ELEVATION_TYPE.TokenElevationTypeDefault; - - int elevationResultSize = Marshal.SizeOf((int)elevationResult); - uint returnedSize = 0; - IntPtr elevationTypePtr = Marshal.AllocHGlobal(elevationResultSize); - - bool success = GetTokenInformation(tokenHandle, TOKEN_INFORMATION_CLASS.TokenElevationType, elevationTypePtr, (uint)elevationResultSize, out returnedSize); - if (!success) - { - Updater.Instance.Logger.Warn(nameof(PermissionUtil), nameof(IsProcessElevated), "Unable to determine the current elevation."); - return false; - } - - elevationResult = (TOKEN_ELEVATION_TYPE)Marshal.ReadInt32(elevationTypePtr); - bool isProcessAdmin = elevationResult == TOKEN_ELEVATION_TYPE.TokenElevationTypeFull; - return isProcessAdmin; - } - else - { - WindowsIdentity identity = WindowsIdentity.GetCurrent(); - WindowsPrincipal principal = new WindowsPrincipal(identity); - return principal.IsInRole(WindowsBuiltInRole.Administrator); - } - }); - - - public static bool DirectoryHasPermission(string dir, FileSystemRights accessRights = FileSystemRights.Modify) - { - if (string.IsNullOrEmpty(dir)) - return false; - - try - { - AuthorizationRuleCollection rules = Directory.GetAccessControl(dir).GetAccessRules(true, true, typeof(SecurityIdentifier)); - WindowsIdentity identity = WindowsIdentity.GetCurrent(); - - foreach (FileSystemAccessRule rule in rules) - if (identity.Groups.Contains(rule.IdentityReference) || rule.IdentityReference == identity.User) - if ((accessRights & rule.FileSystemRights) == accessRights && rule.AccessControlType == AccessControlType.Allow) - return true; - } - catch (Exception e) - { - Updater.Instance.Logger.Warn(nameof(PermissionUtil), nameof(DirectoryHasPermission), $"Current user has no access rights to: '{dir}'{Environment.NewLine}{e.ToString()}"); - } - - return false; - } - - public static bool CheckRegPermission(RegistryKeyEntry key) - { - try - { - RegistryHelper.InternalOpenSubKey(key.Parent.DestinationLocation, key.Name); - return true; - } - catch (Exception ex) - { - Updater.Instance.Logger.Error(nameof(PermissionUtil), nameof(CheckRegPermission), ex); - return false; - } - } - } -} diff --git a/UpdateLib/UpdateLib/Tasks/AsyncTask.cs b/UpdateLib/UpdateLib/Tasks/AsyncTask.cs deleted file mode 100644 index 9fae9f0..0000000 --- a/UpdateLib/UpdateLib/Tasks/AsyncTask.cs +++ /dev/null @@ -1,436 +0,0 @@ -/* Copyright - * - * UpdateLib - .Net auto update library - * - * File: AsyncTask.cs v0.5 - * - * Author: Matthias Beerens - * - * Copyright (C) 2016 - MatthiWare - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Diagnostics; -using System.Threading; - -using MatthiWare.UpdateLib.Common; - -namespace MatthiWare.UpdateLib.Tasks -{ - /// - /// Base class for all Tasks that need to be run Async - /// - public abstract class AsyncTask - { - - #region private fields - - protected Exception m_lastException = null; - - private bool m_useSyncContext = true; - private SynchronizationContext m_syncContext; - - internal bool IsChildTask { get; set; } = false; - -#if DEBUG - public Stopwatch m_sw = new Stopwatch(); -#endif - - private readonly Queue m_childTasks = new Queue(); - private ManualResetEvent m_waitHandle = new ManualResetEvent(true); - private readonly object sync = new object(); - - private bool m_running = false; - private bool m_cancelled = false; - private bool m_completed = false; - - #endregion - - #region events - - /// - /// Raises when this is completed. - /// - public event EventHandler TaskCompleted; - /// - /// Raises when the progress changed. - /// - public event EventHandler TaskProgressChanged; - - #endregion - - #region properties - - public Exception LastException - { - get - { - lock (sync) - return m_lastException; - } - } - - /// - /// Gets if there have been any errors in the task. - /// - public bool HasErrors - { - get - { - lock (sync) - return m_lastException != null; - } - } - - public bool IsCompleted - { - get - { - lock (sync) - return m_completed; - } - } - - /// - /// Gets if the current is cancelled. - /// - public bool IsCancelled - { - get - { - lock (sync) - return m_cancelled; - } - } - - - - /// - /// Gets if the current is Running. - /// - public bool IsRunning - { - get - { - lock (sync) - return m_running; - } - } - - #endregion - - #region static methods - - /// - /// Blocks the calling threads and calls on each in . - /// - /// The tasks to await. - public static void WaitAll(IEnumerable tasks) - { - foreach (AsyncTask task in tasks) - task.AwaitTask(); - } - - #endregion - - #region FluentAPI - - /// - /// Enable if we should switch back to the synchronization context to continue our Task completed. - /// - /// default is true. - /// Indicate if we should use the synchronization context - /// The task object for fluent API. - public AsyncTask ConfigureAwait(bool useSyncContext) - { - m_useSyncContext = useSyncContext; - return this; - } - - /// - /// Starts the task - /// - /// Returns the current Task. - public AsyncTask Start() - { - lock (sync) - { - if (m_running) - return this; - - Reset(); - - m_syncContext = SynchronizationContext.Current; - - Action worker = new Action(() => - { - try - { - m_running = true; - DoWork(); - } - catch (Exception ex) - { - m_lastException = ex; - - Updater.Instance.Logger.Error(GetType().Name, null, ex); - } - finally - { - AwaitWorkers(); - - m_running = false; - m_completed = true; - } - }); - -#if DEBUG - m_sw.Start(); -#endif - - worker.BeginInvoke(new AsyncCallback((IAsyncResult r) => - { -#if DEBUG - m_sw.Stop(); - Updater.Instance.Logger.Debug(GetType().Name, nameof(Start), $"Completed in {m_sw.ElapsedMilliseconds}ms"); -#endif - worker.EndInvoke(r); - - OnTaskCompleted(m_lastException, IsCancelled); - - m_waitHandle.Set(); - - }), null); ; - - return this; - } - } - - /// - /// Blocks the calling thread until the complete task is done. - /// DO NOT call this in the worker method use method instead. - /// - public AsyncTask AwaitTask() - { - lock (sync) - { - if (IsChildTask && !m_completed && !m_running) - Reset(); - - if (m_waitHandle != null) - { - m_waitHandle.WaitOne(); - m_waitHandle.Close(); - m_waitHandle = null; - } - - return this; - } - } - - #endregion - - /// - /// Resets the task back to its initial state - /// - private void Reset() - { - m_cancelled = false; - m_running = false; - m_lastException = null; - m_completed = false; - - m_waitHandle.Reset(); - m_childTasks.Clear(); - -#if DEBUG - m_sw.Reset(); -#endif - } - - /// - /// The worker method. - /// - protected abstract void DoWork(); - - /// - /// Cancels the current - /// Check in the worker code to see if the got cancelled. - /// - public virtual void Cancel() - { - lock (sync) - m_cancelled = true; - } - - /// - /// Adds a new inner task - /// - /// - /// Optional arguments for the action - protected void Enqueue(Delegate action, params object[] args) - { - lock (sync) - { - // Don't allow to start another child task when the parent task has been cancelled or contains errors. - if (m_lastException != null || m_cancelled) - return; - - var task = AsyncTaskFactory.From(action, args); - - task.IsChildTask = true; - task.TaskCompleted += (o, e) => - { - if (e.Error != null) - { - m_lastException = e.Error?.InnerException ?? e.Error; - - Updater.Instance.Logger.Error(GetType().Name, null, LastException); - } - }; - - m_childTasks.Enqueue(task); - - WorkerScheduler.Instance.Schedule(task); - } - } - - /// - /// Blocks the calling thread until all the workers are done. - /// - protected void AwaitWorkers() - { - lock (sync) - while (m_childTasks.Count != 0) - m_childTasks.Dequeue().AwaitTask(); - } - - /// - /// Raises the event. - /// - /// The amount of work that is done. - /// The total amount of work. - protected virtual void OnTaskProgressChanged(int done, int total) - => OnTaskProgressChanged((int)((done / (double)total) * 100)); - - /// /// Raises the event. - /// - /// The percentage of work that is done. - protected virtual void OnTaskProgressChanged(int percent) - => OnTaskProgressChanged(new ProgressChangedEventArgs(percent, null)); - - private int m_lastProgressUpdate = -1; - - /// - /// Raises the event. - /// - /// The event. - protected virtual void OnTaskProgressChanged(ProgressChangedEventArgs e) - { - // filter out redundant calls - if (m_lastProgressUpdate == e.ProgressPercentage) - return; - - m_lastProgressUpdate = e.ProgressPercentage; - - if (!m_useSyncContext || m_syncContext == null) - TaskProgressChanged?.Invoke(this, e); - else - m_syncContext.Post(new SendOrPostCallback((o) => TaskProgressChanged?.Invoke(this, e)), null); - - } - - /// - /// Raises the event. - /// - /// If an occured pass the object. - /// Indicates whether the got cancelled. - protected virtual void OnTaskCompleted(Exception e, bool cancelled = false) - => OnTaskCompleted(new AsyncCompletedEventArgs(e, cancelled, null)); - - /// - /// Raises the event. - /// - /// The event. - protected virtual void OnTaskCompleted(AsyncCompletedEventArgs e) - { - if (!m_useSyncContext || m_syncContext == null) - TaskCompleted?.Invoke(this, e); - else - m_syncContext.Post(new SendOrPostCallback((o) => TaskCompleted?.Invoke(this, e)), null); - } - } - - /// - /// Base class for all Tasks that need to be run Async - /// - /// The type of the Result object - public abstract class AsyncTask : AsyncTask - { - /// - /// Gets or sets the result - /// - public virtual ResultType Result { get; protected set; } = default(ResultType); - } - - /// - /// Base class for all Tasks that need to be run Async - /// - /// The task type to be returned from the FluentAPI - /// The type of the Result object - public abstract class AsyncTask : AsyncTask where TaskType : AsyncTask - { - #region FluentAPI - - /// - /// Enable if we should switch back to the synchronization context to continue our Task completed. - /// - /// default is true. - /// Indicate if we should use the synchronization context - /// The task object for fluent API. - public new TaskType ConfigureAwait(bool useSyncContext) - { - return (TaskType)base.ConfigureAwait(useSyncContext); - } - - /// - /// Starts the task - /// - /// Returns the current Task. - public new TaskType Start() - { - return (TaskType)base.Start(); - - } - - /// - /// Blocks the calling thread until the complete task is done. - /// DO NOT call this in the worker method use method instead. - /// - /// - public new TaskType AwaitTask() - { - return (TaskType)base.AwaitTask(); - - } - - #endregion - } - - -} diff --git a/UpdateLib/UpdateLib/Tasks/AsyncTaskFactory.cs b/UpdateLib/UpdateLib/Tasks/AsyncTaskFactory.cs deleted file mode 100644 index c6ccb2b..0000000 --- a/UpdateLib/UpdateLib/Tasks/AsyncTaskFactory.cs +++ /dev/null @@ -1,105 +0,0 @@ -/* Copyright - * - * UpdateLib - .Net auto update library - * - * File: AsyncTaskFactory.cs v0.5 - * - * Author: Matthias Beerens - * - * Copyright (C) 2016 - MatthiWare - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; - -namespace MatthiWare.UpdateLib.Tasks -{ - /// - /// Factory methods for creating and starting a new task - /// - public class AsyncTaskFactory - { - /// - /// Starts a new task - /// - /// The action delegate - /// The parameters to pass to the action - /// The object - public static AsyncTask StartNew(Delegate action, params object[] args) - => new AnonymousTask(action, args).Start(); - - /// - /// Starts a new task - /// - /// The result type - /// The action delegate - /// The parameters to pass to the action - /// The object with result property - public static AsyncTask StartNew(Delegate action, params object[] args) - => new AnonymousTask(action, args).Start(); - - /// - /// Creates a new task - /// - /// The action delegate - /// The parameters to pass to the action - /// The object - public static AsyncTask From(Delegate action, params object[] args) - => new AnonymousTask(action, args); - - /// - /// Creates a new task - /// - /// The result type - /// The action delegate - /// The parameters to pass to the action - /// The object with result property - public static AsyncTask From(Delegate action, params object[] args) - => new AnonymousTask(action, args); - - private class AnonymousTask : AsyncTask - { - private Delegate action; - private object[] args; - - public AnonymousTask(Delegate action, params object[] args) - { - this.action = action; - this.args = args; - } - - protected override void DoWork() - => action.DynamicInvoke(args); - } - - private class AnonymousTask : AsyncTask> - { - private Delegate action; - private object[] args; - - public AnonymousTask(Delegate action, params object[] args) - { - this.action = action; - this.args = args; - } - - protected override void DoWork() - { - Result = (TResult)action.DynamicInvoke(args); - } - } - - } -} diff --git a/UpdateLib/UpdateLib/Tasks/CheckForUpdatedItemsTask.cs b/UpdateLib/UpdateLib/Tasks/CheckForUpdatedItemsTask.cs deleted file mode 100644 index c70dd02..0000000 --- a/UpdateLib/UpdateLib/Tasks/CheckForUpdatedItemsTask.cs +++ /dev/null @@ -1,107 +0,0 @@ -/* Copyright - * - * UpdateLib - .Net auto update library - * - * File: CheckForUpdatedItemsTask.cs v0.5 - * - * Author: Matthias Beerens - * - * Copyright (C) 2016 - MatthiWare - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using MatthiWare.UpdateLib.Common; -using MatthiWare.UpdateLib.Files; -using MatthiWare.UpdateLib.Utils; -using System; -using System.Collections.Generic; -using System.Linq; - -namespace MatthiWare.UpdateLib.Tasks -{ - public class CheckForUpdatedItemsTask : AsyncTask - { - private Files.UpdateInfo m_updateFile; - private HashCacheFile m_cacheFile; - - public CheckForUpdatedItemsTask(Files.UpdateInfo update, HashCacheFile cache) - { - m_updateFile = update ?? throw new ArgumentNullException(nameof(update)); - m_cacheFile = cache ?? throw new ArgumentNullException(nameof(cache)); - } - - protected override void DoWork() - { - foreach (DirectoryEntry dir in m_updateFile.Folders) - Enqueue(new Action(CheckFiles), dir); - - foreach (DirectoryEntry dir in m_updateFile.Registry) - Enqueue(new Action(CheckRegister), dir); - - AwaitWorkers(); - - Result = m_updateFile.FileCount > 0 || m_updateFile.RegistryKeyCount > 0; - } - - private void CheckFiles(DirectoryEntry dir) - { - dir.Items.RemoveAll(fe => - { - string convertedPath = Updater.Instance.Converter.Convert(fe.DestinationLocation); - HashCacheEntry cacheEntry = m_cacheFile.Items.Find(hash => hash.FilePath.Equals(convertedPath)); - - if (cacheEntry == null) - return false; - - return (fe as FileEntry)?.Hash.Equals(cacheEntry.Hash) ?? true; - }); - - IEnumerable dirsToCheck = dir.Directories.Where(d => d.Count > 0); - int left = dirsToCheck.Count(); - - foreach (DirectoryEntry subDir in dir.Directories) - { - if (--left == 0) - CheckFiles(subDir); - else - Enqueue(new Action(CheckFiles), subDir); - } - } - - private void CheckRegister(DirectoryEntry dir) - { - dir.Items.RemoveAll(entry => - { - RegistryKeyEntry key = entry as RegistryKeyEntry; - - if (key == null) - return true; - - return RegistryHelper.IsSame(key); - }); - - IEnumerable dirsToCheck = dir.Directories.Where(d => d.Count > 0); - int left = dirsToCheck.Count(); - - foreach (DirectoryEntry subDir in dir.Directories) - { - if (--left == 0) - CheckRegister(subDir); - else - Enqueue(new Action(CheckRegister), dir); - } - } - } -} diff --git a/UpdateLib/UpdateLib/Tasks/CheckForUpdatesCompletedEventArgs.cs b/UpdateLib/UpdateLib/Tasks/CheckForUpdatesCompletedEventArgs.cs deleted file mode 100644 index 977d103..0000000 --- a/UpdateLib/UpdateLib/Tasks/CheckForUpdatesCompletedEventArgs.cs +++ /dev/null @@ -1,49 +0,0 @@ -/* Copyright - * - * UpdateLib - .Net auto update library - * - * File: CheckForUpdatesCompletedEventArgs.cs v0.5 - * - * Author: Matthias Beerens - * - * Copyright (C) 2016 - MatthiWare - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using MatthiWare.UpdateLib.Common; -using System; -using System.ComponentModel; - -namespace MatthiWare.UpdateLib.Tasks -{ - public class CheckForUpdatesCompletedEventArgs : AsyncCompletedEventArgs - { - public UpdateVersion LatestVersion { get; set; } - public bool UpdateAvailable { get; set; } - - public CheckForUpdatesCompletedEventArgs(CheckForUpdatesTask.CheckForUpdatesResult result, Exception error, bool cancelled, object userState) - : base(error, cancelled, userState) - { - LatestVersion = result.Version; - UpdateAvailable = result.UpdateAvailable; - } - - public CheckForUpdatesCompletedEventArgs(CheckForUpdatesTask.CheckForUpdatesResult result, AsyncCompletedEventArgs e) - : this(result, e.Error, e.Cancelled, e.UserState) - { - - } - } -} diff --git a/UpdateLib/UpdateLib/Tasks/CheckForUpdatesTask.cs b/UpdateLib/UpdateLib/Tasks/CheckForUpdatesTask.cs deleted file mode 100644 index a889391..0000000 --- a/UpdateLib/UpdateLib/Tasks/CheckForUpdatesTask.cs +++ /dev/null @@ -1,134 +0,0 @@ -/* Copyright - * - * UpdateLib - .Net auto update library - * - * File: CheckForUpdatesTask.cs v0.5 - * - * Author: Matthias Beerens - * - * Copyright (C) 2016 - MatthiWare - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.Collections.Generic; -using System.Net; - -using MatthiWare.UpdateLib.Common; -using MatthiWare.UpdateLib.Common.Abstraction; -using MatthiWare.UpdateLib.Common.Exceptions; -using MatthiWare.UpdateLib.Files; -using MatthiWare.UpdateLib.Utils; - -using static MatthiWare.UpdateLib.Tasks.CheckForUpdatesTask; - -namespace MatthiWare.UpdateLib.Tasks -{ - public class CheckForUpdatesTask : AsyncTask - { - public IList Urls { get; set; } - - private WebClient m_wc; - private UpdateVersion m_version; - private Updater m_updater; - - private const string REPLACE_FILE_NAME = "%file%"; - - public CheckForUpdatesTask(IList urls, UpdateVersion currentVersion) - { - Urls = urls ?? throw new ArgumentNullException(nameof(urls)); - m_version = currentVersion ?? throw new ArgumentNullException(nameof(currentVersion)); - if (urls.Count == 0) throw new ArgumentException("Empty url list provided", nameof(urls)); - - m_wc = new WebClient(); - m_updater = Updater.Instance; - } - - protected override void DoWork() - { - Result = new CheckForUpdatesResult(); - - if (!NetworkUtils.HasConnection()) throw new NoInternetException("No internet available"); - - if (IsCancelled) return; - - // load the updatefile from disk - var file = DownloadFile(Urls.Replace(REPLACE_FILE_NAME, UpdateCatalogFile.FILE_NAME), $"{IOUtils.AppDataPath}\\{UpdateCatalogFile.FILE_NAME}"); - - if (IsCancelled) return; - - if (file.Catalog == null || file.Catalog.Count == 0) throw new InvalidUpdateServerException(); - - Result.UpdateInfo = file.GetLatestUpdateForVersion(m_version); - Result.ApplicationName = file.ApplicationName; - Result.DownloadURLs = file.DownloadUrls; - - if (!Result.UpdateAvailable || IsCancelled) return; - - if (Result.DownloadURLs == null || Result.DownloadURLs.Count == 0) throw new InvalidUpdateServerException(); - - var meta = DownloadFile(Result.DownloadURLs.Replace(REPLACE_FILE_NAME, Result.UpdateInfo.FileName), $"{IOUtils.TempPath}\\{UpdateMetadataFile.FILE_NAME}"); - - if (IsCancelled) return; - - var privilegesCheckTask = new CheckRequiredPrivilegesTask(meta).ConfigureAwait(false).Start(); - Result.AdminRightsNeeded = privilegesCheckTask.AwaitTask().Result; - } - - private T DownloadFile(IEnumerable urlsToUse, string localFile) where T : FileBase, new() - { - var enumerator = urlsToUse.GetEnumerator(); - - m_updater.Logger.Info(nameof(CheckForUpdatesTask), nameof(DownloadFile), $"Getting {typeof(T).GetDescription()}"); - - do - { - if (!enumerator.MoveNext() || string.IsNullOrEmpty(enumerator.Current)) - throw new UnableToDownloadUpdateException(); - } while (!DownloadLocalFile(enumerator.Current, localFile)); - - return FileManager.LoadFile(localFile); - } - - private bool DownloadLocalFile(string url, string localFile) - { - m_updater.Logger.Debug(nameof(CheckForUpdatesTask), nameof(DownloadLocalFile), $"Attempting to download file from {url}"); - - try - { - m_wc.DownloadFile(url, localFile); - - m_updater.Logger.Info(nameof(CheckForUpdatesTask), nameof(DownloadLocalFile), $"Succesfully downloaded file from {url}"); - } - catch (Exception e) - { - m_updater.Logger.Error(nameof(CheckForUpdatesTask), nameof(DoWork), e); - return false; - } - - return true; - } - - public class CheckForUpdatesResult - { - public UpdateVersion Version { get { return UpdateInfo.Version; } } - public bool UpdateAvailable => UpdateInfo != null; - public UpdateInfo UpdateInfo { get; set; } - public string ApplicationName { get; set; } - public IList DownloadURLs { get; set; } - public bool AdminRightsNeeded { get; set; } - } - } -} diff --git a/UpdateLib/UpdateLib/Tasks/CheckRequiredPrivilegesTask.cs b/UpdateLib/UpdateLib/Tasks/CheckRequiredPrivilegesTask.cs deleted file mode 100644 index 9f683ef..0000000 --- a/UpdateLib/UpdateLib/Tasks/CheckRequiredPrivilegesTask.cs +++ /dev/null @@ -1,92 +0,0 @@ -/* Copyright - * - * UpdateLib - .Net auto update library - * - * File: CheckRequiredPrivilegesTask.cs v0.5 - * - * Author: Matthias Beerens - * - * Copyright (C) 2016 - MatthiWare - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System.Linq; - -using MatthiWare.UpdateLib.Common; -using MatthiWare.UpdateLib.Files; -using MatthiWare.UpdateLib.Security; -using MatthiWare.UpdateLib.Utils; - -namespace MatthiWare.UpdateLib.Tasks -{ - public class CheckRequiredPrivilegesTask : AsyncTask - { - - public UpdateMetadataFile UpdateFile { get; set; } - - public CheckRequiredPrivilegesTask(UpdateMetadataFile updateFile) - { - UpdateFile = updateFile; - } - - protected override void DoWork() - { - Result = false; - - if (PermissionUtil.IsProcessElevated) - return; - - foreach (DirectoryEntry dir in UpdateFile.Folders) - if (!CheckHasSufficientPermissionsForDirectory(dir)) - { - Result = true; - return; - } - - - foreach (DirectoryEntry dir in UpdateFile.Registry) - if (!CheckHasSufficientPermissionForRegistry(dir)) - { - Result = true; - return; - } - - Updater.Instance.Logger.Info(nameof(CheckRequiredPrivilegesTask), nameof(DoWork), $"Elavation required: {Result}"); - } - - private bool CheckHasSufficientPermissionsForDirectory(DirectoryEntry dir) - { - string localPath = Updater.Instance.Converter.Convert(dir.DestinationLocation); - - if (!PermissionUtil.DirectoryHasPermission(localPath)) - return false; - - foreach (DirectoryEntry subDir in dir.Directories) - if (!CheckHasSufficientPermissionsForDirectory(subDir)) - return false; - - return true; - } - - private bool CheckHasSufficientPermissionForRegistry(DirectoryEntry dir) - { - foreach (RegistryKeyEntry key in dir.GetItems().Select(e => e as RegistryKeyEntry).NotNull()) - if (!PermissionUtil.CheckRegPermission(key)) - return false; - - return true; - } - } -} diff --git a/UpdateLib/UpdateLib/Tasks/CleanUpTask.cs b/UpdateLib/UpdateLib/Tasks/CleanUpTask.cs deleted file mode 100644 index 3487dc2..0000000 --- a/UpdateLib/UpdateLib/Tasks/CleanUpTask.cs +++ /dev/null @@ -1,60 +0,0 @@ -/* Copyright - * - * UpdateLib - .Net auto update library - * - * File: CleanUpTask.cs v0.5 - * - * Author: Matthias Beerens - * - * Copyright (C) 2016 - MatthiWare - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.IO; - -namespace MatthiWare.UpdateLib.Tasks -{ - public class CleanUpTask : AsyncTask - { - public string PathToClean { get; set; } - public string SearchPattern { get; set; } - public bool IncludeSubDirectories { get; set; } - - public CleanUpTask(string pathToCleanUp, string searchPattern = "*.old.tmp", bool includeSubDirs = true) - { - PathToClean = Updater.Instance.Converter.Convert(pathToCleanUp); - SearchPattern = searchPattern; - IncludeSubDirectories = includeSubDirs; - } - protected override void DoWork() - { - DirectoryInfo dir = new DirectoryInfo(PathToClean); - FileInfo[] files = dir.GetFiles(SearchPattern, IncludeSubDirectories ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly); - - foreach (FileInfo file in files) - { - try - { - file.Delete(); - } - catch (Exception e) - { - Updater.Instance.Logger.Error(nameof(CleanUpTask), nameof(DoWork), e); - } - } - } - } -} diff --git a/UpdateLib/UpdateLib/Tasks/DownloadManager.cs b/UpdateLib/UpdateLib/Tasks/DownloadManager.cs deleted file mode 100644 index 9e35f3f..0000000 --- a/UpdateLib/UpdateLib/Tasks/DownloadManager.cs +++ /dev/null @@ -1,118 +0,0 @@ -/* Copyright - * - * UpdateLib - .Net auto update library - * - * File: DownloadManager.cs v0.5 - * - * Author: Matthias Beerens - * - * Copyright (C) 2016 - MatthiWare - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.IO; -using System.Net; - -using MatthiWare.UpdateLib.Common; -using MatthiWare.UpdateLib.Common.Exceptions; -using MatthiWare.UpdateLib.Security; -using MatthiWare.UpdateLib.Utils; - -namespace MatthiWare.UpdateLib.Tasks -{ - public class DownloadManager - { - private UpdateInfo m_updateInfo; - - private IList m_urls; - - public event EventHandler ProgressChanged; - public event EventHandler Completed; - - private int index = 0; - - private Updater updater; - - public DownloadManager(UpdateInfo updateInfo, IList urls) - { - m_urls = urls ?? throw new ArgumentNullException(nameof(urls)); - m_updateInfo = updateInfo ?? throw new ArgumentNullException(nameof(updateInfo)); - - if (m_urls.Count == 0) throw new ArgumentException("No download sources specified ", nameof(urls)); - - updater = Updater.Instance; - } - - public void Download() - { - var urlToUse = GetNextUrl(); - - if (string.IsNullOrEmpty(urlToUse)) - throw new WebException("Unable to download patch from specified download sources"); - - var local = new FileInfo($"{IOUtils.TempPath}\\{m_updateInfo.FileName}"); - - if (!local.Directory.Exists) local.Directory.Create(); - if (local.Exists) local.Delete(); - - var task = new DownloadTask(urlToUse, local.FullName); - - task.TaskProgressChanged += (o, e) => OnProgressChanged(e.ProgressPercentage, 110); - - task.TaskCompleted += (o, e) => - { - if (e.Error != null) - { - updater.Logger.Error(nameof(DownloadManager), nameof(Download), e.Error); - updater.Logger.Info(nameof(DownloadManager), nameof(Download), "Attempting to download patch from next url.."); - - task.Url = GetNextUrl(); - - if (string.IsNullOrEmpty(task.Url)) - OnCompleted(new WebException("Unable to download patch from specified download sources", e.Error)); - else - task.Start(); - - return; - } - - var hash = HashUtil.GetHash(local.FullName); - - if (m_updateInfo.Hash != hash) - { - OnCompleted(new InvalidHashException($"Hash doesn't match was expecting '{m_updateInfo.Hash}' but got '{hash}'")); - return; - } - - OnProgressChanged(100, 100); - OnCompleted(null); - }; - - task.Start(); - } - - protected void OnProgressChanged(int done, int total) - => ProgressChanged?.Invoke(this, new ProgressChangedEventArgs((int)((done / (double)total) * 100), null)); - - protected void OnCompleted(Exception e) - => Completed?.Invoke(this, new AsyncCompletedEventArgs(e, false, null)); - - private string GetNextUrl() - => (index < m_urls.Count) ? m_urls[index++].Replace("%file%", m_updateInfo.FileName) : string.Empty; - } -} diff --git a/UpdateLib/UpdateLib/Tasks/DownloadTask.cs b/UpdateLib/UpdateLib/Tasks/DownloadTask.cs deleted file mode 100644 index 999531d..0000000 --- a/UpdateLib/UpdateLib/Tasks/DownloadTask.cs +++ /dev/null @@ -1,85 +0,0 @@ -/* Copyright - * - * UpdateLib - .Net auto update library - * -/* Copyright - * - * UpdateLib - .Net auto update library - * - * File: DownloadTask.cs v0.5 - * - * Author: Matthias Beerens - * - * Copyright (C) 2016 - MatthiWare - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.IO; -using System.Net; -using System.Threading; - -namespace MatthiWare.UpdateLib.Tasks -{ - public class DownloadTask : AsyncTask - { - private WebClient webClient; - private ManualResetEvent wait; - private Updater m_updater; - - public string Url { get; set; } - public string Local { get; set; } - - public DownloadTask(string url, string local) - { - if (string.IsNullOrEmpty(local)) throw new ArgumentNullException(nameof(local)); - if (string.IsNullOrEmpty(url)) throw new ArgumentNullException(nameof(url)); - - Url = url; - Local = local; - - webClient = new WebClient(); - webClient.DownloadProgressChanged += (o, e) => { OnTaskProgressChanged(e.ProgressPercentage); }; - webClient.DownloadFileCompleted += (o, e) => { wait.Set(); }; - - m_updater = Updater.Instance; - } - - protected override void DoWork() - { - if (IsCancelled) - return; - - wait = new ManualResetEvent(false); - - m_updater.Logger.Debug(nameof(DownloadTask), nameof(DoWork), $"LocalFile => {Local}"); - m_updater.Logger.Debug(nameof(DownloadTask), nameof(DoWork), $"RemoteFile => {Url}"); - - var fi = new FileInfo(Local); - - if (!fi.Directory.Exists) - fi.Directory.Create(); - - var uri = new Uri(Url); - webClient.DownloadFileAsync(uri, Local); - - wait.WaitOne(); - wait.Close(); - wait = null; - - OnTaskProgressChanged(100); - } - } -} diff --git a/UpdateLib/UpdateLib/Tasks/LoadCacheTask.cs b/UpdateLib/UpdateLib/Tasks/LoadCacheTask.cs deleted file mode 100644 index c0b8850..0000000 --- a/UpdateLib/UpdateLib/Tasks/LoadCacheTask.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using System.Linq; -using System.Reflection; - -using MatthiWare.UpdateLib.Common; -using MatthiWare.UpdateLib.Files; -using MatthiWare.UpdateLib.Utils; - -namespace MatthiWare.UpdateLib.Tasks -{ - public class LoadCacheTask : AsyncTask - { - private Lazy m_lazyUpdateVersion = new Lazy(() => - { - ApplicationVersionAttribute attr = Assembly.GetEntryAssembly()?.GetCustomAttributes(typeof(ApplicationVersionAttribute), true).FirstOrDefault() as ApplicationVersionAttribute; - - return attr?.Version ?? "0.0.0"; - }); - - - - protected override void DoWork() - { - try - { - Result = FileManager.LoadFile(); - } - catch (Exception e) - { - Updater.Instance.Logger.Error(nameof(LoadCacheTask), nameof(DoWork), e); - - Result = new CacheFile(); - Result.CurrentVersion = m_lazyUpdateVersion; - Result.Save(); - } - } - } -} diff --git a/UpdateLib/UpdateLib/Tasks/UpdatableTask.cs b/UpdateLib/UpdateLib/Tasks/UpdatableTask.cs deleted file mode 100644 index 4309a12..0000000 --- a/UpdateLib/UpdateLib/Tasks/UpdatableTask.cs +++ /dev/null @@ -1,49 +0,0 @@ -/* Copyright - * - * UpdateLib - .Net auto update library - * - * File: UpdatableTask.cs v0.5 - * - * Author: Matthias Beerens - * - * Copyright (C) 2016 - MatthiWare - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -namespace MatthiWare.UpdateLib.Tasks -{ - public abstract class UpdatableTask : AsyncTask - { - private new void Start() - { - base.Start(); - } - - public void Update() - { - Start(); - } - - public override void Cancel() - { - base.Cancel(); - - Rollback(); - } - - public abstract void Rollback(); - - } -} diff --git a/UpdateLib/UpdateLib/Tasks/UpdateCacheTask.cs b/UpdateLib/UpdateLib/Tasks/UpdateCacheTask.cs deleted file mode 100644 index ce2c51a..0000000 --- a/UpdateLib/UpdateLib/Tasks/UpdateCacheTask.cs +++ /dev/null @@ -1,125 +0,0 @@ -/* Copyright - * - * UpdateLib - .Net auto update library - * - * File: UpdateCacheTask.cs v0.5 - * - * Author: Matthias Beerens - * - * Copyright (C) 2016 - MatthiWare - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using MatthiWare.UpdateLib.Common; -using MatthiWare.UpdateLib.Files; -using MatthiWare.UpdateLib.Utils; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; - -namespace MatthiWare.UpdateLib.Tasks -{ - public class UpdateCacheTask : AsyncTask - { - private Dictionary existingEntries = null; - private IEnumerable files = null; - - protected override void DoWork() - { - existingEntries = new Dictionary(); - - try - { - // first of lets load the file, (file might be corrupt..) - Result = FileManager.LoadFile(); - - Result.Items.ForEach(e => existingEntries.Add(e, false)); - } - catch (Exception e) - { - Updater.Instance.Logger.Error(nameof(UpdateCacheTask), nameof(DoWork), e); - Result = null; - } - - var dir = new DirectoryInfo(Updater.Instance.Converter.Convert("%appdir%")); - files = dir.GetFiles("*", SearchOption.AllDirectories).Where(f => !f.FullName.Contains(".old.tmp")); - - Updater.Instance.Logger.Debug(nameof(UpdateCacheTask), nameof(DoWork), $"found {files.Count()} files to recheck."); - - if (Result == null) // The file doesn't exist yet - { - Result = CreateNewHashCacheFile(); - - return; - } - - CheckFiles(); - - existingEntries.Where(e => e.Value == false).ForEach(e => Result.Items.Remove(e.Key)); - - Result.Save(); - } - - private void CheckFiles() - { - foreach (System.IO.FileInfo f in files) - { - HashCacheEntry entry = base.Result.Items.Find(match => match.FilePath == f.FullName); - if (entry == null) - { - try - { - base.Result.Items.Add(new HashCacheEntry(f.FullName)); - } - catch (Exception ex) // file might no longer exist or is in use - { - Updater.Instance.Logger.Error(nameof(UpdateCacheTask), nameof(DoWork), ex); - } - - continue; - } - - existingEntries[entry] = true; - - // check to see if the file has been modified since last cache check - entry.Recalculate(); - } - } - - private HashCacheFile CreateNewHashCacheFile() - { - Updater.Instance.Logger.Warn(nameof(UpdateCacheTask), nameof(DoWork), $"{nameof(HashCacheFile)} doesn't exist. Creating.."); - - var result = new HashCacheFile(); - - foreach (System.IO.FileInfo f in files) - { - try - { - result.Items.Add(new HashCacheEntry(f.FullName)); - } - catch (Exception ex) // file might no longer exist or is in use - { - Updater.Instance.Logger.Error(nameof(UpdateCacheTask), nameof(DoWork), ex); - } - } - - result.Save(); - - return result; - } - } -} diff --git a/UpdateLib/UpdateLib/Tasks/UpdateRegistryTask.cs b/UpdateLib/UpdateLib/Tasks/UpdateRegistryTask.cs deleted file mode 100644 index 5cbbb87..0000000 --- a/UpdateLib/UpdateLib/Tasks/UpdateRegistryTask.cs +++ /dev/null @@ -1,138 +0,0 @@ -/* Copyright - * - * UpdateLib - .Net auto update library - * - * File: UpdateRegistryTask.cs v0.5 - * - * Author: Matthias Beerens - * - * Copyright (C) 2016 - MatthiWare - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using MatthiWare.UpdateLib.Common; -using MatthiWare.UpdateLib.Utils; -using Microsoft.Win32; -using System; -using System.Collections.Generic; -using System.Linq; - -namespace MatthiWare.UpdateLib.Tasks -{ - public class UpdateRegistryTask : UpdatableTask - { - - public IEnumerable Keys { get; set; } - - private List cachedUpdates = new List(); - - public UpdateRegistryTask(IEnumerable keys) - { - Keys = keys; - } - - protected override void DoWork() - { - cachedUpdates.Clear(); - - int total = Keys.Count(); - int count = 0; - - foreach (RegistryKeyEntry key in Keys) - { - UpdateKey(key); - - OnTaskProgressChanged(++count, total); - } - } - - private void UpdateKey(RegistryKeyEntry key) - { - string path = key.Parent.DestinationLocation; - - RollbackData rollback = new RollbackData(key); - - cachedUpdates.Add(rollback); - - RegistryHelper.Update(key, rollback); - - Updater.Instance.Logger.Info( - nameof(UpdateRegistryTask), - nameof(UpdateKey), - $"Succesfully updated {key.DestinationLocation}"); - } - - public override void Rollback() - { - int total = cachedUpdates.Count; - int count = 0; - - foreach (RollbackData data in cachedUpdates) - { - RollbackFailSafe(data); - - OnTaskProgressChanged(++count, total); - } - } - - private void RollbackFailSafe(RollbackData data) - { - try - { - RegistryKey key = RegistryHelper.GetOrMakeKey(data.path); - - if (!data.existed) - { - key.DeleteValue(data.key); - - Updater.Instance.Logger.Warn( - nameof(UpdateRegistryTask), - nameof(Rollback), - $"Deleted -> {data.path}\\{data.key}"); - - return; - } - - key.SetValue(data.key, data.cachedValue, data.type); - - Updater.Instance.Logger.Warn( - nameof(UpdateRegistryTask), - nameof(Rollback), - $"Rolled back -> {data.path}\\{data.key}"); - } - catch (Exception e) - { - Updater.Instance.Logger.Error(nameof(UpdateRegistryTask), nameof(Rollback), e); - } - } - - public struct RollbackData - { - public bool existed; - public string path; - public string key; - public object cachedValue; - public RegistryValueKind type; - - public RollbackData(RegistryKeyEntry l_key) - { - key = l_key.Name; - path = l_key.Parent.DestinationLocation; - existed = RegistryHelper.Exists(l_key, out cachedValue); - type = RegistryValueKind.Unknown; - } - } - } -} diff --git a/UpdateLib/UpdateLib/UI/Components/ChangelogPage.Designer.cs b/UpdateLib/UpdateLib/UI/Components/ChangelogPage.Designer.cs deleted file mode 100644 index 55dbc85..0000000 --- a/UpdateLib/UpdateLib/UI/Components/ChangelogPage.Designer.cs +++ /dev/null @@ -1,83 +0,0 @@ -namespace MatthiWare.UpdateLib.UI.Components -{ - partial class ChangelogPage - { - /// - /// 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 Component Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ChangelogPage)); - this.txtTitle = new System.Windows.Forms.Label(); - this.richTextBox1 = new System.Windows.Forms.RichTextBox(); - this.SuspendLayout(); - // - // txtTitle - // - this.txtTitle.AutoSize = true; - this.txtTitle.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.txtTitle.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(43)))), ((int)(((byte)(129)))), ((int)(((byte)(181))))); - this.txtTitle.Location = new System.Drawing.Point(12, 12); - this.txtTitle.Name = "txtTitle"; - this.txtTitle.Size = new System.Drawing.Size(224, 25); - this.txtTitle.TabIndex = 1; - this.txtTitle.Text = "Changelog / Patchnotes"; - // - // richTextBox1 - // - this.richTextBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.richTextBox1.BackColor = System.Drawing.SystemColors.Window; - this.richTextBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.richTextBox1.Cursor = System.Windows.Forms.Cursors.IBeam; - this.richTextBox1.Location = new System.Drawing.Point(14, 52); - this.richTextBox1.Name = "richTextBox1"; - this.richTextBox1.ReadOnly = true; - this.richTextBox1.Size = new System.Drawing.Size(612, 359); - this.richTextBox1.TabIndex = 2; - this.richTextBox1.Text = resources.GetString("richTextBox1.Text"); - // - // ChangelogPage - // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.SystemColors.Window; - this.Controls.Add(this.richTextBox1); - this.Controls.Add(this.txtTitle); - this.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.Name = "ChangelogPage"; - this.Size = new System.Drawing.Size(637, 425); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.Label txtTitle; - private System.Windows.Forms.RichTextBox richTextBox1; - } -} diff --git a/UpdateLib/UpdateLib/UI/Components/ChangelogPage.cs b/UpdateLib/UpdateLib/UI/Components/ChangelogPage.cs deleted file mode 100644 index cad8560..0000000 --- a/UpdateLib/UpdateLib/UI/Components/ChangelogPage.cs +++ /dev/null @@ -1,127 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.Windows.Forms; - -namespace MatthiWare.UpdateLib.UI.Components -{ - public partial class ChangelogPage : UserControl, IWizardPage - { - public ChangelogPage(UpdaterForm parent) - { - InitializeComponent(); - - _updaterForm = parent; - } - - public UserControl Conent - { - get - { - return this; - } - } - - - - public bool NeedsCancel - { - get - { - return false; - } - } - - public bool NeedsExecution - { - get - { - return false; - } - } - - public string Title - { - get - { - return txtTitle.Text; - } - } - - private UpdaterForm _updaterForm; - public UpdaterForm UpdaterForm - { - get - { - return _updaterForm; - } - } - - private bool _isbusy; - public bool IsBusy - { - get - { - return _isbusy; - } - - set - { - _isbusy = value; - } - } - - public bool IsDone - {get;set; - } - - public bool HasErrors - { - get; set; - } - - public void PageEntered() - { - IsDone = true; - } - - public event EventHandler PageUpdate; - - public bool NeedsRollBack { get { return false; } } - - public void UpdateState() - { - - } - - public void Cancel() - { - IsDone = true; - } - - public void Execute() - { - throw new NotImplementedException(); - } - - public void Rollback() - { - - } - } -} diff --git a/UpdateLib/UpdateLib/UI/Components/ChangelogPage.resx b/UpdateLib/UpdateLib/UI/Components/ChangelogPage.resx deleted file mode 100644 index 35f5067..0000000 --- a/UpdateLib/UpdateLib/UI/Components/ChangelogPage.resx +++ /dev/null @@ -1,235 +0,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 - - - # Change Log -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](http://keepachangelog.com/) -and this project adheres to [Semantic Versioning](http://semver.org/). - -## [Unreleased] -### Added -- zh-CN and zh-TW translations from @tianshuo. -- de translation from @mpbzh. -- it-IT translation from @roalz. -- sv translation from @magol. -- tr-TR translation from @karalamalar. -- fr translation from @zapashcanon. - -### Changed -- Start versioning based on the current English version at 0.3.0 to help -translation authors keep things up-to-date. -- Fix typos in zh-CN translation. -- Fix typos in pt-BR translation. - -## [0.3.0] - 2015-12-03 -### Added -- RU translation from @aishek. -- pt-BR translation from @tallesl. -- es-ES translation from @ZeliosAriex. - -## [0.2.0] - 2015-10-06 -### Changed -- Remove exclusionary mentions of "open source" since this project can benefit -both "open" and "closed" source projects equally. - -## [0.1.0] - 2015-10-06 -### Added -- Answer "Should you ever rewrite a change log?". - -### Changed -- Improve argument against commit logs. -- Start following [SemVer](http://semver.org) properly. - -## [0.0.8] - 2015-02-17 -### Changed -- Update year to match in every README example. -- Reluctantly stop making fun of Brits only, since most of the world - writes dates in a strange way. - -### Fixed -- Fix typos in recent README changes. -- Update outdated unreleased diff link. - -## [0.0.7] - 2015-02-16 -### Added -- Link, and make it obvious that date format is ISO 8601. - -### Changed -- Clarified the section on "Is there a standard change log format?". - -### Fixed -- Fix Markdown links to tag comparison URL with footnote-style links. - -## [0.0.6] - 2014-12-12 -### Added -- README section on "yanked" releases. - -## [0.0.5] - 2014-08-09 -### Added -- Markdown links to version tags on release headings. -- Unreleased section to gather unreleased changes and encourage note -keeping prior to releases. - -## [0.0.4] - 2014-08-09 -### Added -- Better explanation of the difference between the file ("CHANGELOG") -and its function "the change log". - -### Changed -- Refer to a "change log" instead of a "CHANGELOG" throughout the site -to differentiate between the file and the purpose of the file - the -logging of changes. - -### Removed -- Remove empty sections from CHANGELOG, they occupy too much space and -create too much noise in the file. People will have to assume that the -missing sections were intentionally left out because they contained no -notable changes. - -## [0.0.3] - 2014-08-09 -### Added -- "Why should I care?" section mentioning The Changelog podcast. - -## [0.0.2] - 2014-07-10 -### Added -- Explanation of the recommended reverse chronological release ordering. - -## 0.0.1 - 2014-05-31 -### Added -- This CHANGELOG file to hopefully serve as an evolving example of a standardized open source project CHANGELOG. -- CNAME file to enable GitHub Pages custom domain -- README now contains answers to common questions about CHANGELOGs -- Good examples and basic guidelines, including proper date formatting. -- Counter-examples: "What makes unicorns cry?" - -[Unreleased]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.3.0...HEAD -[0.3.0]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.2.0...v0.3.0 -[0.2.0]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.1.0...v0.2.0 -[0.1.0]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.0.8...v0.1.0 -[0.0.8]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.0.7...v0.0.8 -[0.0.7]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.0.6...v0.0.7 -[0.0.6]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.0.5...v0.0.6 -[0.0.5]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.0.4...v0.0.5 -[0.0.4]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.0.3...v0.0.4 -[0.0.3]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.0.2...v0.0.3 -[0.0.2]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.0.1...v0.0.2 - - \ No newline at end of file diff --git a/UpdateLib/UpdateLib/UI/Components/FinishPage.Designer.cs b/UpdateLib/UpdateLib/UI/Components/FinishPage.Designer.cs deleted file mode 100644 index e58fabf..0000000 --- a/UpdateLib/UpdateLib/UI/Components/FinishPage.Designer.cs +++ /dev/null @@ -1,97 +0,0 @@ -namespace MatthiWare.UpdateLib.UI.Components -{ - partial class FinishPage - { - /// - /// 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 Component Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FinishPage)); - this.txtFinished = new System.Windows.Forms.Label(); - this.txtDescription = new System.Windows.Forms.Label(); - this.cbRestart = new System.Windows.Forms.CheckBox(); - this.SuspendLayout(); - // - // txtFinished - // - this.txtFinished.AutoSize = true; - this.txtFinished.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.txtFinished.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(43)))), ((int)(((byte)(129)))), ((int)(((byte)(181))))); - this.txtFinished.Location = new System.Drawing.Point(12, 12); - this.txtFinished.Name = "txtFinished"; - this.txtFinished.Size = new System.Drawing.Size(85, 25); - this.txtFinished.TabIndex = 0; - this.txtFinished.Text = "Finished"; - // - // txtDescription - // - this.txtDescription.AutoSize = true; - this.txtDescription.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.txtDescription.Location = new System.Drawing.Point(14, 52); - this.txtDescription.Name = "txtDescription"; - this.txtDescription.Size = new System.Drawing.Size(433, 136); - this.txtDescription.TabIndex = 1; - this.txtDescription.Text = resources.GetString("txtDescription.Text"); - // - // cbRestart - // - this.cbRestart.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.cbRestart.AutoSize = true; - this.cbRestart.Checked = true; - this.cbRestart.CheckState = System.Windows.Forms.CheckState.Checked; - this.cbRestart.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.cbRestart.Location = new System.Drawing.Point(17, 202); - this.cbRestart.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.cbRestart.Name = "cbRestart"; - this.cbRestart.Size = new System.Drawing.Size(136, 21); - this.cbRestart.TabIndex = 2; - this.cbRestart.Text = "Restart application"; - this.cbRestart.UseVisualStyleBackColor = true; - this.cbRestart.CheckedChanged += new System.EventHandler(this.cbRestart_CheckedChanged); - // - // FinishPage - // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.SystemColors.Window; - this.Controls.Add(this.cbRestart); - this.Controls.Add(this.txtDescription); - this.Controls.Add(this.txtFinished); - this.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.Name = "FinishPage"; - this.Size = new System.Drawing.Size(701, 245); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.Label txtFinished; - private System.Windows.Forms.Label txtDescription; - private System.Windows.Forms.CheckBox cbRestart; - } -} diff --git a/UpdateLib/UpdateLib/UI/Components/FinishPage.cs b/UpdateLib/UpdateLib/UI/Components/FinishPage.cs deleted file mode 100644 index e2512b5..0000000 --- a/UpdateLib/UpdateLib/UI/Components/FinishPage.cs +++ /dev/null @@ -1,170 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.Windows.Forms; - -namespace MatthiWare.UpdateLib.UI.Components -{ - public partial class FinishPage : UserControl, IWizardPage - { - - private UpdaterForm _updaterForm; - - public FinishPage(UpdaterForm parent) - { - InitializeComponent(); - - _updaterForm = parent; - - txtDescription.Text = txtDescription.Text.Replace("%AppName%", parent.ApplicationName); - txtDescription.Text = txtDescription.Text.Replace("%version%", parent.UpdateInfo.Version); - } - - public void UpdateState() - { - var version = _updaterForm.UpdateInfo.Version; - string appName = _updaterForm.ApplicationName; - - if (_updaterForm.HasHadErrors) - { - cbRestart.Checked = false; - cbRestart.Enabled = false; - - txtDescription.Text = $"{appName} was unable to update to version {version}!\n\n" + - "Check the log files for more information!\n\n" + - "Press Finish to close this wizard."; - - txtFinished.Text = "Finished (with errors)"; - } - else if (_updaterForm.UserCancelled) - { - cbRestart.Checked = false; - cbRestart.Enabled = false; - - txtDescription.Text = $"{appName} was unable to update to version {version}!\n\n" + - "Update process cancelled by the user.\n\n" + - "Press Finish to close this wizard."; - - txtFinished.Text = "Finished (cancelled)"; - } - } - - public UserControl Conent - { - get - { - return this; - } - } - - private bool _isbusy; - public bool IsBusy - { - get - { - return _isbusy; - } - - set - { - _isbusy = value; - } - } - - private bool _isdone; - public bool IsDone - { - get - { - return _isdone; - } - - set - { - _isdone = value; - } - } - - public void PageEntered() - { - IsDone = true; - } - - public bool NeedsCancel - { - get - { - return false; - } - } - - public bool NeedsExecution - { - get - { - return false; - } - } - - public string Title - { - get - { - return txtFinished.Text; - } - } - - - public UpdaterForm UpdaterForm - { - get - { - return _updaterForm; - } - } - - public bool NeedsRollBack { get { return false; } } - - public bool HasErrors - { - get; set; - } - - public event EventHandler PageUpdate; - - public void Cancel() - { - IsDone = true; - } - - public void Execute() - { - throw new NotImplementedException(); - } - - private void cbRestart_CheckedChanged(object sender, EventArgs e) - { - UpdaterForm.NeedsRestart = cbRestart.Checked; - } - - public void Rollback() - { - - } - } -} diff --git a/UpdateLib/UpdateLib/UI/Components/FinishPage.resx b/UpdateLib/UpdateLib/UI/Components/FinishPage.resx deleted file mode 100644 index 166646a..0000000 --- a/UpdateLib/UpdateLib/UI/Components/FinishPage.resx +++ /dev/null @@ -1,131 +0,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 - - - %AppName% has been succesfully updated to version %version%. - -%AppName% needs to restart for the changes to take effect. - -If you do not want this you can uncheck the Restart application checkbox. - -Press Finish to close this wizard. - - - - \ No newline at end of file diff --git a/UpdateLib/UpdateLib/UI/Components/IntroPage.Designer.cs b/UpdateLib/UpdateLib/UI/Components/IntroPage.Designer.cs deleted file mode 100644 index 8c406d0..0000000 --- a/UpdateLib/UpdateLib/UI/Components/IntroPage.Designer.cs +++ /dev/null @@ -1,77 +0,0 @@ -namespace MatthiWare.UpdateLib.UI.Components -{ - partial class IntroPage - { - /// - /// 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 Component Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(IntroPage)); - this.txtWelcome = new System.Windows.Forms.Label(); - this.txtDesc = new System.Windows.Forms.Label(); - this.SuspendLayout(); - // - // txtWelcome - // - this.txtWelcome.AutoSize = true; - this.txtWelcome.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.txtWelcome.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(43)))), ((int)(((byte)(129)))), ((int)(((byte)(181))))); - this.txtWelcome.Location = new System.Drawing.Point(12, 12); - this.txtWelcome.Name = "txtWelcome"; - this.txtWelcome.Size = new System.Drawing.Size(360, 25); - this.txtWelcome.TabIndex = 0; - this.txtWelcome.Text = "Welcome to the %AppName% Updater!"; - // - // txtDesc - // - this.txtDesc.AutoSize = true; - this.txtDesc.Location = new System.Drawing.Point(14, 52); - this.txtDesc.Name = "txtDesc"; - this.txtDesc.Size = new System.Drawing.Size(425, 119); - this.txtDesc.TabIndex = 1; - this.txtDesc.Text = resources.GetString("txtDesc.Text"); - // - // IntroPage - // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.SystemColors.Window; - this.Controls.Add(this.txtDesc); - this.Controls.Add(this.txtWelcome); - this.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.Name = "IntroPage"; - this.Size = new System.Drawing.Size(515, 232); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.Label txtWelcome; - private System.Windows.Forms.Label txtDesc; - } -} diff --git a/UpdateLib/UpdateLib/UI/Components/IntroPage.cs b/UpdateLib/UpdateLib/UI/Components/IntroPage.cs deleted file mode 100644 index ad000c8..0000000 --- a/UpdateLib/UpdateLib/UI/Components/IntroPage.cs +++ /dev/null @@ -1,138 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.Windows.Forms; - -namespace MatthiWare.UpdateLib.UI.Components -{ - public partial class IntroPage : UserControl, IWizardPage - { - public IntroPage(UpdaterForm parent) - { - InitializeComponent(); - - _updateForm = parent; - - txtDesc.Text = txtDesc.Text.Replace("%AppName%", parent.ApplicationName); - txtWelcome.Text = txtWelcome.Text.Replace("%AppName%", parent.ApplicationName); - } - - public UserControl Conent - { - get - { - return this; - } - } - - private bool _isbusy; - public bool IsBusy - { - get - { - return _isbusy; - } - - set - { - _isbusy = value; - } - } - - private bool _isdone; - public bool IsDone - { - get - { - return _isdone; - } - - set - { - _isdone = value; - } - } - - public void PageEntered() - { - IsDone = true; - } - - public bool NeedsCancel - { - get - { - return false; - } - } - - public bool NeedsExecution - { - get - { - return false; - } - } - - public string Title - { - get - { - return txtWelcome.Text; - } - } - - private UpdaterForm _updateForm; - public UpdaterForm UpdaterForm - { - get - { - return _updateForm; - } - } - - public bool HasErrors - { - get; set; - } - - public event EventHandler PageUpdate; - - public void UpdateState() - { - - } - - public bool NeedsRollBack { get { return false; } } - - public void Cancel() - { - IsDone = true; - } - - public void Execute() - { - throw new NotImplementedException(); - } - - public void Rollback() - { - - } - } -} diff --git a/UpdateLib/UpdateLib/UI/Components/IntroPage.resx b/UpdateLib/UpdateLib/UI/Components/IntroPage.resx deleted file mode 100644 index 94af550..0000000 --- a/UpdateLib/UpdateLib/UI/Components/IntroPage.resx +++ /dev/null @@ -1,129 +0,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 - - - This wizard will guide you throug the update process of %AppName%. - -To return to the previous screen, click Previous. - -To cancel the update process at any time, click Cancel. - -Click Next to continue. - - \ No newline at end of file diff --git a/UpdateLib/UpdateLib/UI/Components/RollbackPage.Designer.cs b/UpdateLib/UpdateLib/UI/Components/RollbackPage.Designer.cs deleted file mode 100644 index 2164900..0000000 --- a/UpdateLib/UpdateLib/UI/Components/RollbackPage.Designer.cs +++ /dev/null @@ -1,142 +0,0 @@ -namespace MatthiWare.UpdateLib.UI.Components -{ - partial class RollbackPage - { - /// - /// 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 Component Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - System.Windows.Forms.ListViewGroup listViewGroup1 = new System.Windows.Forms.ListViewGroup("Installed version", System.Windows.Forms.HorizontalAlignment.Left); - System.Windows.Forms.ListViewGroup listViewGroup2 = new System.Windows.Forms.ListViewGroup("Local versions", System.Windows.Forms.HorizontalAlignment.Left); - System.Windows.Forms.ListViewGroup listViewGroup3 = new System.Windows.Forms.ListViewGroup("Available versions", System.Windows.Forms.HorizontalAlignment.Left); - this.lblHeader = new System.Windows.Forms.Label(); - this.ilIcons = new System.Windows.Forms.ImageList(this.components); - this.lvItems = new System.Windows.Forms.ListView(); - this.clmnVersion = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.clmnStatus = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.clmnProgress = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.clmnDescription = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.clmnPath = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.SuspendLayout(); - // - // lblHeader - // - this.lblHeader.AutoSize = true; - this.lblHeader.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblHeader.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(43)))), ((int)(((byte)(129)))), ((int)(((byte)(181))))); - this.lblHeader.Location = new System.Drawing.Point(17, 18); - this.lblHeader.Name = "lblHeader"; - this.lblHeader.Size = new System.Drawing.Size(359, 25); - this.lblHeader.TabIndex = 3; - this.lblHeader.Text = "Rollback/repair manager %AppName%"; - // - // ilIcons - // - this.ilIcons.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit; - this.ilIcons.ImageSize = new System.Drawing.Size(16, 16); - this.ilIcons.TransparentColor = System.Drawing.Color.Transparent; - // - // lvItems - // - this.lvItems.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.lvItems.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.clmnVersion, - this.clmnStatus, - this.clmnProgress, - this.clmnDescription, - this.clmnPath}); - this.lvItems.FullRowSelect = true; - listViewGroup1.Header = "Installed version"; - listViewGroup1.Name = "lvgInstalled"; - listViewGroup2.Header = "Local versions"; - listViewGroup2.Name = "lvgLocal"; - listViewGroup3.Header = "Available versions"; - listViewGroup3.Name = "lvgAvailable"; - this.lvItems.Groups.AddRange(new System.Windows.Forms.ListViewGroup[] { - listViewGroup1, - listViewGroup2, - listViewGroup3}); - this.lvItems.Location = new System.Drawing.Point(17, 46); - this.lvItems.Name = "lvItems"; - this.lvItems.Size = new System.Drawing.Size(505, 282); - this.lvItems.TabIndex = 4; - this.lvItems.UseCompatibleStateImageBehavior = false; - this.lvItems.View = System.Windows.Forms.View.Details; - // - // clmnVersion - // - this.clmnVersion.Text = "Version"; - this.clmnVersion.Width = 125; - // - // clmnStatus - // - this.clmnStatus.Text = "Status"; - this.clmnStatus.Width = 131; - // - // clmnProgress - // - this.clmnProgress.Text = "Progress"; - this.clmnProgress.Width = 85; - // - // clmnDescription - // - this.clmnDescription.Text = "Description"; - this.clmnDescription.Width = 100; - // - // clmnPath - // - this.clmnPath.Text = "Path"; - this.clmnPath.Width = 350; - // - // RollbackPage - // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.SystemColors.Window; - this.Controls.Add(this.lvItems); - this.Controls.Add(this.lblHeader); - this.Font = new System.Drawing.Font("Segoe UI", 9.75F); - this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.Name = "RollbackPage"; - this.Size = new System.Drawing.Size(538, 341); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - private System.Windows.Forms.Label lblHeader; - private System.Windows.Forms.ImageList ilIcons; - private System.Windows.Forms.ListView lvItems; - private System.Windows.Forms.ColumnHeader clmnVersion; - private System.Windows.Forms.ColumnHeader clmnStatus; - private System.Windows.Forms.ColumnHeader clmnProgress; - private System.Windows.Forms.ColumnHeader clmnDescription; - private System.Windows.Forms.ColumnHeader clmnPath; - } -} diff --git a/UpdateLib/UpdateLib/UI/Components/RollbackPage.cs b/UpdateLib/UpdateLib/UI/Components/RollbackPage.cs deleted file mode 100644 index b088ae3..0000000 --- a/UpdateLib/UpdateLib/UI/Components/RollbackPage.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Windows.Forms; - -namespace MatthiWare.UpdateLib.UI.Components -{ - public partial class RollbackPage : UserControl - { - public RollbackPage() - { - InitializeComponent(); - } - } -} diff --git a/UpdateLib/UpdateLib/UI/Components/RollbackPage.resx b/UpdateLib/UpdateLib/UI/Components/RollbackPage.resx deleted file mode 100644 index be67fa0..0000000 --- a/UpdateLib/UpdateLib/UI/Components/RollbackPage.resx +++ /dev/null @@ -1,123 +0,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 - - - 17, 17 - - \ No newline at end of file diff --git a/UpdateLib/UpdateLib/UI/Components/UpdatePage.Designer.cs b/UpdateLib/UpdateLib/UI/Components/UpdatePage.Designer.cs deleted file mode 100644 index 8aec832..0000000 --- a/UpdateLib/UpdateLib/UI/Components/UpdatePage.Designer.cs +++ /dev/null @@ -1,142 +0,0 @@ -namespace MatthiWare.UpdateLib.UI.Components -{ - partial class UpdatePage - { - /// - /// 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 Component Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - this.lblHeader = new System.Windows.Forms.Label(); - this.lblSubheader = new System.Windows.Forms.Label(); - this.lvItems = new System.Windows.Forms.ListView(); - this.clmnName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.clmnStatus = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.clmnProgress = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.clmnDescription = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.clmnPath = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.ilIcons = new System.Windows.Forms.ImageList(this.components); - this.SuspendLayout(); - // - // lblHeader - // - this.lblHeader.AutoSize = true; - this.lblHeader.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblHeader.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(43)))), ((int)(((byte)(129)))), ((int)(((byte)(181))))); - this.lblHeader.Location = new System.Drawing.Point(14, 14); - this.lblHeader.Name = "lblHeader"; - this.lblHeader.Size = new System.Drawing.Size(140, 25); - this.lblHeader.TabIndex = 0; - this.lblHeader.Text = "Apply updates"; - // - // lblSubheader - // - this.lblSubheader.AutoSize = true; - this.lblSubheader.Location = new System.Drawing.Point(14, 52); - this.lblSubheader.Name = "lblSubheader"; - this.lblSubheader.Size = new System.Drawing.Size(252, 17); - this.lblSubheader.TabIndex = 1; - this.lblSubheader.Text = "Press Update to start the update process."; - // - // lvItems - // - this.lvItems.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.lvItems.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.clmnName, - this.clmnStatus, - this.clmnProgress, - this.clmnDescription, - this.clmnPath}); - this.lvItems.FullRowSelect = true; - this.lvItems.Location = new System.Drawing.Point(17, 72); - this.lvItems.Name = "lvItems"; - this.lvItems.Size = new System.Drawing.Size(505, 255); - this.lvItems.TabIndex = 2; - this.lvItems.UseCompatibleStateImageBehavior = false; - this.lvItems.View = System.Windows.Forms.View.Details; - // - // clmnName - // - this.clmnName.Text = "File name"; - this.clmnName.Width = 125; - // - // clmnStatus - // - this.clmnStatus.Text = "Status"; - this.clmnStatus.Width = 131; - // - // clmnProgress - // - this.clmnProgress.Text = "Progress"; - this.clmnProgress.Width = 85; - // - // clmnDescription - // - this.clmnDescription.Text = "Description"; - this.clmnDescription.Width = 100; - // - // clmnPath - // - this.clmnPath.Text = "Path"; - this.clmnPath.Width = 350; - // - // ilIcons - // - this.ilIcons.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit; - this.ilIcons.ImageSize = new System.Drawing.Size(16, 16); - this.ilIcons.TransparentColor = System.Drawing.Color.Transparent; - // - // UpdatePage - // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.SystemColors.Window; - this.Controls.Add(this.lvItems); - this.Controls.Add(this.lblSubheader); - this.Controls.Add(this.lblHeader); - this.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.Name = "UpdatePage"; - this.Size = new System.Drawing.Size(538, 341); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.Label lblHeader; - private System.Windows.Forms.Label lblSubheader; - private System.Windows.Forms.ListView lvItems; - private System.Windows.Forms.ImageList ilIcons; - private System.Windows.Forms.ColumnHeader clmnName; - private System.Windows.Forms.ColumnHeader clmnStatus; - private System.Windows.Forms.ColumnHeader clmnProgress; - private System.Windows.Forms.ColumnHeader clmnPath; - private System.Windows.Forms.ColumnHeader clmnDescription; - } -} diff --git a/UpdateLib/UpdateLib/UI/Components/UpdatePage.cs b/UpdateLib/UpdateLib/UI/Components/UpdatePage.cs deleted file mode 100644 index 1834367..0000000 --- a/UpdateLib/UpdateLib/UI/Components/UpdatePage.cs +++ /dev/null @@ -1,374 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Windows.Forms; - -using MatthiWare.UpdateLib.Common; -using MatthiWare.UpdateLib.Files; -using MatthiWare.UpdateLib.Properties; -using MatthiWare.UpdateLib.Tasks; -using MatthiWare.UpdateLib.Threading; -using MatthiWare.UpdateLib.Utils; - -namespace MatthiWare.UpdateLib.UI.Components -{ - public partial class UpdatePage : UserControl, IWizardPage - { - - public UpdateMetadataFile UpdateFile { get; set; } - - public event EventHandler PageUpdate; - - private AtomicInteger amountToDownload = new AtomicInteger(); - private Dictionary m_items = new Dictionary(); - private bool hasRegTask = false; - - public UpdatePage(UpdaterForm parent) - { - InitializeComponent(); - - _updaterForm = parent; - - UpdateFile = parent.UpdateInfo; - - ImageList ilItems = MakeImageList(); - lvItems.SmallImageList = ilItems; - - - FillListView(); - - - } - - private ImageList MakeImageList() - { - ImageList imgList = new ImageList(); - - imgList.Images.Add("status_download", Resources.status_download); - imgList.Images.Add("status_done", Resources.status_done); - imgList.Images.Add("status_error", Resources.status_error); - imgList.Images.Add("status_info", Resources.status_info); - imgList.Images.Add("status_update", Resources.status_update); - imgList.Images.Add("status_warning", Resources.status_warning); - - return imgList; - } - - private void FillListView() - { - amountToDownload.Value = UpdateFile.FileCount; - - lvItems.BeginUpdate(); - - AddDirectoryToListView( - UpdateFile.Folders - .SelectMany(dir => dir.GetItems()) - .Select(e => e as FileEntry) - .Distinct() - .NotNull()); - - AddRegistryToListView(UpdateFile.Registry - .SelectMany(dir => dir.GetItems()) - .Select(e => e as RegistryKeyEntry) - .Distinct() - .NotNull()); - - lvItems.Columns[4].Width = -1; - lvItems.Columns[0].Width = -1; - - lvItems.EndUpdate(); - } - - private void AddDirectoryToListView(IEnumerable files) - { - foreach (FileEntry entry in files) - { - ListViewItem item = new ListViewItem(new string[] { entry.Name, "Ready to download", "0%", entry.Description, Updater.Instance.Converter.Convert(entry.DestinationLocation) }); - item.Tag = entry; - - DownloadTask task = new DownloadTask(entry); - task.TaskProgressChanged += Task_TaskProgressChanged; - task.TaskCompleted += Task_TaskCompleted; - - m_items.Add(task, item); - - lvItems.Items.Add(item); - } - } - - private void AddRegistryToListView(IEnumerable keys) - { - if (keys.Count() == 0) - return; - - amountToDownload.Increment(); - hasRegTask = true; - - ListViewItem item = new ListViewItem(new string[] { "Update registry", "Waiting for other tasks to complete", "0%", "Applies changes to the registry" }); - - UpdateRegistryTask task = new UpdateRegistryTask(keys); - task.TaskProgressChanged += Task_TaskProgressChanged; - task.TaskCompleted += Task_TaskCompleted; - - m_items.Add(task, item); - - lvItems.Items.Add(item); - } - - public void StartUpdate() - { - IsBusy = true; - PageUpdate?.Invoke(this, new EventArgs()); - - var items = m_items.Where(x => (x.Key as DownloadTask != null)); - - foreach (var kvp in items) - { - SetImageKey(kvp.Value, "status_download"); - SetSubItemText(kvp.Value.SubItems[1], "Downloading.."); - - kvp.Key.Start(); - } - - - if (hasRegTask && items.Count() == 0) - StartRegUpdate(); - - } - - private void StartRegUpdate() - { - var kvp = m_items.Where(x => (x.Key as UpdateRegistryTask) != null).NotNull().FirstOrDefault(); - - if (kvp.Key == null || kvp.Value == null) - return; - - var view = kvp.Value; - - SetImageKey(view, "status_download"); - SetSubItemText(view.SubItems[1], "Updating.."); - - kvp.Key.Start(); - - } - - private void Task_TaskCompleted(object sender, AsyncCompletedEventArgs e) - { - var task = (UpdatableTask)sender; - var view = m_items[task]; - - if (e.Cancelled) - { - SetSubItemText(view.SubItems[1], "Rolled back"); - SetImageKey(view, "status_warning"); - - return; - } - - if (e.Error != null) - { - HasErrors = true; - PageUpdate?.Invoke(this, EventArgs.Empty); - - Updater.Instance.Logger.Error(nameof(UpdatePage), nameof(StartUpdate), e.Error); - - SetSubItemText(view.SubItems[1], "Error"); - SetImageKey(view, "status_error"); - - return; - } - - SetSubItemText(view.SubItems[1], "Done"); - SetImageKey(view, "status_done"); - - int left = amountToDownload.Decrement(); - - if (left == 1 && hasRegTask) - StartRegUpdate(); - else if (left == 0) - { - IsBusy = false; - IsDone = true; - PageUpdate?.Invoke(this, EventArgs.Empty); - } - } - - private void Task_TaskProgressChanged(object sender, ProgressChangedEventArgs e) - { - UpdatableTask task = (UpdatableTask)sender; - - SetSubItemText(m_items[task].SubItems[2], $"{e.ProgressPercentage}%"); - } - - public void CancelUpdate() - { - - } - - private void StartDownloadItem(ListViewItem item) - { - - //Test(item); - - } - - private void SetImageKey(ListViewItem item, string key) - { - this.InvokeOnUI(() => item.ImageKey = key); - //if (InvokeRequired) - //{ - // Invoke(new Action(SetImageKey), item, key); - // return; - //} - //item.ImageKey = key; - } - - private void SetSubItemText(ListViewItem.ListViewSubItem item, string key) - { - this.InvokeOnUI(() => item.Text = key); - //if (InvokeRequired) - //{ - // Invoke(new Action(SetSubItemText), item, key); - // return; - //} - - //item.Text = key; - } - - public void Cancel() - { - if (NeedsRollBack) - Rollback(); - - IsDone = true; - - - PageUpdate?.Invoke(this, EventArgs.Empty); - } - - public void Execute() - { - StartUpdate(); - } - - private UpdaterForm _updaterForm; - public UpdaterForm UpdaterForm - { - get - { - return _updaterForm; - } - } - - public UserControl Conent - { - get - { - return this; - } - } - - public bool NeedsCancel - { - get - { - return true; - } - } - - public bool NeedsExecution - { - get - { - return true; - } - } - - public bool NeedsRollBack { get { return true; } } - - public bool IsBusy - { - get; set; - - } - - public void PageEntered() - { - - } - - public void UpdateState() - { - - } - - public void Rollback() - { - IsBusy = true; - - foreach (var item in m_items) - { - UpdatableTask task = item.Key; - ListViewItem view = item.Value; - - if (task.IsCancelled || (!task.IsCompleted && !task.IsRunning)) - { - SetSubItemText(view.SubItems[1], "No action"); - - SetImageKey(view, "status_warning"); - - continue; - } - - - task.Cancel(); - - SetSubItemText(view.SubItems[1], "Rolled back"); - - SetImageKey(view, "status_warning"); - } - - IsBusy = false; - HasErrors = false; - IsDone = true; - - PageUpdate?.Invoke(this, EventArgs.Empty); - } - - public bool IsDone - { - get; set; - } - - public string Title - { - get - { - return lblHeader.Text; - } - } - - public bool HasErrors - { - get; set; - } - } -} diff --git a/UpdateLib/UpdateLib/UI/Components/UpdatePage.resx b/UpdateLib/UpdateLib/UI/Components/UpdatePage.resx deleted file mode 100644 index be67fa0..0000000 --- a/UpdateLib/UpdateLib/UI/Components/UpdatePage.resx +++ /dev/null @@ -1,123 +0,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 - - - 17, 17 - - \ No newline at end of file diff --git a/UpdateLib/UpdateLib/UI/IWizardPage.cs b/UpdateLib/UpdateLib/UI/IWizardPage.cs deleted file mode 100644 index 7824d6d..0000000 --- a/UpdateLib/UpdateLib/UI/IWizardPage.cs +++ /dev/null @@ -1,41 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.Windows.Forms; - -namespace MatthiWare.UpdateLib.UI -{ - public interface IWizardPage - { - event EventHandler PageUpdate; - UpdaterForm UpdaterForm { get; } - void Cancel(); - void Execute(); - UserControl Conent { get; } - bool NeedsCancel { get; } - bool NeedsExecution { get; } - bool IsBusy { get; set; } - bool IsDone { get; set; } - string Title { get; } - void PageEntered(); - void Rollback(); - bool HasErrors { get; set; } - bool NeedsRollBack { get; } - void UpdateState(); - } -} diff --git a/UpdateLib/UpdateLib/UI/MessageDialog.Designer.cs b/UpdateLib/UpdateLib/UI/MessageDialog.Designer.cs deleted file mode 100644 index ef98053..0000000 --- a/UpdateLib/UpdateLib/UI/MessageDialog.Designer.cs +++ /dev/null @@ -1,152 +0,0 @@ -namespace MatthiWare.UpdateLib.UI -{ - partial class MessageDialog - { - /// - /// 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() - { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MessageDialog)); - this.panel1 = new System.Windows.Forms.Panel(); - this.btn2 = new System.Windows.Forms.Button(); - this.btn1 = new System.Windows.Forms.Button(); - this.btn3 = new System.Windows.Forms.Button(); - this.pbIcon = new System.Windows.Forms.PictureBox(); - this.lblHeader = new System.Windows.Forms.Label(); - this.lblDesc = new System.Windows.Forms.Label(); - this.panel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pbIcon)).BeginInit(); - this.SuspendLayout(); - // - // panel1 - // - this.panel1.BackColor = System.Drawing.SystemColors.Control; - this.panel1.Controls.Add(this.btn2); - this.panel1.Controls.Add(this.btn1); - this.panel1.Controls.Add(this.btn3); - this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom; - this.panel1.Location = new System.Drawing.Point(0, 100); - this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(401, 46); - this.panel1.TabIndex = 0; - // - // btn2 - // - this.btn2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btn2.Location = new System.Drawing.Point(227, 11); - this.btn2.Name = "btn2"; - this.btn2.Size = new System.Drawing.Size(75, 23); - this.btn2.TabIndex = 3; - this.btn2.UseVisualStyleBackColor = true; - this.btn2.Visible = false; - // - // btn1 - // - this.btn1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btn1.Location = new System.Drawing.Point(146, 11); - this.btn1.Name = "btn1"; - this.btn1.Size = new System.Drawing.Size(75, 23); - this.btn1.TabIndex = 2; - this.btn1.UseVisualStyleBackColor = true; - this.btn1.Visible = false; - // - // btn3 - // - this.btn3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btn3.Location = new System.Drawing.Point(308, 11); - this.btn3.Name = "btn3"; - this.btn3.Size = new System.Drawing.Size(75, 23); - this.btn3.TabIndex = 1; - this.btn3.UseVisualStyleBackColor = true; - this.btn3.Visible = false; - // - // pbIcon - // - this.pbIcon.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; - this.pbIcon.Location = new System.Drawing.Point(12, 12); - this.pbIcon.Name = "pbIcon"; - this.pbIcon.Size = new System.Drawing.Size(48, 48); - this.pbIcon.TabIndex = 1; - this.pbIcon.TabStop = false; - // - // lblHeader - // - this.lblHeader.AutoSize = true; - this.lblHeader.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblHeader.ForeColor = System.Drawing.Color.MidnightBlue; - this.lblHeader.Location = new System.Drawing.Point(65, 12); - this.lblHeader.Name = "lblHeader"; - this.lblHeader.Size = new System.Drawing.Size(212, 25); - this.lblHeader.TabIndex = 2; - this.lblHeader.Text = "Version 1.0.0.0 available"; - // - // lblDesc - // - this.lblDesc.AutoSize = true; - this.lblDesc.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblDesc.Location = new System.Drawing.Point(67, 46); - this.lblDesc.Name = "lblDesc"; - this.lblDesc.Size = new System.Drawing.Size(218, 34); - this.lblDesc.TabIndex = 3; - this.lblDesc.Text = "Update now?\r\nPress yes to update or no to cancel."; - // - // MessageDialog - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.AutoSize = true; - this.BackColor = System.Drawing.SystemColors.Window; - this.ClientSize = new System.Drawing.Size(401, 146); - this.Controls.Add(this.lblDesc); - this.Controls.Add(this.lblHeader); - this.Controls.Add(this.pbIcon); - this.Controls.Add(this.panel1); - 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.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "MessageDialog"; - this.ShowIcon = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Message Dialog"; - this.panel1.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.pbIcon)).EndInit(); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.Panel panel1; - private System.Windows.Forms.Button btn3; - private System.Windows.Forms.PictureBox pbIcon; - private System.Windows.Forms.Label lblHeader; - private System.Windows.Forms.Label lblDesc; - private System.Windows.Forms.Button btn1; - private System.Windows.Forms.Button btn2; - } -} \ No newline at end of file diff --git a/UpdateLib/UpdateLib/UI/MessageDialog.cs b/UpdateLib/UpdateLib/UI/MessageDialog.cs deleted file mode 100644 index 3d5c384..0000000 --- a/UpdateLib/UpdateLib/UI/MessageDialog.cs +++ /dev/null @@ -1,119 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System.Drawing; -using System.Windows.Forms; - -namespace MatthiWare.UpdateLib.UI -{ - public partial class MessageDialog : Form - { - public static DialogResult Show(IWin32Window owner, string title, string header, string desc, Icon icon, MessageBoxButtons buttons = MessageBoxButtons.YesNo) - { - return new MessageDialog( - title, - header, - desc, - icon, - buttons).ShowDialog(owner); - } - - public static DialogResult Show(string title, string header, string desc, Icon icon, MessageBoxButtons buttons = MessageBoxButtons.YesNo) - { - return Show(null, title, header, desc, icon, buttons); - } - - public string Header - { - get { return this.lblHeader.Text; } - set { this.lblHeader.Text = value; } - } - - public string Description - { - get { return this.lblDesc.Text; } - set { this.lblDesc.Text = value; } - } - - public Icon DialogIcon - { - set { this.pbIcon.BackgroundImage = value.ToBitmap(); } - } - - public MessageDialog() - { - InitializeComponent(); - } - - public MessageDialog(string title, string header, string desc, Icon icon, MessageBoxButtons buttons = MessageBoxButtons.YesNo) - : this() - { - Header = header; - Description = desc; - Text = title; - DialogIcon = icon; - Icon = icon; - - ShowIcon = true; - - SetUpButtons(buttons); - } - - private void SetUpButtons(MessageBoxButtons buttons) - { - switch (buttons) - { - case MessageBoxButtons.OK: - default: - SetUpButton(btn3, "OK", DialogResult.OK, true); - break; - case MessageBoxButtons.OKCancel: - SetUpButton(btn2, "OK", DialogResult.OK, true); - SetUpButton(btn3, "Cancel", DialogResult.Cancel); - break; - case MessageBoxButtons.AbortRetryIgnore: - SetUpButton(btn3, "Ignore", DialogResult.Ignore); - SetUpButton(btn2, "Retry", DialogResult.Retry); - SetUpButton(btn1, "Abort", DialogResult.Abort, true); - break; - case MessageBoxButtons.YesNoCancel: - SetUpButton(btn3, "Cancel", DialogResult.Cancel); - SetUpButton(btn2, "No", DialogResult.No); - SetUpButton(btn1, "Yes", DialogResult.Yes, true); - break; - case MessageBoxButtons.YesNo: - SetUpButton(btn3, "No", DialogResult.No); - SetUpButton(btn2, "Yes", DialogResult.Yes, true); - break; - case MessageBoxButtons.RetryCancel: - SetUpButton(btn3, "Cancel", DialogResult.Cancel); - SetUpButton(btn2, "Retry", DialogResult.Retry, true); - break; - } - } - - private void SetUpButton(Button button, string text, DialogResult result, bool defaultButton = false) - { - button.Text = text; - button.DialogResult = result; - button.Visible = true; - - if (defaultButton) - button.TabIndex = 0; - } - } -} diff --git a/UpdateLib/UpdateLib/UI/MessageDialog.resx b/UpdateLib/UpdateLib/UI/MessageDialog.resx deleted file mode 100644 index 9fe1da0..0000000 --- a/UpdateLib/UpdateLib/UI/MessageDialog.resx +++ /dev/null @@ -1,306 +0,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 - - - - - AAABAAIAMDAAAAEAIACoJQAAJgAAABAQAAABACAAaAQAAM4lAAAoAAAAMAAAAGAAAAABACAAAAAAAAAk - AAASCwAAEgsAAAAAAAAAAAAA////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8ANJtQDDOYTkgxlEx2MZJLojCQSs0wkEr0MJBK4zCR - SsswkUuyMZJLmTGTTIAylk1fNJtQDP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AACEIy0UgTKaIIM89iuDQv8pgkD/JoI//yWF - QP8liUD/JYdA/yWHQP8mhED/JoI//yiBP/8qg0H/IIM89hSDM5kAhCMs////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wAAfB9RE30xxxt7Nv8kfjz/IYU8/yWP - Q/88oFb/VKxs/2e2ff9yvIf/abZ+/2K0ev9asXL/VK1t/02pZv82mFH/JYZA/yZ/Pf8bezb/En0wxwqD - K1sAgyMG////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8AAIUjFBN/Ma4ZdzT/In06/x6G - Ov9MqGP/iMaZ/6XUsv+cz6r/lMuk/43Hnf+JxJn/hMKU/4DAkv99vo3/ebyL/3a7if90u4f/abd//0+p - Zf8zkE3/JX49/yd8Pv8ggzrTDYsvIf///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8AMZRMiwCEIw7///8A////AP///wD///8A////AP///wD///8A////AP///wAJgClUHX037iF3 - OP8jiT//YrZ6/57Qq/+l07L/mc2n/5DIoP+KxZr/hsOX/4LBk/9+v4//er2M/3a7iP9yuYX/breC/2q1 - fv9ms3v/ZLJ5/2KyeP9hs3f/WrBy/zqYU/8nez7/HXw38wiCKUv///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8ALYZF/x58OO4WhzVpAIUkAv///wD///8A////AP///wD///8AAIQjAxN/ - MaEXci//Hno2/z6eWP+i06//p9Sz/5vNqf+TyaL/jsee/4vFmv+IxJn/hsOW/4PBlf+AwJP/fL6O/3a7 - iv9xuIT/a7Z//2aze/9isXf/Xq90/1qtcP9Wq23/VKps/1Ora/9Colv/J30+/xp1M/0VgjGDAIQjAf// - /wD///8A////AP///wD///8A////AP///wD///8ALIRE/yd3PP8mdjv/HX031AmBKkH///8A////AP// - /wANiy8EH4M7ryFyNv8fgzr/b7uD/6/au/+i0bD/mM2m/5TLo/+QyKD/kcig/5LJof+FwpX/c7mG/2Ox - eP9Tqmr/Uqlo/1uucv9jsnn/aLV+/2q1ff9isXj/XK5x/1arbf9SqWr/Tqdm/0ulZP9Jp2L/QaJd/y2G - Rv8ndTv/III6ug2MLxD///8A////AP///wD///8A////AP///wD///8ALIND/iyJRv87l1b/GG0u/xVt - LP8QeS2zDo4wIBuVPAUfgTqzHm80/yqHQv+e0qv/rNa4/5/PrP+YzKX/l8yl/5jNpv+UyqP/Z7R8/zme - Vf8llEP/KZZG/yuXSP8tmEr/LZhK/y2YSv8sl0n/K5dI/yuWSf9Co13/WK1u/1arbf9PqGf/SqVj/0ak - X/9Colz/P6JZ/z2jWP8ujUn/JnM7/x5/OccAhSQE////AP///wD///8A////AP///wD///8AK4FC/TKI - Sf/y/vT/f8OR/xt9Nv8Zai//JXU8+yuCQ9MdazL/J4dD/6TWsv+q1rb/nM2q/5nNpv+azqj/mM2n/1es - b/8nlET/KpZH/zCZTP8zm0//NJtQ/zSbUP80m1D/NJtQ/zSbUP80m1D/NJtQ/zObT/8xmk3/LphL/z6f - WP9JpWP/R6Vg/0KiXP8+oFj/Op5V/zadUv81n1L/L49K/yVuOf8SfS+W////AP///wD///8A////AP// - /wD///8AKn9B/SyDRf/f8+T/y+fS/8Hjyv9XrG7/FXQw/xNiKP8phkL/p9az/6rWtv+dz6r/nM6p/57Q - q/9+wJH/MplP/yuXSP8xmk7/NJtQ/zScUP81nVH/NZ5R/zagU/82olP/NqNU/zajVP82olP/NqBS/zWe - Uf80nFD/M5tP/zKaTv8zm1D/QKFb/z+hWf86nlX/NZxS/zObT/80nFD/NqBT/yyERP8XaC7/CH0mXf// - /wD///8A////AP///wD///8AKn1A/C6DRf/V7t3/udzD/7vexf/B4sr/oNOu/0OhXP+k1rL/qta2/53P - qv+czqr/otGv/1etb/8mlET/L5lM/zObT/80nFD/NZ1R/zagU/80nVH/MJFK/yuAQ/8lbzn/I2k2/yVu - OP8mdDv/Kn5B/zGVTf82olT/NZ9S/zScUP8zm0//MppO/zufVv83nFL/M5tP/zSbUP80m1D/NZ1R/zWg - Uv8mdT3/GW0w+QmEKy7///8A////AP///wD///8AKXxA+zGCSP/Q7Nj/tNq//7DYu/+v17r/sdi6/67W - uf+m1LP/nc+q/53Oqv+f0K3/Tahm/ymWRv8xmk7/NJtQ/zScUP81n1L/NZ5R/yp8QP8hZDP/Imc1/xlw - MfkOcSq/Am4gmgFrHrEObijIGW0w+iBlNP8lcDr/L49K/zahU/81nVH/NJtQ/zObUP8zm1D/NJtQ/zSb - UP80m1D/NJtQ/zWeUf80nVH/JGw3/xtzM+MOjjAP////AP///wD///8AKXo/+zGBSf/L6tX/sNi7/63W - uP+p1LT/pdKx/6HQrv+dzqr/ns6r/57Oq/9GpF//KpZH/zKaTv80nFD/NZ1R/zahU/8xlEz/Imo2/xdk - LP0Sei2dDYsvQACHJQb///8A////AP///wD///8AAIglEhN/MHYZbzDfIWEz/yuBQv81oVL/NZ5R/zSc - UP80m1D/NJtQ/zSbUP80m1D/NJxQ/zWdUf83pFX/MJFK/yJkNP8ceDW8AIMjAf///wD///8AKHg++jWC - Sf/I6NH/rda4/6nUtP+l0rH/odCu/53Oqv+bzan/otCu/0+nZ/8qlkf/MptP/zSbUP81nlH/NZ9S/yp/ - Qf8gYDL/GnEy5gqELD////8A////AP///wD///8A////AP///wD///8A////AP///wAAiCUHEHQsqBRc - J/8mcjr/NJ1R/zWeUf80m1D/NJtQ/zSbUP80nFH/Np9S/zWhU/8shET/IGMy/xdmLPoReC2BAHwXBP// - /wD///8AJ3c9+jaBSv/D587/qdW1/6XTsv+h0K7/nc6q/5rMqP+ezqv/cLmE/yeVRf8ymk7/NJtQ/zSb - UP81nlH/J3Q7/x9cL/8ndTz9KZtHTv///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AAZ2I3MUYCj9JG45/zWiU/81nVH/NJxQ/zWeUv83olT/MJJL/yNnNf8SWSb/DXApvgCB - ISL///8A////AP///wD///8AJ3U8+jd/S/++5Mj/pdOy/6HRrv+dz6v/mc6n/5zNqP+KxZr/KJVF/zCZ - Tf80m1D/NJtQ/zSbUP81nVH/NqJU/y2JRv8gYDL/E1om/w9wKbUBiiYg////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wAEdSRvEVYj/yt+Qf83o1T/NqJT/zSeUf8mdDv/HVgt/xlq - LusHfSdW////AP///wD///8A////AP///wD///8AJnM7+Th+TP+54sX/odGu/53Pq/+Zzaf/mc2o/5vM - qP80m1D/LphL/zSbUP80m1D/NJtQ/zSbUP80m1D/NZ1R/zagUv82olP/KX1A/x1ZLv8VYCn7EHcsjgCG - JAv///8A////AP///wD///8A////AP///wD///8A////AP///wD///8ADm8osBxVLf8xkkv/LYZF/x9a - Lv8TWyf9EXUslACJJQv///8A////AP///wD///8A////AP///wD///8AJnI7+Dl+S/+04MD/nc+r/5nN - p/+Xzab/nc+r/0ynZP8rl0j/M5tP/zSbUP80m1D/NJtQ/zSbUP80m1D/NJtQ/zScUP82oVP/OalY/y+P - Sf8eWC3/D1Ag/wRzIqgAdAoB////AP///wD///8A////AP///wD///8A////AP///wD///8AAYkmDBdo - LeIdVCv/HFYt/xltMM0Khywu////AP///wD///8A////AP///wD///8A////AABiEiErgkOkJXA6+Dp8 - Sv+x3r3/ms2o/5bMpf+azqj/a7Z//yiVRv8ymk7/NJtQ/zSbUP80m1D/NJtQ/zSbUP80nFD/NZ5R/zei - VP80m0//JGs2/xpQKP8YZy7lB30oUv///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AAiAKC4JYSDnFH4waACIJQH///8A////AP///wD///8A////AP///wAAaBUID3MphBx3 - Nfgqf0HyJW859zp7S/+s3Ln/lsul/5fLpf+Mx5v/JpVF/zCaTf80m1D/NJtQ/zSbUP80m1D/NJtQ/zWd - Uf82oVP/NaFT/yd3Pv8ZTCf/E1km+BF4LYABiSYG////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wAAfhgC////AP///wD///8A////AP///wD///8A////AABp - GlUUdC7kL4BG/yV5O/8pfEDzJG049jp5TP+n2rb/k8qi/5nNqP9JpmL/LZhK/zSbUP80m1D/NJtQ/zSb - UP80nFH/NqBS/zimVv8rhET/G1Eq/w9NIP4NaiasAYsnGP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wAAYxEpB24jvglsJP9fk2//grSQ/yN6PP8oeT70JGs39jl3Sv+j2LH/k8qj/4PCk/8mlET/MppO/zSb - UP80m1D/NJxQ/zWfUv83pVX/MJFL/x5aLf8YSSb/FmYs0guGLDf///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8AAGIQDQxxJpAPcSn8LHtB/5a1nv/a69//OaVX/yR3Ov8ndj30I2o29Tp2S/+f1q//lsuk/0Cg - Wv8umEv/NJtQ/zScUP81nlH/N6NU/zSdUf8jZjX/FUIh/xJaJu8TfjBkAYkmAf///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wAAahxiE3Mt6xdyMf9jmHL/v9fH/9Hs1/+Lx5v/JppG/yZ0PP8mczv2I2k28jt2 - TP+g2K//eL2K/yiVRf8zm0//NZ1R/zahU/83o1P/J3c9/xZFI/8PUCH8DnIpkQGLJwv///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8AAGcTNAlvJcgKbCX/N4FL/6jFr//J6NH/vuLH/8Piy/8xmk7/MJ9O/yZz - O/8lcDn3I2o28j12Tf+i2bL/OJxU/y+aTP82oFL/OKZV/y2GRf8ZTij/C0Ub/wplJLwAhSMi////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AABhERMNciidEHAr/RxzM/94p4X/y+XQ/8Diyf+z277/ttvA/36/ - j/8llEP/NqJT/yVvOf8kbTj3I2o28UF3Uf96xI//KplI/zakVP8xlk3/Hlwv/xZEI/8VYireCH8pR/// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wAAhyQCD3MqbhZ0L/EWci//SYta/7jVwf/I59H/t93C/63Y - uv+t1rf/r9e5/yyYSP8vmUz/N6NU/yRtOP8jajb4I2o38El9Vf9Cr1//MZ1P/yRrN/8WQiH/Elck9RF5 - LXUBiiYD////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AAFrHj8YdTHSG3Qz/yN2Of+Qu5z/zerU/7zf - xf+v2Lr/qtW2/6XTs/+s1bj/ZLJ5/ymWRv8zm1D/N6RU/yNrN/8iZzX5I2o27zBzQf8ngED/F0ck/w5L - Hv0NbCaiAYwnEv///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wAAYhIbDXEpqRJwLP4Vby7/XJtt/8fj - z//B48z/tNu//6vVtv+m07L/odGu/6LRr/+bzqn/JpRD/zCaTf80m1D/N6RV/yNnNv8hYzP5I2o37xdI - JP8LRBv/CWEhygCDIi7///8A////AP///wD///8A////AP///wD///8AAHoVAv///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8AAFcMBRB1K3sYdDD2GnMy/y5/ - Rf+pzrP/yOfQ/7jdwv+u17n/qNS0/6PRsP+ez6v/ms6o/6HQrf9LpmX/LJdJ/zSbUP80m1D/N6VV/yJl - M/8gYDH5JGs37xRfKOkHeiVZ////AP///wD///8A////AP///wD///8A////AP///wALhy1NGY453QqD - Kkv///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wACbR9LHHk23iF5 - Of8aczL/da+F/8zp1P+94Mf/r9m7/6nUtP+l0rH/oNCt/5vNqf+Wy6X/l8yl/3/Akf8mlET/MppO/zSb - UP80m1D/OKVV/yBiMv8fXTD6MI9KbgCIJQj///8A////AP///wD///8A////AP///wD///8AAIEhHhiO - OLAhkj//L5ZK/yGNPvAJgSkg////AP///wD///8A////AP///wD///8A////AP///wD///8A////AABj - EYobdzT/KXw//zOCSP/L6dT/zuzW/7bcwf+q1bb/pdOy/6HQrv+czqn/mMym/5PKov+QyKD/lsqk/zac - Uv8vmUv/NJtQ/zSbUP80m1D/OKZV/x9fMf8eWi77////AP///wD///8A////AP///wD///8A////AACB - IQQZjjl1IZI/9x+NPP8wlEz/Xaxy/yCKPf8giD3MAIMjBv///wD///8A////AP///wD///8A////AP// - /wD///8A////AABDAAQNbyh2GXEx8h1wNP80fUj/mcWl/7jgw/+o1rX/ntCs/5nMp/+UyqP/j8ie/4zG - nP+Nxp3/YrJ4/yqWR/8zm0//NJtQ/zSbUP80m1D/OKZW/x9dMP8dVy37////AP///wD///8A////AP// - /wD///8AC4gtOySUQtMlkkP/E4c0/4fCl////////////y2RSP8jhj7/E30wmP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8AAFsNFQlmI6IQZCf9E2Uq/0uGWv+cy6j/ndOt/5LJ - of+Mxpz/h8SY/4XClf+EwpT/K5dJ/zGaTf80m1D/NJtQ/zSbUP80m1D/OKdW/x5aLv8dVy38////AP// - /wD///8A////AACBIRMZjjmcI5JC/h+NPv9RpGb/8vn1///////8/v3//////9fs3f8UfS//GHwz/xB3 - LJAAhiQC////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wAacTM7IWw19BNg - KP8RViT/f7KO/4rFmv+EwpX/gMGS/4HBlP9LpmT/LZhK/zSbUP80m1D/NJtQ/zSbUP80m1D/OKdW/x5a - L/8dViz8////AP///wD///8AAIEhYyWUQ+4zmE7/MJVM/0aiYP////////////L49P/r9e7/6vTs//X6 - 9v+t1bn/GX00/yF9Ov8deja/AGgcE////wD///8A////AP///wD///8A////AP///wD///8A////AABf - GTEUZSvXGmMt/yNoNf93s4n/jsyf/4LDk/98vo7/e76O/222gf8qlkf/MptP/zSbUP80m1D/NJtQ/zSb - UP80m1D/OKZW/x5cL/8dViz8////AP///wD///8ACoMqjTKXTv8ylk3/M5xQ/x+RPv+UyqP//////+z2 - 7v/j8ef/3+/j/97u4v/m9Or/v+HI/yGBO/8ddjX/GHQx6g1vKIgAYRAe////AP///wD///8A////AAA7 - AAMAXxdBCWEhlRBdJfsUXCn/RoNW/5TOpP+LyJv/f8CR/3m9i/93u4n/crqH/zKaTv8wmk3/NJtQ/zSb - UP80m1D/NJtQ/zSbUP80m1D/OKZW/x5cL/8dViz9////AP///wD///8AAIIiBSOMQMkxkUv/MpZN/y6a - S/8ckDz/u97E//P69P/f7+P/1+vc/9Lp2P/P59b/1ezc/8no0f9RmmT/Emss/xtvMv8Vayv9C2Qi0ABb - F7gAXBWkCWMhuxRkKfUdZTH/Fl4p/x5hMP9xq4D/kc+i/4LDlf96vYz/dbuI/3O6hf9zuYb/PZ9Y/y+Z - TP80m1D/NZ1R/zWeUf81nlH/NJxQ/zSbUP80m1D/OKZW/x5cL/8dViz9////AP///wD///8A////AAZ6 - JyEihz7yLoxI/zKZT/8smUr/G446/6PRsP/o8+r/1OrZ/8rl0f/F4s3/weDK/8TjzP/L6NL/stq+/0+b - ZP8fcDT/Dl8l/xFgJ/8TXyf/EFwl/xdiLP89gU7/bqh9/47Hn/+HyJr/fcCP/3a7if9yuYX/b7iC/262 - gv9Lp2X/LphL/zObT/81nlL/NqNT/yl8P/81oVL/NqJU/zWeUf80nFD/OKZW/x5cLv8dViz9////AP// - /wD///8A////AP///wAFdSNVIIE6/y2JRf80nFH/LppL/x2QPP+EwpX/2+3g/8vm0f+/38f/uNzC/7Ta - vv+y2b3/stm8/7XdwP+44cP/sNu8/5TKov+CvJH/lMej/57Wrv+Tz6T/iciZ/3/BkP95vYz/c7qG/264 - gv9stn//a7Z//0akX/8umEv/M5tP/zWeUv82pFT/JGo2/xdIJf8aTyn/K39B/zekVf82oVP/OKhX/x5c - MP8dViz+////AP///wD///8A////AP///wD///8AEXgtmSuDRP8shkX/NJ1R/zCbTf8jk0L/QqFc/7fc - wf/E4cv/tdu//63XuP+n07P/o9Gw/57Pq/+Zzaf/l8ul/5TLov+Pyp//iMWa/4PClP9+v4//eb2L/3S6 - h/9vuIP/bLaB/2m2ff9ntH3/P6Ba/y6ZS/8zm0//NZ9S/zalVP8kajf/GUwn/x1XLOkbUyr5GEwn/x1X - Lf8vjEj/O7Bb/x9gMv8cViz+////AP///wD///8A////AP///wD///8AAF0OBh17NrEqfED/K4BB/zOb - UP8znVD/KpdI/yKSQv9rt4D/r9i6/7HZu/+k0bD/m86p/5bLpf+RyaD/jcac/4jEmP+DwpT/fr+Q/3q9 - jP92u4j/cbmE/222gP9ptX7/Z7V8/1etb/81m1H/MJlM/zObT/82n1L/N6RV/yJqNf8ZTCf/Dk0g3Qdb - HRkAUBEgAksVtwxEG/4YSyb/I2o2/yBdMP8cViz+////AP///wD///8A////AP///wD///8A////AACH - JAEMbCibGnEy/yl4Pf8ymU7/NZ9S/zCaTf8plkb/I5JB/1mucf+Xy6X/odGu/5fMpv+PyJ//iMWZ/4HA - kv97vo3/druJ/3O5iP9xuIX/breB/2u1f/9brnH/Op1U/y6YSv8xmk7/NJ1R/zaiU/80nVH/IWQz/xlM - J/8QTyDYAFERFP///wD///8A////AABDAkQBRRLXC0cc/xtTKv8cViz/////AP///wD///8A////AP// - /wD///8A////AP///wD///8AAGQaghdrL/4lcjr/L4pI/zWhUv81n1L/MZtO/yuXSf8klEP/MZlO/1Gp - aP9rtn//er6L/3q+jP97vo3/eL6L/2u1f/9YrG//R6Rg/zmeU/8tmEr/MZpN/zScUP81n1L/OKVV/yyG - Rf8aUCn/CkQa/wFGFM0ARAEQ////AP///wD///8A////AP///wD///8AAEkNbg9OH+4cViz/////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AABfF2kWZy36I2o3/yVxOv8wkkv/N6NU/zWf - Uv80nFD/MZpO/y6YS/8qlkj/KJVG/yiVRv8olUb/KZZG/yuXSP8tmEr/MJlM/zKaTv80nFD/NqBS/zel - Vf81n1D/ImY0/xhLJv8MRxz6AEMKhf///wD///8A////AP///wD///8A////AP///wD///8A////AAA/ - AAwhYzOZ////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wAAVAkjCV0ftRRd - J/4gYTL/J3U9/zGVTP82pVT/N6NU/zagUv81nVH/NJxQ/zSbUP80m1D/NJtQ/zScUP81nlH/NqBS/zej - VP84qFb/L49J/yJmNP8ZSSX/GVAp/xBRIdYATA0v////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AABWE0YTWyfWHlsw/x5aLv8fWy//JnE7/y2KSP82oVP/OalX/zioV/84qFb/OKhX/zeo - Vv8zmk//LolG/yh3Pf8dVSz/GEom/wpEGv8AQhHjAEoMgAAYAAL///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wACjSgBAE8PYwRSGrcQUSH1G1Qr/xpQKf8YSyb/GEkm/xpN - J/8bUyr/HVgt/xhKJv8XSSX/GEom/xhNJ/8MRhz9AUoWwABCAVL///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wAndDwEI2o2TyFi - MqUfXTDRHlsv3R5aLucdWC3xHVgt+B5bL+EgXzG+IWMzlCJmNGQjaTYc////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A///AAf// - AAD//wAAf/8AAP/8AAAP/wAA//AAAAf/AAA/4AAAA/8AAA+AAAAA/wAABwAAAAB/AAAAAAAAAD8AAAAA - AAAAPwAAAAAAAAAfAAAAAAAAAA8AAAAAAAAABwAAAAAB4AADAAAAAA/4AAMAAAAAH/4ADwAAAAAH/wA/ - AAAAAAH/gH8AAAAAAP+B/AAAAAAD/8PwAAAAAAf/7+AAAAAAH///gAAAAAB///4AAAAAAP///AAAAAAD - ///wAAAAAA///8AAAAAAP///AAAAAAB///4AAAAAAf//+AAAAAAH9//gAAAAAB/j/8AAAAAAP4H/gAAA - AAD+AP+AAAAAAPwA/+AAAAAA8AA/+AAAAADgAB/wAAAAAOAAB4AAAAAA4AAAAAAAAADwAAAAAAAAAPgA - AAAAAAAA/AAAAAAAAAD8AAAAAAAAAP4AAAAA4AAA/4AAAAH4AAD/wAAAB/wAAP/gAAAP/wAA//gAAB// - AAD//AAA//8AAP//gAP//wAAKAAAABAAAAAgAAAAAQAgAAAAAAAABAAAEgsAABILAAAAAAAAAAAAAP// - /wD///8A////AP///wA0m1AIMpJMbDOTTt0/mlj4Qpta+TuYVPUyk0zDMJFLIv///wD///8A////AP// - /wAvjEhW////AP///wAAbhkgJIU99Hu4jP+q17b/sdq8/6DRrv+PyZ//cbmF/zOPTf4FeCSi////AP// - /wD///8AQpFY/BB3K+4AbRp8LodG/MHgyf+j1LH/abZ+/0KkW/9BpFz/Wa9w/2W0ev9fsXX/NJVP/wZ0 - I83///8A////AGamd/3h9ef/cbCC/8rn0v9+wpD/I5ZD/yaNQf8mgT77J4FA+yeJQv8smUr/R6dh/0Kk - XP8giDz/AG0alP///wBionP91O3b/77fx/9otn7/JZVD/yV7PP4vhUahKZxJChuVPAQLaSU/G3Qz+DOf - Uf81oVL/IIU8/wJoHd7///8AX51w/cbn0P+ZzKf/I5JB/zKdT/8yl03/KHU8+Q1qJkz///8A////AABi - GiYccjP6Kn1B+R54N3j///8ALIVFFlqZa/3B5cr/O59W/y6bS/81n1H/G3Uz/RBtKb4AZwwK////AP// - /wD///8AAGEYJCCIPAsMXCIEKotEpTKDR/hVlGb9fseR/ymcSP8bdjT/DGIi5ABbDSH///8A////AP// - /wD///8A////AP///wARfS5ZU5Zk96zTtv8sg0T8SY5c/SyOSP8hbDb1GmwwVP///wD///8A////AP// - /wD///8A////AABfCSEQdCvjfrCL/9Lr2f9Wsm//Kn5B/SVuOfYabDGZJptFASOXQwgIiCsg////AP// - /wD///8AAF8HCA14KbdUmWf+weDL/7new/+MyJz/JppF/yl4Pv00m1AM////ABqTO2BLpGP4OplV+wB0 - GS7///8A////AA1uJ0A2hUv4nsiq/6vZt/+WzKX/NpxS/zGgT/8nczv9////AAqHLM9IoWD///////3/ - /v8efzb6AGYaTAFeGgkRaykKGHIwmjR3Rv6Mx5z/V65u/yyYSf83pVT/JnI7/f///wAAeR5jDn8s/ozJ - nf/t+PD/zufV/3ywi/9Bh1T9Sodb/XCqf/+Myp7/XrV1/yudSv8pfj//N6ZW/yZyO/3///8A////AAJy - IIgPeyv/QKRb/5jQqP+y3L3/otWx/5DNoP9zvof/TKtk/yycS/8SXCb9B1QbjghYHfAgYjL9////AP// - /wD///8ABGwfoBRwLfshij7/KZxJ/zmkVf85pFf/K5tJ/ymFQf8TWyX4AEgNNP///wD///8AImU0Zv// - /wD///8A////AP///wAlcDoLKXY+mSdyO/Umcjv7JnE7+ydwO+cmbzqHI2k2EP///wD///8A////AP// - /wDwDwAAYAcAAAADAAAAAQAAAAEAAADCAAAA4AAAA/AAAA/AAAAHAAAAQwAAAIAAAACAAAAAwAAAAOAG - AADwDwAA - - - \ No newline at end of file diff --git a/UpdateLib/UpdateLib/UI/UIExtensions.cs b/UpdateLib/UpdateLib/UI/UIExtensions.cs deleted file mode 100644 index 56b18c7..0000000 --- a/UpdateLib/UpdateLib/UI/UIExtensions.cs +++ /dev/null @@ -1,43 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.ComponentModel; - -namespace MatthiWare.UpdateLib.UI -{ - public static class UIExtensions - { - public static void InvokeOnUI(this T control, Action action) where T : ISynchronizeInvoke - { - if (control != null && control.InvokeRequired) - control.Invoke(action, null); - else - action(); - - } - - public static TResult InvokeOnUI(this T control, Func action) where T : ISynchronizeInvoke - { - if (control != null && control.InvokeRequired) - return (TResult)control.Invoke(action, null); - else - return action(); - } - - } -} diff --git a/UpdateLib/UpdateLib/UI/UpdaterForm.Designer.cs b/UpdateLib/UpdateLib/UI/UpdaterForm.Designer.cs deleted file mode 100644 index 81839a8..0000000 --- a/UpdateLib/UpdateLib/UI/UpdaterForm.Designer.cs +++ /dev/null @@ -1,167 +0,0 @@ -namespace MatthiWare.UpdateLib.UI -{ - partial class UpdaterForm - { - /// - /// 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() - { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(UpdaterForm)); - this.pnlSide = new System.Windows.Forms.Panel(); - this.label1 = new System.Windows.Forms.Label(); - this.pnlBottom = new System.Windows.Forms.Panel(); - this.btnPrevious = new System.Windows.Forms.Button(); - this.btnNext = new System.Windows.Forms.Button(); - this.btnCancel = new System.Windows.Forms.Button(); - this.pnlContent = new System.Windows.Forms.Panel(); - this.linkSite = new System.Windows.Forms.LinkLabel(); - this.pnlSide.SuspendLayout(); - this.pnlBottom.SuspendLayout(); - this.SuspendLayout(); - // - // pnlSide - // - this.pnlSide.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(43)))), ((int)(((byte)(129)))), ((int)(((byte)(181))))); - this.pnlSide.Controls.Add(this.label1); - this.pnlSide.Dock = System.Windows.Forms.DockStyle.Left; - this.pnlSide.Location = new System.Drawing.Point(0, 0); - this.pnlSide.Name = "pnlSide"; - this.pnlSide.Size = new System.Drawing.Size(149, 376); - this.pnlSide.TabIndex = 0; - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Font = new System.Drawing.Font("Segoe UI Semibold", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label1.ForeColor = System.Drawing.SystemColors.Window; - this.label1.Location = new System.Drawing.Point(12, 23); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(115, 21); - this.label1.TabIndex = 0; - this.label1.Text = "Update wizard"; - // - // pnlBottom - // - this.pnlBottom.BackColor = System.Drawing.SystemColors.Control; - this.pnlBottom.Controls.Add(this.linkSite); - this.pnlBottom.Controls.Add(this.btnPrevious); - this.pnlBottom.Controls.Add(this.btnNext); - this.pnlBottom.Controls.Add(this.btnCancel); - this.pnlBottom.Dock = System.Windows.Forms.DockStyle.Bottom; - this.pnlBottom.Location = new System.Drawing.Point(149, 329); - this.pnlBottom.Name = "pnlBottom"; - this.pnlBottom.Size = new System.Drawing.Size(536, 47); - this.pnlBottom.TabIndex = 1; - // - // btnPrevious - // - this.btnPrevious.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.btnPrevious.Enabled = false; - this.btnPrevious.Location = new System.Drawing.Point(287, 13); - this.btnPrevious.Name = "btnPrevious"; - this.btnPrevious.Size = new System.Drawing.Size(75, 23); - this.btnPrevious.TabIndex = 1; - this.btnPrevious.Text = "< Previous"; - this.btnPrevious.UseVisualStyleBackColor = true; - this.btnPrevious.Click += new System.EventHandler(this.btnPrevious_Click); - // - // btnNext - // - this.btnNext.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.btnNext.Location = new System.Drawing.Point(368, 13); - this.btnNext.Name = "btnNext"; - this.btnNext.Size = new System.Drawing.Size(75, 23); - this.btnNext.TabIndex = 0; - this.btnNext.Text = "Next >"; - this.btnNext.UseVisualStyleBackColor = true; - this.btnNext.Click += new System.EventHandler(this.btnNext_Click); - // - // btnCancel - // - this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.btnCancel.Location = new System.Drawing.Point(449, 13); - this.btnCancel.Name = "btnCancel"; - this.btnCancel.Size = new System.Drawing.Size(75, 23); - this.btnCancel.TabIndex = 2; - this.btnCancel.Text = "Cancel"; - this.btnCancel.UseVisualStyleBackColor = true; - this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); - // - // pnlContent - // - this.pnlContent.Dock = System.Windows.Forms.DockStyle.Fill; - this.pnlContent.Location = new System.Drawing.Point(149, 0); - this.pnlContent.Name = "pnlContent"; - this.pnlContent.Size = new System.Drawing.Size(536, 329); - this.pnlContent.TabIndex = 2; - // - // linkSite - // - this.linkSite.AutoSize = true; - this.linkSite.Font = new System.Drawing.Font("Segoe UI Semibold", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.linkSite.LinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(43)))), ((int)(((byte)(129)))), ((int)(((byte)(181))))); - this.linkSite.Location = new System.Drawing.Point(6, 17); - this.linkSite.Name = "linkSite"; - this.linkSite.Size = new System.Drawing.Size(126, 15); - this.linkSite.TabIndex = 3; - this.linkSite.TabStop = true; - this.linkSite.Text = "Powered by UpdateLib"; - this.linkSite.VisitedLinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(43)))), ((int)(((byte)(129)))), ((int)(((byte)(181))))); - this.linkSite.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LinkSite_LinkClicked); - // - // UpdaterForm - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.SystemColors.Window; - this.ClientSize = new System.Drawing.Size(685, 376); - this.Controls.Add(this.pnlContent); - this.Controls.Add(this.pnlBottom); - this.Controls.Add(this.pnlSide); - this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.Name = "UpdaterForm"; - this.Text = "Updater"; - this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.UpdaterForm_FormClosing); - this.pnlSide.ResumeLayout(false); - this.pnlSide.PerformLayout(); - this.pnlBottom.ResumeLayout(false); - this.pnlBottom.PerformLayout(); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.Panel pnlSide; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Panel pnlBottom; - private System.Windows.Forms.Button btnPrevious; - private System.Windows.Forms.Button btnNext; - private System.Windows.Forms.Button btnCancel; - private System.Windows.Forms.Panel pnlContent; - private System.Windows.Forms.LinkLabel linkSite; - } -} \ No newline at end of file diff --git a/UpdateLib/UpdateLib/UI/UpdaterForm.cs b/UpdateLib/UpdateLib/UI/UpdaterForm.cs deleted file mode 100644 index 0f76d9e..0000000 --- a/UpdateLib/UpdateLib/UI/UpdaterForm.cs +++ /dev/null @@ -1,258 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.Diagnostics; -using System.Drawing; -using System.Windows.Forms; -using MatthiWare.UpdateLib.Common; -using MatthiWare.UpdateLib.Files; -using MatthiWare.UpdateLib.UI.Components; - -namespace MatthiWare.UpdateLib.UI -{ - public partial class UpdaterForm : Form - { - public UpdateInfo UpdateInfo { get; internal set; } - public string ApplicationName { get; internal set; } - public bool NeedsRestart { get; internal set; } = true; - public bool HasHadErrors { get; internal set; } = false; - public bool UserCancelled { get; internal set; } = false; - - private WizardPageCollection pages; - - public UpdaterForm(UpdateInfo updateInfo, string appName) - { - InitializeComponent(); - - UpdateInfo = updateInfo ?? throw new ArgumentException(nameof(UpdateInfo)); - ApplicationName = string.IsNullOrEmpty(appName) ? throw new ArgumentException(nameof(appName)) : appName; - - pages = new WizardPageCollection(); - AddPage(new IntroPage(this)); - AddPage(new ChangelogPage(this)); - AddPage(new UpdatePage(this)); - AddPage(new FinishPage(this)); - - SetContentPage(pages.FirstPage); - } - - private void SetContentPage(IWizardPage page) - { - page.PageEntered(); - - for (int i = pnlContent.Controls.Count - 1; i >= 0; i--) - { - IWizardPage item = pnlContent.Controls[i] as IWizardPage; - if (item == null) - continue; - - pnlContent.Controls.RemoveAt(i); - } - - pnlContent.Controls.Add(page.Conent); - } - - private void AddPage(IWizardPage page) - { - page.PageUpdate += Page_PageUpdate; - pages.Add(page); - } - - private void Page_PageUpdate(object sender, EventArgs e) - { - - IWizardPage page = (IWizardPage)sender; - OnPageUpdate(page); - } - - delegate void _OnPageUpdate(IWizardPage page); - private void OnPageUpdate(IWizardPage page) - { - this.InvokeOnUI(() => - { - if (page.IsDone && !page.IsBusy) - { - btnNext.Enabled = true; - if (page == pages.CurrentPage) - btnNext.Focus(); - if (page.NeedsExecution) - btnNext.Text = "Next >"; - } - - if (page.HasErrors && page.NeedsRollBack) - { - HasHadErrors = true; - btnNext.Enabled = true; - btnPrevious.Enabled = false; - btnCancel.Enabled = false; - btnNext.Text = "Rollback"; - } - - if (!pages.CurrentPage.HasErrors && pages.CurrentPage.NeedsRollBack && HasHadErrors) - foreach (IWizardPage wp in pages) - wp.UpdateState(); - - if (pages.AllDone()) - btnCancel.Enabled = false; - - }); - } - - private void btnPrevious_Click(object sender, EventArgs e) - { - IWizardPage currentPage = pages.CurrentPage; - IWizardPage page = pages.Previous(); - - if (page == null) - return; - - if (!btnNext.Enabled) - btnNext.Enabled = true; - - if (page.NeedsExecution) - btnNext.Text = "Next >"; - - if (page == pages.FirstPage) - btnPrevious.Enabled = false; - - SetContentPage(page); - } - - private void btnNext_Click(object sender, EventArgs e) - { - if (pages.CurrentPage.HasErrors && pages.CurrentPage.NeedsRollBack) - { - btnNext.Enabled = false; - pages.CurrentPage.Rollback(); - return; - } - - if (pages.CurrentPage.NeedsExecution && !pages.CurrentPage.IsDone) - { - pages.CurrentPage.Execute(); - btnNext.Enabled = false; - return; - } - - if (pages.CurrentPage == pages.LastPage && pages.CurrentPage.IsDone) - { - ExitUpdater(); - return; - } - - IWizardPage page = pages.Next(); - if (page == null) - return; - - if (!btnPrevious.Enabled) - btnPrevious.Enabled = true; - - if (page.NeedsExecution && !page.IsDone) - btnNext.Text = "Update"; - - if (page.NeedsExecution && !page.IsDone && page.IsBusy) - btnNext.Enabled = false; - - if (page.HasErrors && page.NeedsRollBack) - btnNext.Text = "Rollback"; - - if (page == pages.LastPage) - { - btnNext.Text = "Finish"; - btnCancel.Enabled = false; - } - - - SetContentPage(page); - - } - - private void ExitUpdater() - { - Updater.Instance.GetCache2().Save(); - - if (NeedsRestart) - { - Updater.Instance.RestartApp(); - } - else - { - pages.Clear(); - FinishPage page = new FinishPage(this); - page.UpdateState(); - pages.Add(page); - SetContentPage(page); - btnPrevious.Enabled = false; - btnCancel.Enabled = false; - Close(); - } - } - - private void btnCancel_Click(object sender, EventArgs e) - { - Cancel(); - } - - private void Cancel() - { - bool cancelled = MessageDialog.Show( - this, - "Cancel", - "Cancel updating?", - "Press Yes to cancel the updating process.\nPress No to keep updating.", - SystemIcons.Exclamation) == DialogResult.Yes; - - if (cancelled) - UserCancelled = true; - - if (!cancelled) - return; - - foreach (IWizardPage page in pages) - { - page.Cancel(); - page.UpdateState(); - } - - pages.CurrentPage = pages.LastPage; - SetContentPage(pages.CurrentPage); - - btnNext.Text = "Finish"; - btnPrevious.Enabled = true; - - OnPageUpdate(pages.CurrentPage); - - } - - private void UpdaterForm_FormClosing(object sender, FormClosingEventArgs e) - { - if (pages.AllDone()) - return; - - Cancel(); - - if (e.CloseReason == CloseReason.UserClosing || e.CloseReason == CloseReason.None) - e.Cancel = true; - } - - private void LinkSite_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) - { - Process.Start("https://github.com/MatthiWare/UpdateLib"); - } - } -} diff --git a/UpdateLib/UpdateLib/UI/UpdaterForm.resx b/UpdateLib/UpdateLib/UI/UpdaterForm.resx deleted file mode 100644 index 9fe1da0..0000000 --- a/UpdateLib/UpdateLib/UI/UpdaterForm.resx +++ /dev/null @@ -1,306 +0,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 - - - - - AAABAAIAMDAAAAEAIACoJQAAJgAAABAQAAABACAAaAQAAM4lAAAoAAAAMAAAAGAAAAABACAAAAAAAAAk - AAASCwAAEgsAAAAAAAAAAAAA////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8ANJtQDDOYTkgxlEx2MZJLojCQSs0wkEr0MJBK4zCR - SsswkUuyMZJLmTGTTIAylk1fNJtQDP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AACEIy0UgTKaIIM89iuDQv8pgkD/JoI//yWF - QP8liUD/JYdA/yWHQP8mhED/JoI//yiBP/8qg0H/IIM89hSDM5kAhCMs////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wAAfB9RE30xxxt7Nv8kfjz/IYU8/yWP - Q/88oFb/VKxs/2e2ff9yvIf/abZ+/2K0ev9asXL/VK1t/02pZv82mFH/JYZA/yZ/Pf8bezb/En0wxwqD - K1sAgyMG////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8AAIUjFBN/Ma4ZdzT/In06/x6G - Ov9MqGP/iMaZ/6XUsv+cz6r/lMuk/43Hnf+JxJn/hMKU/4DAkv99vo3/ebyL/3a7if90u4f/abd//0+p - Zf8zkE3/JX49/yd8Pv8ggzrTDYsvIf///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8AMZRMiwCEIw7///8A////AP///wD///8A////AP///wD///8A////AP///wAJgClUHX037iF3 - OP8jiT//YrZ6/57Qq/+l07L/mc2n/5DIoP+KxZr/hsOX/4LBk/9+v4//er2M/3a7iP9yuYX/breC/2q1 - fv9ms3v/ZLJ5/2KyeP9hs3f/WrBy/zqYU/8nez7/HXw38wiCKUv///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8ALYZF/x58OO4WhzVpAIUkAv///wD///8A////AP///wD///8AAIQjAxN/ - MaEXci//Hno2/z6eWP+i06//p9Sz/5vNqf+TyaL/jsee/4vFmv+IxJn/hsOW/4PBlf+AwJP/fL6O/3a7 - iv9xuIT/a7Z//2aze/9isXf/Xq90/1qtcP9Wq23/VKps/1Ora/9Colv/J30+/xp1M/0VgjGDAIQjAf// - /wD///8A////AP///wD///8A////AP///wD///8ALIRE/yd3PP8mdjv/HX031AmBKkH///8A////AP// - /wANiy8EH4M7ryFyNv8fgzr/b7uD/6/au/+i0bD/mM2m/5TLo/+QyKD/kcig/5LJof+FwpX/c7mG/2Ox - eP9Tqmr/Uqlo/1uucv9jsnn/aLV+/2q1ff9isXj/XK5x/1arbf9SqWr/Tqdm/0ulZP9Jp2L/QaJd/y2G - Rv8ndTv/III6ug2MLxD///8A////AP///wD///8A////AP///wD///8ALIND/iyJRv87l1b/GG0u/xVt - LP8QeS2zDo4wIBuVPAUfgTqzHm80/yqHQv+e0qv/rNa4/5/PrP+YzKX/l8yl/5jNpv+UyqP/Z7R8/zme - Vf8llEP/KZZG/yuXSP8tmEr/LZhK/y2YSv8sl0n/K5dI/yuWSf9Co13/WK1u/1arbf9PqGf/SqVj/0ak - X/9Colz/P6JZ/z2jWP8ujUn/JnM7/x5/OccAhSQE////AP///wD///8A////AP///wD///8AK4FC/TKI - Sf/y/vT/f8OR/xt9Nv8Zai//JXU8+yuCQ9MdazL/J4dD/6TWsv+q1rb/nM2q/5nNpv+azqj/mM2n/1es - b/8nlET/KpZH/zCZTP8zm0//NJtQ/zSbUP80m1D/NJtQ/zSbUP80m1D/NJtQ/zObT/8xmk3/LphL/z6f - WP9JpWP/R6Vg/0KiXP8+oFj/Op5V/zadUv81n1L/L49K/yVuOf8SfS+W////AP///wD///8A////AP// - /wD///8AKn9B/SyDRf/f8+T/y+fS/8Hjyv9XrG7/FXQw/xNiKP8phkL/p9az/6rWtv+dz6r/nM6p/57Q - q/9+wJH/MplP/yuXSP8xmk7/NJtQ/zScUP81nVH/NZ5R/zagU/82olP/NqNU/zajVP82olP/NqBS/zWe - Uf80nFD/M5tP/zKaTv8zm1D/QKFb/z+hWf86nlX/NZxS/zObT/80nFD/NqBT/yyERP8XaC7/CH0mXf// - /wD///8A////AP///wD///8AKn1A/C6DRf/V7t3/udzD/7vexf/B4sr/oNOu/0OhXP+k1rL/qta2/53P - qv+czqr/otGv/1etb/8mlET/L5lM/zObT/80nFD/NZ1R/zagU/80nVH/MJFK/yuAQ/8lbzn/I2k2/yVu - OP8mdDv/Kn5B/zGVTf82olT/NZ9S/zScUP8zm0//MppO/zufVv83nFL/M5tP/zSbUP80m1D/NZ1R/zWg - Uv8mdT3/GW0w+QmEKy7///8A////AP///wD///8AKXxA+zGCSP/Q7Nj/tNq//7DYu/+v17r/sdi6/67W - uf+m1LP/nc+q/53Oqv+f0K3/Tahm/ymWRv8xmk7/NJtQ/zScUP81n1L/NZ5R/yp8QP8hZDP/Imc1/xlw - MfkOcSq/Am4gmgFrHrEObijIGW0w+iBlNP8lcDr/L49K/zahU/81nVH/NJtQ/zObUP8zm1D/NJtQ/zSb - UP80m1D/NJtQ/zWeUf80nVH/JGw3/xtzM+MOjjAP////AP///wD///8AKXo/+zGBSf/L6tX/sNi7/63W - uP+p1LT/pdKx/6HQrv+dzqr/ns6r/57Oq/9GpF//KpZH/zKaTv80nFD/NZ1R/zahU/8xlEz/Imo2/xdk - LP0Sei2dDYsvQACHJQb///8A////AP///wD///8AAIglEhN/MHYZbzDfIWEz/yuBQv81oVL/NZ5R/zSc - UP80m1D/NJtQ/zSbUP80m1D/NJxQ/zWdUf83pFX/MJFK/yJkNP8ceDW8AIMjAf///wD///8AKHg++jWC - Sf/I6NH/rda4/6nUtP+l0rH/odCu/53Oqv+bzan/otCu/0+nZ/8qlkf/MptP/zSbUP81nlH/NZ9S/yp/ - Qf8gYDL/GnEy5gqELD////8A////AP///wD///8A////AP///wD///8A////AP///wAAiCUHEHQsqBRc - J/8mcjr/NJ1R/zWeUf80m1D/NJtQ/zSbUP80nFH/Np9S/zWhU/8shET/IGMy/xdmLPoReC2BAHwXBP// - /wD///8AJ3c9+jaBSv/D587/qdW1/6XTsv+h0K7/nc6q/5rMqP+ezqv/cLmE/yeVRf8ymk7/NJtQ/zSb - UP81nlH/J3Q7/x9cL/8ndTz9KZtHTv///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AAZ2I3MUYCj9JG45/zWiU/81nVH/NJxQ/zWeUv83olT/MJJL/yNnNf8SWSb/DXApvgCB - ISL///8A////AP///wD///8AJ3U8+jd/S/++5Mj/pdOy/6HRrv+dz6v/mc6n/5zNqP+KxZr/KJVF/zCZ - Tf80m1D/NJtQ/zSbUP81nVH/NqJU/y2JRv8gYDL/E1om/w9wKbUBiiYg////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wAEdSRvEVYj/yt+Qf83o1T/NqJT/zSeUf8mdDv/HVgt/xlq - LusHfSdW////AP///wD///8A////AP///wD///8AJnM7+Th+TP+54sX/odGu/53Pq/+Zzaf/mc2o/5vM - qP80m1D/LphL/zSbUP80m1D/NJtQ/zSbUP80m1D/NZ1R/zagUv82olP/KX1A/x1ZLv8VYCn7EHcsjgCG - JAv///8A////AP///wD///8A////AP///wD///8A////AP///wD///8ADm8osBxVLf8xkkv/LYZF/x9a - Lv8TWyf9EXUslACJJQv///8A////AP///wD///8A////AP///wD///8AJnI7+Dl+S/+04MD/nc+r/5nN - p/+Xzab/nc+r/0ynZP8rl0j/M5tP/zSbUP80m1D/NJtQ/zSbUP80m1D/NJtQ/zScUP82oVP/OalY/y+P - Sf8eWC3/D1Ag/wRzIqgAdAoB////AP///wD///8A////AP///wD///8A////AP///wD///8AAYkmDBdo - LeIdVCv/HFYt/xltMM0Khywu////AP///wD///8A////AP///wD///8A////AABiEiErgkOkJXA6+Dp8 - Sv+x3r3/ms2o/5bMpf+azqj/a7Z//yiVRv8ymk7/NJtQ/zSbUP80m1D/NJtQ/zSbUP80nFD/NZ5R/zei - VP80m0//JGs2/xpQKP8YZy7lB30oUv///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AAiAKC4JYSDnFH4waACIJQH///8A////AP///wD///8A////AP///wAAaBUID3MphBx3 - Nfgqf0HyJW859zp7S/+s3Ln/lsul/5fLpf+Mx5v/JpVF/zCaTf80m1D/NJtQ/zSbUP80m1D/NJtQ/zWd - Uf82oVP/NaFT/yd3Pv8ZTCf/E1km+BF4LYABiSYG////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wAAfhgC////AP///wD///8A////AP///wD///8A////AABp - GlUUdC7kL4BG/yV5O/8pfEDzJG049jp5TP+n2rb/k8qi/5nNqP9JpmL/LZhK/zSbUP80m1D/NJtQ/zSb - UP80nFH/NqBS/zimVv8rhET/G1Eq/w9NIP4NaiasAYsnGP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wAAYxEpB24jvglsJP9fk2//grSQ/yN6PP8oeT70JGs39jl3Sv+j2LH/k8qj/4PCk/8mlET/MppO/zSb - UP80m1D/NJxQ/zWfUv83pVX/MJFL/x5aLf8YSSb/FmYs0guGLDf///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8AAGIQDQxxJpAPcSn8LHtB/5a1nv/a69//OaVX/yR3Ov8ndj30I2o29Tp2S/+f1q//lsuk/0Cg - Wv8umEv/NJtQ/zScUP81nlH/N6NU/zSdUf8jZjX/FUIh/xJaJu8TfjBkAYkmAf///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wAAahxiE3Mt6xdyMf9jmHL/v9fH/9Hs1/+Lx5v/JppG/yZ0PP8mczv2I2k28jt2 - TP+g2K//eL2K/yiVRf8zm0//NZ1R/zahU/83o1P/J3c9/xZFI/8PUCH8DnIpkQGLJwv///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8AAGcTNAlvJcgKbCX/N4FL/6jFr//J6NH/vuLH/8Piy/8xmk7/MJ9O/yZz - O/8lcDn3I2o28j12Tf+i2bL/OJxU/y+aTP82oFL/OKZV/y2GRf8ZTij/C0Ub/wplJLwAhSMi////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AABhERMNciidEHAr/RxzM/94p4X/y+XQ/8Diyf+z277/ttvA/36/ - j/8llEP/NqJT/yVvOf8kbTj3I2o28UF3Uf96xI//KplI/zakVP8xlk3/Hlwv/xZEI/8VYireCH8pR/// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wAAhyQCD3MqbhZ0L/EWci//SYta/7jVwf/I59H/t93C/63Y - uv+t1rf/r9e5/yyYSP8vmUz/N6NU/yRtOP8jajb4I2o38El9Vf9Cr1//MZ1P/yRrN/8WQiH/Elck9RF5 - LXUBiiYD////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AAFrHj8YdTHSG3Qz/yN2Of+Qu5z/zerU/7zf - xf+v2Lr/qtW2/6XTs/+s1bj/ZLJ5/ymWRv8zm1D/N6RU/yNrN/8iZzX5I2o27zBzQf8ngED/F0ck/w5L - Hv0NbCaiAYwnEv///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wAAYhIbDXEpqRJwLP4Vby7/XJtt/8fj - z//B48z/tNu//6vVtv+m07L/odGu/6LRr/+bzqn/JpRD/zCaTf80m1D/N6RV/yNnNv8hYzP5I2o37xdI - JP8LRBv/CWEhygCDIi7///8A////AP///wD///8A////AP///wD///8AAHoVAv///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8AAFcMBRB1K3sYdDD2GnMy/y5/ - Rf+pzrP/yOfQ/7jdwv+u17n/qNS0/6PRsP+ez6v/ms6o/6HQrf9LpmX/LJdJ/zSbUP80m1D/N6VV/yJl - M/8gYDH5JGs37xRfKOkHeiVZ////AP///wD///8A////AP///wD///8A////AP///wALhy1NGY453QqD - Kkv///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wACbR9LHHk23iF5 - Of8aczL/da+F/8zp1P+94Mf/r9m7/6nUtP+l0rH/oNCt/5vNqf+Wy6X/l8yl/3/Akf8mlET/MppO/zSb - UP80m1D/OKVV/yBiMv8fXTD6MI9KbgCIJQj///8A////AP///wD///8A////AP///wD///8AAIEhHhiO - OLAhkj//L5ZK/yGNPvAJgSkg////AP///wD///8A////AP///wD///8A////AP///wD///8A////AABj - EYobdzT/KXw//zOCSP/L6dT/zuzW/7bcwf+q1bb/pdOy/6HQrv+czqn/mMym/5PKov+QyKD/lsqk/zac - Uv8vmUv/NJtQ/zSbUP80m1D/OKZV/x9fMf8eWi77////AP///wD///8A////AP///wD///8A////AACB - IQQZjjl1IZI/9x+NPP8wlEz/Xaxy/yCKPf8giD3MAIMjBv///wD///8A////AP///wD///8A////AP// - /wD///8A////AABDAAQNbyh2GXEx8h1wNP80fUj/mcWl/7jgw/+o1rX/ntCs/5nMp/+UyqP/j8ie/4zG - nP+Nxp3/YrJ4/yqWR/8zm0//NJtQ/zSbUP80m1D/OKZW/x9dMP8dVy37////AP///wD///8A////AP// - /wD///8AC4gtOySUQtMlkkP/E4c0/4fCl////////////y2RSP8jhj7/E30wmP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8AAFsNFQlmI6IQZCf9E2Uq/0uGWv+cy6j/ndOt/5LJ - of+Mxpz/h8SY/4XClf+EwpT/K5dJ/zGaTf80m1D/NJtQ/zSbUP80m1D/OKdW/x5aLv8dVy38////AP// - /wD///8A////AACBIRMZjjmcI5JC/h+NPv9RpGb/8vn1///////8/v3//////9fs3f8UfS//GHwz/xB3 - LJAAhiQC////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wAacTM7IWw19BNg - KP8RViT/f7KO/4rFmv+EwpX/gMGS/4HBlP9LpmT/LZhK/zSbUP80m1D/NJtQ/zSbUP80m1D/OKdW/x5a - L/8dViz8////AP///wD///8AAIEhYyWUQ+4zmE7/MJVM/0aiYP////////////L49P/r9e7/6vTs//X6 - 9v+t1bn/GX00/yF9Ov8deja/AGgcE////wD///8A////AP///wD///8A////AP///wD///8A////AABf - GTEUZSvXGmMt/yNoNf93s4n/jsyf/4LDk/98vo7/e76O/222gf8qlkf/MptP/zSbUP80m1D/NJtQ/zSb - UP80m1D/OKZW/x5cL/8dViz8////AP///wD///8ACoMqjTKXTv8ylk3/M5xQ/x+RPv+UyqP//////+z2 - 7v/j8ef/3+/j/97u4v/m9Or/v+HI/yGBO/8ddjX/GHQx6g1vKIgAYRAe////AP///wD///8A////AAA7 - AAMAXxdBCWEhlRBdJfsUXCn/RoNW/5TOpP+LyJv/f8CR/3m9i/93u4n/crqH/zKaTv8wmk3/NJtQ/zSb - UP80m1D/NJtQ/zSbUP80m1D/OKZW/x5cL/8dViz9////AP///wD///8AAIIiBSOMQMkxkUv/MpZN/y6a - S/8ckDz/u97E//P69P/f7+P/1+vc/9Lp2P/P59b/1ezc/8no0f9RmmT/Emss/xtvMv8Vayv9C2Qi0ABb - F7gAXBWkCWMhuxRkKfUdZTH/Fl4p/x5hMP9xq4D/kc+i/4LDlf96vYz/dbuI/3O6hf9zuYb/PZ9Y/y+Z - TP80m1D/NZ1R/zWeUf81nlH/NJxQ/zSbUP80m1D/OKZW/x5cL/8dViz9////AP///wD///8A////AAZ6 - JyEihz7yLoxI/zKZT/8smUr/G446/6PRsP/o8+r/1OrZ/8rl0f/F4s3/weDK/8TjzP/L6NL/stq+/0+b - ZP8fcDT/Dl8l/xFgJ/8TXyf/EFwl/xdiLP89gU7/bqh9/47Hn/+HyJr/fcCP/3a7if9yuYX/b7iC/262 - gv9Lp2X/LphL/zObT/81nlL/NqNT/yl8P/81oVL/NqJU/zWeUf80nFD/OKZW/x5cLv8dViz9////AP// - /wD///8A////AP///wAFdSNVIIE6/y2JRf80nFH/LppL/x2QPP+EwpX/2+3g/8vm0f+/38f/uNzC/7Ta - vv+y2b3/stm8/7XdwP+44cP/sNu8/5TKov+CvJH/lMej/57Wrv+Tz6T/iciZ/3/BkP95vYz/c7qG/264 - gv9stn//a7Z//0akX/8umEv/M5tP/zWeUv82pFT/JGo2/xdIJf8aTyn/K39B/zekVf82oVP/OKhX/x5c - MP8dViz+////AP///wD///8A////AP///wD///8AEXgtmSuDRP8shkX/NJ1R/zCbTf8jk0L/QqFc/7fc - wf/E4cv/tdu//63XuP+n07P/o9Gw/57Pq/+Zzaf/l8ul/5TLov+Pyp//iMWa/4PClP9+v4//eb2L/3S6 - h/9vuIP/bLaB/2m2ff9ntH3/P6Ba/y6ZS/8zm0//NZ9S/zalVP8kajf/GUwn/x1XLOkbUyr5GEwn/x1X - Lf8vjEj/O7Bb/x9gMv8cViz+////AP///wD///8A////AP///wD///8AAF0OBh17NrEqfED/K4BB/zOb - UP8znVD/KpdI/yKSQv9rt4D/r9i6/7HZu/+k0bD/m86p/5bLpf+RyaD/jcac/4jEmP+DwpT/fr+Q/3q9 - jP92u4j/cbmE/222gP9ptX7/Z7V8/1etb/81m1H/MJlM/zObT/82n1L/N6RV/yJqNf8ZTCf/Dk0g3Qdb - HRkAUBEgAksVtwxEG/4YSyb/I2o2/yBdMP8cViz+////AP///wD///8A////AP///wD///8A////AACH - JAEMbCibGnEy/yl4Pf8ymU7/NZ9S/zCaTf8plkb/I5JB/1mucf+Xy6X/odGu/5fMpv+PyJ//iMWZ/4HA - kv97vo3/druJ/3O5iP9xuIX/breB/2u1f/9brnH/Op1U/y6YSv8xmk7/NJ1R/zaiU/80nVH/IWQz/xlM - J/8QTyDYAFERFP///wD///8A////AABDAkQBRRLXC0cc/xtTKv8cViz/////AP///wD///8A////AP// - /wD///8A////AP///wD///8AAGQaghdrL/4lcjr/L4pI/zWhUv81n1L/MZtO/yuXSf8klEP/MZlO/1Gp - aP9rtn//er6L/3q+jP97vo3/eL6L/2u1f/9YrG//R6Rg/zmeU/8tmEr/MZpN/zScUP81n1L/OKVV/yyG - Rf8aUCn/CkQa/wFGFM0ARAEQ////AP///wD///8A////AP///wD///8AAEkNbg9OH+4cViz/////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AABfF2kWZy36I2o3/yVxOv8wkkv/N6NU/zWf - Uv80nFD/MZpO/y6YS/8qlkj/KJVG/yiVRv8olUb/KZZG/yuXSP8tmEr/MJlM/zKaTv80nFD/NqBS/zel - Vf81n1D/ImY0/xhLJv8MRxz6AEMKhf///wD///8A////AP///wD///8A////AP///wD///8A////AAA/ - AAwhYzOZ////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wAAVAkjCV0ftRRd - J/4gYTL/J3U9/zGVTP82pVT/N6NU/zagUv81nVH/NJxQ/zSbUP80m1D/NJtQ/zScUP81nlH/NqBS/zej - VP84qFb/L49J/yJmNP8ZSSX/GVAp/xBRIdYATA0v////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AABWE0YTWyfWHlsw/x5aLv8fWy//JnE7/y2KSP82oVP/OalX/zioV/84qFb/OKhX/zeo - Vv8zmk//LolG/yh3Pf8dVSz/GEom/wpEGv8AQhHjAEoMgAAYAAL///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wACjSgBAE8PYwRSGrcQUSH1G1Qr/xpQKf8YSyb/GEkm/xpN - J/8bUyr/HVgt/xhKJv8XSSX/GEom/xhNJ/8MRhz9AUoWwABCAVL///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wAndDwEI2o2TyFi - MqUfXTDRHlsv3R5aLucdWC3xHVgt+B5bL+EgXzG+IWMzlCJmNGQjaTYc////AP///wD///8A////AP// - /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A///AAf// - AAD//wAAf/8AAP/8AAAP/wAA//AAAAf/AAA/4AAAA/8AAA+AAAAA/wAABwAAAAB/AAAAAAAAAD8AAAAA - AAAAPwAAAAAAAAAfAAAAAAAAAA8AAAAAAAAABwAAAAAB4AADAAAAAA/4AAMAAAAAH/4ADwAAAAAH/wA/ - AAAAAAH/gH8AAAAAAP+B/AAAAAAD/8PwAAAAAAf/7+AAAAAAH///gAAAAAB///4AAAAAAP///AAAAAAD - ///wAAAAAA///8AAAAAAP///AAAAAAB///4AAAAAAf//+AAAAAAH9//gAAAAAB/j/8AAAAAAP4H/gAAA - AAD+AP+AAAAAAPwA/+AAAAAA8AA/+AAAAADgAB/wAAAAAOAAB4AAAAAA4AAAAAAAAADwAAAAAAAAAPgA - AAAAAAAA/AAAAAAAAAD8AAAAAAAAAP4AAAAA4AAA/4AAAAH4AAD/wAAAB/wAAP/gAAAP/wAA//gAAB// - AAD//AAA//8AAP//gAP//wAAKAAAABAAAAAgAAAAAQAgAAAAAAAABAAAEgsAABILAAAAAAAAAAAAAP// - /wD///8A////AP///wA0m1AIMpJMbDOTTt0/mlj4Qpta+TuYVPUyk0zDMJFLIv///wD///8A////AP// - /wAvjEhW////AP///wAAbhkgJIU99Hu4jP+q17b/sdq8/6DRrv+PyZ//cbmF/zOPTf4FeCSi////AP// - /wD///8AQpFY/BB3K+4AbRp8LodG/MHgyf+j1LH/abZ+/0KkW/9BpFz/Wa9w/2W0ev9fsXX/NJVP/wZ0 - I83///8A////AGamd/3h9ef/cbCC/8rn0v9+wpD/I5ZD/yaNQf8mgT77J4FA+yeJQv8smUr/R6dh/0Kk - XP8giDz/AG0alP///wBionP91O3b/77fx/9otn7/JZVD/yV7PP4vhUahKZxJChuVPAQLaSU/G3Qz+DOf - Uf81oVL/IIU8/wJoHd7///8AX51w/cbn0P+ZzKf/I5JB/zKdT/8yl03/KHU8+Q1qJkz///8A////AABi - GiYccjP6Kn1B+R54N3j///8ALIVFFlqZa/3B5cr/O59W/y6bS/81n1H/G3Uz/RBtKb4AZwwK////AP// - /wD///8AAGEYJCCIPAsMXCIEKotEpTKDR/hVlGb9fseR/ymcSP8bdjT/DGIi5ABbDSH///8A////AP// - /wD///8A////AP///wARfS5ZU5Zk96zTtv8sg0T8SY5c/SyOSP8hbDb1GmwwVP///wD///8A////AP// - /wD///8A////AABfCSEQdCvjfrCL/9Lr2f9Wsm//Kn5B/SVuOfYabDGZJptFASOXQwgIiCsg////AP// - /wD///8AAF8HCA14KbdUmWf+weDL/7new/+MyJz/JppF/yl4Pv00m1AM////ABqTO2BLpGP4OplV+wB0 - GS7///8A////AA1uJ0A2hUv4nsiq/6vZt/+WzKX/NpxS/zGgT/8nczv9////AAqHLM9IoWD///////3/ - /v8efzb6AGYaTAFeGgkRaykKGHIwmjR3Rv6Mx5z/V65u/yyYSf83pVT/JnI7/f///wAAeR5jDn8s/ozJ - nf/t+PD/zufV/3ywi/9Bh1T9Sodb/XCqf/+Myp7/XrV1/yudSv8pfj//N6ZW/yZyO/3///8A////AAJy - IIgPeyv/QKRb/5jQqP+y3L3/otWx/5DNoP9zvof/TKtk/yycS/8SXCb9B1QbjghYHfAgYjL9////AP// - /wD///8ABGwfoBRwLfshij7/KZxJ/zmkVf85pFf/K5tJ/ymFQf8TWyX4AEgNNP///wD///8AImU0Zv// - /wD///8A////AP///wAlcDoLKXY+mSdyO/Umcjv7JnE7+ydwO+cmbzqHI2k2EP///wD///8A////AP// - /wDwDwAAYAcAAAADAAAAAQAAAAEAAADCAAAA4AAAA/AAAA/AAAAHAAAAQwAAAIAAAACAAAAAwAAAAOAG - AADwDwAA - - - \ No newline at end of file diff --git a/UpdateLib/UpdateLib/UI/WizardPageCollection.cs b/UpdateLib/UpdateLib/UI/WizardPageCollection.cs deleted file mode 100644 index c676ef0..0000000 --- a/UpdateLib/UpdateLib/UI/WizardPageCollection.cs +++ /dev/null @@ -1,178 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; - -namespace MatthiWare.UpdateLib.UI -{ - public class WizardPageCollection : IList - { - private List store; - - private int index = 0; - - public IWizardPage CurrentPage - { - get - { - return this[index]; - } - set - { - index = store.IndexOf(value); - } - } - - public IWizardPage FirstPage { get { return this.First(); } } - - public IWizardPage LastPage { get { return this.Last(); } } - - - - public WizardPageCollection() { store = new List(5); } - - public void Cancel() - { - - } - - public IWizardPage Next() - { - if (CurrentPage == LastPage) - return null; - - if (CurrentPage.IsBusy || !CurrentPage.IsDone) - return null; - - index++; - return CurrentPage; - } - - public IWizardPage Previous() - { - if (CurrentPage == FirstPage) - return null; - - //if (CurrentPage.IsBusy || !CurrentPage.IsDone) - // return null; - - index--; - return CurrentPage; - } - - public bool AllDone() - { - foreach (IWizardPage page in store) - { - if (!page.IsDone || page.HasErrors) - return false; - } - return true; - } - - #region IList Implementation - - public int Count - { - get - { - return store.Count; - } - } - - public bool IsReadOnly - { - get - { - return false; - } - } - - public IWizardPage this[int index] - { - get - { - return store[index]; - } - - set - { - store[index] = value; - } - } - - public int IndexOf(IWizardPage item) - { - return store.IndexOf(item); - } - - public void Insert(int index, IWizardPage item) - { - store.Insert(index, item); - } - - public void RemoveAt(int index) - { - store.RemoveAt(index); - } - - public void Add(IWizardPage item) - { - if (item == null) - throw new ArgumentNullException("item"); - - item.Conent.Dock = System.Windows.Forms.DockStyle.Fill; - store.Add(item); - } - - public void Clear() - { - index = 0; - store.Clear(); - } - - public bool Contains(IWizardPage item) - { - return store.Contains(item); - } - - public void CopyTo(IWizardPage[] array, int arrayIndex) - { - store.CopyTo(array, arrayIndex); - } - - public bool Remove(IWizardPage item) - { - return store.Remove(item); - } - - public IEnumerator GetEnumerator() - { - return store.GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return store.GetEnumerator(); - } - - #endregion - } -} diff --git a/UpdateLib/UpdateLib/UpdateLib.csproj b/UpdateLib/UpdateLib/UpdateLib.csproj index f04610e..084d41f 100644 --- a/UpdateLib/UpdateLib/UpdateLib.csproj +++ b/UpdateLib/UpdateLib/UpdateLib.csproj @@ -1,256 +1,10 @@ - - - + - Debug - AnyCPU - {4394BE57-95E2-45B1-A968-1404B0590B35} - Library - Properties + netstandard2.0 MatthiWare.UpdateLib - UpdateLib - v3.5 - 512 - - + false - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - Auto - - - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false - - - updater.ico - - - - - - - - - - - - - - Properties\SharedAssemblyInfo.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - UserControl - - - UpdaterControl.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - True - True - Resources.resx - - - - - - - - UserControl - - - ChangelogPage.cs - - - UserControl - - - FinishPage.cs - - - UserControl - - - IntroPage.cs - - - UserControl - - - RollbackPage.cs - - - UserControl - - - UpdatePage.cs - - - - Form - - - MessageDialog.cs - - - - Form - - - UpdaterForm.cs - - - - - - - - - - - - - - - - - - - - - - - - - - UpdaterControl.cs - - - ResXFileCodeGenerator - Resources.Designer.cs - - - ChangelogPage.cs - - - FinishPage.cs - - - IntroPage.cs - - - RollbackPage.cs - - - UpdatePage.cs - - - MessageDialog.cs - - - UpdaterForm.cs - + - - - \ No newline at end of file diff --git a/UpdateLib/UpdateLib/Updater.cs b/UpdateLib/UpdateLib/Updater.cs index da5cf9d..68880f6 100644 --- a/UpdateLib/UpdateLib/Updater.cs +++ b/UpdateLib/UpdateLib/Updater.cs @@ -24,21 +24,11 @@ using System; using System.Collections.Generic; -using System.ComponentModel; using System.Diagnostics; -using System.Drawing; using System.Linq; using System.Reflection; -using System.Security; -using System.Windows.Forms; using MatthiWare.UpdateLib.Common; -using MatthiWare.UpdateLib.Common.Exceptions; -using MatthiWare.UpdateLib.Files; -using MatthiWare.UpdateLib.Logging; -using MatthiWare.UpdateLib.Security; -using MatthiWare.UpdateLib.Tasks; -using MatthiWare.UpdateLib.UI; using MatthiWare.UpdateLib.Utils; namespace MatthiWare.UpdateLib @@ -73,45 +63,13 @@ public static Updater Instance private const string m_argUpdate = "update"; private const string m_argWait = "wait"; private const string m_rollback = "rollback"; - private Lazy m_lazyPathVarConv = new Lazy(() => new PathVariableConverter()); - private Lazy m_lazyLogger = new Lazy(() => new Logger()); private InstallationMode m_installationMode = InstallationMode.Shared; - private LoadCacheTask m_loadCacheTask; - - private static Lazy m_lazyProductName = new Lazy(() => - { - AssemblyProductAttribute attr = Assembly.GetEntryAssembly()?.GetCustomAttributes(typeof(AssemblyProductAttribute), true).FirstOrDefault() as AssemblyProductAttribute; - - //AssemblyProductAttribute attr = Attribute.GetCustomAttribute(Assembly.GetEntryAssembly(), ) as AssemblyProductAttribute; - return attr?.Product ?? m_strUpdateLib; - }); - - private static Lazy m_lazyUpdaterName = new Lazy(() => - { - AssemblyProductAttribute attr = Assembly.GetAssembly(typeof(Updater))?.GetCustomAttributes(typeof(AssemblyProductAttribute), true).FirstOrDefault() as AssemblyProductAttribute; - - //AssemblyProductAttribute attr = Attribute.GetCustomAttribute(), typeof(AssemblyProductAttribute)) as AssemblyProductAttribute; - return attr?.Product ?? m_strUpdateLib; - }); - - #endregion - - #region Events - - /// - /// Check for updates completed event. - /// - public event EventHandler CheckForUpdatesCompleted; #endregion #region Properties - internal static string ProductName => m_lazyProductName; - - internal static string UpdaterName => m_lazyUpdaterName; - /// /// Gets the command line parser. Use this to add additional command line arguments that need to be parsed. /// @@ -123,10 +81,6 @@ public static Updater Instance /// If you want to specify an unsafe connection you should enable public IList UpdateURLs { get; } = new List(); - /// - /// Gets the logger for the application. - /// - public ILogger Logger => m_lazyLogger.Value; /// /// Gets or sets the Updater Installation mode @@ -139,7 +93,7 @@ public InstallationMode InstallationMode if (m_installationMode != value) { m_installationMode = value; - IOUtils.ReinitializeAppData(); + //IOUtils.ReinitializeAppData(); } } } @@ -164,15 +118,6 @@ public InstallationMode InstallationMode public bool Rollback { get; private set; } - /// - /// Gets the . - /// This property is only initialized when called. - /// - public PathVariableConverter Converter - { - get { return m_lazyPathVarConv.Value; } - private set { m_lazyPathVarConv.Value = value; } - } /// /// Gets or sets if the updater allows unsafe connection @@ -180,18 +125,6 @@ public PathVariableConverter Converter /// public bool AllowUnsafeConnection { get; set; } = false; - /// - /// Gets the clean up task - /// - public CleanUpTask CleanUpTask { get; private set; } - - /// - /// Gets the update cache task - /// - public UpdateCacheTask UpdateCacheTask { get; private set; } - - - /// /// Is the updater already initialized? /// @@ -208,18 +141,6 @@ public PathVariableConverter Converter #region Fluent API - /// - /// Configures the path variable converter - /// - /// the action to perform on the - /// - public Updater ConfigurePathConverter(Action action) - { - action(Converter); - - return this; - } - /// /// Configures if unsafe connections are allowed /// @@ -233,18 +154,6 @@ public Updater ConfigureAllowUnsafeConnections(bool allow) return this; } - /// - /// Configures the logger - /// - /// Action to perform on the logger - /// - public Updater ConfigureLogger(Action action) - { - action(Logger); - - return this; - } - /// /// Configures the command line parser /// @@ -326,7 +235,7 @@ private Updater() /// public void Initialize() { - StartInitializationTasks(); + //StartInitializationTasks(); // parse the command line CommandLine.Parse(); @@ -341,17 +250,7 @@ public void Initialize() IsInitialized = true; - if (StartUpdating) CheckForUpdates(); - } - - /// - /// Starts the initialization tasks - /// - private void StartInitializationTasks() - { - CleanUpTask = new CleanUpTask("%appdir%").ConfigureAwait(false).Start(); - UpdateCacheTask = new UpdateCacheTask().ConfigureAwait(false).Start(); - m_loadCacheTask = new LoadCacheTask().ConfigureAwait(false).Start(); + //if (StartUpdating) CheckForUpdates(); } /// @@ -366,195 +265,26 @@ private void WaitForProcessToExit(int pid) process?.WaitForExit(); } - /// - /// Starting the update process - /// - /// Whether or not there is an update available and the latest version - public CheckForUpdatesTask.CheckForUpdatesResult CheckForUpdates() - => CheckForUpdatesAsync().AwaitTask().Result; - - /// - /// Starting the update process - /// - /// The owner window - /// Whether or not there is an update available and the latest version - public CheckForUpdatesTask.CheckForUpdatesResult CheckForUpdates(IWin32Window owner) - => CheckForUpdatesAsync(owner).AwaitTask().Result; - - /// - /// Start the update process asynchronously - /// - /// The update checker task. - public CheckForUpdatesTask CheckForUpdatesAsync() - => CheckForUpdatesAsync(null); - - /// - /// Start the update process asynchronously - /// - /// The owner window - /// The update checker task. - public CheckForUpdatesTask CheckForUpdatesAsync(IWin32Window owner) - { - if (!IsInitialized) throw new InvalidOperationException("The updater needs to be initialized first"); - if (UpdateURLs.Count == 0) throw new ArgumentException("No uri's specified", nameof(UpdateURLs)); - - var urls = UpdateURLs.Where(u => !AllowUnsafeConnection || (AllowUnsafeConnection && u.StartsWith(Uri.UriSchemeHttps))); - - if (AllowUnsafeConnection && urls.Count() == 0) - throw new SecurityException("Using unsafe connections to update from is not allowed"); - - var version = GetCache().CurrentVersion; - - CheckForUpdatesTask task = new CheckForUpdatesTask(urls.ToList(), version); - task.TaskCompleted += (o, e) => - { - bool error = e.Error != null; - bool cancelled = e.Cancelled; - bool update = task.Result.UpdateAvailable; - bool adminReq = task.Result.AdminRightsNeeded; - - CheckForUpdatesCompleted?.Invoke(task, new CheckForUpdatesCompletedEventArgs(task.Result, e)); - - if (!update || cancelled || error) - { - if (error) - HandleException(owner, e.Error); - else if (cancelled) - HandleUserCancelled(owner); - else if (!update) - HandleNoUpdate(owner, task.Result.Version); - - return; - } - - DialogResult result = DialogResult.Yes; - - if (!UpdateSilently && !StartUpdating) - result = MessageDialog.Show( - owner, - "Update available", - $"Version {task.Result.Version} available", - "Update now?\nPress yes to update or no to cancel.", - SystemIcons.Question); - - if (result != DialogResult.Yes) - return; - - if (((!StartUpdating && NeedsRestartBeforeUpdate) || (adminReq && !PermissionUtil.IsProcessElevated)) - && !RestartApp(owner, true, UpdateSilently, true, adminReq)) - return; - - if (UpdateSilently) - UpdateWithoutGUI(task.Result.UpdateInfo, task.Result.DownloadURLs); - else - { - UpdaterForm updateForm = new UpdaterForm(task.Result.UpdateInfo, task.Result.ApplicationName); - updateForm.ShowDialog(owner); - } - }; - - return task.Start(); - } - - private void HandleException(IWin32Window owner, Exception e) - { - if (UpdateSilently) - return; - - if (e is NoInternetException) - MessageDialog.Show( - owner, - $"{ProductName} Updater", - "Error while updating", - "Unable to connect to the update server\nPlease check your internet connection and try again!", - SystemIcons.Error, - MessageBoxButtons.OK); - else if (e is InvalidUpdateServerException) - MessageDialog.Show( - owner, - $"{ProductName} Updater", - "Error while updating", - "No valid update server available\nPlease contact the software vendor!", - SystemIcons.Error, - MessageBoxButtons.OK); - else if (e is Win32Exception) - MessageDialog.Show( - owner, - $"{ProductName} Updater", - "Update cancelled", - "Update got cancelled by the user!", - SystemIcons.Warning, - MessageBoxButtons.OK); - else - MessageDialog.Show( - owner, - $"{ProductName} Updater", - "Error while updating", - "Check the log files for more information!", - SystemIcons.Error, - MessageBoxButtons.OK); - } - - private void HandleNoUpdate(IWin32Window owner, UpdateVersion latest) - { - Logger.Info(nameof(Updater), nameof(CheckForUpdatesAsync), "No update available"); - - if (!UpdateSilently) - MessageDialog.Show( - owner, - $"{ProductName} Updater", - "No Update available", - $"You already have the latest version {latest}", - SystemIcons.Information, - MessageBoxButtons.OK); - } - - private void HandleUserCancelled(IWin32Window owner) - { - Logger.Info(nameof(Updater), nameof(CheckForUpdatesAsync), "Update cancalled"); - - if (!UpdateSilently) - MessageDialog.Show( - owner, - $"{ProductName} Updater", - "Cancelled", - "Update got cancelled", - SystemIcons.Warning, - MessageBoxButtons.OK); - } - - /// - /// Gets the cached index of the current application - /// - /// The of the current application - public HashCacheFile GetCache2() => UpdateCacheTask.AwaitTask().Result; - - /// - /// Gets the cache of the updater - /// - /// The loaded of the current application - public CacheFile GetCache() => m_loadCacheTask.AwaitTask().Result; - /// /// Updates without user interaction /// /// The update specifications file private void UpdateWithoutGUI(UpdateInfo updateInfo, IList urls) { - var downloadManager = new DownloadManager(updateInfo, urls); + //var downloadManager = new DownloadManager(updateInfo, urls); - downloadManager.Completed += (o, e) => - { - GetCache2().Save(); - RestartApp(); - }; + //downloadManager.Completed += (o, e) => + //{ + // GetCache2().Save(); + // RestartApp(); + //}; - downloadManager.Download(); + //downloadManager.Download(); } - internal bool RestartApp(IWin32Window owner = null, bool update = false, bool silent = false, bool waitForPid = true, bool asAdmin = false) + internal bool RestartApp(bool update = false, bool silent = false, bool waitForPid = true, bool asAdmin = false) { - Logger.Debug(nameof(Updater), nameof(RestartApp), $"Restarting app: [update={update}; silent={silent}; waitForPid={waitForPid}; asAdmin={asAdmin}]"); + //Logger.Debug(nameof(Updater), nameof(RestartApp), $"Restarting app: [update={update}; silent={silent}; waitForPid={waitForPid}; asAdmin={asAdmin}]"); List args = new List(Environment.GetCommandLineArgs()); @@ -601,9 +331,9 @@ internal bool RestartApp(IWin32Window owner = null, bool update = false, bool si } catch (Exception e) { - Logger.Error(nameof(Updater), nameof(RestartApp), e); + //Logger.Error(nameof(Updater), nameof(RestartApp), e); - HandleException(owner, e); + //HandleException(owner, e); return false; } diff --git a/UpdateLib/UpdateLib/UpdaterControl.bmp b/UpdateLib/UpdateLib/UpdaterControl.bmp deleted file mode 100644 index b40cc5a9a10e131119577e06603ce1ab0d57c371..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 822 zcmZ?rHDhJ~12Z700mK4O%*Y@C76%bW_#hZ2@E-|$`}uA0>2>idioEA1dCgA@Uy{?l zd+PnSkCBx8-+ui7gnR121^+oIMcZ2^o?O^=czV^|p4{z?k!$kpriINpwj8d-d16HL zyxb+n*M-c>n0;<#)1fJ$t8*L|M%yijbXgqdyFAr>NrKt5fcnk75G|=o%huo6owvSW z;l*{yn=6fG`x#F5(eH4#>y*vZ_)Q(-+@v$UflJY5N|xg&ty)ZUav>$ypn(a{>9D7pL>3F#olhiS$;rs zjHdb8GzT2KejH-^=O163+Cpqv12&)A1r&Mx`EB%!?B3&Z&E^CF6$6n@opbkwslb4O zs0We{UOxuv`t|46>_f}!I)lQeWQ4EDGo2f#)#Q{ut>p3Br*M^U#@-u8vX)fMI=)Q1 z+1aN*PPfb9{ zAyZN(9hyJu?26uFa~u~%1AV7nYz>qx-_;qsGW*M~Z>Jt#jF_K&>G5@-;P;>3XY5+! z+!oq+U{dtDB4AJh)vFbO)UUs?Q)iM#--&tWo?qR1Yk$g;QvV4FK7DZ+D=I7Zbth~r zGnpHx)9egV4>ljDrDfYBoqqSQHMx^cE}VIGdDqcd)q8t^>BoOXI#97jiOtmYb9`ze z<&zA7iXmX??)f_PP6pF`Y!-yOFHLk_9BVc|NWa&^wAgL;nf(wo8;@;+ss>XJUOuXt b-{Mdks9j>OTk7cB5It$_%#U9_BC7!aEC2c3 diff --git a/UpdateLib/UpdateLib/Utils/IOUtils.cs b/UpdateLib/UpdateLib/Utils/IOUtils.cs index 1298990..5c68602 100644 --- a/UpdateLib/UpdateLib/Utils/IOUtils.cs +++ b/UpdateLib/UpdateLib/Utils/IOUtils.cs @@ -25,17 +25,16 @@ namespace MatthiWare.UpdateLib.Utils { public static class IOUtils { - private static Lazy m_getAppDataPath = new Lazy(GetAppDataPath); - private static Lazy m_getCachePath = new Lazy(() => $"{AppDataPath}\\Cache"); - private static Lazy m_getLogPath = new Lazy(() => $"{AppDataPath}\\Log"); - private static Lazy m_getTempPath = new Lazy(() => $"{AppDataPath}\\Temp"); + private static Lazy m_getAppDataPath = new Lazy(() => ""); + private static Lazy m_getCachePath = new Lazy(() => $""); + private static Lazy m_getLogPath = new Lazy(() => $""); + private static Lazy m_getTempPath = new Lazy(() => $""); - internal static void ReinitializeAppData() => m_getAppDataPath.Reset(); - public static string AppDataPath => m_getAppDataPath; - public static string CachePath => m_getCachePath; - public static string LogPath => m_getLogPath; - public static string TempPath => m_getTempPath; + public static string AppDataPath => m_getAppDataPath.Value; + public static string CachePath => m_getCachePath.Value; + public static string LogPath => m_getLogPath.Value; + public static string TempPath => m_getTempPath.Value; internal static string GetRemoteBasePath(string url) { @@ -55,15 +54,6 @@ internal static string GetRemoteBasePath(string url) return builder.ToString(); } - private static string GetAppDataPath() - { - string path = GetPathPrefix(); - string updaterName = Updater.UpdaterName; - string productName = Updater.ProductName; - - return $@"{path}\{productName}\{updaterName}"; - } - private static string GetPathPrefix() { switch (Updater.Instance.InstallationMode) diff --git a/UpdateLib/UpdateLib/Utils/Lazy.cs b/UpdateLib/UpdateLib/Utils/Lazy.cs deleted file mode 100644 index 9caa64c..0000000 --- a/UpdateLib/UpdateLib/Utils/Lazy.cs +++ /dev/null @@ -1,84 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; - -namespace MatthiWare.UpdateLib.Utils -{ - /// - /// Threadsafe lazy initialization - /// - /// The return type - public class Lazy - { - private readonly Func m_initFunction; - - private readonly object sync = new object(); - private bool m_initialized = false; - - private T m_storedValue = default(T); - - /// - /// Gets the value and initializes once. - /// - public T Value - { - get - { - if (!m_initialized) - lock (sync) - if (!m_initialized) - { - m_storedValue = m_initFunction(); - m_initialized = true; - } - - return m_storedValue; - } - set - { - lock (sync) - { - m_initialized = true; - m_storedValue = value; - } - } - } - - /// - /// Resets the lazy function - /// - public void Reset() - { - lock (sync) - m_initialized = false; - } - - /// - /// Makes a new instance of an lazy initializer - /// - /// The lazy initialization function - public Lazy(Func initFunction) - { - m_initFunction = initFunction; - } - - public static implicit operator T(Lazy self) - => self.Value; - - } -} diff --git a/UpdateLib/UpdateLib/Utils/NetworkUtils.cs b/UpdateLib/UpdateLib/Utils/NetworkUtils.cs deleted file mode 100644 index b4dc6a7..0000000 --- a/UpdateLib/UpdateLib/Utils/NetworkUtils.cs +++ /dev/null @@ -1,31 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using MatthiWare.UpdateLib.Win32; - -namespace MatthiWare.UpdateLib.Utils -{ - public static class NetworkUtils - { - public static bool HasConnection() - { - int desc; - return NativeMethods.InternetGetConnectedState(out desc, 0); - } - - } -} diff --git a/UpdateLib/UpdateLib/Utils/RegistryHelper.cs b/UpdateLib/UpdateLib/Utils/RegistryHelper.cs deleted file mode 100644 index 37bf802..0000000 --- a/UpdateLib/UpdateLib/Utils/RegistryHelper.cs +++ /dev/null @@ -1,160 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using MatthiWare.UpdateLib.Common; -using MatthiWare.UpdateLib.Tasks; -using Microsoft.Win32; -using System; -using System.Linq; -using System.Security.AccessControl; - -namespace MatthiWare.UpdateLib.Utils -{ - public static class RegistryHelper - { - - public static RegistryKey GetOrMakeKey(RegistryKeyEntry key) - { - if (key == null) throw new ArgumentNullException(nameof(key)); - - string pathToKeyRoot = key.Parent.DestinationLocation; - - return GetOrMakeKey(pathToKeyRoot); - } - - public static RegistryKey GetOrMakeKey(string pathToKeyRoot) - { - if (string.IsNullOrEmpty(pathToKeyRoot)) throw new ArgumentNullException(nameof(pathToKeyRoot)); - - string pathToKey = pathToKeyRoot.Split(char.Parse(@"\")).Skip(1).AppendAll(@"\"); - - return OpenSubKey(GetRootKey(pathToKeyRoot), pathToKey); - } - - private static RegistryKey GetRootKey(string pathToKeyRoot) - { - if (pathToKeyRoot.StartsWith("HKEY_LOCAL_MACHINE")) - return Registry.LocalMachine; - else if (pathToKeyRoot.StartsWith("HKEY_CURRENT_USER")) - return Registry.CurrentUser; - else if (pathToKeyRoot.StartsWith("HKEY_CLASSES_ROOT")) - return Registry.ClassesRoot; - else if (pathToKeyRoot.StartsWith("HKEY_USERS")) - return Registry.Users; - else if (pathToKeyRoot.StartsWith("HKEY_CURRENT_CONFIG")) - return Registry.CurrentConfig; - else if (pathToKeyRoot.StartsWith("HKEY_PERFORMANCE_DATA")) - return Registry.PerformanceData; - else if (pathToKeyRoot.StartsWith("HKEY_DYN_DATA")) - return Registry.DynData; - else - return null; - } - - private static RegistryKey OpenSubKey(RegistryKey key, string path) - { - if (key == null) - return null; - - RegistryKey reg = key?.OpenSubKey(path, RegistryKeyPermissionCheck.ReadWriteSubTree, RegistryRights.FullControl); - - if (reg != null) - return reg; - - key.CreateSubKey(path, RegistryKeyPermissionCheck.ReadWriteSubTree); - - return OpenSubKey(key, path); - } - - internal static void InternalOpenSubKey(string root, string keyName) - { - RegistryKey key = GetRootKey(root); - - foreach (string item in root.Split(char.Parse(@"\")).Skip(1).NotEmpty()) - { - RegistryKey tmp = key?.OpenSubKey(item, RegistryKeyPermissionCheck.ReadWriteSubTree, RegistryRights.FullControl); - key?.Close(); - - key = tmp; - } - - key?.Close(); - } - - public static bool IsSame(RegistryKeyEntry key) - { - if (key == null) - return false; - - string path = key.Parent.DestinationLocation; - - try - { - object value = Registry.GetValue(path, key.Name, new NullObject()); - - return key.Value.Equals(value); - - } - catch (Exception e) - { - Updater.Instance.Logger.Error(nameof(RegistryHelper), nameof(IsSame), e); - } - - return false; - } - - public static bool Exists(RegistryKeyEntry key, out object value) - { - value = null; - - if (key == null) - return false; - - string path = key.Parent.DestinationLocation; - - try - { - value = Registry.GetValue(path, key.Name, null); - - return value != null; - } - catch (Exception e) - { - Updater.Instance.Logger.Error(nameof(RegistryHelper), nameof(Exists), e); - } - - return false; - } - - public static void Update(RegistryKeyEntry logicalKey, UpdateRegistryTask.RollbackData rollback) - { - if (logicalKey == null) throw new ArgumentNullException(nameof(logicalKey)); - - RegistryKey key = GetOrMakeKey(logicalKey); - - if (key?.GetValueNames().Contains(logicalKey.Name) ?? false) - rollback.type = key.GetValueKind(logicalKey.Name); - - key.SetValue(logicalKey.Name, logicalKey.Value, logicalKey.Type); - } - - /// - /// We do nothing with this - /// - private class NullObject { } - } -} diff --git a/UpdateLib/UpdateLib/Win32/NativeMethods.cs b/UpdateLib/UpdateLib/Win32/NativeMethods.cs deleted file mode 100644 index 5e7ba9f..0000000 --- a/UpdateLib/UpdateLib/Win32/NativeMethods.cs +++ /dev/null @@ -1,28 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System.Runtime.InteropServices; - -namespace MatthiWare.UpdateLib.Win32 -{ - internal static class NativeMethods - { - [DllImport("wininet.dll")] - internal static extern bool InternetGetConnectedState(out int connDescription, int reservedValue); - - } -} diff --git a/UpdateLib/UpdateLib/updater.ico b/UpdateLib/UpdateLib/updater.ico deleted file mode 100644 index c952e49470813cd4e96fa2bcf0bc3e004851c040..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10806 zcmb_i2Urx>79Na=6+uCzw`F%(SYVeby{JgFBKDww*pOZNR>X?2Ym5bZ zPojos@_aEqV~iRs@V|2h)`wW)OWg0fduL~7=KlBGb5HrtaGVm?hLg!S>J7L`A;*b0 zj#E`_`aQ8N$DN~dCUlN2;l@&9*YO`?j_cN`sWqM8H~^od*%S@zY@OfVTb}EmC|~AR zCR^frmf90)cV$a`Yh_FQw$u3n`EvhstGs|q$Z~#WmgNaa zraMHLZV+a>LpYaOPE!-jYC3O{;Re$z53uXiv#bl~e(66M|L@+*CF>7TOOc<@o@oc; zRA(4wJ43j*H=I`oA#ig9ChSf@?EV}~+MSA!oii}9Iu?OjrXpZNIPCHVK{%V{ljZ_; zf43CbiH=!jqqr==7k?Me$KJ7h z<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 zD9SO1?E71>*CVo-W0^f=wp6LP9i_gGPLXj^IZXD3e)gu8-rNpTU-t#sF1q)>+DCmT From fff6f1d7d92f5b6908a83203f38e09ac1f87c8a0 Mon Sep 17 00:00:00 2001 From: Matthias Beerens Date: Thu, 16 Aug 2018 18:09:09 +0200 Subject: [PATCH 35/40] Add nuget packages --- UpdateLib/UpdateLib/UpdateLib.csproj | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/UpdateLib/UpdateLib/UpdateLib.csproj b/UpdateLib/UpdateLib/UpdateLib.csproj index 084d41f..c744ef1 100644 --- a/UpdateLib/UpdateLib/UpdateLib.csproj +++ b/UpdateLib/UpdateLib/UpdateLib.csproj @@ -7,4 +7,9 @@ + + + + + \ No newline at end of file From a050b81f7867a681ad41179f75c9c4ebbd200778 Mon Sep 17 00:00:00 2001 From: Matthias Beerens Date: Sun, 19 Aug 2018 10:20:08 +0200 Subject: [PATCH 36/40] Start reworking the structure of UpdateLib --- UpdateLib/TestApp/Form1.Designer.cs | 39 +++ UpdateLib/TestApp/Form1.cs | 20 ++ UpdateLib/TestApp/Program.cs | 43 +-- UpdateLib/TestApp/TestApp.csproj | 1 + UpdateLib/TestApp/Testing/DummyTask.cs | 48 --- .../Properties/Resources.Designer.cs | 163 ---------- .../Properties/Resources.resx | 151 --------- .../Properties/Settings.Designer.cs | 26 -- .../Properties/Settings.settings | 7 - .../UpdateLib.Generator.csproj | 1 + .../UpdateLib.Tests/UpdateLib.Tests.csproj | 1 + UpdateLib/UpdateLib.Tests/UpdaterTest.cs | 2 +- .../ICheckForUpdatesMiddleware.cs | 16 + .../ICommandLineArgumentResolver.cs | 18 ++ .../Abstractions/ICommandLineParser.cs | 21 ++ .../Abstractions/IParameterDefinition.cs | 25 ++ UpdateLib/UpdateLib/Abstractions/IUpdater.cs | 13 + .../UpdateLib/Abstractions/IValueResolver.cs | 13 + .../Abstractions/Internal/IUpdateManager.cs | 16 + UpdateLib/UpdateLib/Common/Enums.cs | 100 ------ UpdateLib/UpdateLib/Common/Interfaces.cs | 19 -- .../UpdateLib/Common/ParameterDefinition.cs | 27 -- .../{Common => Core}/Abstraction/EntryBase.cs | 0 .../{Common => Core}/Abstraction/FileBase.cs | 0 .../UpdateLib/{Common => Core}/Attributes.cs | 0 .../UpdateLib/Core/CheckForUpdatesResult.cs | 12 + .../UpdateLib/{Common => Core}/Delegates.cs | 0 .../{Common => Core}/DirectoryEntry.cs | 0 UpdateLib/UpdateLib/Core/Enums.cs | 47 +++ .../Exceptions/InvalidHashException.cs | 0 .../InvalidUpdateServerException.cs | 0 .../Exceptions/NoInternetException.cs | 0 .../UnableToDownloadUpdateException.cs | 0 .../UpdateLib/{Common => Core}/FileEntry.cs | 0 .../UpdateLib/{Common => Core}/FileManager.cs | 0 .../{Common => Core}/HashCacheEntry.cs | 0 .../StringToIntArgumentResolver.cs | 21 ++ .../StringToMultipleIntsArgumentResolver.cs | 29 ++ .../StringToStringArgumentResolver.cs | 28 ++ .../StringToUpdateVersionArgumentResolver.cs | 21 ++ .../Core/Internal/DefaultVersionResolver.cs | 25 ++ .../Core/Internal/UpdateLibOptionsSetup.cs | 26 ++ .../UpdateLib/Core/Internal/UpdateManager.cs | 37 +++ .../UpdateLib/Core/ParameterDefinition.cs | 51 +++ .../{Common => Core}/PathVariableConverter.cs | 0 .../UpdateLib/{Common => Core}/UpdateInfo.cs | 2 - UpdateLib/UpdateLib/Core/UpdateLibOptions.cs | 17 + .../UpdateLib/Core/UpdateLibServiceBuilder.cs | 10 + .../{Common => Core}/UpdateVersion.cs | 20 +- UpdateLib/UpdateLib/UpdateBuilder.cs | 55 ++++ UpdateLib/UpdateLib/UpdateLib.csproj | 5 + UpdateLib/UpdateLib/Updater.cs | 306 ++++++------------ UpdateLib/UpdateLib/Utils/CmdLineParser.cs | 126 ++++---- UpdateLib/UpdateLib/Utils/IOUtils.cs | 17 +- 54 files changed, 768 insertions(+), 857 deletions(-) create mode 100644 UpdateLib/TestApp/Form1.Designer.cs create mode 100644 UpdateLib/TestApp/Form1.cs delete mode 100644 UpdateLib/TestApp/Testing/DummyTask.cs delete mode 100644 UpdateLib/UpdateLib.Generator/Properties/Resources.Designer.cs delete mode 100644 UpdateLib/UpdateLib.Generator/Properties/Resources.resx delete mode 100644 UpdateLib/UpdateLib.Generator/Properties/Settings.Designer.cs delete mode 100644 UpdateLib/UpdateLib.Generator/Properties/Settings.settings create mode 100644 UpdateLib/UpdateLib/Abstractions/ICheckForUpdatesMiddleware.cs create mode 100644 UpdateLib/UpdateLib/Abstractions/ICommandLineArgumentResolver.cs create mode 100644 UpdateLib/UpdateLib/Abstractions/ICommandLineParser.cs create mode 100644 UpdateLib/UpdateLib/Abstractions/IParameterDefinition.cs create mode 100644 UpdateLib/UpdateLib/Abstractions/IUpdater.cs create mode 100644 UpdateLib/UpdateLib/Abstractions/IValueResolver.cs create mode 100644 UpdateLib/UpdateLib/Abstractions/Internal/IUpdateManager.cs delete mode 100644 UpdateLib/UpdateLib/Common/Enums.cs delete mode 100644 UpdateLib/UpdateLib/Common/Interfaces.cs delete mode 100644 UpdateLib/UpdateLib/Common/ParameterDefinition.cs rename UpdateLib/UpdateLib/{Common => Core}/Abstraction/EntryBase.cs (100%) rename UpdateLib/UpdateLib/{Common => Core}/Abstraction/FileBase.cs (100%) rename UpdateLib/UpdateLib/{Common => Core}/Attributes.cs (100%) create mode 100644 UpdateLib/UpdateLib/Core/CheckForUpdatesResult.cs rename UpdateLib/UpdateLib/{Common => Core}/Delegates.cs (100%) rename UpdateLib/UpdateLib/{Common => Core}/DirectoryEntry.cs (100%) create mode 100644 UpdateLib/UpdateLib/Core/Enums.cs rename UpdateLib/UpdateLib/{Common => Core}/Exceptions/InvalidHashException.cs (100%) rename UpdateLib/UpdateLib/{Common => Core}/Exceptions/InvalidUpdateServerException.cs (100%) rename UpdateLib/UpdateLib/{Common => Core}/Exceptions/NoInternetException.cs (100%) rename UpdateLib/UpdateLib/{Common => Core}/Exceptions/UnableToDownloadUpdateException.cs (100%) rename UpdateLib/UpdateLib/{Common => Core}/FileEntry.cs (100%) rename UpdateLib/UpdateLib/{Common => Core}/FileManager.cs (100%) rename UpdateLib/UpdateLib/{Common => Core}/HashCacheEntry.cs (100%) create mode 100644 UpdateLib/UpdateLib/Core/Internal/CommandLine/StringToIntArgumentResolver.cs create mode 100644 UpdateLib/UpdateLib/Core/Internal/CommandLine/StringToMultipleIntsArgumentResolver.cs create mode 100644 UpdateLib/UpdateLib/Core/Internal/CommandLine/StringToStringArgumentResolver.cs create mode 100644 UpdateLib/UpdateLib/Core/Internal/CommandLine/StringToUpdateVersionArgumentResolver.cs create mode 100644 UpdateLib/UpdateLib/Core/Internal/DefaultVersionResolver.cs create mode 100644 UpdateLib/UpdateLib/Core/Internal/UpdateLibOptionsSetup.cs create mode 100644 UpdateLib/UpdateLib/Core/Internal/UpdateManager.cs create mode 100644 UpdateLib/UpdateLib/Core/ParameterDefinition.cs rename UpdateLib/UpdateLib/{Common => Core}/PathVariableConverter.cs (100%) rename UpdateLib/UpdateLib/{Common => Core}/UpdateInfo.cs (99%) create mode 100644 UpdateLib/UpdateLib/Core/UpdateLibOptions.cs create mode 100644 UpdateLib/UpdateLib/Core/UpdateLibServiceBuilder.cs rename UpdateLib/UpdateLib/{Common => Core}/UpdateVersion.cs (95%) create mode 100644 UpdateLib/UpdateLib/UpdateBuilder.cs diff --git a/UpdateLib/TestApp/Form1.Designer.cs b/UpdateLib/TestApp/Form1.Designer.cs new file mode 100644 index 0000000..2bf95e8 --- /dev/null +++ b/UpdateLib/TestApp/Form1.Designer.cs @@ -0,0 +1,39 @@ +namespace TestApp +{ + partial class Form1 + { + /// + /// 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.components = new System.ComponentModel.Container(); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(800, 450); + this.Text = "Form1"; + } + + #endregion + } +} \ No newline at end of file diff --git a/UpdateLib/TestApp/Form1.cs b/UpdateLib/TestApp/Form1.cs new file mode 100644 index 0000000..ab38765 --- /dev/null +++ b/UpdateLib/TestApp/Form1.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace TestApp +{ + public partial class Form1 : Form + { + public Form1() + { + InitializeComponent(); + } + } +} diff --git a/UpdateLib/TestApp/Program.cs b/UpdateLib/TestApp/Program.cs index af4720e..e97ee9e 100644 --- a/UpdateLib/TestApp/Program.cs +++ b/UpdateLib/TestApp/Program.cs @@ -15,11 +15,10 @@ * along with this program. If not, see . */ -using MatthiWare.UpdateLib; -using MatthiWare.UpdateLib.Common; -using MatthiWare.UpdateLib.Logging.Writers; using System; using System.Windows.Forms; +using MatthiWare.UpdateLib; +using MatthiWare.UpdateLib.Common; namespace TestApp { @@ -31,31 +30,33 @@ static class Program [STAThread] static void Main() { - // UpdateVersion v1 = new UpdateVersion(1, 2, 3, VersionLabel.Alpha); - // XmlSerializer xml = new XmlSerializer(typeof(UpdateVersion)); - // xml.Serialize(Console.Out, v1); + // UpdateVersion v1 = new UpdateVersion(1, 2, 3, VersionLabel.Alpha); + // XmlSerializer xml = new XmlSerializer(typeof(UpdateVersion)); + // xml.Serialize(Console.Out, v1); - // Console.WriteLine(Environment.CommandLine); - // foreach (var s in Environment.GetCommandLineArgs()) - // Console.WriteLine(s); + // Console.WriteLine(Environment.CommandLine); + // foreach (var s in Environment.GetCommandLineArgs()) + // Console.WriteLine(s); - //Environment.Exit(0); + //Environment.Exit(0); // we still want our updater to have visual styles in case of update cmd argument switch Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); - Updater.Instance - //.ConfigureUpdateUrl("https://raw.githubusercontent.com/MatthiWare/UpdateLib.TestApp.UpdateExample/master/Dev/updatefile.xml") - .ConfigureAddUpdateUri("http://matthiware.dev/UpdateLib/Dev/updatefile.xml") - .ConfigureLogger((logger) => logger.LogLevel = LoggingLevel.Debug) - .ConfigureLogger((logger) => logger.Writers.Add(new ConsoleLogWriter())) - .ConfigureLogger((logger) => logger.Writers.Add(new FileLogWriter())) - .ConfigureAllowUnsafeConnections(true) - .ConfigureCacheInvalidation(TimeSpan.FromSeconds(30)) - .ConfigureNeedsRestartBeforeUpdate(true) - .ConfigureInstallationMode(InstallationMode.Shared) - .Initialize(); + Updater.GetBuilder().Build().InitializeAsync().Wait(); + + //Updater.Instance + // //.ConfigureUpdateUrl("https://raw.githubusercontent.com/MatthiWare/UpdateLib.TestApp.UpdateExample/master/Dev/updatefile.xml") + // .ConfigureAddUpdateUri("http://matthiware.dev/UpdateLib/Dev/updatefile.xml") + // .ConfigureLogger((logger) => logger.LogLevel = LoggingLevel.Debug) + // .ConfigureLogger((logger) => logger.Writers.Add(new ConsoleLogWriter())) + // .ConfigureLogger((logger) => logger.Writers.Add(new FileLogWriter())) + // .ConfigureAllowUnsafeConnections(true) + // .ConfigureCacheInvalidation(TimeSpan.FromSeconds(30)) + // .ConfigureNeedsRestartBeforeUpdate(true) + // .ConfigureInstallationMode(InstallationMode.Shared) + // .Initialize(); Application.Run(new Form1()); diff --git a/UpdateLib/TestApp/TestApp.csproj b/UpdateLib/TestApp/TestApp.csproj index e06bb35..1e541fb 100644 --- a/UpdateLib/TestApp/TestApp.csproj +++ b/UpdateLib/TestApp/TestApp.csproj @@ -18,6 +18,7 @@ {7C3C0345-6D01-40A6-9F01-60D8D6451FB1} TestApp.Program app.manifest + 7.1 diff --git a/UpdateLib/TestApp/Testing/DummyTask.cs b/UpdateLib/TestApp/Testing/DummyTask.cs deleted file mode 100644 index 8a8c447..0000000 --- a/UpdateLib/TestApp/Testing/DummyTask.cs +++ /dev/null @@ -1,48 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using MatthiWare.UpdateLib; -using MatthiWare.UpdateLib.Tasks; -using System; -using System.Threading; - -namespace TestApp.Testing -{ - public class DummyTask : AsyncTask - { - protected override void DoWork() - { - for (int i = 0; i < 10; i++) - { - Enqueue(new Action(ChildWorkStuff), i); - } - } - - Random rnd = new Random(DateTime.Now.Millisecond); - - private void ChildWorkStuff(int id) - { - int waitTime = rnd.Next(1000, 5000); - - Thread.Sleep(waitTime); - - Updater.Instance.Logger.Debug(nameof(ChildWorkStuff), string.Empty, $"Task[{id.ToString("X2")}] Completed"); - } - - - } -} diff --git a/UpdateLib/UpdateLib.Generator/Properties/Resources.Designer.cs b/UpdateLib/UpdateLib.Generator/Properties/Resources.Designer.cs deleted file mode 100644 index 017ea70..0000000 --- a/UpdateLib/UpdateLib.Generator/Properties/Resources.Designer.cs +++ /dev/null @@ -1,163 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace MatthiWare.UpdateLib.Generator.Properties { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // 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")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MatthiWare.UpdateLib.Generator.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap cross { - get { - object obj = ResourceManager.GetObject("cross", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap folder_transparent_16px { - get { - object obj = ResourceManager.GetObject("folder_transparent_16px", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap gears { - get { - object obj = ResourceManager.GetObject("gears", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap image_transparent_16px { - get { - object obj = ResourceManager.GetObject("image_transparent_16px", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap loading { - get { - object obj = ResourceManager.GetObject("loading", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap loading_gear { - get { - object obj = ResourceManager.GetObject("loading_gear", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap project_16px { - get { - object obj = ResourceManager.GetObject("project_16px", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap reg_bin_16px { - get { - object obj = ResourceManager.GetObject("reg_bin_16px", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap reg_string_16px { - get { - object obj = ResourceManager.GetObject("reg_string_16px", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Registry_Editor_32px { - get { - object obj = ResourceManager.GetObject("Registry_Editor_32px", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - } -} diff --git a/UpdateLib/UpdateLib.Generator/Properties/Resources.resx b/UpdateLib/UpdateLib.Generator/Properties/Resources.resx deleted file mode 100644 index d5f13cd..0000000 --- a/UpdateLib/UpdateLib.Generator/Properties/Resources.resx +++ /dev/null @@ -1,151 +0,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 - - - - ..\Resources\loading.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\gears.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\folder_transparent_16px.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\loading_gear.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\image_transparent_16px.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\cross.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\project_16px.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\reg_bin_16px.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\reg_string_16px.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\Registry Editor_32px.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - \ No newline at end of file diff --git a/UpdateLib/UpdateLib.Generator/Properties/Settings.Designer.cs b/UpdateLib/UpdateLib.Generator/Properties/Settings.Designer.cs deleted file mode 100644 index 58bfc72..0000000 --- a/UpdateLib/UpdateLib.Generator/Properties/Settings.Designer.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace MatthiWare.UpdateLib.Generator.Properties { - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default { - get { - return defaultInstance; - } - } - } -} diff --git a/UpdateLib/UpdateLib.Generator/Properties/Settings.settings b/UpdateLib/UpdateLib.Generator/Properties/Settings.settings deleted file mode 100644 index 3964565..0000000 --- a/UpdateLib/UpdateLib.Generator/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/UpdateLib/UpdateLib.Generator/UpdateLib.Generator.csproj b/UpdateLib/UpdateLib.Generator/UpdateLib.Generator.csproj index f9adb81..88d728d 100644 --- a/UpdateLib/UpdateLib.Generator/UpdateLib.Generator.csproj +++ b/UpdateLib/UpdateLib.Generator/UpdateLib.Generator.csproj @@ -4,6 +4,7 @@ MatthiWare.UpdateLib.Generator Exe false + 7.1 diff --git a/UpdateLib/UpdateLib.Tests/UpdateLib.Tests.csproj b/UpdateLib/UpdateLib.Tests/UpdateLib.Tests.csproj index 4de1865..40646d3 100644 --- a/UpdateLib/UpdateLib.Tests/UpdateLib.Tests.csproj +++ b/UpdateLib/UpdateLib.Tests/UpdateLib.Tests.csproj @@ -13,6 +13,7 @@ {C47B8CC3-ABAB-4F56-8CA2-1323F902D1C3} + 7.1 diff --git a/UpdateLib/UpdateLib.Tests/UpdaterTest.cs b/UpdateLib/UpdateLib.Tests/UpdaterTest.cs index c402ffd..f38b98f 100644 --- a/UpdateLib/UpdateLib.Tests/UpdaterTest.cs +++ b/UpdateLib/UpdateLib.Tests/UpdaterTest.cs @@ -54,7 +54,7 @@ public void TestInitializationActuallyInitializes() { Updater u = Updater.Instance; - u.Initialize(); + u.InitializeAsync(); Assert.IsTrue(u.IsInitialized); diff --git a/UpdateLib/UpdateLib/Abstractions/ICheckForUpdatesMiddleware.cs b/UpdateLib/UpdateLib/Abstractions/ICheckForUpdatesMiddleware.cs new file mode 100644 index 0000000..3834a6d --- /dev/null +++ b/UpdateLib/UpdateLib/Abstractions/ICheckForUpdatesMiddleware.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading; + +namespace MatthiWare.UpdateLib.Abstractions +{ + public interface ICheckForUpdatesMiddleware + { + void BeforeCheckForUpdates(CancellationToken cancellation); + + void OnCheckForUpdates(CancellationToken cancellation); + + void PostCheckForUpdates(CancellationToken cancellation); + } +} diff --git a/UpdateLib/UpdateLib/Abstractions/ICommandLineArgumentResolver.cs b/UpdateLib/UpdateLib/Abstractions/ICommandLineArgumentResolver.cs new file mode 100644 index 0000000..0291a4e --- /dev/null +++ b/UpdateLib/UpdateLib/Abstractions/ICommandLineArgumentResolver.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace MatthiWare.UpdateLib.Abstractions +{ + public interface ICommandLineArgumentResolver + { + bool CanResolve(ref string[] data, ref int index); + + object Resolve(ref string[] data, ref int index); + } + + public interface ICommandLineArgumentResolver : ICommandLineArgumentResolver + { + new TOutput Resolve(ref string[] data, ref int index); + } +} diff --git a/UpdateLib/UpdateLib/Abstractions/ICommandLineParser.cs b/UpdateLib/UpdateLib/Abstractions/ICommandLineParser.cs new file mode 100644 index 0000000..15df04b --- /dev/null +++ b/UpdateLib/UpdateLib/Abstractions/ICommandLineParser.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Text; +using MatthiWare.UpdateLib.Common; + +namespace MatthiWare.UpdateLib.Abstractions +{ + public interface ICommandLineParser + { + void AddParameter(string paramName, ParamMandatoryType mandatoryType = ParamMandatoryType.Optional, ParamValueType valueType = ParamValueType.None); + + void AddParameter(string paramName, ParamMandatoryType mandatoryType, ParamValueType valueType, ICommandLineArgumentResolver resolver); + + void Parse(); + + IParameterDefinition Get(string name); + + IParameterDefinition Get(string name); + + } +} diff --git a/UpdateLib/UpdateLib/Abstractions/IParameterDefinition.cs b/UpdateLib/UpdateLib/Abstractions/IParameterDefinition.cs new file mode 100644 index 0000000..795c90e --- /dev/null +++ b/UpdateLib/UpdateLib/Abstractions/IParameterDefinition.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Text; +using MatthiWare.UpdateLib.Common; + +namespace MatthiWare.UpdateLib.Abstractions +{ + public interface IParameterDefinition + { + string Name { get; } + ParamValueType ValueType { get; } + ParamMandatoryType MandatoryType { get; } + dynamic Value { get; } + int Count { get; set; } + bool IsFound { get; } + void Reset(); + void Resolve(ref string[] args, ref int index); + bool CanResolve(ref string[] args, ref int index); + } + + public interface IParameterDefinition : IParameterDefinition + { + new T Value { get; } + } +} diff --git a/UpdateLib/UpdateLib/Abstractions/IUpdater.cs b/UpdateLib/UpdateLib/Abstractions/IUpdater.cs new file mode 100644 index 0000000..3913ac7 --- /dev/null +++ b/UpdateLib/UpdateLib/Abstractions/IUpdater.cs @@ -0,0 +1,13 @@ +using System.Threading; +using System.Threading.Tasks; +using MatthiWare.UpdateLib.Core; + +namespace MatthiWare.UpdateLib.Abstractions +{ + public interface IUpdater + { + Task InitializeAsync(CancellationToken cancellation = default); + + Task CheckForUpdatesAsync(CancellationToken cancellation = default); + } +} diff --git a/UpdateLib/UpdateLib/Abstractions/IValueResolver.cs b/UpdateLib/UpdateLib/Abstractions/IValueResolver.cs new file mode 100644 index 0000000..17ae8d0 --- /dev/null +++ b/UpdateLib/UpdateLib/Abstractions/IValueResolver.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Text; +using MatthiWare.UpdateLib.Common; + +namespace MatthiWare.UpdateLib.Abstractions +{ + public interface IValueResolver + { + T Resolve(); + + } +} diff --git a/UpdateLib/UpdateLib/Abstractions/Internal/IUpdateManager.cs b/UpdateLib/UpdateLib/Abstractions/Internal/IUpdateManager.cs new file mode 100644 index 0000000..7abc9cf --- /dev/null +++ b/UpdateLib/UpdateLib/Abstractions/Internal/IUpdateManager.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using MatthiWare.UpdateLib.Core; + +namespace MatthiWare.UpdateLib.Abstractions.Internal +{ + public interface IUpdateManager + { + Task CheckForUpdatesAsync(CancellationToken cancellation); + + Task UpdateAsync(CancellationToken cancellation); + } +} diff --git a/UpdateLib/UpdateLib/Common/Enums.cs b/UpdateLib/UpdateLib/Common/Enums.cs deleted file mode 100644 index ce6eedc..0000000 --- a/UpdateLib/UpdateLib/Common/Enums.cs +++ /dev/null @@ -1,100 +0,0 @@ -namespace MatthiWare.UpdateLib.Common -{ - /// - /// Indicates the how the underlaying application is installed. - /// - public enum InstallationMode - { - /// - /// Shared installation we will use the roaming folder - /// - Shared = 0, - - /// - /// Single user installation we will use the local folder - /// - Local = 1 - } - - public enum ParamValueType - { - None, - String, - OptionalString, - Int, - OptionalInt, - Bool, - OptionalBool, - MultipleInts - } - - public enum ParamMandatoryType - { - Optional, - Required - } - - public enum TOKEN_INFORMATION_CLASS - { - TokenUser = 1, - TokenGroups, - TokenPrivileges, - TokenOwner, - TokenPrimaryGroup, - TokenDefaultDacl, - TokenSource, - TokenType, - TokenImpersonationLevel, - TokenStatistics, - TokenRestrictedSids, - TokenSessionId, - TokenGroupsAndPrivileges, - TokenSessionReference, - TokenSandBoxInert, - TokenAuditPolicy, - TokenOrigin, - TokenElevationType, - TokenLinkedToken, - TokenElevation, - TokenHasRestrictions, - TokenAccessInformation, - TokenVirtualizationAllowed, - TokenVirtualizationEnabled, - TokenIntegrityLevel, - TokenUIAccess, - TokenMandatoryPolicy, - TokenLogonSid, - MaxTokenInfoClass - } - - public enum TOKEN_ELEVATION_TYPE - { - TokenElevationTypeDefault = 1, - TokenElevationTypeFull, - TokenElevationTypeLimited - } - - public enum LoggingLevel - { - Debug = 0, - Info = 1, - Warn = 2, - Error = 3 - } - - public enum VersionLabel : byte - { - Alpha=0, - Beta=1, - RC=2, - None=3 - } - - internal enum InstructionType : byte - { - NoOp = 0, - Add = 1, - Run = 2, - Copy = 3 - } -} diff --git a/UpdateLib/UpdateLib/Common/Interfaces.cs b/UpdateLib/UpdateLib/Common/Interfaces.cs deleted file mode 100644 index d4cc281..0000000 --- a/UpdateLib/UpdateLib/Common/Interfaces.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace MatthiWare.UpdateLib.Common -{ - public interface IPatchGenerator - { - event ProgressChangedHandler ProgressChanged; - void Generate(); - } - - public interface IPatcher - { - event ProgressChangedHandler ProgressChanged; - void Patch(); - } -} diff --git a/UpdateLib/UpdateLib/Common/ParameterDefinition.cs b/UpdateLib/UpdateLib/Common/ParameterDefinition.cs deleted file mode 100644 index 3b0eefd..0000000 --- a/UpdateLib/UpdateLib/Common/ParameterDefinition.cs +++ /dev/null @@ -1,27 +0,0 @@ -namespace MatthiWare.UpdateLib.Common -{ - public class ParameterDefinition - { - public string ParameterName { get; private set; } - public ParamMandatoryType MandatoryType { get; private set; } - public ParamValueType ValueType { get; private set; } - public object Value { get; internal set; } - - public int Count { get; internal set; } - - public bool IsFound => Count > 0; - - internal ParameterDefinition(string paramName, ParamMandatoryType mandatoryType = ParamMandatoryType.Optional, ParamValueType valueType = ParamValueType.None) - { - ParameterName = paramName; - MandatoryType = mandatoryType; - ValueType = valueType; - } - - internal void Reset() - { - Value = null; - Count = 0; - } - } -} diff --git a/UpdateLib/UpdateLib/Common/Abstraction/EntryBase.cs b/UpdateLib/UpdateLib/Core/Abstraction/EntryBase.cs similarity index 100% rename from UpdateLib/UpdateLib/Common/Abstraction/EntryBase.cs rename to UpdateLib/UpdateLib/Core/Abstraction/EntryBase.cs diff --git a/UpdateLib/UpdateLib/Common/Abstraction/FileBase.cs b/UpdateLib/UpdateLib/Core/Abstraction/FileBase.cs similarity index 100% rename from UpdateLib/UpdateLib/Common/Abstraction/FileBase.cs rename to UpdateLib/UpdateLib/Core/Abstraction/FileBase.cs diff --git a/UpdateLib/UpdateLib/Common/Attributes.cs b/UpdateLib/UpdateLib/Core/Attributes.cs similarity index 100% rename from UpdateLib/UpdateLib/Common/Attributes.cs rename to UpdateLib/UpdateLib/Core/Attributes.cs diff --git a/UpdateLib/UpdateLib/Core/CheckForUpdatesResult.cs b/UpdateLib/UpdateLib/Core/CheckForUpdatesResult.cs new file mode 100644 index 0000000..61fad9b --- /dev/null +++ b/UpdateLib/UpdateLib/Core/CheckForUpdatesResult.cs @@ -0,0 +1,12 @@ +using MatthiWare.UpdateLib.Common; + +namespace MatthiWare.UpdateLib.Core +{ + public class CheckForUpdatesResult + { + public UpdateVersion Version { get { return UpdateInfo.Version; } } + public bool UpdateAvailable => UpdateInfo != null; + public UpdateInfo UpdateInfo { get; internal set; } + public bool AdminRightsNeeded { get; internal set; } + } +} \ No newline at end of file diff --git a/UpdateLib/UpdateLib/Common/Delegates.cs b/UpdateLib/UpdateLib/Core/Delegates.cs similarity index 100% rename from UpdateLib/UpdateLib/Common/Delegates.cs rename to UpdateLib/UpdateLib/Core/Delegates.cs diff --git a/UpdateLib/UpdateLib/Common/DirectoryEntry.cs b/UpdateLib/UpdateLib/Core/DirectoryEntry.cs similarity index 100% rename from UpdateLib/UpdateLib/Common/DirectoryEntry.cs rename to UpdateLib/UpdateLib/Core/DirectoryEntry.cs diff --git a/UpdateLib/UpdateLib/Core/Enums.cs b/UpdateLib/UpdateLib/Core/Enums.cs new file mode 100644 index 0000000..0402427 --- /dev/null +++ b/UpdateLib/UpdateLib/Core/Enums.cs @@ -0,0 +1,47 @@ +namespace MatthiWare.UpdateLib.Common +{ + /// + /// Indicates the how the underlaying application is installed. + /// + public enum InstallationMode + { + /// + /// Shared installation we will use the roaming folder + /// + Shared = 0, + + /// + /// Single user installation we will use the local folder + /// + Local = 1 + } + + public enum ParamValueType + { + None, + Optional, + Required + } + + public enum ParamMandatoryType + { + Optional, + Required + } + + public enum VersionLabel : byte + { + Alpha = 0, + Beta = 1, + RC = 2, + None = 3 + } + + internal enum InstructionType : byte + { + NoOp = 0, + Add = 1, + Run = 2, + Copy = 3 + } +} diff --git a/UpdateLib/UpdateLib/Common/Exceptions/InvalidHashException.cs b/UpdateLib/UpdateLib/Core/Exceptions/InvalidHashException.cs similarity index 100% rename from UpdateLib/UpdateLib/Common/Exceptions/InvalidHashException.cs rename to UpdateLib/UpdateLib/Core/Exceptions/InvalidHashException.cs diff --git a/UpdateLib/UpdateLib/Common/Exceptions/InvalidUpdateServerException.cs b/UpdateLib/UpdateLib/Core/Exceptions/InvalidUpdateServerException.cs similarity index 100% rename from UpdateLib/UpdateLib/Common/Exceptions/InvalidUpdateServerException.cs rename to UpdateLib/UpdateLib/Core/Exceptions/InvalidUpdateServerException.cs diff --git a/UpdateLib/UpdateLib/Common/Exceptions/NoInternetException.cs b/UpdateLib/UpdateLib/Core/Exceptions/NoInternetException.cs similarity index 100% rename from UpdateLib/UpdateLib/Common/Exceptions/NoInternetException.cs rename to UpdateLib/UpdateLib/Core/Exceptions/NoInternetException.cs diff --git a/UpdateLib/UpdateLib/Common/Exceptions/UnableToDownloadUpdateException.cs b/UpdateLib/UpdateLib/Core/Exceptions/UnableToDownloadUpdateException.cs similarity index 100% rename from UpdateLib/UpdateLib/Common/Exceptions/UnableToDownloadUpdateException.cs rename to UpdateLib/UpdateLib/Core/Exceptions/UnableToDownloadUpdateException.cs diff --git a/UpdateLib/UpdateLib/Common/FileEntry.cs b/UpdateLib/UpdateLib/Core/FileEntry.cs similarity index 100% rename from UpdateLib/UpdateLib/Common/FileEntry.cs rename to UpdateLib/UpdateLib/Core/FileEntry.cs diff --git a/UpdateLib/UpdateLib/Common/FileManager.cs b/UpdateLib/UpdateLib/Core/FileManager.cs similarity index 100% rename from UpdateLib/UpdateLib/Common/FileManager.cs rename to UpdateLib/UpdateLib/Core/FileManager.cs diff --git a/UpdateLib/UpdateLib/Common/HashCacheEntry.cs b/UpdateLib/UpdateLib/Core/HashCacheEntry.cs similarity index 100% rename from UpdateLib/UpdateLib/Common/HashCacheEntry.cs rename to UpdateLib/UpdateLib/Core/HashCacheEntry.cs diff --git a/UpdateLib/UpdateLib/Core/Internal/CommandLine/StringToIntArgumentResolver.cs b/UpdateLib/UpdateLib/Core/Internal/CommandLine/StringToIntArgumentResolver.cs new file mode 100644 index 0000000..46ba9bd --- /dev/null +++ b/UpdateLib/UpdateLib/Core/Internal/CommandLine/StringToIntArgumentResolver.cs @@ -0,0 +1,21 @@ +using MatthiWare.UpdateLib.Abstractions; + +namespace MatthiWare.UpdateLib.Core.Internal.CommandLine +{ + public class StringToIntArgumentResolver : ICommandLineArgumentResolver + { + private int value; + + public bool CanResolve(ref string[] data, ref int index) + { + return int.TryParse(data[index], out value); + } + + + public int Resolve(ref string[] data, ref int index) + => value; + + object ICommandLineArgumentResolver.Resolve(ref string[] data, ref int index) + => Resolve(ref data, ref index); + } +} diff --git a/UpdateLib/UpdateLib/Core/Internal/CommandLine/StringToMultipleIntsArgumentResolver.cs b/UpdateLib/UpdateLib/Core/Internal/CommandLine/StringToMultipleIntsArgumentResolver.cs new file mode 100644 index 0000000..4935009 --- /dev/null +++ b/UpdateLib/UpdateLib/Core/Internal/CommandLine/StringToMultipleIntsArgumentResolver.cs @@ -0,0 +1,29 @@ +using System.Collections.Generic; +using System.Linq; +using MatthiWare.UpdateLib.Abstractions; + +namespace MatthiWare.UpdateLib.Core.Internal.CommandLine +{ + public class StringToMultipleIntsArgumentResolver : ICommandLineArgumentResolver + { + private IList ints = new List(); + + public bool CanResolve(ref string[] data, ref int index) + { + while (index < data.Length && int.TryParse(data[index], out int outValue)) + { + ints.Add(outValue); + index++; + } + + return ints.Count >= 2; // at least 2 elements + } + + + public int[] Resolve(ref string[] data, ref int index) + => ints.ToArray(); + + object ICommandLineArgumentResolver.Resolve(ref string[] data, ref int index) + => Resolve(ref data, ref index); + } +} diff --git a/UpdateLib/UpdateLib/Core/Internal/CommandLine/StringToStringArgumentResolver.cs b/UpdateLib/UpdateLib/Core/Internal/CommandLine/StringToStringArgumentResolver.cs new file mode 100644 index 0000000..0e012cc --- /dev/null +++ b/UpdateLib/UpdateLib/Core/Internal/CommandLine/StringToStringArgumentResolver.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Text; +using MatthiWare.UpdateLib.Abstractions; +using Microsoft.Extensions.Options; + +namespace MatthiWare.UpdateLib.Core.Internal.CommandLine +{ + public class StringToStringArgumentResolver : ICommandLineArgumentResolver + { + private readonly UpdateLibOptions options; + + public StringToStringArgumentResolver(IOptions options) + { + this.options = options.Value; + } + + public bool CanResolve(ref string[] data, ref int index) + => !data[index].StartsWith(options.ParameterPrefix); // if it is not a parameter + + + public string Resolve(ref string[] data, ref int index) + => data[index]; + + object ICommandLineArgumentResolver.Resolve(ref string[] data, ref int index) + => Resolve(ref data, ref index); + } +} diff --git a/UpdateLib/UpdateLib/Core/Internal/CommandLine/StringToUpdateVersionArgumentResolver.cs b/UpdateLib/UpdateLib/Core/Internal/CommandLine/StringToUpdateVersionArgumentResolver.cs new file mode 100644 index 0000000..3a88f43 --- /dev/null +++ b/UpdateLib/UpdateLib/Core/Internal/CommandLine/StringToUpdateVersionArgumentResolver.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; +using MatthiWare.UpdateLib.Abstractions; +using MatthiWare.UpdateLib.Common; + +namespace MatthiWare.UpdateLib.Core.Internal.CommandLine +{ + internal class StringToUpdateVersionArgumentResolver : ICommandLineArgumentResolver + { + public bool CanResolve(ref string[] data, ref int index) + => UpdateVersion.CanParse(data[index]); + + public UpdateVersion Resolve(ref string[] data, ref int index) + => new UpdateVersion(data[index]); + + object ICommandLineArgumentResolver.Resolve(ref string[] data, ref int index) + => Resolve(ref data, ref index); + } +} diff --git a/UpdateLib/UpdateLib/Core/Internal/DefaultVersionResolver.cs b/UpdateLib/UpdateLib/Core/Internal/DefaultVersionResolver.cs new file mode 100644 index 0000000..36e16d0 --- /dev/null +++ b/UpdateLib/UpdateLib/Core/Internal/DefaultVersionResolver.cs @@ -0,0 +1,25 @@ +using System; +using System.Reflection; +using MatthiWare.UpdateLib.Abstractions; +using MatthiWare.UpdateLib.Common; + +namespace MatthiWare.UpdateLib.Core.Internal +{ + public sealed class DefaultVersionResolver : IValueResolver + { + private UpdateVersion m_versionCached; + + public UpdateVersion Resolve() => GetOrResolve(); + + private UpdateVersion GetOrResolve() + { + if (m_versionCached == null) + { + var attribute = Assembly.GetEntryAssembly().GetCustomAttribute(); + m_versionCached = attribute?.Version ?? throw new InvalidOperationException("Unable to resolve the application version from the assembly metadata. Consider using a custom resolver."); + } + + return m_versionCached; + } + } +} diff --git a/UpdateLib/UpdateLib/Core/Internal/UpdateLibOptionsSetup.cs b/UpdateLib/UpdateLib/Core/Internal/UpdateLibOptionsSetup.cs new file mode 100644 index 0000000..e0529e6 --- /dev/null +++ b/UpdateLib/UpdateLib/Core/Internal/UpdateLibOptionsSetup.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Microsoft.Extensions.Options; + +namespace MatthiWare.UpdateLib.Core.Internal +{ + public class UpdateLibOptionsSetup : IConfigureOptions + { + private const string m_argUpdateSilent = "silent"; + private const string m_argUpdate = "update"; + private const string m_argWait = "wait"; + private const string m_rollback = "rollback"; + private const string m_argumentPrefix = "--"; + + public void Configure(UpdateLibOptions options) + { + options.AllowUnsafeUrl = false; + options.ParameterPrefix = m_argumentPrefix; + options.RollbackArgumentName = m_rollback; + options.UpdateSilentArgumentName = m_argUpdateSilent; + options.WaitArgumentName = m_argWait; + options.UpdateArgumentName = m_argUpdate; + } + } +} diff --git a/UpdateLib/UpdateLib/Core/Internal/UpdateManager.cs b/UpdateLib/UpdateLib/Core/Internal/UpdateManager.cs new file mode 100644 index 0000000..3a3091a --- /dev/null +++ b/UpdateLib/UpdateLib/Core/Internal/UpdateManager.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using MatthiWare.UpdateLib.Abstractions; +using MatthiWare.UpdateLib.Abstractions.Internal; +using MatthiWare.UpdateLib.Common; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; + +namespace MatthiWare.UpdateLib.Core.Internal +{ + internal class UpdateManager : IUpdateManager + { + private readonly IValueResolver versionResolver; + private readonly UpdateLibOptions options; + private readonly ILogger logger; + + public UpdateManager(IValueResolver versionResolver, IOptions options, ILogger logger) + { + this.versionResolver = versionResolver; + this.options = options.Value; + this.logger = logger; + } + + public Task CheckForUpdatesAsync(CancellationToken cancellation) + { + throw new NotImplementedException(); + } + + public Task UpdateAsync(CancellationToken cancellation) + { + throw new NotImplementedException(); + } + } +} diff --git a/UpdateLib/UpdateLib/Core/ParameterDefinition.cs b/UpdateLib/UpdateLib/Core/ParameterDefinition.cs new file mode 100644 index 0000000..2f9e4aa --- /dev/null +++ b/UpdateLib/UpdateLib/Core/ParameterDefinition.cs @@ -0,0 +1,51 @@ +using MatthiWare.UpdateLib.Abstractions; + +namespace MatthiWare.UpdateLib.Common +{ + public class ParameterDefinition : IParameterDefinition + { + public string Name { get; private set; } + public ParamMandatoryType MandatoryType { get; private set; } + + public ParamValueType ValueType { get; private set; } + + private ICommandLineArgumentResolver m_valueResolver; + + public T Value { get; set; } + + public int Count { get; set; } + + public bool IsFound => Count > 0; + + object IParameterDefinition.Value => Value; + + internal ParameterDefinition(string paramName, ParamMandatoryType mandatoryType, ParamValueType valueType) + { + Name = paramName; + MandatoryType = mandatoryType; + ValueType = valueType; + } + + internal ParameterDefinition(string paramName, ParamMandatoryType mandatoryType, ParamValueType valueType, ICommandLineArgumentResolver valueResolver) + { + Name = paramName; + MandatoryType = mandatoryType; + ValueType = valueType; + m_valueResolver = valueResolver; + } + + public void Resolve(ref string[] args, ref int index) + { + Value = m_valueResolver.Resolve(ref args, ref index); + Count++; + } + + public bool CanResolve(ref string[] args, ref int index) => m_valueResolver.CanResolve(ref args, ref index); + + public void Reset() + { + Value = default; + Count = 0; + } + } +} diff --git a/UpdateLib/UpdateLib/Common/PathVariableConverter.cs b/UpdateLib/UpdateLib/Core/PathVariableConverter.cs similarity index 100% rename from UpdateLib/UpdateLib/Common/PathVariableConverter.cs rename to UpdateLib/UpdateLib/Core/PathVariableConverter.cs diff --git a/UpdateLib/UpdateLib/Common/UpdateInfo.cs b/UpdateLib/UpdateLib/Core/UpdateInfo.cs similarity index 99% rename from UpdateLib/UpdateLib/Common/UpdateInfo.cs rename to UpdateLib/UpdateLib/Core/UpdateInfo.cs index b159a91..3395dda 100644 --- a/UpdateLib/UpdateLib/Common/UpdateInfo.cs +++ b/UpdateLib/UpdateLib/Core/UpdateInfo.cs @@ -30,7 +30,6 @@ namespace MatthiWare.UpdateLib.Common /// /// An entry for the /// - [Serializable] public class UpdateInfo : IComparable, IComparable { /// @@ -67,7 +66,6 @@ public class UpdateInfo : IComparable, IComparable /// /// Indicates if this update is a patch. /// - [XmlIgnore] public bool IsPatch => BasedOnVersion != null; public UpdateInfo() { } diff --git a/UpdateLib/UpdateLib/Core/UpdateLibOptions.cs b/UpdateLib/UpdateLib/Core/UpdateLibOptions.cs new file mode 100644 index 0000000..c658393 --- /dev/null +++ b/UpdateLib/UpdateLib/Core/UpdateLibOptions.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace MatthiWare.UpdateLib.Core +{ + public sealed class UpdateLibOptions + { + public string UpdateSilentArgumentName { get; set; } + public string UpdateArgumentName { get; set; } + public string WaitArgumentName { get; set; } + public string RollbackArgumentName { get; set; } + public string UpdateUrl { get; set; } + public string ParameterPrefix { get; set; } + public bool AllowUnsafeUrl { get; set; } + } +} diff --git a/UpdateLib/UpdateLib/Core/UpdateLibServiceBuilder.cs b/UpdateLib/UpdateLib/Core/UpdateLibServiceBuilder.cs new file mode 100644 index 0000000..272d090 --- /dev/null +++ b/UpdateLib/UpdateLib/Core/UpdateLibServiceBuilder.cs @@ -0,0 +1,10 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace MatthiWare.UpdateLib.Core +{ + class UpdateLibServiceBuilder + { + } +} diff --git a/UpdateLib/UpdateLib/Common/UpdateVersion.cs b/UpdateLib/UpdateLib/Core/UpdateVersion.cs similarity index 95% rename from UpdateLib/UpdateLib/Common/UpdateVersion.cs rename to UpdateLib/UpdateLib/Core/UpdateVersion.cs index 6bd3008..904f2f3 100644 --- a/UpdateLib/UpdateLib/Common/UpdateVersion.cs +++ b/UpdateLib/UpdateLib/Core/UpdateVersion.cs @@ -18,6 +18,7 @@ using System; using System.ComponentModel; using System.Diagnostics; +using System.Text.RegularExpressions; using System.Xml; using System.Xml.Serialization; @@ -28,8 +29,7 @@ namespace MatthiWare.UpdateLib.Common /// Support for version label's and serializable. /// Partially based on Semantic Versioning /// - [Serializable] - [DebuggerDisplay("[UpdateVersion {Value}]")] + [DebuggerDisplay("{Value}")] public class UpdateVersion : IComparable, IComparable, IEquatable { private int m_major, m_minor, m_patch; @@ -42,26 +42,20 @@ public class UpdateVersion : IComparable, IComparable, IEquatable private const string RC_STRING = "-rc"; private static readonly char[] CharSplitDot = new char[] { '.' }; private static readonly char[] CharSplitDash = new char[] { '-' }; + private static readonly Regex m_regex = new Regex(@"([v]?[0-9]+){1}(\.[0-9]+){0,2}([-](alpha|beta|rc))?"); #endregion #region Properties - [XmlIgnore] public int Major => m_major; - [XmlIgnore] public int Minor => m_minor; - [XmlIgnore] public int Patch => m_patch; - [XmlIgnore] public VersionLabel Label => m_label; - [XmlText] - [XmlElement(typeof(string))] - [EditorBrowsable(EditorBrowsableState.Never), Browsable(false)] public string Value { get { return ToString(); } @@ -230,14 +224,20 @@ private static bool TryParseVersionLabelString(string input, out VersionLabel la } } + public static bool CanParse(string input) + => m_regex.IsMatch(input); + /// /// Tries to parse the to a /// - /// Input string should be of format "major.minor.patch(-label)". The (-label) is optional + /// Input string should be of format "(v)major.minor.patch(-label)". The (v) and (-label) are optional /// The output parameter /// True if succesfully parsed, false if failed public static bool TryParse(string input, out UpdateVersion version) { + if (input.StartsWith("v")) + input = input.Substring(1, input.Length - 2); + var tokens = input.Split(CharSplitDot); version = new UpdateVersion(); diff --git a/UpdateLib/UpdateLib/UpdateBuilder.cs b/UpdateLib/UpdateLib/UpdateBuilder.cs new file mode 100644 index 0000000..1ad6a38 --- /dev/null +++ b/UpdateLib/UpdateLib/UpdateBuilder.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using System.Text; +using MatthiWare.UpdateLib.Abstractions; +using MatthiWare.UpdateLib.Abstractions.Internal; +using MatthiWare.UpdateLib.Common; +using MatthiWare.UpdateLib.Core; +using MatthiWare.UpdateLib.Core.Internal; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Options; + +namespace MatthiWare.UpdateLib +{ + public class UpdateBuilder + { + private IServiceCollection services; + private string remoteUrl; + + private UpdateBuilder() + { + services = new ServiceCollection(); + } + + public static UpdateBuilder CreateDefaultUpdateBuilder() + { + return new UpdateBuilder(); + } + + public IUpdater Build() + { + Validate(); + + RegisterDefaultServices(); + + var svcProvider = services.BuildServiceProvider(); + + return svcProvider.GetRequiredService(); + } + + private void Validate() + { + if (string.IsNullOrEmpty(remoteUrl)) + throw new ArgumentNullException("Specify the remote url"); + + } + + private void RegisterDefaultServices() + { + services.AddTransient, DefaultVersionResolver>(); + services.AddTransient(); + services.AddTransient, UpdateLibOptionsSetup>(); + services.AddSingleton(); + } + } +} diff --git a/UpdateLib/UpdateLib/UpdateLib.csproj b/UpdateLib/UpdateLib/UpdateLib.csproj index c744ef1..1b8360f 100644 --- a/UpdateLib/UpdateLib/UpdateLib.csproj +++ b/UpdateLib/UpdateLib/UpdateLib.csproj @@ -3,6 +3,7 @@ netstandard2.0 MatthiWare.UpdateLib false + 7.1 @@ -11,5 +12,9 @@ + + + + \ No newline at end of file diff --git a/UpdateLib/UpdateLib/Updater.cs b/UpdateLib/UpdateLib/Updater.cs index 68880f6..2501333 100644 --- a/UpdateLib/UpdateLib/Updater.cs +++ b/UpdateLib/UpdateLib/Updater.cs @@ -27,274 +27,169 @@ using System.Diagnostics; using System.Linq; using System.Reflection; - +using System.Threading; +using System.Threading.Tasks; +using MatthiWare.UpdateLib.Abstractions; +using MatthiWare.UpdateLib.Abstractions.Internal; using MatthiWare.UpdateLib.Common; +using MatthiWare.UpdateLib.Core; using MatthiWare.UpdateLib.Utils; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; namespace MatthiWare.UpdateLib { - public sealed class Updater + public sealed class Updater : IUpdater { - #region Singleton - private static volatile Updater instance = null; - private static readonly object synclock = new object(); - - /// - /// Gets a thread safe instance of - /// - public static Updater Instance - { - get - { - if (instance == null) - lock (synclock) - if (instance == null) - instance = new Updater(); - - return instance; - } - } - #endregion - #region Fields - private const string m_strUpdateLib = "UpdateLib"; - private const string m_argUpdateSilent = "silent"; - private const string m_argUpdate = "update"; - private const string m_argWait = "wait"; - private const string m_rollback = "rollback"; - private InstallationMode m_installationMode = InstallationMode.Shared; - - - #endregion - - #region Properties - - /// - /// Gets the command line parser. Use this to add additional command line arguments that need to be parsed. - /// - public CmdLineParser CommandLine { get; } = new CmdLineParser(); - - /// - /// Gets the collection of Url's to update from - /// - /// If you want to specify an unsafe connection you should enable - public IList UpdateURLs { get; } = new List(); - - - /// - /// Gets or sets the Updater Installation mode - /// - public InstallationMode InstallationMode - { - get { return m_installationMode; } - set - { - if (m_installationMode != value) - { - m_installationMode = value; - //IOUtils.ReinitializeAppData(); - } - } - } + private readonly ILogger logger; + private readonly UpdateLibOptions options; + private readonly ICommandLineParser cmd; + private readonly IUpdateManager updateManager; + private bool m_initialized = false; /// /// Gets or sets if we want to check for updates before the actual program is loaded. /// - public bool StartUpdating { get; private set; } = false; - - /// - /// Gets or sets if we want to update silently (no UI interaction). - /// - public bool UpdateSilently { get; private set; } = false; + private bool m_startUpdating = false; /// /// Indicates if we want to wait for the given process to wait - /// See and - /// If this property has been set to true it will wait for the to exit before continuing when has been called. - /// - public bool WaitForProcessExit { get; private set; } - - public bool Rollback { get; private set; } - - - /// - /// Gets or sets if the updater allows unsafe connection - /// `True` to allow HTTP connections, `False` to only allow HTTPS connections - /// - public bool AllowUnsafeConnection { get; set; } = false; - - /// - /// Is the updater already initialized? + /// If this property has been set to true it will wait for the to exit before continuing when has been called. /// - public bool IsInitialized { get; private set; } + private bool m_waitForProcessExit = false; - /// - /// Gets or sets if the updater needs to launch as a new instance. - /// True if you want cold-swapping, False if you want hot-swapping - /// - /// Hot-swapping might cause issues if the files are still in use. - public bool NeedsRestartBeforeUpdate { get; set; } = true; + private bool m_rollback = false; #endregion - #region Fluent API - /// - /// Configures if unsafe connections are allowed + /// Initializes a new instance of with the default settings. /// - /// Do not enable this unless you know what you are doing - /// Allowed? - /// - public Updater ConfigureAllowUnsafeConnections(bool allow) + public Updater(ILogger logger, IOptions options, ICommandLineParser commandLineParser, IUpdateManager updateManager) { - AllowUnsafeConnection = allow; - - return this; + this.logger = logger; + this.options = options.Value; + cmd = commandLineParser; + this.updateManager = updateManager; + + //CommandLine.AddParameter(m_argUpdateSilent); + //CommandLine.AddParameter(m_argUpdate); + //CommandLine.AddParameter(m_argWait, ParamMandatoryType.Optional, ParamValueType.Int); + //CommandLine.AddParameter(m_rollback); } - /// - /// Configures the command line parser - /// - /// Action to perform on the command line parser - /// - public Updater ConfigureCommandLineParser(Action action) - { - action(CommandLine); - - return this; - } + public static UpdateBuilder GetBuilder() + => UpdateBuilder.CreateDefaultUpdateBuilder(); /// - /// Configures if the updater needs a restart before updating + /// Initializes the updater /// - /// Disabling this feature will allow for hot-swapping of the files. - /// Restart updater in new instance - /// - public Updater ConfigureNeedsRestartBeforeUpdate(bool needsRestartBeforeUpdate) + public async Task InitializeAsync(CancellationToken cancellation = default) { - NeedsRestartBeforeUpdate = needsRestartBeforeUpdate; + //StartInitializationTasks(); - return this; - } + // parse the command line + cmd.Parse(); - /// - /// Configures the time till the cache becomes invalid - /// - /// Specify the validity time - /// - [Obsolete("No longer used")] - public Updater ConfigureCacheInvalidation(TimeSpan timeTillInvalidation) - { - //CacheInvalidationTime = timeTillInvalidation; + // Set cmd line flags + m_waitForProcessExit = cmd.Get(options.WaitArgumentName)?.IsFound ?? false; + m_startUpdating = cmd.Get(options.UpdateArgumentName)?.IsFound ?? false; + m_rollback = cmd.Get(options.RollbackArgumentName)?.IsFound ?? false; - return this; - } + if (m_waitForProcessExit) await WaitForProcessToExitAsync(cmd.Get(options.WaitArgumentName).Value, cancellation); - /// - /// Configures the installation mode for the client - /// - /// The - /// - public Updater ConfigureInstallationMode(InstallationMode mode) - { - InstallationMode = mode; + m_initialized = true; - return this; + if (m_startUpdating) await CheckForUpdatesAsync(cancellation); } - /// - /// Configures the update url - /// - /// To use HTTP you should enable - /// Uri to update from - /// - public Updater ConfigureAddUpdateUri(string uri) + public async Task CheckForUpdatesAsync(CancellationToken cancellation = default) { - UpdateURLs.Add(uri); + var childCts = CancellationTokenSource.CreateLinkedTokenSource(cancellation); - return this; - } + if (!m_initialized) throw new InvalidOperationException("The updater needs to be initialized first"); + if (string.IsNullOrEmpty(options.UpdateUrl)) throw new ArgumentException("No update url specified", nameof(UpdateLibOptions)); - #endregion + var checkForUpdatesTask = updateManager.CheckForUpdatesAsync(childCts.Token); + var result = await checkForUpdatesTask; - /// - /// Initializes a new instance of with the default settings. - /// - private Updater() - { - CommandLine.AddParameter(m_argUpdateSilent); - CommandLine.AddParameter(m_argUpdate); - CommandLine.AddParameter(m_argWait, ParamMandatoryType.Optional, ParamValueType.Int); - CommandLine.AddParameter(m_rollback); - } + if (checkForUpdatesTask.IsCanceled || checkForUpdatesTask.IsFaulted || !result.UpdateAvailable) + { + // TODO: what to do here? Let the caller handle it? + return result; + } - /// - /// Initializes the updater - /// - public void Initialize() - { - //StartInitializationTasks(); + // update available yay!! + // TODO: let the caller decide if we want to update with some middleware? + Func allowedToUpdate = new Func(() => true); - // parse the command line - CommandLine.Parse(); + if (!allowedToUpdate()) + { + // TODO: Is this a good way? + childCts.Cancel(); + } - // Set cmd line flags - WaitForProcessExit = CommandLine[m_argWait]?.IsFound ?? false; - StartUpdating = CommandLine[m_argUpdate]?.IsFound ?? false; - UpdateSilently = CommandLine[m_argUpdateSilent]?.IsFound ?? false; - Rollback = CommandLine[m_rollback]?.IsFound ?? false; + bool elevated = false; - if (WaitForProcessExit) WaitForProcessToExit((int)CommandLine[m_argWait].Value); + // we are allowed to update + if (((!m_startUpdating || (result.AdminRightsNeeded && !elevated))) && !RestartApp(true, true, result.AdminRightsNeeded)) + return result; - IsInitialized = true; + await updateManager.UpdateAsync(childCts.Token); - //if (StartUpdating) CheckForUpdates(); + return result; } /// /// Waits for a process to exit on the current thread /// /// Process ID - private void WaitForProcessToExit(int pid) + private Task WaitForProcessToExitAsync(int pid, CancellationToken cancellation) { - var process = Process.GetProcesses().FirstOrDefault(p => p.Id == pid); + logger.LogInformation($"Waiting for pid {pid} to exit"); - process?.CloseMainWindow(); - process?.WaitForExit(); - } + var tcs = new TaskCompletionSource(); - /// - /// Updates without user interaction - /// - /// The update specifications file - private void UpdateWithoutGUI(UpdateInfo updateInfo, IList urls) - { - //var downloadManager = new DownloadManager(updateInfo, urls); + cancellation.Register(() => + { + tcs.SetCanceled(); + }); + + using (var process = Process.GetProcesses().FirstOrDefault(p => p.Id == pid)) + { + if (process.HasExited) tcs.SetResult(process.ExitCode); - //downloadManager.Completed += (o, e) => - //{ - // GetCache2().Save(); - // RestartApp(); - //}; + process.EnableRaisingEvents = true; - //downloadManager.Download(); + process.Exited += (sender, args) => + { + tcs.SetResult(process.ExitCode); + }; + + process?.CloseMainWindow(); + process?.WaitForExit(1); + } + + return tcs.Task; } - internal bool RestartApp(bool update = false, bool silent = false, bool waitForPid = true, bool asAdmin = false) + + internal bool RestartApp(bool update = false, bool waitForPid = true, bool asAdmin = false) { - //Logger.Debug(nameof(Updater), nameof(RestartApp), $"Restarting app: [update={update}; silent={silent}; waitForPid={waitForPid}; asAdmin={asAdmin}]"); + logger.LogDebug($"Restarting app: [update={update}; waitForPid={waitForPid}; asAdmin={asAdmin}]"); List args = new List(Environment.GetCommandLineArgs()); for (int i = 0; i < args.Count; i++) { - if ((!update && args[i] == CommandLine.ParameterPrefix + m_argUpdate) || (!silent && args[i] == CommandLine.ParameterPrefix + m_argUpdateSilent)) + if (!update && args[i] == options.ParameterPrefix + options.UpdateArgumentName) { args[i] = string.Empty; } - else if (args[i] == CommandLine.ParameterPrefix + m_argWait) + else if (args[i] == options.ParameterPrefix + options.WaitArgumentName) { args[i] = string.Empty; if (i + 1 < args.Count) @@ -302,17 +197,14 @@ internal bool RestartApp(bool update = false, bool silent = false, bool waitForP } } - if (waitForPid && !args.Contains(CommandLine.ParameterPrefix + m_argWait)) + if (waitForPid && !args.Contains(options.ParameterPrefix + options.WaitArgumentName)) { - args.Add(CommandLine.ParameterPrefix + m_argWait); + args.Add(options.ParameterPrefix + options.WaitArgumentName); args.Add(Process.GetCurrentProcess().Id.ToString()); } - if (update && !args.Contains(CommandLine.ParameterPrefix + m_argUpdate)) - args.Add(CommandLine.ParameterPrefix + m_argUpdate); - - if (silent && !args.Contains(CommandLine.ParameterPrefix + m_argUpdateSilent)) - args.Add(CommandLine.ParameterPrefix + m_argUpdateSilent); + if (update && !args.Contains(options.ParameterPrefix + options.UpdateArgumentName)) + args.Add(options.ParameterPrefix + options.UpdateArgumentName); string arguments = args.NotEmpty().Distinct().AppendAll(" "); @@ -331,7 +223,7 @@ internal bool RestartApp(bool update = false, bool silent = false, bool waitForP } catch (Exception e) { - //Logger.Error(nameof(Updater), nameof(RestartApp), e); + logger.LogError(e, $"Unable to restart the application"); //HandleException(owner, e); diff --git a/UpdateLib/UpdateLib/Utils/CmdLineParser.cs b/UpdateLib/UpdateLib/Utils/CmdLineParser.cs index 83546d0..d646b5b 100644 --- a/UpdateLib/UpdateLib/Utils/CmdLineParser.cs +++ b/UpdateLib/UpdateLib/Utils/CmdLineParser.cs @@ -17,39 +17,40 @@ using System; using System.Collections.Generic; using System.Linq; - +using MatthiWare.UpdateLib.Abstractions; using MatthiWare.UpdateLib.Common; namespace MatthiWare.UpdateLib.Utils { - public class CmdLineParser + public class CmdLineParser : ICommandLineParser { - private SortedDictionary m_params = new SortedDictionary(); + private SortedDictionary m_params = new SortedDictionary(); public string ParameterPrefix { get; set; } = "--"; - public void AddParameter(string paramName, ParamMandatoryType mandatoryType = ParamMandatoryType.Optional, ParamValueType valueType = ParamValueType.None) + public void AddParameter(string paramName, ParamMandatoryType mandatoryType = ParamMandatoryType.Optional, ParamValueType valueType = ParamValueType.None) + => AddParameter(paramName, mandatoryType, valueType, default); + + public void AddParameter(string paramName, ParamMandatoryType mandatoryType, ParamValueType valueType, ICommandLineArgumentResolver resolver) { if (string.IsNullOrEmpty(paramName)) throw new ArgumentNullException(nameof(paramName)); if (paramName.Contains(' ')) throw new ArgumentException("Parameter cannot contain spaces", nameof(paramName)); if (m_params.ContainsKey(paramName)) throw new ArgumentException("Key already exists", nameof(paramName)); - var param = new ParameterDefinition(paramName, mandatoryType, valueType); + var param = new ParameterDefinition(paramName, mandatoryType, valueType, resolver); m_params.Add(paramName, param); } - public ParameterDefinition this[string paramName] - { - get - { - return m_params.ContainsKey(paramName) ? m_params[paramName] : null; - } - } + public IParameterDefinition Get(string paramName) + => m_params.ContainsKey(paramName) ? m_params[paramName] as IParameterDefinition : default; + + public IParameterDefinition Get(string paramName) + => m_params.ContainsKey(paramName) ? m_params[paramName] : default; public void Parse() => Parse(Environment.GetCommandLineArgs()); - public void Parse(string[] args) + private void Parse(string[] args) { if (string.IsNullOrEmpty(ParameterPrefix)) throw new ArgumentNullException(nameof(ParameterPrefix)); @@ -69,76 +70,67 @@ public void Parse(string[] args) if (def.ValueType == ParamValueType.None) continue; - FindParameterValue(def, args, ref i); + FindParameterValue(def, ref args, ref i); } CheckAllMandatoryParamsFound(); } - private void FindParameterValue(ParameterDefinition param, string[] args, ref int index) + private void FindParameterValue(IParameterDefinition param, ref string[] args, ref int index) { - string data = args[++index]; - bool succes = true; - - if (param.ValueType == ParamValueType.Int || param.ValueType == ParamValueType.OptionalInt) - { - succes = int.TryParse(data, out int value); - - if (succes) - param.Value = value; - } - else if (param.ValueType == ParamValueType.Bool || param.ValueType == ParamValueType.OptionalBool) - { - succes = bool.TryParse(data, out bool value); - - if (succes) - param.Value = value; - } - else if (param.ValueType == ParamValueType.String || param.ValueType == ParamValueType.OptionalString) - { - succes = !data.StartsWith(ParameterPrefix); - - if (succes) - param.Value = data; - } - else if (param.ValueType == ParamValueType.MultipleInts) - { - var values = new List(); - - while (index < args.Length && int.TryParse(args[index], out int outValue)) - { - values.Add(outValue); - index++; - } - - succes = values.Count >= 2; - - if (succes) - param.Value = values.ToArray(); - } + ++index; + bool succes = param.CanResolve(ref args, ref index); + + if (succes) + param.Resolve(ref args, ref index); + + //else if (param.ValueType == ParamValueType.Bool || param.ValueType == ParamValueType.OptionalBool) + //{ + // succes = bool.TryParse(data, out bool value); + + // if (succes) + // param.Value = value; + //} + //else if (param.ValueType == ParamValueType.String || param.ValueType == ParamValueType.OptionalString) + //{ + // succes = !data.StartsWith(ParameterPrefix); + + // if (succes) + // param.Value = data; + //} + //else if (param.ValueType == ParamValueType.MultipleInts) + //{ + // var values = new List(); + + // while (index < args.Length && int.TryParse(args[index], out int outValue)) + // { + // values.Add(outValue); + // index++; + // } + + // succes = values.Count >= 2; + + // if (succes) + // param.Value = values.ToArray(); + //} if (!succes) - { --index; - if (param.ValueType != ParamValueType.OptionalBool && - param.ValueType != ParamValueType.OptionalInt && - param.ValueType != ParamValueType.OptionalString) - param.Count = 0; - } - } private void CheckAllMandatoryParamsFound() { + IList exceptions = new List(); + m_params - .Where(kvp => kvp.Value.MandatoryType == ParamMandatoryType.Required) .Select(kvp => kvp.Value) - .ForEach(param => - { - if (!param.IsFound) - throw new KeyNotFoundException($"Mandatory parameter '{param.ParameterName}' is missing"); - }); + .Where(param => param.MandatoryType == ParamMandatoryType.Required && !param.IsFound) + .ForEach(param => exceptions.Add(new KeyNotFoundException($"Mandatory parameter '{param.Name}' is missing"))); + + if (exceptions.Any()) + throw new AggregateException("One or more mandatory parameters are missing", exceptions); + } } diff --git a/UpdateLib/UpdateLib/Utils/IOUtils.cs b/UpdateLib/UpdateLib/Utils/IOUtils.cs index 5c68602..d10cea0 100644 --- a/UpdateLib/UpdateLib/Utils/IOUtils.cs +++ b/UpdateLib/UpdateLib/Utils/IOUtils.cs @@ -56,14 +56,15 @@ internal static string GetRemoteBasePath(string url) private static string GetPathPrefix() { - switch (Updater.Instance.InstallationMode) - { - case InstallationMode.Local: - return Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); - case InstallationMode.Shared: - default: - return Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); - } + //switch (Updater.Instance.InstallationMode) + //{ + // case InstallationMode.Local: + // return Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); + // case InstallationMode.Shared: + // default: + // return Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); + //} + return ""; } internal static byte[] CheckedReadBytes(this Stream stream, int size) From ea09f0e61d7ca46d66f63f6b71d9bc1cca2c40ea Mon Sep 17 00:00:00 2001 From: Matthias Beerens Date: Mon, 20 Aug 2018 13:13:37 +0200 Subject: [PATCH 37/40] Setup some ideas in Generator project --- UpdateLib/UpdateLib.Generator/PatchBuilder.cs | 46 +++++++++++++++++++ UpdateLib/UpdateLib.Generator/Program.cs | 38 ++++++++++++--- .../Properties/launchSettings.json | 8 ++++ .../UpdateLib.Generator.csproj | 3 ++ .../UpdateLib.Tests/UpdateLib.Tests.csproj | 3 ++ .../UpdateLib/Compression/PatchBuilder.cs | 23 ---------- UpdateLib/UpdateLib/UpdateLib.csproj | 8 ++-- 7 files changed, 97 insertions(+), 32 deletions(-) create mode 100644 UpdateLib/UpdateLib.Generator/PatchBuilder.cs create mode 100644 UpdateLib/UpdateLib.Generator/Properties/launchSettings.json delete mode 100644 UpdateLib/UpdateLib/Compression/PatchBuilder.cs diff --git a/UpdateLib/UpdateLib.Generator/PatchBuilder.cs b/UpdateLib/UpdateLib.Generator/PatchBuilder.cs new file mode 100644 index 0000000..1de13df --- /dev/null +++ b/UpdateLib/UpdateLib.Generator/PatchBuilder.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading; +using System.Threading.Tasks; + +namespace MatthiWare.UpdateLib.Generator +{ + public class PatchBuilder + { + private readonly string previousVersionFolder, currentVersionFolder, tempFolder, outputFolder; + + public PatchBuilder(string prev, string curr, string output) + { + previousVersionFolder = prev; + currentVersionFolder = curr; + tempFolder = $@"{System.IO.Path.GetTempPath()}UpdateLib.Generator\{Guid.NewGuid().ToString()}\"; + outputFolder = output; + } + + public async Task CreatePatch(Action progress, CancellationToken cancellation = default) + { + progress(0); + + await Task.Delay(2000); + + progress(50); + + Console.WriteLine(previousVersionFolder); + await Task.Delay(200); + Console.WriteLine(currentVersionFolder); + await Task.Delay(200); + Console.WriteLine(tempFolder); + await Task.Delay(200); + Console.WriteLine(outputFolder); + + progress(75); + + await Task.Delay(1000); + + progress(100); + + return await Task.FromResult(0); + } + } +} diff --git a/UpdateLib/UpdateLib.Generator/Program.cs b/UpdateLib/UpdateLib.Generator/Program.cs index 5794640..f013d39 100644 --- a/UpdateLib/UpdateLib.Generator/Program.cs +++ b/UpdateLib/UpdateLib.Generator/Program.cs @@ -15,23 +15,49 @@ * along with this program. If not, see . */ +using McMaster.Extensions.CommandLineUtils; using System; +using System.ComponentModel.DataAnnotations; namespace MatthiWare.UpdateLib.Generator { - static class Program + class Program { /// /// The main entry point for the application. /// [STAThread] - static void Main() + static void Main(string[] args) { - //Updater.Instance.ConfigureLogger((logger) => logger.Writers.Add(new ConsoleLogWriter())); + CommandLineApplication.Execute(args); - //Application.EnableVisualStyles(); - //Application.SetCompatibleTextRenderingDefault(false); - //Application.Run(new MainForm()); +#if DEBUG + Console.ReadKey(); +#endif } + + [Required] + [DirectoryExists] + [Option("--from ", Description = "Required. 'Old' program directory")] + private string PreviousVersionDir { get; } + + [Required] + [DirectoryExists] + [Option("--to ", Description = "Required. 'new' program directory")] + private string CurrentVersionDirectory { get; } + + [Required] + [DirectoryExists] + [Option("--output ", Description = "Required. Delta output directory")] + private string OutputDirectory { get; } + + private async void OnExecuteAsync() + { + var patchBuilder = new PatchBuilder(PreviousVersionDir, CurrentVersionDirectory, OutputDirectory); + + await patchBuilder.CreatePatch((progress) => Console.WriteLine($"Progress: {progress}")); + } + + } } diff --git a/UpdateLib/UpdateLib.Generator/Properties/launchSettings.json b/UpdateLib/UpdateLib.Generator/Properties/launchSettings.json new file mode 100644 index 0000000..b585fc6 --- /dev/null +++ b/UpdateLib/UpdateLib.Generator/Properties/launchSettings.json @@ -0,0 +1,8 @@ +{ + "profiles": { + "UpdateLib.Generator": { + "commandName": "Project", + "commandLineArgs": "--from C:\\temp --to C:\\temp\\OUTPUT_TESTING --output C:\\temp\\Editor_CLI_2_XML_debug" + } + } +} \ No newline at end of file diff --git a/UpdateLib/UpdateLib.Generator/UpdateLib.Generator.csproj b/UpdateLib/UpdateLib.Generator/UpdateLib.Generator.csproj index 88d728d..ae5c30e 100644 --- a/UpdateLib/UpdateLib.Generator/UpdateLib.Generator.csproj +++ b/UpdateLib/UpdateLib.Generator/UpdateLib.Generator.csproj @@ -6,6 +6,9 @@ false 7.1 + + + diff --git a/UpdateLib/UpdateLib.Tests/UpdateLib.Tests.csproj b/UpdateLib/UpdateLib.Tests/UpdateLib.Tests.csproj index 40646d3..7eefc41 100644 --- a/UpdateLib/UpdateLib.Tests/UpdateLib.Tests.csproj +++ b/UpdateLib/UpdateLib.Tests/UpdateLib.Tests.csproj @@ -42,4 +42,7 @@ + + + \ No newline at end of file diff --git a/UpdateLib/UpdateLib/Compression/PatchBuilder.cs b/UpdateLib/UpdateLib/Compression/PatchBuilder.cs deleted file mode 100644 index 5e9936a..0000000 --- a/UpdateLib/UpdateLib/Compression/PatchBuilder.cs +++ /dev/null @@ -1,23 +0,0 @@ -using MatthiWare.UpdateLib.Common; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace MatthiWare.UpdateLib.Compression -{ - public class PatchBuilder - { - - public event ProgressChangedHandler ProgressChanged; - - public void Generate() - { - - } - - protected void OnProgressChanged(bool completed, double progress) - => ProgressChanged?.Invoke(completed, progress); - - } -} diff --git a/UpdateLib/UpdateLib/UpdateLib.csproj b/UpdateLib/UpdateLib/UpdateLib.csproj index 1b8360f..4ef8463 100644 --- a/UpdateLib/UpdateLib/UpdateLib.csproj +++ b/UpdateLib/UpdateLib/UpdateLib.csproj @@ -5,6 +5,11 @@ false 7.1 + + + + + @@ -14,7 +19,4 @@ - - - \ No newline at end of file From 3d2784e0fdf5714f895ffb80112c3c1ae3f9aa8f Mon Sep 17 00:00:00 2001 From: Matthias Beerens Date: Wed, 22 Aug 2018 13:23:07 +0200 Subject: [PATCH 38/40] Dummy logic on how the patching will work. --- .../Abstractions/IPatchBuilderTask.cs | 12 +++++++ .../UpdateLib.Generator/Core/DeltaTask.cs | 28 +++++++++++++++ UpdateLib/UpdateLib.Generator/PatchBuilder.cs | 34 +++++++++++-------- UpdateLib/UpdateLib/Utils/ExtensionMethods.cs | 25 ++++++++++++++ 4 files changed, 85 insertions(+), 14 deletions(-) create mode 100644 UpdateLib/UpdateLib.Generator/Abstractions/IPatchBuilderTask.cs create mode 100644 UpdateLib/UpdateLib.Generator/Core/DeltaTask.cs diff --git a/UpdateLib/UpdateLib.Generator/Abstractions/IPatchBuilderTask.cs b/UpdateLib/UpdateLib.Generator/Abstractions/IPatchBuilderTask.cs new file mode 100644 index 0000000..62eb8f8 --- /dev/null +++ b/UpdateLib/UpdateLib.Generator/Abstractions/IPatchBuilderTask.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading.Tasks; + +namespace MatthiWare.UpdateLib.Generator.Abstractions +{ + public interface IPatchBuilderTask + { + Task Execute(); + } +} diff --git a/UpdateLib/UpdateLib.Generator/Core/DeltaTask.cs b/UpdateLib/UpdateLib.Generator/Core/DeltaTask.cs new file mode 100644 index 0000000..a6438e6 --- /dev/null +++ b/UpdateLib/UpdateLib.Generator/Core/DeltaTask.cs @@ -0,0 +1,28 @@ +using MatthiWare.UpdateLib.Generator.Abstractions; +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading.Tasks; + +namespace MatthiWare.UpdateLib.Generator.Core +{ + public class DeltaTask : IPatchBuilderTask + { + private readonly string CurrentFilePath; + private readonly string OldFilepath; + private readonly PatchBuilder patchBuilder; + + public DeltaTask(PatchBuilder builder, string curr, string old) + { + patchBuilder = builder; + CurrentFilePath = curr; + OldFilepath = old; + } + + public async Task Execute() + { + await Task.Delay(50); + return Task.FromResult(0); + } + } +} diff --git a/UpdateLib/UpdateLib.Generator/PatchBuilder.cs b/UpdateLib/UpdateLib.Generator/PatchBuilder.cs index 1de13df..7c7d719 100644 --- a/UpdateLib/UpdateLib.Generator/PatchBuilder.cs +++ b/UpdateLib/UpdateLib.Generator/PatchBuilder.cs @@ -1,14 +1,20 @@ -using System; +using MatthiWare.UpdateLib.Generator.Abstractions; +using MatthiWare.UpdateLib.Generator.Core; +using System; using System.Collections.Generic; +using System.IO; using System.Text; using System.Threading; using System.Threading.Tasks; +using MatthiWare.UpdateLib.Utils; namespace MatthiWare.UpdateLib.Generator { public class PatchBuilder { private readonly string previousVersionFolder, currentVersionFolder, tempFolder, outputFolder; + private int currProgress, totalprogress; + private readonly IList tasks; public PatchBuilder(string prev, string curr, string output) { @@ -16,29 +22,29 @@ public PatchBuilder(string prev, string curr, string output) currentVersionFolder = curr; tempFolder = $@"{System.IO.Path.GetTempPath()}UpdateLib.Generator\{Guid.NewGuid().ToString()}\"; outputFolder = output; + tasks = new List(); } public async Task CreatePatch(Action progress, CancellationToken cancellation = default) { - progress(0); + DirectoryInfo dirCurrVersion = new DirectoryInfo(currentVersionFolder); - await Task.Delay(2000); + var files = dirCurrVersion.GetFiles("*", SearchOption.AllDirectories); - progress(50); + foreach (var fi in files) + tasks.Add(new DeltaTask(this, fi.FullName, fi.FullName)); - Console.WriteLine(previousVersionFolder); - await Task.Delay(200); - Console.WriteLine(currentVersionFolder); - await Task.Delay(200); - Console.WriteLine(tempFolder); - await Task.Delay(200); - Console.WriteLine(outputFolder); + totalprogress = tasks.Count; - progress(75); + Action reportTaskCompleted = new Action(() => + { + currProgress += 1; - await Task.Delay(1000); + progress(currProgress / totalprogress); + }); - progress(100); + await tasks.ForEachAsync(task => task.Execute().ContinueWith(x => reportTaskCompleted()), Environment.ProcessorCount, cancellation); + return await Task.FromResult(0); } diff --git a/UpdateLib/UpdateLib/Utils/ExtensionMethods.cs b/UpdateLib/UpdateLib/Utils/ExtensionMethods.cs index c29d625..e45ce92 100644 --- a/UpdateLib/UpdateLib/Utils/ExtensionMethods.cs +++ b/UpdateLib/UpdateLib/Utils/ExtensionMethods.cs @@ -21,6 +21,8 @@ using System.Diagnostics; using System.Linq; using System.Text; +using System.Threading; +using System.Threading.Tasks; namespace MatthiWare.UpdateLib.Utils { @@ -80,6 +82,29 @@ public static void ForEach(this IEnumerable collection, Action action) action(item); } + public static async Task ForEachAsync(this IEnumerable source, Func action, int maxDegreeOfParallelism, CancellationToken cancellation = default) + { + using (var semaphore = new SemaphoreSlim(maxDegreeOfParallelism, maxDegreeOfParallelism)) + { + var throttledTasks = new List(); + + foreach (var task in source) + { + await semaphore.WaitAsync(cancellation); + + throttledTasks.Add(Task.Run(async () => + { + await action(task); + + semaphore.Release(); + + })); + } + + await Task.WhenAll(throttledTasks.ToArray()); + } + } + [DebuggerStepThrough] public static IEnumerable NotNull(this IEnumerable collection) { From f6ad9fb477d14a375ace37422177e1883e6d94e3 Mon Sep 17 00:00:00 2001 From: Matthias Beerens Date: Fri, 31 Aug 2018 22:00:00 +0200 Subject: [PATCH 39/40] CommandLineParserTests fixed --- UpdateLib/UpdateLib.Generator/Program.cs | 23 +- .../UpdateLib.Tests/Files/UpdateFileTest.cs | 17 +- .../UpdateLib.Tests/Logging/LoggingTests.cs | 102 ------- .../UpdateLib.Tests/Tasks/AsyncTaskTest.cs | 211 -------------- .../UpdateLib.Tests/Tasks/CleanUpTaskTest.cs | 64 ----- .../Tasks/DownloadManagerTests.cs | 93 ------ .../UpdateLib.Tests/Tasks/DownloadTaskTest.cs | 60 ---- .../UI/WizardPageCollectionTest.cs | 268 ------------------ .../UpdateLib.Tests/UpdateLib.Tests.csproj | 31 +- UpdateLib/UpdateLib.Tests/UpdaterTest.cs | 32 +-- .../UpdateLib.Tests/Util/CmdLineParserTest.cs | 140 ++++----- .../Util/ExtensionMethodsTest.cs | 39 +-- UpdateLib/UpdateLib.Tests/Util/IOUtilsTest.cs | 16 +- UpdateLib/UpdateLib.Tests/Util/LazyTests.cs | 76 ----- .../Util/RegistryHelperTest.cs | 46 --- UpdateLib/UpdateLib.Tests/app.config | 11 - UpdateLib/UpdateLib/Utils/CmdLineParser.cs | 5 +- UpdateLib/UpdateLib/Utils/ExtensionMethods.cs | 35 --- UpdateLib/UpdateLib/Utils/IOUtils.cs | 14 +- 19 files changed, 132 insertions(+), 1151 deletions(-) delete mode 100644 UpdateLib/UpdateLib.Tests/Logging/LoggingTests.cs delete mode 100644 UpdateLib/UpdateLib.Tests/Tasks/AsyncTaskTest.cs delete mode 100644 UpdateLib/UpdateLib.Tests/Tasks/CleanUpTaskTest.cs delete mode 100644 UpdateLib/UpdateLib.Tests/Tasks/DownloadManagerTests.cs delete mode 100644 UpdateLib/UpdateLib.Tests/Tasks/DownloadTaskTest.cs delete mode 100644 UpdateLib/UpdateLib.Tests/UI/WizardPageCollectionTest.cs delete mode 100644 UpdateLib/UpdateLib.Tests/Util/LazyTests.cs delete mode 100644 UpdateLib/UpdateLib.Tests/Util/RegistryHelperTest.cs delete mode 100644 UpdateLib/UpdateLib.Tests/app.config diff --git a/UpdateLib/UpdateLib.Generator/Program.cs b/UpdateLib/UpdateLib.Generator/Program.cs index 5794640..2658010 100644 --- a/UpdateLib/UpdateLib.Generator/Program.cs +++ b/UpdateLib/UpdateLib.Generator/Program.cs @@ -16,6 +16,8 @@ */ using System; +using System.Collections.Generic; +using System.Linq; namespace MatthiWare.UpdateLib.Generator { @@ -27,11 +29,24 @@ static class Program [STAThread] static void Main() { - //Updater.Instance.ConfigureLogger((logger) => logger.Writers.Add(new ConsoleLogWriter())); + List Unavailability = new List +{ + new Stack1{ Key = "A", StartDate = new DateTime(2018,1,1), EndDate = new DateTime(2018,1,30) }, + new Stack1{ Key = "B", StartDate = new DateTime(2018,1,2), EndDate = new DateTime(2018,1,30)}, + new Stack1{ Key = "C", StartDate = new DateTime(2018,1,2), EndDate = new DateTime(2018,1,30)} +}; + + bool allUnique = Unavailability.Select(_ => new { _.StartDate, _.EndDate }).Distinct().Count() <= 1; - //Application.EnableVisualStyles(); - //Application.SetCompatibleTextRenderingDefault(false); - //Application.Run(new MainForm()); + Console.WriteLine(allUnique); + Console.ReadKey(); + } + + public class Stack1 + { + public string Key { get; set; } + public DateTime StartDate { get; set; } + public DateTime EndDate { get; set; } } } } diff --git a/UpdateLib/UpdateLib.Tests/Files/UpdateFileTest.cs b/UpdateLib/UpdateLib.Tests/Files/UpdateFileTest.cs index addf83a..3d47991 100644 --- a/UpdateLib/UpdateLib.Tests/Files/UpdateFileTest.cs +++ b/UpdateLib/UpdateLib.Tests/Files/UpdateFileTest.cs @@ -46,9 +46,9 @@ public void SaveAndLoadUpdateFileShouldBeTheSame() var updateFile = FileManager.LoadFile(temp_file); - //Assert.AreEqual(file.ApplicationName, updateFile.ApplicationName); - Assert.AreEqual(file.Version, updateFile.Version); - Assert.AreEqual(file.FileCount, updateFile.FileCount); + ////Assert.AreEqual(file.ApplicationName, updateFile.ApplicationName); + //Assert.AreEqual(file.Version, updateFile.Version); + //Assert.AreEqual(file.FileCount, updateFile.FileCount); } [Test] @@ -89,7 +89,7 @@ private UpdateMetadataFile MakeUpdateFile() { var file = new UpdateMetadataFile(); - var info = new UpdateMetadataFile { Version = "9.9.9" }; + var info = new UpdateMetadataFile { }; DirectoryEntry appSubFolder = new DirectoryEntry("AppSubFolder"); DirectoryEntry otherSubFolder = new DirectoryEntry("OtherSubFolder"); @@ -114,16 +114,7 @@ private UpdateMetadataFile MakeUpdateFile() info.Folders.Add(appSubFolder); info.Folders.Add(otherSubFolder); - DirectoryEntry regDir = new DirectoryEntry("HKEY_LOCAL_MACHINE"); - - EntryBase regEntry = new RegistryKeyEntry("test", Microsoft.Win32.RegistryValueKind.String, null); - - regDir.Add(regEntry); - - info.Registry.Add(regDir); - Assert.AreEqual(2, info.FileCount); - Assert.AreEqual(1, info.RegistryKeyCount); return file; } diff --git a/UpdateLib/UpdateLib.Tests/Logging/LoggingTests.cs b/UpdateLib/UpdateLib.Tests/Logging/LoggingTests.cs deleted file mode 100644 index aea5e4c..0000000 --- a/UpdateLib/UpdateLib.Tests/Logging/LoggingTests.cs +++ /dev/null @@ -1,102 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using MatthiWare.UpdateLib.Logging; -using NUnit.Framework; -using Moq; -using MatthiWare.UpdateLib.Common; - -namespace UpdateLib.Tests.Logging -{ - [TestFixture] - public class LoggingTests - { - private Logger logger; - - [SetUp] - public void Setup() - { - logger = new Logger(); - } - - [Test] - public void ErrorLogLevelShouldNotLogWhenDebugLog() - { - logger.LogLevel = LoggingLevel.Error; - Mock writer = SetUpWriter(LoggingLevel.Debug); - - logger.Writers.Add(writer.Object); - - logger.Debug(nameof(LoggingTests), nameof(ErrorLogLevelShouldNotLogWhenDebugLog), "This is my log msg"); - - writer.Verify(mock => mock.Log(It.IsAny()), Times.Never); - } - - [Test] - public void DebugLogLevelShouldLogErrorLog() - { - logger.LogLevel = LoggingLevel.Debug; - Mock writer = SetUpWriter(LoggingLevel.Error); - - logger.Writers.Add(writer.Object); - - logger.Error(nameof(LoggingTests), nameof(DebugLogLevelShouldLogErrorLog), "This is my log msg"); - - writer.Verify(mock => mock.Log(It.IsAny()), Times.Once); - } - - [Test] - public void ErrorLogLevelShouldNotLogAnyLowerLevel() - { - logger.LogLevel = LoggingLevel.Error; - - Mock info = SetUpWriter(LoggingLevel.Info); - - Mock warn = SetUpWriter(LoggingLevel.Warn); - - Mock debug = SetUpWriter(LoggingLevel.Debug); - - logger.Writers.Add(info.Object); - logger.Writers.Add(warn.Object); - logger.Writers.Add(debug.Object); - - logger.Error(string.Empty, string.Empty, string.Empty); - logger.Warn(string.Empty, string.Empty, string.Empty); - logger.Info(string.Empty, string.Empty, string.Empty); - logger.Debug(string.Empty, string.Empty, string.Empty); - - info.Verify(mock => mock.Log(It.IsAny()), Times.Never); - warn.Verify(mock => mock.Log(It.IsAny()), Times.Never); - debug.Verify(mock => mock.Log(It.IsAny()), Times.Never); - } - - private Mock SetUpWriter(LoggingLevel level) - { - Mock writer = new Mock(); - writer.SetupGet(w => w.LoggingLevel).Returns(level); - - return writer; - } - - [TearDown] - public void CleanUp() - { - logger.Writers.Clear(); - } - - } -} diff --git a/UpdateLib/UpdateLib.Tests/Tasks/AsyncTaskTest.cs b/UpdateLib/UpdateLib.Tests/Tasks/AsyncTaskTest.cs deleted file mode 100644 index f18f13b..0000000 --- a/UpdateLib/UpdateLib.Tests/Tasks/AsyncTaskTest.cs +++ /dev/null @@ -1,211 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.Runtime.Serialization; -using System.Threading; - -using MatthiWare.UpdateLib.Tasks; - -using NUnit.Framework; - -namespace UpdateLib.Tests.Tasks -{ - [TestFixture] - public class AsyncTaskTest - { - - [Test, Parallelizable] - public void CancelledTaskIsCancelled() - { - TestTask task = new TestTask(1000); - task.TaskCompleted += (o, e) => - { - Assert.True(e.Cancelled, "The task did not cancel!"); - }; - task.Start(); - task.Cancel(); - task.AwaitTask(); - - Assert.True(task.IsCancelled, "Task did not cancel"); - } - - [Test, Parallelizable] - public void FaultyTaskReturnsException() - { - ErrorTask task = new ErrorTask(); - //ManualResetEvent wait = new ManualResetEvent(false); - - task.TaskCompleted += (o, e) => - { - Assert.False(e.Cancelled, "The task got cancelled"); - Assert.NotNull(e.Error, "The error object is null"); - Assert.IsInstanceOf(e.Error, $"{e.Error} is not an instance of {nameof(AsyncTaskTestException)}"); - // wait.Set(); - }; - task.Start(); - task.AwaitTask(); - //wait.WaitOne(); - } - - [Test, Parallelizable] - public void TestMethod() - { - object o = new object(); - ResultTask task = new ResultTask(o); - task.Start(); - Assert.AreEqual(o, task.AwaitTask().Result); - } - - [Test, Parallelizable] - public void TestResultReturnsCorrectObject() - { - TestResultTask(false); - TestResultTask(19951); - TestResultTask(new object()); - } - - private void TestResultTask(T input) - { - ResultTask task = new ResultTask(input); - task.TaskCompleted += (o, e) => - { - Assert.False(e.Cancelled, "Task got cancelled"); - Assert.IsNull(e.Error, "There was an error"); - - Assert.AreEqual(input, task.Result); - }; - task.Start(); - - Assert.AreEqual(input, task.AwaitTask().Result); - } - - [Test, Parallelizable] - public void CheckDoubleWait() - { - TestTask task = new TestTask(100); - task.Start(); - task.AwaitTask(); - task.AwaitTask(); - } - - [Test, Parallelizable] - public void TestAwaitWorker() - { - WorkerTestTask task = new WorkerTestTask(); - task.TaskCompleted += (o, e) => - { - Assert.IsFalse(e.Cancelled, "The task got cancelled??"); - Assert.IsNull(e.Error, "there was an error"); - }; - task.Start(); - task.AwaitTask(); - } - - private class WorkerTestTask : AsyncTask - { - protected override void DoWork() - { - bool value = false; - - Action simulation = new Action(() => - { - Thread.Sleep(1000); - value = true; - }); - - Assert.IsFalse(value); - - Enqueue(simulation); - - AwaitWorkers(); - - Assert.IsTrue(value); - } - } - - private class TestTask : AsyncTask - { - public int Sleep { get; set; } - public TestTask(int sleep) - { - Sleep = sleep; - } - - protected override void DoWork() - { - Thread.Sleep(Sleep); - } - } - - private class ErrorTask : AsyncTask - { - protected override void DoWork() - { - Action a = new Action(() => { Thread.Sleep(1000); throw new AsyncTaskTestException(); }); - - Enqueue(a); - - //throw new InvalidOperationException(); - - AwaitWorkers(); - } - } - - private class ResultTask : AsyncTask> - { - private T returnObj; - - public ResultTask(T returnObj) - { - this.returnObj = returnObj; - } - - protected override void DoWork() - { - Action call = new Action((x) => - { - Thread.Sleep(x); - Result = returnObj; - }); - - Enqueue(call, 50); - } - } - - private class AsyncTaskTestException : Exception - { - public AsyncTaskTestException() : base("Test Exception") - { - } - - public AsyncTaskTestException(string message) : base(message) - { - } - - public AsyncTaskTestException(string message, Exception innerException) : base(message, innerException) - { - } - - protected AsyncTaskTestException(SerializationInfo info, StreamingContext context) : base(info, context) - { - } - } - } - - -} diff --git a/UpdateLib/UpdateLib.Tests/Tasks/CleanUpTaskTest.cs b/UpdateLib/UpdateLib.Tests/Tasks/CleanUpTaskTest.cs deleted file mode 100644 index 5cb0d5f..0000000 --- a/UpdateLib/UpdateLib.Tests/Tasks/CleanUpTaskTest.cs +++ /dev/null @@ -1,64 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using MatthiWare.UpdateLib.Tasks; -using NUnit.Framework; -using System; -using System.IO; - -namespace UpdateLib.Tests.Tasks -{ - [TestFixture] - public class CleanUpTaskTest - { - - private string m_folder, m_file; - - [SetUp] - public void Before() - { - m_folder = $"{Path.GetTempPath()}test_{Guid.NewGuid().ToString()}"; - m_file = $"{m_folder}\\test.old.tmp"; - - if (!Directory.Exists(m_folder)) - Directory.CreateDirectory(m_folder); - - if (!File.Exists(m_file)) - File.Open(m_file, FileMode.OpenOrCreate).Dispose(); - } - - [Test] - public void TestCleanUp() - { - Assert.IsTrue(File.Exists(m_file)); - - CleanUpTask task = new CleanUpTask(m_folder); - task.ConfigureAwait(false); - task.Start().AwaitTask(); - - Assert.IsFalse(File.Exists(m_file)); - } - - [TearDown] - public void CleanUp() - { - if (Directory.Exists(m_folder)) - Directory.Delete(m_folder); - } - - } -} diff --git a/UpdateLib/UpdateLib.Tests/Tasks/DownloadManagerTests.cs b/UpdateLib/UpdateLib.Tests/Tasks/DownloadManagerTests.cs deleted file mode 100644 index 82d0a22..0000000 --- a/UpdateLib/UpdateLib.Tests/Tasks/DownloadManagerTests.cs +++ /dev/null @@ -1,93 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.IO; -using System.Threading; - -using MatthiWare.UpdateLib; -using MatthiWare.UpdateLib.Common; -using MatthiWare.UpdateLib.Files; -using MatthiWare.UpdateLib.Security; -using MatthiWare.UpdateLib.Tasks; - -using NUnit.Framework; - -namespace UpdateLib.Tests.Tasks -{ - [TestFixture] - public class DownloadManagerTests - { - - private string m_path, m_file; - - [SetUp] - public void Before() - { - m_path = string.Concat(Path.GetTempPath(), Guid.NewGuid().ToString(), "\\updater"); - - m_file = string.Concat(m_path, "\\testfile.txt").Replace("//", "\\"); - - if (!Directory.Exists(m_path)) - Directory.CreateDirectory(m_path); - - using (StreamWriter sw = new StreamWriter(File.Open(m_file, FileMode.OpenOrCreate, FileAccess.Write))) - { - sw.Write("test"); - } - - Updater.Instance.ConfigurePathConverter(c => c["appdir"] = $@"{Path.GetTempPath()}dl_test"); - Updater.Instance.ConfigureAddUpdateUri(m_path + "\\update.xml"); - - Updater.Instance.Initialize(); - } - - [Test, Parallelizable] - public void TestDownloadManager() - { - MatthiWare.UpdateLib.Files.UpdateInfo info = new MatthiWare.UpdateLib.Files.UpdateInfo(); - - DirectoryEntry dir = new DirectoryEntry("%appdir%"); - FileEntry entry_file = new FileEntry("testfile.txt"); - - entry_file.Hash = HashUtil.GetHash(m_file); - dir.Add(entry_file); - - info.Folders.Add(dir); - - ManualResetEvent wait = new ManualResetEvent(false); - DownloadManager manager = new DownloadManager(info); - manager.Completed += (o, e) => wait.Set(); - manager.Download(); - - Assert.IsTrue(wait.WaitOne(TimeSpan.FromSeconds(60*5)), "The async download timed-out after 10 seconds"); - - string localFile = Updater.Instance.Converter.Convert("%appdir%/testfile.txt"); - Assert.IsTrue(File.Exists(localFile), "File didn't exist"); - - using (StreamReader sr = new StreamReader(File.Open(localFile, FileMode.Open, FileAccess.Read))) - { - var data = sr.ReadToEnd(); - - Assert.AreEqual("test", data); - } - - } - - - } -} diff --git a/UpdateLib/UpdateLib.Tests/Tasks/DownloadTaskTest.cs b/UpdateLib/UpdateLib.Tests/Tasks/DownloadTaskTest.cs deleted file mode 100644 index 789d778..0000000 --- a/UpdateLib/UpdateLib.Tests/Tasks/DownloadTaskTest.cs +++ /dev/null @@ -1,60 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using MatthiWare.UpdateLib; -using MatthiWare.UpdateLib.Common; -using System.IO; - -namespace UpdateLib.Tests.Tasks -{ - //[TestFixture] - public class DownloadTaskTest - { - - // [OneTimeSetUp] - public void Before() - { - var path = new DirectoryInfo(".").FullName; - - Updater.Instance - .ConfigureAddUpdateUri($@"file:///{path}") - .ConfigureInstallationMode(InstallationMode.Local) - .ConfigureAllowUnsafeConnections(true) - .Initialize(); - } - - // [Test] - public void TestDownload() - { - FileEntry fe = MakeFileEntry(); - - var s = fe.DestinationLocation; - } - - private FileEntry MakeFileEntry() - { - DirectoryEntry appDir = new DirectoryEntry("%appdir%"); - FileEntry file = new FileEntry("testFile"); - - - appDir.Add(file); - - return file; - } - - } -} diff --git a/UpdateLib/UpdateLib.Tests/UI/WizardPageCollectionTest.cs b/UpdateLib/UpdateLib.Tests/UI/WizardPageCollectionTest.cs deleted file mode 100644 index ae4c37f..0000000 --- a/UpdateLib/UpdateLib.Tests/UI/WizardPageCollectionTest.cs +++ /dev/null @@ -1,268 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using NUnit.Framework; -using MatthiWare.UpdateLib.UI; -using Moq; -using System.Windows.Forms; - -namespace UpdateLib.Tests.UI -{ - [TestFixture] - public class WizardPageCollectionTest - { - private WizardPageCollection wizard; - - [SetUp] - public void Before() - { - wizard = new WizardPageCollection(); - } - - [Test] - public void CorrectPageCount() - { - Mock page1 = new Mock(); - page1.SetupGet(p => p.IsBusy).Returns(false); - page1.SetupGet(p => p.IsDone).Returns(true); - page1.SetupGet(p => p.Conent).Returns(new UserControl()); - - Mock page2 = new Mock(); - page2.SetupGet(p => p.IsBusy).Returns(false); - page2.SetupGet(p => p.IsDone).Returns(true); - page2.SetupGet(p => p.Conent).Returns(new UserControl()); - - Mock page3 = new Mock(); - page3.SetupGet(p => p.IsBusy).Returns(false); - page3.SetupGet(p => p.IsDone).Returns(true); - page3.SetupGet(p => p.Conent).Returns(new UserControl()); - - wizard.Add(page1.Object); - wizard.Add(page2.Object); - wizard.Add(page3.Object); - - - Assert.AreEqual(3, wizard.Count); - } - - [Test] - public void CorrectFirstPageAndLastPage() - { - Mock page1 = new Mock(); - page1.SetupGet(p => p.IsBusy).Returns(false); - page1.SetupGet(p => p.IsDone).Returns(true); - page1.SetupGet(p => p.Conent).Returns(new UserControl()); - - Mock page2 = new Mock(); - page2.SetupGet(p => p.IsBusy).Returns(false); - page2.SetupGet(p => p.IsDone).Returns(true); - page2.SetupGet(p => p.Conent).Returns(new UserControl()); - - Mock page3 = new Mock(); - page3.SetupGet(p => p.IsBusy).Returns(false); - page3.SetupGet(p => p.IsDone).Returns(true); - page3.SetupGet(p => p.Conent).Returns(new UserControl()); - - wizard.Add(page1.Object); - wizard.Add(page2.Object); - wizard.Add(page3.Object); - - Assert.AreEqual(page1.Object, wizard.FirstPage); - Assert.AreEqual(page3.Object, wizard.LastPage); - } - - [Test] - public void AddNullPageShouldThrowArgumentNullException() - { - Assert.Throws(() => { wizard.Add(null); }); - } - - [Test] - public void ClearingTheWizardShouldReturnCountOfZero() - { - Mock page1 = new Mock(); - page1.SetupGet(p => p.IsBusy).Returns(false); - page1.SetupGet(p => p.IsDone).Returns(true); - page1.SetupGet(p => p.Conent).Returns(new UserControl()); - - Mock page2 = new Mock(); - page2.SetupGet(p => p.IsBusy).Returns(false); - page2.SetupGet(p => p.IsDone).Returns(true); - page2.SetupGet(p => p.Conent).Returns(new UserControl()); - - Mock page3 = new Mock(); - page3.SetupGet(p => p.IsBusy).Returns(false); - page3.SetupGet(p => p.IsDone).Returns(true); - page3.SetupGet(p => p.Conent).Returns(new UserControl()); - - wizard.Add(page1.Object); - wizard.Add(page2.Object); - wizard.Add(page3.Object); - - wizard.Clear(); - - Assert.AreEqual(0, wizard.Count); - } - - [Test] - public void NextShouldReturnTheCorrectPage() - { - Mock page1 = new Mock(); - page1.SetupGet(p => p.IsBusy).Returns(false); - page1.SetupGet(p => p.IsDone).Returns(true); - page1.SetupGet(p => p.Conent).Returns(new UserControl()); - - Mock page2 = new Mock(); - page2.SetupGet(p => p.IsBusy).Returns(false); - page2.SetupGet(p => p.IsDone).Returns(true); - page2.SetupGet(p => p.Conent).Returns(new UserControl()); - - Mock page3 = new Mock(); - page3.SetupGet(p => p.IsBusy).Returns(false); - page3.SetupGet(p => p.IsDone).Returns(true); - page3.SetupGet(p => p.Conent).Returns(new UserControl()); - - wizard.Add(page1.Object); - wizard.Add(page2.Object); - wizard.Add(page3.Object); - - Assert.AreEqual(wizard.FirstPage, wizard.CurrentPage); - - IWizardPage page = wizard.Next(); - - Assert.AreEqual(page2.Object, page); - - page = wizard.Next(); - - Assert.AreEqual(page3.Object, page); - Assert.AreEqual(wizard.LastPage, page); - - page = wizard.Next(); - - Assert.AreEqual(null, page); - - } - - [Test] - public void PreviousShouldReturnTheCorrectPage() - { - Mock page1 = new Mock(); - page1.SetupGet(p => p.IsBusy).Returns(false); - page1.SetupGet(p => p.IsDone).Returns(true); - page1.SetupGet(p => p.Conent).Returns(new UserControl()); - - Mock page2 = new Mock(); - page2.SetupGet(p => p.IsBusy).Returns(false); - page2.SetupGet(p => p.IsDone).Returns(true); - page2.SetupGet(p => p.Conent).Returns(new UserControl()); - - Mock page3 = new Mock(); - page3.SetupGet(p => p.IsBusy).Returns(false); - page3.SetupGet(p => p.IsDone).Returns(true); - page3.SetupGet(p => p.Conent).Returns(new UserControl()); - - wizard.Add(page1.Object); - wizard.Add(page2.Object); - wizard.Add(page3.Object); - - IWizardPage page = wizard.Next(); - page = wizard.Next(); - - Assert.AreEqual(page3.Object, page); - - page = wizard.Previous(); - Assert.AreEqual(page2.Object, page); - - page = wizard.Previous(); - Assert.AreEqual(page1.Object, page); - - page = wizard.Previous(); - Assert.AreEqual(null, page); - } - - [Test] - public void AllDoneShouldReturnTrueWhenAllPagesAreDone() - { - Mock page1 = new Mock(); - page1.SetupGet(p => p.IsDone).Returns(true); - page1.SetupGet(p => p.Conent).Returns(new UserControl()); - - Mock page2 = new Mock(); - page2.SetupGet(p => p.IsDone).Returns(true); - page2.SetupGet(p => p.Conent).Returns(new UserControl()); - - Mock page3 = new Mock(); - page3.SetupGet(p => p.IsDone).Returns(true); - page3.SetupGet(p => p.Conent).Returns(new UserControl()); - - wizard.Add(page1.Object); - wizard.Add(page2.Object); - wizard.Add(page3.Object); - - Assert.IsTrue(wizard.AllDone()); - } - - [Test] - public void AllDoneShouldReturnFalseWhenSomePagesAreNotDone() - { - Mock page1 = new Mock(); - page1.SetupGet(p => p.IsDone).Returns(true); - page1.SetupGet(p => p.Conent).Returns(new UserControl()); - - Mock page2 = new Mock(); - page2.SetupGet(p => p.IsDone).Returns(false); - page2.SetupGet(p => p.Conent).Returns(new UserControl()); - - Mock page3 = new Mock(); - page3.SetupGet(p => p.IsDone).Returns(true); - page3.SetupGet(p => p.Conent).Returns(new UserControl()); - - wizard.Add(page1.Object); - wizard.Add(page2.Object); - wizard.Add(page3.Object); - - Assert.IsFalse(wizard.AllDone()); - } - - - [Test] - public void CheckIfWizardContainsPage() - { - Mock page1 = new Mock(); - page1.SetupGet(p => p.Conent).Returns(new UserControl()); - - Mock page2 = new Mock(); - page2.SetupGet(p => p.Conent).Returns(new UserControl()); - - Mock page3 = new Mock(); - page3.SetupGet(p => p.Conent).Returns(new UserControl()); - - Mock pageNotAdded = new Mock(); - - wizard.Add(page1.Object); - wizard.Add(page2.Object); - wizard.Add(page3.Object); - - Assert.IsTrue(wizard.Contains(page1.Object)); - Assert.IsTrue(wizard.Contains(page2.Object)); - Assert.IsTrue(wizard.Contains(page3.Object)); - Assert.IsFalse(wizard.Contains(pageNotAdded.Object)); - } - - } -} diff --git a/UpdateLib/UpdateLib.Tests/UpdateLib.Tests.csproj b/UpdateLib/UpdateLib.Tests/UpdateLib.Tests.csproj index 40646d3..8b04251 100644 --- a/UpdateLib/UpdateLib.Tests/UpdateLib.Tests.csproj +++ b/UpdateLib/UpdateLib.Tests/UpdateLib.Tests.csproj @@ -3,14 +3,6 @@ netcoreapp2.1 false - - full - bin\$(Configuration)\ - - - pdbonly - bin\$(Configuration)\ - {C47B8CC3-ABAB-4F56-8CA2-1323F902D1C3} 7.1 @@ -19,27 +11,14 @@ - - - all - - - - - - - - - - + + + + + - - - - - \ No newline at end of file diff --git a/UpdateLib/UpdateLib.Tests/UpdaterTest.cs b/UpdateLib/UpdateLib.Tests/UpdaterTest.cs index f38b98f..ae5d383 100644 --- a/UpdateLib/UpdateLib.Tests/UpdaterTest.cs +++ b/UpdateLib/UpdateLib.Tests/UpdaterTest.cs @@ -16,7 +16,6 @@ */ using MatthiWare.UpdateLib; -using MatthiWare.UpdateLib.Tasks; using NUnit.Framework; using System; using System.Linq; @@ -29,40 +28,13 @@ public class UpdaterTest [Test] public void EnsureMultithreadedAccessWorks() { - int samples = 10; - - AsyncTask[] tasks = new AsyncTask[samples]; - Updater[] updaters = new Updater[samples]; - - Func getUpdaterAction = new Func(() => Updater.Instance); - - for (int i = 0; i < samples; i++) - tasks[i] = AsyncTaskFactory.StartNew(getUpdaterAction, null); - - AsyncTask.WaitAll(tasks); - - for (int i = 0; i < samples; i++) - updaters[i] = tasks[i].Result; - - int amountOfDistinctUpdaters = updaters.Distinct().Count(); - - Assert.AreEqual(1, amountOfDistinctUpdaters); + } [Test] public void TestInitializationActuallyInitializes() { - Updater u = Updater.Instance; - - u.InitializeAsync(); - - Assert.IsTrue(u.IsInitialized); - - AsyncTask task = u.CleanUpTask.AwaitTask(); - AsyncTask task2 = u.UpdateCacheTask.AwaitTask(); - - Assert.IsTrue(task.IsRunning || task.IsCompleted); - Assert.IsTrue(task2.IsRunning || task2.IsCompleted); + } } } diff --git a/UpdateLib/UpdateLib.Tests/Util/CmdLineParserTest.cs b/UpdateLib/UpdateLib.Tests/Util/CmdLineParserTest.cs index 5837a50..0b5b1d1 100644 --- a/UpdateLib/UpdateLib.Tests/Util/CmdLineParserTest.cs +++ b/UpdateLib/UpdateLib.Tests/Util/CmdLineParserTest.cs @@ -15,10 +15,14 @@ * along with this program. If not, see . */ +using System; using MatthiWare.UpdateLib.Common; +using MatthiWare.UpdateLib.Core; +using MatthiWare.UpdateLib.Core.Internal.CommandLine; using MatthiWare.UpdateLib.Utils; +using Microsoft.Extensions.Options; +using Moq; using NUnit.Framework; -using System; namespace UpdateLib.Tests.Util { @@ -37,6 +41,12 @@ public void Setup() [Test] public void GoodArgsAreAllParsedCorrectly() { + var optionsFactory = new OptionsWrapper( + new UpdateLibOptions + { + ParameterPrefix = "--" + }); + string[] args = { @"C:\Dev\TestApp.exe", "--silent", @@ -54,109 +64,109 @@ public void GoodArgsAreAllParsedCorrectly() int[] ints = { 5, 10, 15, 20 }; - cmd.AddParameter("silent", ParamMandatoryType.Required, ParamValueType.None); - cmd.AddParameter("wait", ParamMandatoryType.Required, ParamValueType.Int); - cmd.AddParameter("update", ParamMandatoryType.Required, ParamValueType.None); - cmd.AddParameter("text", ParamMandatoryType.Required, ParamValueType.String); - cmd.AddParameter("ints", ParamMandatoryType.Required, ParamValueType.MultipleInts); + cmd.AddParameter("silent", ParamMandatoryType.Required); + cmd.AddParameter("wait", ParamMandatoryType.Required, ParamValueType.Required, new StringToIntArgumentResolver()); + cmd.AddParameter("update", ParamMandatoryType.Required); + cmd.AddParameter("text", ParamMandatoryType.Required, ParamValueType.Required, new StringToStringArgumentResolver(optionsFactory)); + cmd.AddParameter("ints", ParamMandatoryType.Required, ParamValueType.Required, new StringToMultipleIntsArgumentResolver()); cmd.Parse(args); - Assert.IsTrue(cmd["silent"]?.IsFound); - Assert.IsTrue(cmd["wait"]?.IsFound); - Assert.AreEqual(9999, cmd["wait"]?.Value); - Assert.IsTrue(cmd["update"]?.IsFound); - Assert.IsTrue(cmd["text"]?.IsFound); - Assert.AreEqual("this is my text message", cmd["text"]?.Value); - Assert.IsTrue(cmd["ints"]?.IsFound); - Assert.AreEqual(ints, cmd["ints"]?.Value); + Assert.IsTrue(cmd.Get("silent")?.IsFound ?? false); + Assert.IsTrue(cmd.Get("wait")?.IsFound ?? false); + Assert.AreEqual(9999, cmd.Get("wait")?.Value ?? -1); + Assert.IsTrue(cmd.Get("update")?.IsFound ?? false); + Assert.IsTrue(cmd.Get("text")?.IsFound ?? false); + Assert.AreEqual("this is my text message", cmd.Get("text")?.Value); + Assert.IsTrue(cmd.Get("ints")?.IsFound ?? false); + Assert.AreEqual(ints, cmd.Get("ints")?.Value); } [Test] public void OptionalArgumentIsNotMandatory() { - string[] args = { - @"C:\Dev\TestApp.exe", - "--silent" - }; + //string[] args = { + // @"C:\Dev\TestApp.exe", + // "--silent" + //}; - int[] ints = { 5, 10, 15, 20 }; + //int[] ints = { 5, 10, 15, 20 }; - cmd.AddParameter("silent", ParamMandatoryType.Required, ParamValueType.None); - cmd.AddParameter("wait", ParamMandatoryType.Optional, ParamValueType.Int); + //cmd.AddParameter("silent", ParamMandatoryType.Required, ParamValueType.None); + //cmd.AddParameter("wait", ParamMandatoryType.Optional, ParamValueType.Int); - cmd.Parse(args); + //cmd.Parse(args); - Assert.IsTrue(cmd["silent"]?.IsFound); - Assert.IsFalse(cmd["wait"]?.IsFound); + //Assert.IsTrue(cmd["silent"]?.IsFound); + //Assert.IsFalse(cmd["wait"]?.IsFound); } [Test] public void TestOptionalParamValues() { - string[] args = { - @"C:\Dev\TestApp.exe", - "--test", - "random", - "--test2", - "10" - }; - - cmd.AddParameter("test", ParamMandatoryType.Required, ParamValueType.OptionalInt); - cmd.AddParameter("test2", ParamMandatoryType.Required, ParamValueType.OptionalInt); - - cmd.Parse(args); - - Assert.IsTrue(cmd["test"].IsFound); - Assert.IsTrue(cmd["test2"].IsFound); - Assert.AreEqual(null, cmd["test"].Value); - Assert.AreEqual(10, cmd["test2"].Value); + //string[] args = { + // @"C:\Dev\TestApp.exe", + // "--test", + // "random", + // "--test2", + // "10" + //}; + + //cmd.AddParameter("test", ParamMandatoryType.Required, ParamValueType.OptionalInt); + //cmd.AddParameter("test2", ParamMandatoryType.Required, ParamValueType.OptionalInt); + + //cmd.Parse(args); + + //Assert.IsTrue(cmd["test"].IsFound); + //Assert.IsTrue(cmd["test2"].IsFound); + //Assert.AreEqual(null, cmd["test"].Value); + //Assert.AreEqual(10, cmd["test2"].Value); } [Test] public void TestDoubleParse() { - string[] args = { - @"C:\Dev\TestApp.exe", - "--test1", - "10", - "--test2" - }; + //string[] args = { + // @"C:\Dev\TestApp.exe", + // "--test1", + // "10", + // "--test2" + //}; - cmd.AddParameter("test1", ParamMandatoryType.Required, ParamValueType.Int); - cmd.AddParameter("test2", ParamMandatoryType.Optional, ParamValueType.None); + //cmd.AddParameter("test1", ParamMandatoryType.Required, ParamValueType.Int); + //cmd.AddParameter("test2", ParamMandatoryType.Optional, ParamValueType.None); - cmd.Parse(args); + //cmd.Parse(args); - Assert.IsTrue(cmd["test1"].IsFound); - Assert.AreEqual(10, cmd["test1"].Value); - Assert.IsTrue(cmd["test2"].IsFound); + //Assert.IsTrue(cmd["test1"].IsFound); + //Assert.AreEqual(10, cmd["test1"].Value); + //Assert.IsTrue(cmd["test2"].IsFound); - args[2] = "11"; + //args[2] = "11"; - Array.Resize(ref args, 3); + //Array.Resize(ref args, 3); - cmd.Parse(args); + //cmd.Parse(args); - Assert.IsTrue(cmd["test1"].IsFound); - Assert.AreEqual(11, cmd["test1"].Value); - Assert.IsFalse(cmd["test2"].IsFound); + //Assert.IsTrue(cmd["test1"].IsFound); + //Assert.AreEqual(11, cmd["test1"].Value); + //Assert.IsFalse(cmd["test2"].IsFound); } [Test] public void AddingFaultyParameterThrowsException() { - cmd.ParameterPrefix = string.Empty; - Assert.Catch(() => cmd.AddParameter(null)); - Assert.Catch(() => cmd.AddParameter("test 123")); - Assert.Catch(() => cmd.Parse()); + //cmd.ParameterPrefix = string.Empty; + //Assert.Catch(() => cmd.AddParameter(null)); + //Assert.Catch(() => cmd.AddParameter("test 123")); + //Assert.Catch(() => cmd.Parse()); } [Test] public void AddDuplicateParameterThrowsException() { - cmd.AddParameter("silent", ParamMandatoryType.Required, ParamValueType.None); - Assert.Catch(() => cmd.AddParameter("silent", ParamMandatoryType.Required, ParamValueType.None)); + //cmd.AddParameter("silent", ParamMandatoryType.Required, ParamValueType.None); + //Assert.Catch(() => cmd.AddParameter("silent", ParamMandatoryType.Required, ParamValueType.None)); } [TearDown] diff --git a/UpdateLib/UpdateLib.Tests/Util/ExtensionMethodsTest.cs b/UpdateLib/UpdateLib.Tests/Util/ExtensionMethodsTest.cs index c3121e0..02ba698 100644 --- a/UpdateLib/UpdateLib.Tests/Util/ExtensionMethodsTest.cs +++ b/UpdateLib/UpdateLib.Tests/Util/ExtensionMethodsTest.cs @@ -64,21 +64,21 @@ public void TestMax() UpdateMetadataFile v6 = MakeUpdateFile("2.1.1-rc"); UpdateMetadataFile v7 = MakeUpdateFile("2.1.2"); - List versions = new List(new UpdateMetadataFile[] + var versions = new List(new UpdateMetadataFile[] { v1,v2,v3,v4,v5,v6,v7 }); - var max = versions.MaxOrDefault(u => u.Version); + //var max = versions.MaxOrDefault(u => u.Version); - Assert.AreEqual(v7, max); + //Assert.AreEqual(v7, max); } private UpdateMetadataFile MakeUpdateFile(UpdateVersion version) { return new UpdateMetadataFile() { - Version = version + //Version = version }; } @@ -113,37 +113,6 @@ public void TestNotNullMethod() Assert.AreEqual(3, objs.NotNull().Count()); } - [Test] - public void TestSkipLast0Items() - { - IEnumerable items = Enumerable.Range(1, 20).SkipLast(0); - Assert.AreEqual(20, items.Count()); - - Assert.AreEqual(20, items.Reverse().First()); - - - } - - [Test] - public void TestSkipLast1Items() - { - IEnumerable items = Enumerable.Range(1, 20).SkipLast(1); - Assert.AreEqual(19, items.Count()); - - Assert.AreEqual(19, items.Reverse().First()); - } - - [Test] - public void TestSkipLast2Items() - { - IEnumerable items = Enumerable.Range(1, 20).SkipLast(2); - Assert.AreEqual(18, items.Count()); - - Assert.AreEqual(18, items.Reverse().First()); - - Assert.AreEqual("1234567", Enumerable.Range(1, 10).SkipLast(3).AppendAll(string.Empty)); - } - [DebuggerDisplay("{Id}")] public class TestObject { diff --git a/UpdateLib/UpdateLib.Tests/Util/IOUtilsTest.cs b/UpdateLib/UpdateLib.Tests/Util/IOUtilsTest.cs index 6174607..0160504 100644 --- a/UpdateLib/UpdateLib.Tests/Util/IOUtilsTest.cs +++ b/UpdateLib/UpdateLib.Tests/Util/IOUtilsTest.cs @@ -15,11 +15,11 @@ * along with this program. If not, see . */ +using System; using MatthiWare.UpdateLib; using MatthiWare.UpdateLib.Common; using MatthiWare.UpdateLib.Utils; using NUnit.Framework; -using System; namespace UpdateLib.Tests.Util { @@ -32,27 +32,27 @@ public class IOUtilsTest [SetUp] public void Setup() { - instance = Updater.Instance; + //instance = Updater.Instance; } [Test] public void TestAppDataPathLocal() { - instance.ConfigureInstallationMode(InstallationMode.Local); + //instance.ConfigureInstallationMode(InstallationMode.Local); - string path = IOUtils.AppDataPath; + //string path = IOUtils.AppDataPath; - Assert.IsTrue(path.Contains("Local"), $"Path: '{path}' didn't contain 'Local'"); + //Assert.IsTrue(path.Contains("Local"), $"Path: '{path}' didn't contain 'Local'"); } [Test] public void TestAppDataPathRoaming() { - instance.ConfigureInstallationMode(InstallationMode.Shared); + //instance.ConfigureInstallationMode(InstallationMode.Shared); - string path = IOUtils.AppDataPath; + //string path = IOUtils.AppDataPath; - Assert.IsTrue(path.Contains("Roaming"), $"Path: '{path}' didn't contain 'Roaming'"); + //Assert.IsTrue(path.Contains("Roaming"), $"Path: '{path}' didn't contain 'Roaming'"); } [Test] diff --git a/UpdateLib/UpdateLib.Tests/Util/LazyTests.cs b/UpdateLib/UpdateLib.Tests/Util/LazyTests.cs deleted file mode 100644 index 8c26e0f..0000000 --- a/UpdateLib/UpdateLib.Tests/Util/LazyTests.cs +++ /dev/null @@ -1,76 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using MatthiWare.UpdateLib.Utils; - -using NUnit.Framework; - -namespace UpdateLib.Tests.Util -{ - [TestFixture] - public class LazyTests - { - - [Test] - public void TestLazyInitializesCorreclty() - { - var myObject = new Lazy(() => "test"); - - Assert.AreEqual("test", myObject); - } - - [Test] - public void TestLaszySet() - { - var myObj = new Lazy(() => "test"); - myObj.Value = "new"; - - Assert.AreEqual("new", myObj); - } - - [Test] - public void TestLazyReset() - { - SwitchObject switcher = new SwitchObject(); - - var myLazy = new Lazy(switcher.Get); - - Assert.AreEqual(switcher.Get(), myLazy); - - switcher.Toggle(); - - Assert.AreNotEqual(switcher.Get(), myLazy); - - myLazy.Reset(); - - Assert.AreEqual(switcher.Get(), myLazy); - } - - private class SwitchObject - { - private bool m_state = false; - - public void Toggle() - { - m_state = !m_state; - } - - public string Get() - => m_state ? "true" : "false"; - } - } -} diff --git a/UpdateLib/UpdateLib.Tests/Util/RegistryHelperTest.cs b/UpdateLib/UpdateLib.Tests/Util/RegistryHelperTest.cs deleted file mode 100644 index 932f468..0000000 --- a/UpdateLib/UpdateLib.Tests/Util/RegistryHelperTest.cs +++ /dev/null @@ -1,46 +0,0 @@ -/* UpdateLib - .Net auto update library - * Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using MatthiWare.UpdateLib.Common; -using MatthiWare.UpdateLib.Utils; -using NUnit.Framework; -using System; - -namespace UpdateLib.Tests.Util -{ - [TestFixture] - public class RegistryHelperTest - { - [Test] - public void TestNotExistingRootKey() - { - RegistryKeyEntry regKey = new RegistryKeyEntry("unexisting key", Microsoft.Win32.RegistryValueKind.Unknown, null); - regKey.Parent = new DirectoryEntry("not existing"); - - Assert.AreEqual(null, RegistryHelper.GetOrMakeKey(regKey)); - } - - [Test] - public void GetOrMakeKeyThrowsException() - { - RegistryKeyEntry key = null; - Assert.Throws(() => RegistryHelper.GetOrMakeKey(key)); - Assert.Throws(() => RegistryHelper.GetOrMakeKey(string.Empty)); - } - - } -} diff --git a/UpdateLib/UpdateLib.Tests/app.config b/UpdateLib/UpdateLib.Tests/app.config deleted file mode 100644 index 8ed398d..0000000 --- a/UpdateLib/UpdateLib.Tests/app.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/UpdateLib/UpdateLib/Utils/CmdLineParser.cs b/UpdateLib/UpdateLib/Utils/CmdLineParser.cs index d646b5b..e926bc2 100644 --- a/UpdateLib/UpdateLib/Utils/CmdLineParser.cs +++ b/UpdateLib/UpdateLib/Utils/CmdLineParser.cs @@ -49,8 +49,7 @@ public IParameterDefinition Get(string paramName) public void Parse() => Parse(Environment.GetCommandLineArgs()); - - private void Parse(string[] args) + public void Parse(string[] args) { if (string.IsNullOrEmpty(ParameterPrefix)) throw new ArgumentNullException(nameof(ParameterPrefix)); @@ -121,7 +120,7 @@ private void FindParameterValue(IParameterDefinition param, ref string[] args, r private void CheckAllMandatoryParamsFound() { - IList exceptions = new List(); + var exceptions = new List(); m_params .Select(kvp => kvp.Value) diff --git a/UpdateLib/UpdateLib/Utils/ExtensionMethods.cs b/UpdateLib/UpdateLib/Utils/ExtensionMethods.cs index c29d625..932a2b2 100644 --- a/UpdateLib/UpdateLib/Utils/ExtensionMethods.cs +++ b/UpdateLib/UpdateLib/Utils/ExtensionMethods.cs @@ -96,40 +96,5 @@ public static IEnumerable NotEmpty(this IEnumerable collection) if (!string.IsNullOrEmpty(item)) yield return item; } - - /// - /// Skips n amount of the last elements - /// - /// Any - /// The source collection - /// The count of last elements to skip - /// without the last elements. - [DebuggerStepThrough] - public static IEnumerable SkipLast(this IEnumerable source, int count) - { - if (count == 0) - { - foreach (T item in source) - yield return item; - - yield break; - } - - int i = 0; - var buffer = new Queue(count + 1); - - foreach (T item in source) - { - if (i == count) - { - yield return buffer.Dequeue(); - i--; - } - - buffer.Enqueue(item); - i++; - } - - } } } diff --git a/UpdateLib/UpdateLib/Utils/IOUtils.cs b/UpdateLib/UpdateLib/Utils/IOUtils.cs index d10cea0..35963e0 100644 --- a/UpdateLib/UpdateLib/Utils/IOUtils.cs +++ b/UpdateLib/UpdateLib/Utils/IOUtils.cs @@ -16,7 +16,9 @@ */ using System; +using System.Collections.Generic; using System.IO; +using System.Linq; using System.Text; using MatthiWare.UpdateLib.Common; @@ -45,7 +47,7 @@ internal static string GetRemoteBasePath(string url) StringBuilder builder = new StringBuilder(); - foreach (var s in url.Split(slash, backslash).SkipLast(1)) + foreach (var s in url.Split(slash, backslash)) { builder.Append(s); builder.Append(slash); @@ -54,6 +56,13 @@ internal static string GetRemoteBasePath(string url) return builder.ToString(); } + private class Stack1 + { + public string Key; + public DateTime StartDate; + public DateTime EndDate; + } + private static string GetPathPrefix() { //switch (Updater.Instance.InstallationMode) @@ -64,7 +73,10 @@ private static string GetPathPrefix() // default: // return Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); //} + return ""; + + } internal static byte[] CheckedReadBytes(this Stream stream, int size) From 33df019eff5406ad9e6fa138838b34b2f695bf7e Mon Sep 17 00:00:00 2001 From: Matthias Beerens Date: Sun, 2 Sep 2018 11:57:49 +0200 Subject: [PATCH 40/40] Changes to CommandLineParser --- .../UpdateLib.Tests/Util/CmdLineParserTest.cs | 147 +++++++------ UpdateLib/UpdateLib.Tests/Util/GuardTests.cs | 26 +++ .../Abstractions/ICommandLineParser.cs | 2 +- .../Abstractions/IParameterDefinition.cs | 3 +- UpdateLib/UpdateLib/Abstractions/IUpdater.cs | 5 +- .../UpdateLib/Compression/PatchBuilder.cs | 23 -- UpdateLib/UpdateLib/Compression/Patcher.cs | 37 ---- .../Compression/VCDiff/AddressCache.cs | 81 ------- .../UpdateLib/Compression/VCDiff/CodeTable.cs | 111 ---------- .../Compression/VCDiff/Instruction.cs | 36 ---- .../Compression/VCDiff/VCDiffDecoder.cs | 198 ------------------ .../VCDiff/VCDiffFormatException.cs | 35 ---- ...mentResolver.cs => IntArgumentResolver.cs} | 7 +- ...lver.cs => MultipleIntArgumentResolver.cs} | 2 +- ...tResolver.cs => StringArgumentResolver.cs} | 10 +- ...er.cs => UpdateVersionArgumentResolver.cs} | 2 +- .../Core/Internal/UpdateLibOptionsSetup.cs | 3 +- .../UpdateLib/Core/ParameterDefinition.cs | 49 +++-- UpdateLib/UpdateLib/Core/UpdateLibOptions.cs | 3 +- UpdateLib/UpdateLib/UpdateBuilder.cs | 55 ----- UpdateLib/UpdateLib/Updater.cs | 21 +- UpdateLib/UpdateLib/UpdaterBuilder.cs | 115 ++++++++++ UpdateLib/UpdateLib/Utils/CmdLineParser.cs | 56 ++--- UpdateLib/UpdateLib/Utils/Guard.cs | 20 ++ 24 files changed, 326 insertions(+), 721 deletions(-) create mode 100644 UpdateLib/UpdateLib.Tests/Util/GuardTests.cs delete mode 100644 UpdateLib/UpdateLib/Compression/PatchBuilder.cs delete mode 100644 UpdateLib/UpdateLib/Compression/Patcher.cs delete mode 100644 UpdateLib/UpdateLib/Compression/VCDiff/AddressCache.cs delete mode 100644 UpdateLib/UpdateLib/Compression/VCDiff/CodeTable.cs delete mode 100644 UpdateLib/UpdateLib/Compression/VCDiff/Instruction.cs delete mode 100644 UpdateLib/UpdateLib/Compression/VCDiff/VCDiffDecoder.cs delete mode 100644 UpdateLib/UpdateLib/Compression/VCDiff/VCDiffFormatException.cs rename UpdateLib/UpdateLib/Core/Internal/CommandLine/{StringToIntArgumentResolver.cs => IntArgumentResolver.cs} (72%) rename UpdateLib/UpdateLib/Core/Internal/CommandLine/{StringToMultipleIntsArgumentResolver.cs => MultipleIntArgumentResolver.cs} (89%) rename UpdateLib/UpdateLib/Core/Internal/CommandLine/{StringToStringArgumentResolver.cs => StringArgumentResolver.cs} (63%) rename UpdateLib/UpdateLib/Core/Internal/CommandLine/{StringToUpdateVersionArgumentResolver.cs => UpdateVersionArgumentResolver.cs} (85%) delete mode 100644 UpdateLib/UpdateLib/UpdateBuilder.cs create mode 100644 UpdateLib/UpdateLib/UpdaterBuilder.cs create mode 100644 UpdateLib/UpdateLib/Utils/Guard.cs diff --git a/UpdateLib/UpdateLib.Tests/Util/CmdLineParserTest.cs b/UpdateLib/UpdateLib.Tests/Util/CmdLineParserTest.cs index 0b5b1d1..60ab3d5 100644 --- a/UpdateLib/UpdateLib.Tests/Util/CmdLineParserTest.cs +++ b/UpdateLib/UpdateLib.Tests/Util/CmdLineParserTest.cs @@ -29,24 +29,23 @@ namespace UpdateLib.Tests.Util [TestFixture] public class CmdLineParserTest { + OptionsWrapper optionsFactory = new OptionsWrapper( + new UpdateLibOptions + { + CommandLineArgumentPrefix = "--" + }); CmdLineParser cmd; [SetUp] public void Setup() { - cmd = new CmdLineParser(); + cmd = new CmdLineParser(optionsFactory); } [Test] public void GoodArgsAreAllParsedCorrectly() { - var optionsFactory = new OptionsWrapper( - new UpdateLibOptions - { - ParameterPrefix = "--" - }); - string[] args = { @"C:\Dev\TestApp.exe", "--silent", @@ -64,109 +63,125 @@ public void GoodArgsAreAllParsedCorrectly() int[] ints = { 5, 10, 15, 20 }; - cmd.AddParameter("silent", ParamMandatoryType.Required); - cmd.AddParameter("wait", ParamMandatoryType.Required, ParamValueType.Required, new StringToIntArgumentResolver()); - cmd.AddParameter("update", ParamMandatoryType.Required); - cmd.AddParameter("text", ParamMandatoryType.Required, ParamValueType.Required, new StringToStringArgumentResolver(optionsFactory)); - cmd.AddParameter("ints", ParamMandatoryType.Required, ParamValueType.Required, new StringToMultipleIntsArgumentResolver()); + cmd.AddParameter("silent", ParamMandatoryType.Required); + cmd.AddParameter("wait", ParamMandatoryType.Required, ParamValueType.Required, new IntArgumentResolver()); + cmd.AddParameter("update", ParamMandatoryType.Required); + cmd.AddParameter("text", ParamMandatoryType.Required, ParamValueType.Required, new StringArgumentResolver(optionsFactory)); + cmd.AddParameter("ints", ParamMandatoryType.Required, ParamValueType.Required, new MultipleIntArgumentResolver()); cmd.Parse(args); Assert.IsTrue(cmd.Get("silent")?.IsFound ?? false); Assert.IsTrue(cmd.Get("wait")?.IsFound ?? false); - Assert.AreEqual(9999, cmd.Get("wait")?.Value ?? -1); + Assert.AreEqual(9999, cmd.Get("wait")?.Value ?? -1); Assert.IsTrue(cmd.Get("update")?.IsFound ?? false); Assert.IsTrue(cmd.Get("text")?.IsFound ?? false); - Assert.AreEqual("this is my text message", cmd.Get("text")?.Value); + Assert.AreEqual("this is my text message", cmd.Get("text")?.Value); Assert.IsTrue(cmd.Get("ints")?.IsFound ?? false); - Assert.AreEqual(ints, cmd.Get("ints")?.Value); + Assert.AreEqual(ints, cmd.Get("ints")?.Value); } [Test] public void OptionalArgumentIsNotMandatory() { - //string[] args = { - // @"C:\Dev\TestApp.exe", - // "--silent" - //}; + string[] args = { + @"C:\Dev\TestApp.exe", + "--silent" + }; + + cmd.AddParameter("wait"); + + cmd.Parse(args); + + Assert.IsFalse(cmd.Get("wait").IsFound); + } + + [Test] + public void OptionalValueTypeTest() + { + string[] args = { + @"C:\Dev\TestApp.exe", + "--wait", + "--otherParam" + }; - //int[] ints = { 5, 10, 15, 20 }; + cmd.AddParameter("wait", ParamMandatoryType.Required, ParamValueType.Optional, new IntArgumentResolver()); + cmd.AddParameter("otherParam", ParamMandatoryType.Required, ParamValueType.Optional, new StringArgumentResolver(optionsFactory)); - //cmd.AddParameter("silent", ParamMandatoryType.Required, ParamValueType.None); - //cmd.AddParameter("wait", ParamMandatoryType.Optional, ParamValueType.Int); + cmd.Parse(args); - //cmd.Parse(args); + Assert.IsTrue(cmd.Get("wait").IsFound); + Assert.AreEqual(default(int), cmd.Get("wait").Value); - //Assert.IsTrue(cmd["silent"]?.IsFound); - //Assert.IsFalse(cmd["wait"]?.IsFound); + Assert.IsTrue(cmd.Get("otherParam").IsFound); + Assert.AreEqual(default(string), cmd.Get("otherParam").Value); } [Test] public void TestOptionalParamValues() { - //string[] args = { - // @"C:\Dev\TestApp.exe", - // "--test", - // "random", - // "--test2", - // "10" - //}; - - //cmd.AddParameter("test", ParamMandatoryType.Required, ParamValueType.OptionalInt); - //cmd.AddParameter("test2", ParamMandatoryType.Required, ParamValueType.OptionalInt); - - //cmd.Parse(args); - - //Assert.IsTrue(cmd["test"].IsFound); - //Assert.IsTrue(cmd["test2"].IsFound); - //Assert.AreEqual(null, cmd["test"].Value); - //Assert.AreEqual(10, cmd["test2"].Value); + string[] args = { + @"C:\Dev\TestApp.exe", + "--test", + "random", + "--test2", + "10" + }; + + cmd.AddParameter("test", ParamMandatoryType.Required, ParamValueType.Optional, new StringArgumentResolver(optionsFactory)); + cmd.AddParameter("test2", ParamMandatoryType.Required, ParamValueType.Optional, new IntArgumentResolver()); + + cmd.Parse(args); + + Assert.IsTrue(cmd.Get("test").IsFound); + Assert.IsTrue(cmd.Get("test2").IsFound); + Assert.AreEqual("random", cmd.Get("test").Value); + Assert.AreEqual(10, cmd.Get("test2").Value); } [Test] public void TestDoubleParse() { - //string[] args = { - // @"C:\Dev\TestApp.exe", - // "--test1", - // "10", - // "--test2" - //}; + string[] args = { + @"C:\Dev\TestApp.exe", + "--test1", + "10", + "--test2" + }; - //cmd.AddParameter("test1", ParamMandatoryType.Required, ParamValueType.Int); - //cmd.AddParameter("test2", ParamMandatoryType.Optional, ParamValueType.None); + cmd.AddParameter("test1", ParamMandatoryType.Required, ParamValueType.Required, new IntArgumentResolver()); + cmd.AddParameter("test2", ParamMandatoryType.Optional, ParamValueType.None); - //cmd.Parse(args); + cmd.Parse(args); - //Assert.IsTrue(cmd["test1"].IsFound); - //Assert.AreEqual(10, cmd["test1"].Value); - //Assert.IsTrue(cmd["test2"].IsFound); + Assert.IsTrue(cmd.Get("test1").IsFound); + Assert.AreEqual(10, cmd.Get("test1").Value); + Assert.IsTrue(cmd.Get("test2").IsFound); - //args[2] = "11"; + args[2] = "11"; - //Array.Resize(ref args, 3); + Array.Resize(ref args, 3); - //cmd.Parse(args); + cmd.Parse(args); - //Assert.IsTrue(cmd["test1"].IsFound); - //Assert.AreEqual(11, cmd["test1"].Value); - //Assert.IsFalse(cmd["test2"].IsFound); + Assert.IsTrue(cmd.Get("test1").IsFound); + Assert.AreEqual(11, cmd.Get("test1").Value); + Assert.IsFalse(cmd.Get("test2").IsFound); } [Test] public void AddingFaultyParameterThrowsException() { - //cmd.ParameterPrefix = string.Empty; - //Assert.Catch(() => cmd.AddParameter(null)); - //Assert.Catch(() => cmd.AddParameter("test 123")); - //Assert.Catch(() => cmd.Parse()); + Assert.Catch(() => cmd.AddParameter(null)); + Assert.Catch(() => cmd.AddParameter("")); + Assert.Catch(() => cmd.AddParameter("test 123")); } [Test] public void AddDuplicateParameterThrowsException() { - //cmd.AddParameter("silent", ParamMandatoryType.Required, ParamValueType.None); - //Assert.Catch(() => cmd.AddParameter("silent", ParamMandatoryType.Required, ParamValueType.None)); + cmd.AddParameter("silent", ParamMandatoryType.Required, ParamValueType.None); + Assert.Catch(() => cmd.AddParameter("silent", ParamMandatoryType.Required, ParamValueType.None)); } [TearDown] diff --git a/UpdateLib/UpdateLib.Tests/Util/GuardTests.cs b/UpdateLib/UpdateLib.Tests/Util/GuardTests.cs new file mode 100644 index 0000000..abb0d7b --- /dev/null +++ b/UpdateLib/UpdateLib.Tests/Util/GuardTests.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Text; +using MatthiWare.UpdateLib.Utils; +using NUnit.Framework; + +namespace UpdateLib.Tests.Util +{ + [TestFixture] + public class GuardTests + { + [Test] + public void TestNotNullThrowsExceptionWhenNull() + { + Assert.That(() => Guard.NotNull(null, "null"), Throws.TypeOf()); + } + + [Test] + public void TestNotNullOrEmptyThrowsExceptionWhenNullOrEmpty() + { + Assert.That(() => Guard.NotNullOrEmpty(null, "null"), Throws.TypeOf()); + Assert.That(() => Guard.NotNullOrEmpty("", "null"), Throws.TypeOf()); + } + + } +} diff --git a/UpdateLib/UpdateLib/Abstractions/ICommandLineParser.cs b/UpdateLib/UpdateLib/Abstractions/ICommandLineParser.cs index 15df04b..983a3b4 100644 --- a/UpdateLib/UpdateLib/Abstractions/ICommandLineParser.cs +++ b/UpdateLib/UpdateLib/Abstractions/ICommandLineParser.cs @@ -7,7 +7,7 @@ namespace MatthiWare.UpdateLib.Abstractions { public interface ICommandLineParser { - void AddParameter(string paramName, ParamMandatoryType mandatoryType = ParamMandatoryType.Optional, ParamValueType valueType = ParamValueType.None); + void AddParameter(string paramName, ParamMandatoryType mandatoryType = ParamMandatoryType.Optional, ParamValueType valueType = ParamValueType.None); void AddParameter(string paramName, ParamMandatoryType mandatoryType, ParamValueType valueType, ICommandLineArgumentResolver resolver); diff --git a/UpdateLib/UpdateLib/Abstractions/IParameterDefinition.cs b/UpdateLib/UpdateLib/Abstractions/IParameterDefinition.cs index 795c90e..b140611 100644 --- a/UpdateLib/UpdateLib/Abstractions/IParameterDefinition.cs +++ b/UpdateLib/UpdateLib/Abstractions/IParameterDefinition.cs @@ -10,7 +10,6 @@ public interface IParameterDefinition string Name { get; } ParamValueType ValueType { get; } ParamMandatoryType MandatoryType { get; } - dynamic Value { get; } int Count { get; set; } bool IsFound { get; } void Reset(); @@ -20,6 +19,6 @@ public interface IParameterDefinition public interface IParameterDefinition : IParameterDefinition { - new T Value { get; } + T Value { get; } } } diff --git a/UpdateLib/UpdateLib/Abstractions/IUpdater.cs b/UpdateLib/UpdateLib/Abstractions/IUpdater.cs index 3913ac7..9cdf2dd 100644 --- a/UpdateLib/UpdateLib/Abstractions/IUpdater.cs +++ b/UpdateLib/UpdateLib/Abstractions/IUpdater.cs @@ -1,10 +1,11 @@ -using System.Threading; +using System; +using System.Threading; using System.Threading.Tasks; using MatthiWare.UpdateLib.Core; namespace MatthiWare.UpdateLib.Abstractions { - public interface IUpdater + public interface IUpdater : IDisposable { Task InitializeAsync(CancellationToken cancellation = default); diff --git a/UpdateLib/UpdateLib/Compression/PatchBuilder.cs b/UpdateLib/UpdateLib/Compression/PatchBuilder.cs deleted file mode 100644 index 5e9936a..0000000 --- a/UpdateLib/UpdateLib/Compression/PatchBuilder.cs +++ /dev/null @@ -1,23 +0,0 @@ -using MatthiWare.UpdateLib.Common; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace MatthiWare.UpdateLib.Compression -{ - public class PatchBuilder - { - - public event ProgressChangedHandler ProgressChanged; - - public void Generate() - { - - } - - protected void OnProgressChanged(bool completed, double progress) - => ProgressChanged?.Invoke(completed, progress); - - } -} diff --git a/UpdateLib/UpdateLib/Compression/Patcher.cs b/UpdateLib/UpdateLib/Compression/Patcher.cs deleted file mode 100644 index b0dcec8..0000000 --- a/UpdateLib/UpdateLib/Compression/Patcher.cs +++ /dev/null @@ -1,37 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using MatthiWare.UpdateLib.Common; - -namespace MatthiWare.UpdateLib.Compression -{ - public class Patcher - { - public event ProgressChangedHandler ProgressChanged; - - public void Patch() - { - - } - - protected void OnProgressChanged(bool completed, double progress) - => ProgressChanged?.Invoke(completed, progress); - } -} diff --git a/UpdateLib/UpdateLib/Compression/VCDiff/AddressCache.cs b/UpdateLib/UpdateLib/Compression/VCDiff/AddressCache.cs deleted file mode 100644 index 8e4d05f..0000000 --- a/UpdateLib/UpdateLib/Compression/VCDiff/AddressCache.cs +++ /dev/null @@ -1,81 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.IO; -using MatthiWare.UpdateLib.Utils; - -namespace MatthiWare.UpdateLib.Compression.VCDiff -{ - internal class AddressCache - { - const byte SelfMode = 0; - const byte HereMode = 1; - - int m_nearSize, m_sameSize, m_nextNearSlot; - int[] m_near, m_same; - - Stream m_addressStream; - - internal AddressCache(int nearSize, int sameSize) - { - m_nearSize = nearSize; - m_sameSize = sameSize; - m_near = new int[nearSize]; - m_same = new int[sameSize * 256]; - } - - public void Reset(byte[] addresses) - { - m_nextNearSlot = 0; - Array.Clear(m_near, 0, m_near.Length); - Array.Clear(m_same, 0, m_same.Length); - - m_addressStream = new MemoryStream(addresses, false); - } - - internal int DecodeAddress(int here, byte mode) - { - int ret; - - if (mode == SelfMode) - ret = m_addressStream.ReadBigEndian7BitEncodedInt(); - else if (mode == HereMode) - ret = here - m_addressStream.ReadBigEndian7BitEncodedInt(); - else if (mode - 2 < m_nearSize) // near cache - ret = m_near[mode - 2] + m_addressStream.ReadBigEndian7BitEncodedInt(); - else // same cache - ret = m_same[((mode - (2 + m_nearSize)) * 256) + m_addressStream.CheckedReadByte()]; - - Update(ret); - - return ret; - } - - private void Update(int address) - { - if (m_nearSize > 0) - { - m_near[m_nextNearSlot] = address; - m_nextNearSlot = (m_nextNearSlot + 1) % m_nearSize; - } - - if (m_sameSize > 0) - m_same[address % (m_sameSize * 256)] = address; - } - - } -} diff --git a/UpdateLib/UpdateLib/Compression/VCDiff/CodeTable.cs b/UpdateLib/UpdateLib/Compression/VCDiff/CodeTable.cs deleted file mode 100644 index 5042faa..0000000 --- a/UpdateLib/UpdateLib/Compression/VCDiff/CodeTable.cs +++ /dev/null @@ -1,111 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using MatthiWare.UpdateLib.Common; -using System; - -namespace MatthiWare.UpdateLib.Compression.VCDiff -{ - internal class CodeTable - { - internal static CodeTable Default = BuildDefaultCodeTable(); - Instruction[,] m_instructions = new Instruction[256, 2]; - - internal CodeTable(Instruction[,] instructions) - { - if (instructions == null) - throw new ArgumentNullException(nameof(instructions)); - if (instructions.Rank != 2) - throw new ArgumentException("Array must have a rank of 2", nameof(instructions)); - if (instructions.GetLength(0) != 256) - throw new ArgumentException("Array must have a outer length of 256", nameof(instructions)); - if (instructions.GetLength(1) != 2) - throw new ArgumentException("Array must have a innter length of 2", nameof(instructions)); - - Array.Copy(instructions, 0, m_instructions, 0, 512); - } - - internal Instruction this[int x, int y] - { - get - { - return m_instructions[x, y]; - } - } - - private static CodeTable BuildDefaultCodeTable() - { - // default are NoOps with size and mode 0. - Instruction[,] instructions = new Instruction[256, 2]; - instructions[0, 0] = new Instruction(InstructionType.Run, 0, 0); - - for (byte i = 0; i < 18; i++) - instructions[i + 1, 0] = new Instruction(InstructionType.Add, i, 0); - - int index = 19; - - // instructions 19-162 - for (byte mode = 0; mode < 9; mode++) - { - instructions[index++, 0] = new Instruction(InstructionType.Copy, 0, mode); - for (byte size = 4; size < 19; size++) - instructions[index++, 0] = new Instruction(InstructionType.Copy, size, mode); - } - - // instructions 163-234 - for (byte mode = 0; mode < 6; mode++) - for (byte addSize = 1; addSize < 5; addSize++) - for (byte copySize = 4; copySize < 7; copySize++) - { - instructions[index, 0] = new Instruction(InstructionType.Add, addSize, 0); - instructions[index++, 0] = new Instruction(InstructionType.Copy, copySize, mode); - } - - // instructions 235-246 - for (byte mode = 6; mode < 9; mode++) - for (byte addSize = 1; addSize < 5; addSize++) - { - instructions[index, 0] = new Instruction(InstructionType.Add, addSize, 0); - instructions[index++, 1] = new Instruction(InstructionType.Copy, 4, mode); - } - - for (byte mode = 0; mode < 9; mode++) - { - instructions[index, 0] = new Instruction(InstructionType.Copy, 4, mode); - instructions[index++, 1] = new Instruction(InstructionType.Add, 1, 0); - } - - return new CodeTable(instructions); - } - - internal byte[] GetBytes() - { - byte[] ret = new byte[1536]; - - for (int i = 0; i < 256; i++) - { - ret[i] = (byte)m_instructions[i, 0].Type; - ret[i + 256] = (byte)m_instructions[i, 1].Type; - ret[i + 512] = m_instructions[i, 0].Size; - ret[i + 768] = m_instructions[i, 1].Size; - ret[i + 1024] = m_instructions[i, 0].Size; - ret[i + 1028] = m_instructions[i, 1].Size; - } - - return ret; - } - } -} diff --git a/UpdateLib/UpdateLib/Compression/VCDiff/Instruction.cs b/UpdateLib/UpdateLib/Compression/VCDiff/Instruction.cs deleted file mode 100644 index ac35e63..0000000 --- a/UpdateLib/UpdateLib/Compression/VCDiff/Instruction.cs +++ /dev/null @@ -1,36 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using MatthiWare.UpdateLib.Common; - -namespace MatthiWare.UpdateLib.Compression.VCDiff -{ - internal struct Instruction - { - public readonly InstructionType Type; - - public readonly byte Size; - - public readonly byte Mode; - - internal Instruction(InstructionType type, byte size, byte mode) - { - Type = type; - Size = size; - Mode = mode; - } - } -} diff --git a/UpdateLib/UpdateLib/Compression/VCDiff/VCDiffDecoder.cs b/UpdateLib/UpdateLib/Compression/VCDiff/VCDiffDecoder.cs deleted file mode 100644 index b8e32d8..0000000 --- a/UpdateLib/UpdateLib/Compression/VCDiff/VCDiffDecoder.cs +++ /dev/null @@ -1,198 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.IO; -using MatthiWare.UpdateLib.Utils; -using MatthiWare.UpdateLib.Common; - -namespace MatthiWare.UpdateLib.Compression.VCDiff -{ - public sealed class VCDiffDecoder - { - private Stream m_original, m_delta, m_output; - - private CodeTable m_codeTable = CodeTable.Default; - - private AddressCache m_cache = new AddressCache(4, 3); - - public event ProgressChangedHandler ProgressChanged; - - public VCDiffDecoder(Stream original, Stream delta, Stream output) - { - if (original == null) throw new ArgumentNullException(nameof(original)); - if (delta == null) throw new ArgumentNullException(nameof(delta)); - if (output == null) throw new ArgumentNullException(nameof(output)); - - if (!original.CanRead || !original.CanSeek) - throw new ArgumentException("Must be able to read and seek in stream", nameof(original)); - - if (!delta.CanRead) - throw new ArgumentException("Must be able to read in stream", nameof(delta)); - - if (!output.CanWrite || !output.CanSeek || !output.CanRead) - throw new ArgumentException("Must be able to read, seek and write in stream", nameof(output)); - - m_original = original; - m_delta = delta; - m_output = output; - } - - public void Decode() - { - ReadHeader(); - - while (DecodeWindow()) - OnProgressChanged(false, (m_delta.Position * 1.0) / m_delta.Length); - - OnProgressChanged(true, 1); - } - - private void OnProgressChanged(bool completed, double progress) - => ProgressChanged?.Invoke(completed, progress); - - private void ReadHeader() - { - byte[] header = m_delta.CheckedReadBytes(4); - - if (header[0] != 0xd6 || - header[1] != 0xc3 || - header[2] != 0xc4) - throw new VCDiffFormatException("Invalid header in delta stream"); - - if (header[3] != 0) - throw new VCDiffFormatException("Only VCDiff Version 0 is supported"); - - byte headerIndicator = m_delta.CheckedReadByte(); - - if ((headerIndicator & 1) != 0) - throw new VCDiffFormatException("Secondary compressors are not supported"); - - if ((headerIndicator & 0xf8) != 0) - throw new VCDiffFormatException("Invalid header indicator, bits 3-7 not all zero"); - } - - private bool DecodeWindow() - { - int windowIndicator = m_delta.ReadByte(); - - if (windowIndicator == -1) - return false; - - Stream sourceStream; - int sourceStreamPostReadSeek = -1; - windowIndicator &= 0xfb; - - switch (windowIndicator & 3) - { - case 0: - sourceStream = null; - break; - case 1: - sourceStream = m_original; - break; - case 2: - sourceStream = m_output; - sourceStreamPostReadSeek = (int)m_output.Position; - break; - default: - throw new VCDiffFormatException("Invalid window indicator"); - } - - - int sourceLength = m_delta.ReadBigEndian7BitEncodedInt(); - int sourcePosition = m_delta.ReadBigEndian7BitEncodedInt(); - - sourceStream.Position = sourcePosition; - byte[] sourceData = sourceStream.CheckedReadBytes(sourceLength); - if (sourceStreamPostReadSeek != -1) - sourceStream.Position = sourceStreamPostReadSeek; - - m_delta.ReadBigEndian7BitEncodedInt(); - - int targetLength = m_delta.ReadBigEndian7BitEncodedInt(); - byte[] targetData = new byte[targetLength]; - MemoryStream targetDataStream = new MemoryStream(targetData, true); - - if (m_delta.CheckedReadByte() != 0) - throw new VCDiffFormatException("Unable to handle compressed delta sections"); - - int addRunDataLength = m_delta.ReadBigEndian7BitEncodedInt(); - int instructionsLength = m_delta.ReadBigEndian7BitEncodedInt(); - int addressesLength = m_delta.ReadBigEndian7BitEncodedInt(); - - byte[] addRunData = m_delta.CheckedReadBytes(addRunDataLength); - byte[] instructions = m_delta.CheckedReadBytes(instructionsLength); - byte[] addresses = m_delta.CheckedReadBytes(addressesLength); - - int addRunDataIndex = 0; - MemoryStream instructionStream = new MemoryStream(instructions, false); - - m_cache.Reset(addresses); - - while (true) - { - int instructionIndex = instructionStream.ReadByte(); - if (instructionIndex == -1) - break; - - for (int i = 0; i < 2; i++) - { - Instruction instruction = m_codeTable[instructionIndex, i]; - int size = instruction.Size; - - if (size == 0 && instruction.Type != InstructionType.NoOp) - size = instructionStream.ReadBigEndian7BitEncodedInt(); - - switch (instruction.Type) - { - case InstructionType.NoOp: - break; - case InstructionType.Add: - targetDataStream.Write(addRunData, addRunDataIndex, size); - addRunDataIndex += size; - break; - case InstructionType.Copy: - int addr = m_cache.DecodeAddress((int)targetDataStream.Position + sourceLength, instruction.Mode); - if (addr < sourceData.Length) - targetDataStream.Write(sourceData, addr, size); - else - { - addr -= sourceLength; - if (addr + size < targetDataStream.Position) - targetDataStream.Write(targetData, addr, size); - else - for (int j = 0; j < size; j++) - targetDataStream.WriteByte(targetData[addr++]); - } - break; - case InstructionType.Run: - byte data = addRunData[addRunDataIndex++]; - for (int j = 0; j < size; j++) - targetDataStream.WriteByte(data); - break; - default: - throw new VCDiffFormatException("Invalid instruction type found"); - } - } - - m_output.Write(targetData, 0, targetLength); - } - - return true; - } - } -} diff --git a/UpdateLib/UpdateLib/Compression/VCDiff/VCDiffFormatException.cs b/UpdateLib/UpdateLib/Compression/VCDiff/VCDiffFormatException.cs deleted file mode 100644 index 02f9621..0000000 --- a/UpdateLib/UpdateLib/Compression/VCDiff/VCDiffFormatException.cs +++ /dev/null @@ -1,35 +0,0 @@ -/* Copyright (C) 2016 - MatthiWare (Matthias Beerens) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -using System; -using System.Runtime.Serialization; - -namespace MatthiWare.UpdateLib.Compression.VCDiff -{ - [Serializable] - public class VCDiffFormatException : Exception - { - public VCDiffFormatException() { } - - public VCDiffFormatException(string message) : base(message) { } - - public VCDiffFormatException(string message, Exception inner) : base(message, inner) { } - - protected VCDiffFormatException( - SerializationInfo info, - StreamingContext context) : base(info, context) { } - } -} diff --git a/UpdateLib/UpdateLib/Core/Internal/CommandLine/StringToIntArgumentResolver.cs b/UpdateLib/UpdateLib/Core/Internal/CommandLine/IntArgumentResolver.cs similarity index 72% rename from UpdateLib/UpdateLib/Core/Internal/CommandLine/StringToIntArgumentResolver.cs rename to UpdateLib/UpdateLib/Core/Internal/CommandLine/IntArgumentResolver.cs index 46ba9bd..9bbf49e 100644 --- a/UpdateLib/UpdateLib/Core/Internal/CommandLine/StringToIntArgumentResolver.cs +++ b/UpdateLib/UpdateLib/Core/Internal/CommandLine/IntArgumentResolver.cs @@ -2,15 +2,12 @@ namespace MatthiWare.UpdateLib.Core.Internal.CommandLine { - public class StringToIntArgumentResolver : ICommandLineArgumentResolver + public class IntArgumentResolver : ICommandLineArgumentResolver { private int value; public bool CanResolve(ref string[] data, ref int index) - { - return int.TryParse(data[index], out value); - } - + => int.TryParse(data[index], out value); public int Resolve(ref string[] data, ref int index) => value; diff --git a/UpdateLib/UpdateLib/Core/Internal/CommandLine/StringToMultipleIntsArgumentResolver.cs b/UpdateLib/UpdateLib/Core/Internal/CommandLine/MultipleIntArgumentResolver.cs similarity index 89% rename from UpdateLib/UpdateLib/Core/Internal/CommandLine/StringToMultipleIntsArgumentResolver.cs rename to UpdateLib/UpdateLib/Core/Internal/CommandLine/MultipleIntArgumentResolver.cs index 4935009..2d2b076 100644 --- a/UpdateLib/UpdateLib/Core/Internal/CommandLine/StringToMultipleIntsArgumentResolver.cs +++ b/UpdateLib/UpdateLib/Core/Internal/CommandLine/MultipleIntArgumentResolver.cs @@ -4,7 +4,7 @@ namespace MatthiWare.UpdateLib.Core.Internal.CommandLine { - public class StringToMultipleIntsArgumentResolver : ICommandLineArgumentResolver + public class MultipleIntArgumentResolver : ICommandLineArgumentResolver { private IList ints = new List(); diff --git a/UpdateLib/UpdateLib/Core/Internal/CommandLine/StringToStringArgumentResolver.cs b/UpdateLib/UpdateLib/Core/Internal/CommandLine/StringArgumentResolver.cs similarity index 63% rename from UpdateLib/UpdateLib/Core/Internal/CommandLine/StringToStringArgumentResolver.cs rename to UpdateLib/UpdateLib/Core/Internal/CommandLine/StringArgumentResolver.cs index 0e012cc..2e91408 100644 --- a/UpdateLib/UpdateLib/Core/Internal/CommandLine/StringToStringArgumentResolver.cs +++ b/UpdateLib/UpdateLib/Core/Internal/CommandLine/StringArgumentResolver.cs @@ -6,17 +6,15 @@ namespace MatthiWare.UpdateLib.Core.Internal.CommandLine { - public class StringToStringArgumentResolver : ICommandLineArgumentResolver + public class StringArgumentResolver : ICommandLineArgumentResolver { private readonly UpdateLibOptions options; - public StringToStringArgumentResolver(IOptions options) - { - this.options = options.Value; - } + public StringArgumentResolver(IOptions options) + => this.options = options.Value; public bool CanResolve(ref string[] data, ref int index) - => !data[index].StartsWith(options.ParameterPrefix); // if it is not a parameter + => !data[index].StartsWith(options.CommandLineArgumentPrefix); // if it is not a parameter public string Resolve(ref string[] data, ref int index) diff --git a/UpdateLib/UpdateLib/Core/Internal/CommandLine/StringToUpdateVersionArgumentResolver.cs b/UpdateLib/UpdateLib/Core/Internal/CommandLine/UpdateVersionArgumentResolver.cs similarity index 85% rename from UpdateLib/UpdateLib/Core/Internal/CommandLine/StringToUpdateVersionArgumentResolver.cs rename to UpdateLib/UpdateLib/Core/Internal/CommandLine/UpdateVersionArgumentResolver.cs index 3a88f43..fa92c04 100644 --- a/UpdateLib/UpdateLib/Core/Internal/CommandLine/StringToUpdateVersionArgumentResolver.cs +++ b/UpdateLib/UpdateLib/Core/Internal/CommandLine/UpdateVersionArgumentResolver.cs @@ -7,7 +7,7 @@ namespace MatthiWare.UpdateLib.Core.Internal.CommandLine { - internal class StringToUpdateVersionArgumentResolver : ICommandLineArgumentResolver + internal class UpdateVersionArgumentResolver : ICommandLineArgumentResolver { public bool CanResolve(ref string[] data, ref int index) => UpdateVersion.CanParse(data[index]); diff --git a/UpdateLib/UpdateLib/Core/Internal/UpdateLibOptionsSetup.cs b/UpdateLib/UpdateLib/Core/Internal/UpdateLibOptionsSetup.cs index e0529e6..80603f7 100644 --- a/UpdateLib/UpdateLib/Core/Internal/UpdateLibOptionsSetup.cs +++ b/UpdateLib/UpdateLib/Core/Internal/UpdateLibOptionsSetup.cs @@ -15,8 +15,7 @@ public class UpdateLibOptionsSetup : IConfigureOptions public void Configure(UpdateLibOptions options) { - options.AllowUnsafeUrl = false; - options.ParameterPrefix = m_argumentPrefix; + options.CommandLineArgumentPrefix = m_argumentPrefix; options.RollbackArgumentName = m_rollback; options.UpdateSilentArgumentName = m_argUpdateSilent; options.WaitArgumentName = m_argWait; diff --git a/UpdateLib/UpdateLib/Core/ParameterDefinition.cs b/UpdateLib/UpdateLib/Core/ParameterDefinition.cs index 2f9e4aa..105124a 100644 --- a/UpdateLib/UpdateLib/Core/ParameterDefinition.cs +++ b/UpdateLib/UpdateLib/Core/ParameterDefinition.cs @@ -1,32 +1,52 @@ -using MatthiWare.UpdateLib.Abstractions; +using System; +using MatthiWare.UpdateLib.Abstractions; namespace MatthiWare.UpdateLib.Common { - public class ParameterDefinition : IParameterDefinition - { - public string Name { get; private set; } - public ParamMandatoryType MandatoryType { get; private set; } - public ParamValueType ValueType { get; private set; } + public class ParameterDefinition : IParameterDefinition + { + public string Name { get; } - private ICommandLineArgumentResolver m_valueResolver; + public ParamValueType ValueType { get; } - public T Value { get; set; } + public ParamMandatoryType MandatoryType { get; } public int Count { get; set; } public bool IsFound => Count > 0; - object IParameterDefinition.Value => Value; + public bool CanResolve(ref string[] args, ref int index) => false; - internal ParameterDefinition(string paramName, ParamMandatoryType mandatoryType, ParamValueType valueType) + public ParameterDefinition(string paramName, ParamMandatoryType mandatoryType, ParamValueType valueType) { Name = paramName; MandatoryType = mandatoryType; ValueType = valueType; } - internal ParameterDefinition(string paramName, ParamMandatoryType mandatoryType, ParamValueType valueType, ICommandLineArgumentResolver valueResolver) + public void Reset() => Count = 0; + + public void Resolve(ref string[] args, ref int index) => throw new NotImplementedException(); + } + + public class ParameterDefinition : IParameterDefinition + { + public string Name { get; } + + public ParamMandatoryType MandatoryType { get; } + + public ParamValueType ValueType { get; } + + private readonly ICommandLineArgumentResolver m_valueResolver; + + public T Value { get; set; } + + public int Count { get; set; } + + public bool IsFound => Count > 0; + + public ParameterDefinition(string paramName, ParamMandatoryType mandatoryType, ParamValueType valueType, ICommandLineArgumentResolver valueResolver) { Name = paramName; MandatoryType = mandatoryType; @@ -40,7 +60,12 @@ public void Resolve(ref string[] args, ref int index) Count++; } - public bool CanResolve(ref string[] args, ref int index) => m_valueResolver.CanResolve(ref args, ref index); + public bool CanResolve(ref string[] args, ref int index) + { + if (index < 0 || index >= args.Length) return false; + + return m_valueResolver.CanResolve(ref args, ref index); + } public void Reset() { diff --git a/UpdateLib/UpdateLib/Core/UpdateLibOptions.cs b/UpdateLib/UpdateLib/Core/UpdateLibOptions.cs index c658393..70012c3 100644 --- a/UpdateLib/UpdateLib/Core/UpdateLibOptions.cs +++ b/UpdateLib/UpdateLib/Core/UpdateLibOptions.cs @@ -11,7 +11,6 @@ public sealed class UpdateLibOptions public string WaitArgumentName { get; set; } public string RollbackArgumentName { get; set; } public string UpdateUrl { get; set; } - public string ParameterPrefix { get; set; } - public bool AllowUnsafeUrl { get; set; } + public string CommandLineArgumentPrefix { get; set; } } } diff --git a/UpdateLib/UpdateLib/UpdateBuilder.cs b/UpdateLib/UpdateLib/UpdateBuilder.cs deleted file mode 100644 index 1ad6a38..0000000 --- a/UpdateLib/UpdateLib/UpdateBuilder.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using MatthiWare.UpdateLib.Abstractions; -using MatthiWare.UpdateLib.Abstractions.Internal; -using MatthiWare.UpdateLib.Common; -using MatthiWare.UpdateLib.Core; -using MatthiWare.UpdateLib.Core.Internal; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Options; - -namespace MatthiWare.UpdateLib -{ - public class UpdateBuilder - { - private IServiceCollection services; - private string remoteUrl; - - private UpdateBuilder() - { - services = new ServiceCollection(); - } - - public static UpdateBuilder CreateDefaultUpdateBuilder() - { - return new UpdateBuilder(); - } - - public IUpdater Build() - { - Validate(); - - RegisterDefaultServices(); - - var svcProvider = services.BuildServiceProvider(); - - return svcProvider.GetRequiredService(); - } - - private void Validate() - { - if (string.IsNullOrEmpty(remoteUrl)) - throw new ArgumentNullException("Specify the remote url"); - - } - - private void RegisterDefaultServices() - { - services.AddTransient, DefaultVersionResolver>(); - services.AddTransient(); - services.AddTransient, UpdateLibOptionsSetup>(); - services.AddSingleton(); - } - } -} diff --git a/UpdateLib/UpdateLib/Updater.cs b/UpdateLib/UpdateLib/Updater.cs index 2501333..aebc0e3 100644 --- a/UpdateLib/UpdateLib/Updater.cs +++ b/UpdateLib/UpdateLib/Updater.cs @@ -81,8 +81,8 @@ public Updater(ILogger logger, IOptions options, ICom //CommandLine.AddParameter(m_rollback); } - public static UpdateBuilder GetBuilder() - => UpdateBuilder.CreateDefaultUpdateBuilder(); + public static UpdaterBuilder GetBuilder() + => UpdaterBuilder.CreateDefaultUpdateBuilder(); /// /// Initializes the updater @@ -185,11 +185,11 @@ internal bool RestartApp(bool update = false, bool waitForPid = true, bool asAdm for (int i = 0; i < args.Count; i++) { - if (!update && args[i] == options.ParameterPrefix + options.UpdateArgumentName) + if (!update && args[i] == options.CommandLineArgumentPrefix + options.UpdateArgumentName) { args[i] = string.Empty; } - else if (args[i] == options.ParameterPrefix + options.WaitArgumentName) + else if (args[i] == options.CommandLineArgumentPrefix + options.WaitArgumentName) { args[i] = string.Empty; if (i + 1 < args.Count) @@ -197,14 +197,14 @@ internal bool RestartApp(bool update = false, bool waitForPid = true, bool asAdm } } - if (waitForPid && !args.Contains(options.ParameterPrefix + options.WaitArgumentName)) + if (waitForPid && !args.Contains(options.CommandLineArgumentPrefix + options.WaitArgumentName)) { - args.Add(options.ParameterPrefix + options.WaitArgumentName); + args.Add(options.CommandLineArgumentPrefix + options.WaitArgumentName); args.Add(Process.GetCurrentProcess().Id.ToString()); } - if (update && !args.Contains(options.ParameterPrefix + options.UpdateArgumentName)) - args.Add(options.ParameterPrefix + options.UpdateArgumentName); + if (update && !args.Contains(options.CommandLineArgumentPrefix + options.UpdateArgumentName)) + args.Add(options.CommandLineArgumentPrefix + options.UpdateArgumentName); string arguments = args.NotEmpty().Distinct().AppendAll(" "); @@ -233,5 +233,10 @@ internal bool RestartApp(bool update = false, bool waitForPid = true, bool asAdm // we will never reach this part of the code return true; } + + public void Dispose() + { + + } } } diff --git a/UpdateLib/UpdateLib/UpdaterBuilder.cs b/UpdateLib/UpdateLib/UpdaterBuilder.cs new file mode 100644 index 0000000..725ee23 --- /dev/null +++ b/UpdateLib/UpdateLib/UpdaterBuilder.cs @@ -0,0 +1,115 @@ +using System; +using System.Collections.Generic; +using System.Text; +using MatthiWare.UpdateLib.Abstractions; +using MatthiWare.UpdateLib.Abstractions.Internal; +using MatthiWare.UpdateLib.Common; +using MatthiWare.UpdateLib.Core; +using MatthiWare.UpdateLib.Core.Internal; +using MatthiWare.UpdateLib.Core.Internal.CommandLine; +using MatthiWare.UpdateLib.Utils; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Options; + +namespace MatthiWare.UpdateLib +{ + public class UpdaterBuilder + { + private IServiceCollection services; + private UpdateLibOptions options; + + private UpdaterBuilder() + { + services = new ServiceCollection(); + + options = new UpdateLibOptions + { + CommandLineArgumentPrefix = "--", + RollbackArgumentName = "rollback", + UpdateArgumentName = "update", + WaitArgumentName = "wait" + }; + } + + public UpdaterBuilder UseServiceCollection(IServiceCollection services) + { + services = Guard.NotNull(services, nameof(services)); + + return this; + } + + public UpdaterBuilder UseCommandLineArgumentPrefix(string prefix) + { + options.CommandLineArgumentPrefix = Guard.NotNullOrEmpty(prefix, nameof(prefix)); + + return this; + } + + public UpdaterBuilder UseUpdateUrl(string url) + { + options.UpdateUrl = Guard.NotNullOrEmpty(url, nameof(url)); + + return this; + } + + public UpdaterBuilder UseWaitArgument(string argument) + { + options.WaitArgumentName = Guard.NotNullOrEmpty(argument, nameof(argument)); + + return this; + } + + public UpdaterBuilder UseUpdateArgument(string argument) + { + options.UpdateArgumentName = Guard.NotNullOrEmpty(argument, nameof(argument)); + + return this; + } + + public UpdaterBuilder UseRollbackArgument(string argument) + { + options.RollbackArgumentName = Guard.NotNullOrEmpty(argument, nameof(argument)); + + return this; + } + + public static UpdaterBuilder CreateDefaultUpdateBuilder() => new UpdaterBuilder(); + + public IUpdater Build() + { + Validate(); + + RegisterDefaultServices(); + RegisterCommandLineServices(); + + var svcProvider = services.BuildServiceProvider(); + + return svcProvider.GetRequiredService(); + } + + private void RegisterCommandLineServices() + { + services.AddTransient, IntArgumentResolver>(); + services.AddTransient, MultipleIntArgumentResolver>(); + services.AddTransient, StringArgumentResolver>(); + services.AddTransient, UpdateVersionArgumentResolver>(); + } + + private void RegisterDefaultServices() + { + services.AddTransient, DefaultVersionResolver>(); + services.AddTransient(); + + services.AddOptions(); + + services.ConfigureOptions(options); + + services.AddSingleton(); + } + + private void Validate() + { + options.UpdateUrl.NotNullOrEmpty(nameof(options.UpdateUrl)); + } + } +} diff --git a/UpdateLib/UpdateLib/Utils/CmdLineParser.cs b/UpdateLib/UpdateLib/Utils/CmdLineParser.cs index e926bc2..d11cb39 100644 --- a/UpdateLib/UpdateLib/Utils/CmdLineParser.cs +++ b/UpdateLib/UpdateLib/Utils/CmdLineParser.cs @@ -19,21 +19,34 @@ using System.Linq; using MatthiWare.UpdateLib.Abstractions; using MatthiWare.UpdateLib.Common; +using MatthiWare.UpdateLib.Core; +using Microsoft.Extensions.Options; namespace MatthiWare.UpdateLib.Utils { public class CmdLineParser : ICommandLineParser { private SortedDictionary m_params = new SortedDictionary(); + private readonly string m_paramPrefix; - public string ParameterPrefix { get; set; } = "--"; + public CmdLineParser(IOptions options) + => m_paramPrefix = options.Value.CommandLineArgumentPrefix; - public void AddParameter(string paramName, ParamMandatoryType mandatoryType = ParamMandatoryType.Optional, ParamValueType valueType = ParamValueType.None) - => AddParameter(paramName, mandatoryType, valueType, default); + public void AddParameter(string paramName, ParamMandatoryType mandatoryType = ParamMandatoryType.Optional, ParamValueType valueType = ParamValueType.None) + { + Guard.NotNullOrEmpty(paramName, nameof(paramName)); + + if (paramName.Contains(' ')) throw new ArgumentException("Parameter cannot contain spaces", nameof(paramName)); + if (m_params.ContainsKey(paramName)) throw new ArgumentException("Key already exists", nameof(paramName)); + + var param = new ParameterDefinition(paramName, mandatoryType, valueType); + m_params.Add(paramName, param); + } public void AddParameter(string paramName, ParamMandatoryType mandatoryType, ParamValueType valueType, ICommandLineArgumentResolver resolver) { - if (string.IsNullOrEmpty(paramName)) throw new ArgumentNullException(nameof(paramName)); + Guard.NotNullOrEmpty(paramName, nameof(paramName)); + if (paramName.Contains(' ')) throw new ArgumentException("Parameter cannot contain spaces", nameof(paramName)); if (m_params.ContainsKey(paramName)) throw new ArgumentException("Key already exists", nameof(paramName)); @@ -51,7 +64,7 @@ public IParameterDefinition Get(string paramName) public void Parse(string[] args) { - if (string.IsNullOrEmpty(ParameterPrefix)) throw new ArgumentNullException(nameof(ParameterPrefix)); + if (string.IsNullOrEmpty(m_paramPrefix)) throw new ArgumentNullException(nameof(m_paramPrefix)); m_params.ForEach(kvp => kvp.Value.Reset()); @@ -59,7 +72,7 @@ public void Parse(string[] args) { string data = args[i]; - var def = m_params.Where(p => ParameterPrefix + p.Key == data).Select(p => p.Value).FirstOrDefault(); + var def = m_params.Where(p => m_paramPrefix + p.Key == data).Select(p => p.Value).FirstOrDefault(); if (def == null) continue; @@ -83,39 +96,8 @@ private void FindParameterValue(IParameterDefinition param, ref string[] args, r if (succes) param.Resolve(ref args, ref index); - //else if (param.ValueType == ParamValueType.Bool || param.ValueType == ParamValueType.OptionalBool) - //{ - // succes = bool.TryParse(data, out bool value); - - // if (succes) - // param.Value = value; - //} - //else if (param.ValueType == ParamValueType.String || param.ValueType == ParamValueType.OptionalString) - //{ - // succes = !data.StartsWith(ParameterPrefix); - - // if (succes) - // param.Value = data; - //} - //else if (param.ValueType == ParamValueType.MultipleInts) - //{ - // var values = new List(); - - // while (index < args.Length && int.TryParse(args[index], out int outValue)) - // { - // values.Add(outValue); - // index++; - // } - - // succes = values.Count >= 2; - - // if (succes) - // param.Value = values.ToArray(); - //} - if (!succes) --index; - } private void CheckAllMandatoryParamsFound() diff --git a/UpdateLib/UpdateLib/Utils/Guard.cs b/UpdateLib/UpdateLib/Utils/Guard.cs new file mode 100644 index 0000000..5fe459d --- /dev/null +++ b/UpdateLib/UpdateLib/Utils/Guard.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace MatthiWare.UpdateLib.Utils +{ + internal static class Guard + { + public static T NotNull(this T value, string propertyName) where T : class + => value ?? throw new ArgumentNullException(propertyName); + + public static string NotNullOrEmpty(this string value, string propertyName) + { + if (string.IsNullOrEmpty(value)) + throw new ArgumentNullException(propertyName); + + return value; + } + } +}