xueaaaa.VersionControl 1.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package xueaaaa.VersionControl --version 1.0.1
                    
NuGet\Install-Package xueaaaa.VersionControl -Version 1.0.1
                    
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="xueaaaa.VersionControl" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="xueaaaa.VersionControl" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="xueaaaa.VersionControl" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add xueaaaa.VersionControl --version 1.0.1
                    
#r "nuget: xueaaaa.VersionControl, 1.0.1"
                    
#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.
#:package xueaaaa.VersionControl@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=xueaaaa.VersionControl&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=xueaaaa.VersionControl&version=1.0.1
                    
Install as a Cake Tool

VersionControl is designed to monitor users' app versions, and update them if a new one is released on GitHub.

To begin with

Make sure you have published your app on GitHub, its repository is publicly accessible, and new versions of the app are released using GitHub Releases, with the mandatory version indication in the Release Tag.

Please note that VersionControl only works with 0.0.0.0 format versions. If you are using a different application versioning system, this package will not work for you!

The screenshot below shows how a properly designed release should look like for VersionControl to work correctly.

alternate text is missing from this package README image

Install

You can install VersionControl directly into your project using NuGet.

dotnet add package xueaaaa.VersionControl

Usage

Before using the library, be sure to initialize the parameters required for operation.

using VersionControl;

Parameters.Set(repoName: "VersionControl",
               repoOwner: "xueaaaa",
               updateFileName: "upd.zip");

To get the version of the app installed on the user's device, use this:

using VersionControl.Models.Versions;

var local = Version.Local;

To get the latest version of the app on GitHub you just need to use static method Create(). You cannot get a non-latest version from GitHub.

using VersionControl.Models.Versions;

var gitVersion = await GitVersion.Create();

To install the latest version, use the VersionInstaller class, for example, as shown in the following code snippet. It is recommended to check if it is really required before installing.

using VersionControl.Models.Installers;
using VersionControl.Models.Versions;

var local = Version.Local;
var gitVersion = await GitVersion.Create();
var installer = new VersionInstaller(local, gitVersion);

if (installer.Check())
  installer.Install();
// OR
if (gitVersion > local)
  installer.Install();

VersionControl only downloads the file, it does not install/unpack it.

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 was computed.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows 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
1.0.1.1 169 7/15/2024
1.0.1 155 7/6/2024
1.0.0 169 7/5/2024 1.0.0 is deprecated because it is no longer maintained and has critical bugs.