FSC-Updater
2.1.0
dotnet add package FSC-Updater --version 2.1.0
NuGet\Install-Package FSC-Updater -Version 2.1.0
<PackageReference Include="FSC-Updater" Version="2.1.0" />
paket add FSC-Updater --version 2.1.0
#r "nuget: FSC-Updater, 2.1.0"
// Install FSC-Updater as a Cake Addin #addin nuget:?package=FSC-Updater&version=2.1.0 // Install FSC-Updater as a Cake Tool #tool nuget:?package=FSC-Updater&version=2.1.0
fsc.updater
Introduction
fsc.updater
is an auto-updating solution for .NET applications. It provides an easy-to-use library to integrate update functionality into your applications, ensuring that the end-users always have the latest version running.
Made for windows only
How to Use
To use fsc.updater
in your project, include the FSC.Updater
namespace in your application and follow the sample code provided below.
Sample Code
using FSC.Updater;
namespace LiveTest
{
internal static class Program
{
static async Task Main(string[] args)
{
if (args.Length > 0)
{
Console.WriteLine(args[0]);
Console.ReadKey();
}
Updater updater = new Updater();
if (await updater.CheckForUpdateAsync("https://raw.githubusercontent.com/.../.../main/version.txt"))
{
await updater.DownloadUpdateAsync("https://github.com/.../.../raw/main/LiveTest.zip");
// "LiveTest.exe is an example. Please use an absolute path instead. e.g. Path.GetFullPath("LiveTest.exe");"
updater.RestartApplication(new System.Diagnostics.ProcessStartInfo("LiveTest.exe", "HelloWorld"));
}
Console.ReadKey();
}
}
}
Methods
public async Task<bool> CheckForUpdateAsync(string versionInfoUrl)
Checks for available updates by comparing the local application version with the version information located at the provided URL.public async Task DownloadUpdateAsync(string updateZipFileUrl)
Downloads the update package from the given URL.public void RestartApplication(ProcessStartInfo restartProcessInformation, bool useAdminPermissions = false, string ignoreFileThatMatchThisRegex = "")
TheRestartApplication
method is a pivotal part of thefsc.updater
library. It gracefully restarts your application after an update has been downloaded and applied. This method takes aProcessStartInfo
object as a parameter, which includes the necessary information to start a process, such as the application's executable name and any command-line arguments.Additionally, the method provides two optional parameters:
useAdminPermissions
: When set totrue
, the application restarts with administrative privileges. This is essential if the update process needs to modify system-protected files or settings.ignoreFileThatMatchThisRegex
: This parameter accepts a regex pattern as a string. It is used to specify any files that should not be replaced or modified during the update process. This can be useful for preserving configuration files or logs that are unique to the user's installation.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Framework | net48 is compatible. net481 was computed. |
-
.NETFramework 4.8
- Newtonsoft.Json (>= 13.0.3)
- System.Net.Http (>= 4.3.4)
-
net6.0
- Newtonsoft.Json (>= 13.0.3)
- System.Net.Http (>= 4.3.4)
-
net7.0
- Newtonsoft.Json (>= 13.0.3)
- System.Net.Http (>= 4.3.4)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Downloadinformation can now be tracked with the DownloadProgressChanged event