Created
November 24, 2011 12:09
-
-
Save WizzApp/1391207 to your computer and use it in GitHub Desktop.
Automatic updates for windows client applications (Winforms/WPF)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
s.GetVersionInfo("TestApplication", new string[] {LicenseKey}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create-update Application.msi --version 1.0 --name "Test Application" | |
--key private_key_file --out path_to_update_server_dir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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