Click here to Skip to main content
14,737,146 members
Please Sign up or sign in to vote.
5.00/5 (2 votes)
See more:
I write C# programs / tools and want them to be updated automatically.
For example, whenever I click the update button in my form, the tool will look for a new version available on server.
How to achieve this in an easy way?

What I have tried:

I have found an open source updater, wyUpdate, written in C#.
I'm going to take a look at the source code, but may be some one has a simply idea how to achieve the same instead?
Updated 2-Oct-19 5:11am

1 solution

Take a look at this article: Update Checker.
I hope, this is exactly that what you need:

This XML file manages the updates:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

The main funtion Check4Update() reads the XML file and parse it:
XmlDocument oDom = new XmlDocument();

string str = oDom.SelectSingleNode("//currentVersion/major").InnerText;
Int32.TryParse(str, out _nMajor);

str = oDom.SelectSingleNode("//currentVersion/minor").InnerText;
Int32.TryParse(str, out _nMinor);

str = oDom.SelectSingleNode("//currentVersion/build").InnerText;
Int32.TryParse(str, out _nBuild); 

_sNewVersionPath = oDom.SelectSingleNode("//path").InnerText;
SmokeHead 2-Oct-19 10:15am
Thank you _duDE, looks good :)
I'll take a look!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900