Skip to content

Commit

Permalink
XML format was changed due to serialization refactor. Reverted it to …
Browse files Browse the repository at this point in the history
…original format.
  • Loading branch information
ravibpatel committed Feb 6, 2020
1 parent ca0777c commit 0854ee3
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 13 deletions.
6 changes: 3 additions & 3 deletions AutoUpdater.NET/AutoUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public static class AutoUpdater
/// Set it to folder path where you want to download the update file. If not provided then it defaults to Temp folder.
/// </summary>
public static string DownloadPath;

/// <summary>
/// If you are using a zip file as an update file then you can set this value to path where your app is installed. This is only necessary when your installation directory differs from your executable path.
/// </summary>
Expand Down Expand Up @@ -430,8 +430,8 @@ private static void BackgroundWorkerDoWork(object sender, DoWorkEventArgs e)

if (!Mandatory)
{
Mandatory = args.Mandatory;
UpdateMode = args.UpdateMode;
Mandatory = args.Mandatory.Value;
UpdateMode = args.Mandatory.UpdateMode;
}

if (string.IsNullOrEmpty(args.CurrentVersion) || string.IsNullOrEmpty(args.DownloadURL))
Expand Down
2 changes: 1 addition & 1 deletion AutoUpdater.NET/DownloadUpdateDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ private static void CompareChecksum(string fileName, CheckSum checksum)
var hash = hashAlgorithm.ComputeHash(stream);
var fileChecksum = BitConverter.ToString(hash).Replace("-", string.Empty).ToLowerInvariant();

if (fileChecksum == checksum.Text.ToLower()) return;
if (fileChecksum == checksum.Value.ToLower()) return;

throw new Exception(Resources.FileIntegrityCheckFailedMessage);
}
Expand Down
28 changes: 20 additions & 8 deletions AutoUpdater.NET/UpdateInfoEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,7 @@ public string ChangelogURL
/// Shows if the update is required or optional.
/// </summary>
[XmlElement("mandatory")]
public bool Mandatory { get; set; }

/// <summary>
/// Defines how the Mandatory flag should work.
/// </summary>
[XmlElement("mode")]
public Mode UpdateMode { get; set; }
public Mandatory Mandatory { get; set; }

/// <summary>
/// Command line arguments used by Installer.
Expand Down Expand Up @@ -93,6 +87,24 @@ internal static string GetURL(Uri baseUri, string url)
}
}

/// <summary>
/// Mandatory class to fetch the XML values related to Mandatory field.
/// </summary>
public class Mandatory
{
/// <summary>
/// Value of the Mandatory field.
/// </summary>
[XmlText]
public bool Value { get; set; }

/// <summary>
/// Mode that should be used for this update.
/// </summary>
[XmlAttribute("mode")]
public Mode UpdateMode { get; set; }
}

/// <summary>
/// Checksum class to fetch the XML values for checksum.
/// </summary>
Expand All @@ -102,7 +114,7 @@ public class CheckSum
/// Hash of the file.
/// </summary>
[XmlText]
public string Text { get; set; }
public string Value { get; set; }

/// <summary>
/// Hash algorithm that generated the hash.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
![AutoUpdater.NET](Logo/Horizontal.png)

[![Build status](https://ci.appveyor.com/api/projects/status/yng987o7dauk9gqc?svg=true)](https://ci.appveyor.com/project/ravibpatel/autoupdater-net) [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](http:https://paypal.me/rbsoft)
[![Build status](https://ci.appveyor.com/api/projects/status/yng987o7dauk9gqc?svg=true)](https://ci.appveyor.com/project/ravibpatel/autoupdater-net)

AutoUpdater.NET is a class library that allows .NET developers to easily add auto update functionality to their classic desktop application projects.

Expand Down

0 comments on commit 0854ee3

Please sign in to comment.