-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First shot at implementing an appcast filtering process that allows r…
…egression to a lower version number.
- Loading branch information
1 parent
63f4640
commit db0a7ff
Showing
7 changed files
with
181 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace NetSparkleUpdater.Interfaces | ||
{ | ||
/// <summary> | ||
/// This provides a way to filter out AppCast item instances that do not apply to the current update process. Originally | ||
/// used to make it possible to revert from a "beta" version to a "stable" one - where the current runtime System.Version value | ||
/// is by definition higher than anything in the "stable" app cast list. | ||
/// | ||
/// To force NetSparkle to upgrade to a lower version number, return a System.Version("0.0.0.0") and a list of app cast items that are valid candidates to update - the | ||
/// GetFilteredAppCastItems() method allows you to remove elements from this list before the standard NetSparkle code does its thing. | ||
/// | ||
/// </summary> | ||
public interface IAppCastFilter | ||
{ | ||
/// <summary> | ||
/// Returns a new "minimum" version number and a potentially modified list of app cast items, e.g. maybe you want to remove the beta ones when reverting to stable. | ||
/// </summary> | ||
/** | ||
<example> | ||
This code shows how to do no filtering at all. | ||
<code> | ||
if(noFilteringRequired) | ||
{ | ||
return new Tuple<installed, List<AppCastItem>>(installed, items); | ||
} | ||
</code> | ||
</example> | ||
*/ | ||
/// <remarks>The app must return a version and list of app cast items. If there is no need to filter then simply return the values that were passed in.</remarks> | ||
/// <remarks>Note: calls to methods on this interface are made from background threads - dont access UI objects from within this method</remarks> | ||
/// <param name="installed">The currently detected version of this application</param> | ||
/// <param name="items">The current set of AppCastItem objects</param> | ||
/// <returns>A replacement list of items derived from the input set</returns> | ||
Tuple<Version, List<AppCastItem>> GetFilteredAppCastItems(Version installed, List<AppCastItem> items); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
namespace NetSparkleUpdater.Interfaces | ||
{ | ||
/// <summary> | ||
/// Provides the return values for the GetAvailableUpdates call on the IAppCastHandler. When an appcast is downloaded, | ||
/// the IAppCastHandler will work out which AppCastItem instances match criteria for an update. | ||
/// </summary> | ||
/// <seealso cref="IAppCastHandler.GetAvailableUpdates"/> | ||
public enum MatchingResult | ||
{ | ||
/// <summary> | ||
/// Indicates that the AppCastItem is a validate candidate for installation. | ||
/// </summary> | ||
MatchOk = 0, | ||
/// <summary> | ||
/// The AppCastItem is for a different operating system that this one, and must be ignored. | ||
/// </summary> | ||
NotThisPlatform = 1, | ||
/// <summary> | ||
/// The version indicated by the AppCastItem is less than or equal to the currently installed/running version. | ||
/// </summary> | ||
VersionIsOlderThanCurrent = 2, | ||
/// <summary> | ||
/// A signature is required to validate the item - but it's missing from the AppCastItem | ||
/// </summary> | ||
SignatureIsMissing = 3 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters