Skip to content

Check for .NET app updates

License

Notifications You must be signed in to change notification settings

HMBSbige/UpdateChecker

Repository files navigation

UpdateChecker

Channel Status
CI CI
NuGet.org NuGet.org

Usage

GitHub Releases

var updaterChecker = new GitHubReleasesUpdateChecker(
		@"TCPingInfoView", // Owner
		@"TCPingInfoView-Classic", // Repo
		false, // Is pre-release
		@"1.6.0", // Current app version string
		tag => tag.Replace(@"v", string.Empty), // Tag to version string
		new DefaultVersionComparer() // Version comparer
);
try
{
	var res = await updaterChecker.CheckAsync(default);
	//var res = await updaterChecker.CheckAsync(new HttpClient(), new CancellationToken());
	if (res)
	{
		// Update Found

		var latestVersion = updaterChecker.LatestVersion;
		var latestVersionUrl = updaterChecker.LatestVersionUrl;
		var assetsUrl = updaterChecker.LatestRelease.assets.Select(asset => asset.browser_download_url);
	}
	else
	{
		// No newer version was found
	}
}
catch (Exception ex)
{
	// Network exception or cannot find any correct tag.
}

About

Check for .NET app updates

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages