FSC-Updater 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package FSC-Updater --version 1.0.0                
NuGet\Install-Package FSC-Updater -Version 1.0.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FSC-Updater" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add FSC-Updater --version 1.0.0                
#r "nuget: FSC-Updater, 1.0.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install FSC-Updater as a Cake Addin
#addin nuget:?package=FSC-Updater&version=1.0.0

// Install FSC-Updater as a Cake Tool
#tool nuget:?package=FSC-Updater&version=1.0.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");
                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 = "") The RestartApplication method is a pivotal part of the fsc.updater library. It gracefully restarts your application after an update has been downloaded and applied. This method takes a ProcessStartInfo 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 to true, 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.1.0 229 12/5/2023
2.0.0 122 12/4/2023
1.0.1 120 11/29/2023
1.0.0 111 11/28/2023