Reputation: 1883
So i've build an AwesomeApplication.exe with visual studio winforms, it has a public repository with releases.
I'd like to add update checker to the application (notifying the user that new release is available for download).
I can get latest release info with github api: https://developer.github.com/v3/repos/releases/#get-the-latest-release
But the application doesn't "know" which github release tag or version it is, unless i'd manually type that in the application settings (before building it)? and then using the api, compare that hard coded version string with github release tag. That would be possible, but requires bit too much manual work.. wondering that are there other options?
my publish process is:
Solution, modified version of @VonC link:
Small update on that: Actually with that checkup above, the string would be always different, since at compile time the current latest release is, lets say 1.10, while after compile and adding new release, its already 1.11 (and compile time string is the old 1.10). So temporary fix for that is to float or int parse your version tag number, compare if its larger by 0.1 or 1 for example, then show update available.
Upvotes: 2
Views: 711
Reputation: 1326782
You can embed the current version in your exe: see "Embed git commit hash in a .Net dll".
That way, your Application can compare its internal version (based on git describe --long
, which includes the closest tag) with the version from the latest release (which is based on a tag as well)
Upvotes: 1