Making your Application Automatically Update Itself
I've always thought it was the height of classiness when an application lets me know that there's a new version available. Even little applications with no installer like Lutz's Reflector update themselves automatically.
There's lots of ways to implement an automatic update check in your application, and many products that say they'll do it automatically.
From my point of view, there's a number of levels of "coolness" in auto-updating. Now, all this assumes you're NOT using ClickOnce.
- Add a "Check for Update" menu that just launches the default browser like www.foo.com/update.aspx?version=22.214.171.124 where 126.96.36.199 is your own Main Assembly Version. Then the requested page just lets them know if they've got the latest or not.
- You can get your app's version number via System.Windows.Forms.Application.ProductVersion() or System.Reflection. Assembly.GetExecutingAssembly(). GetName().Version.ToString(). Whew!
Cooler would be:
- Add a "Check for Update" menu that retrieves via a programmatic HTTP GET some XML from www.foo.com/update.aspx?version=188.8.131.52. Then report INSIDE your app if the user needs to upgrade.
Cooler still would be:
- Bonus points for checking once a day/week/month for updates, silently, gracefully.