Darkshadow
Darkshadow

Reputation: 103

Github Auto-Update

I'm able to get the last commit hash from Github, but now I want to use this to implement an auto-update feature.

I'd like to be able to prompt the user if the repo isn't at the latest commit. However, I do not know how to automate this update process should the user choose to.

How can I do this in C#?

Upvotes: 1

Views: 4944

Answers (1)

Cyral
Cyral

Reputation: 14163

You should take a look into Github's own C# based updater/installer, Squirrel.Windows.

Squirrel is both a set of tools and a library, to completely manage both installation and updating your Desktop Windows application, written in either C# or any other language (i.e. Squirrel can manage native C++ applications).

Squirrel uses NuGet packages to create installation and update packages, which means that you probably already know most of what you need to create an installer.

I've used Squirrel for distributing and updating my own applications, it is very easy to use. One of the best features is that it uses NuGet packages, so updates are only downloaded based on the diff of each version.

It runs it's own bootstrapper program to check for dependencies and manage updating and restarting the application. You will need to make your own update dialog, although it is as simple as adding a hook to the update available and progress event.

You should be able to use Github releases or modify Squirrel to support Github versions better.

Upvotes: 2

Related Questions