I want to implement Squirrel's update solution in my work project, But I wish to classify each update according to a severity (let's say, critical, feature, niceToHave etc.) and decide whether to update/force restart based on the new update's severity.
Can it be done using Squirrel? Thanks
One way to solve this using Squirrel is to first design a versioning scheme that maps to severity levels. For example, consider a version format of XYZ (Major.Minor.Patch). niceToHave
increments the patch version, feature
increments the minor version, and critical
increments the major version.
Then you can customize UpdateManager in your application to implement the logic that applies updates:
using (var mgr = new UpdateManager(pathToUpdateFolder))
{
var updates = await mgr.CheckForUpdate();
if (updates.ReleasesToApply.Any())
{
var lastVersion = updates.ReleasesToApply.OrderBy(x => x.Version).Last();
// TODO: implement the logic to call:
// await mgr.DownloadReleases(updates.ReleasesToApply);
// await mgr.ApplyReleases(updates);
}
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.