Skip to content

Instantly share code, notes, and snippets.

@WizzApp
Created November 24, 2011 12:09
Show Gist options
  • Save WizzApp/1391207 to your computer and use it in GitHub Desktop.
Save WizzApp/1391207 to your computer and use it in GitHub Desktop.
Automatic updates for windows client applications (Winforms/WPF)
var updateServer = new UpdateServer("https://updateserver.com/updates");
var versionInfo = s.GetVersionInfo("TestApplication");
if (versionInfo.Version > ApplicationVersion)
{
MessageBox.Show("An update for your application is available");
}
s.GetVersionInfo("TestApplication", new string[] {LicenseKey});
create-update Application.msi --version 1.0 --name "Test Application"
--key private_key_file --out path_to_update_server_dir
public VersionInfo GetVersionInfo(string applicationName, string[] additionalInfo)
{
// check for an application specific handler
if (handlers.ContainsKey(applicationName)
{
// this may require a license key and throw an exception if none is provided
return handlers[applicationName](applicationName, additionalInfo);
}
// to avoid problems on the client side, this should alwyas return a VersionInfo object
return GetVersionInfoFromXml(applicationName, additionalInfo);
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment