Skip to content

Click Once Deployment In GitHub

BlythMeister edited this page Nov 19, 2014 · 2 revisions

The Method

Click-Once is an easy way to regularly push updates out to your windows desktop apps.

Click-Once can install updates automatically on application start, or you can handle this manually within your app.

We have decided to go with the manual check approach, the reason for this is that we can integrate this experience into the app, rather than having a launcher that downloads the updates. Therefore we operate in a similar way to other apps like Spoitfy whereby the updates are downloaded and installed, all the user has to do is restart the app.

How Does It Work?

GitHub offers a "raw" version of all it's files, and this can be used to serve the application.manifest from a click-once application over the internet.

Changes can be made an published locally to disk, and then when the changes are committed into GitHub they are ready for everyone's application to search and download the new versions.

From Visual Studio the publish of click once is done into 1 of 2 directories depending on version of the app. The "stable" version will publish to "....\deploy\stable" whereas the beta will publish to "....\deploy\beta" This is just so that someone with a Stable version doesn't accidentally get beta installs.

The update URL is then set to "http://blythmeister.github.io/Gallifrey.Releases/deploy/stable/" or for the beta version "http://blythmeister.github.io/Gallifrey.Releases/deploy/beta/" This is the path to where the updates are, once published in GitHub.

The Gallifrey App using click-once will know to go to this URL when checking for updates. The great this about this is that pushing updates is as simple as pushing a new version into GitHub. The only pain point is having to manually perform the publish prior to the push into GitHub.

Pain Points

There are a few pain points to get around with using this approach.

  1. GitAttributes - Since your pushing XML and .deploy files you don't want your Git client to change the line endings. You can add a .GitAttributes file to your repository (check the one in this repo) that will tell Git that all ".manifest" or ".deploy" files are binary and should not be compared or adjusted.

  2. GitHub raw seems to have a cache of some description, so when requesting the latest and greatest version, sometimes this is out of date. From my experience, the updates are there within 5 minutes, so it's fully workable.

  3. You have LOTS of files in your deploy folders! Git stores everything in history, so the more versions you push, the bigger your repo gets. Even if you clean up the files, someone has to pull all the history in, which could over time become cumbersome. Though, we are not talking GB's of download in Gallifrey (Yet!)

Clone this wiki locally