Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Auto-Update Windows Mobile application

I have a .net cf 3.5 Windows Mobile application that my client wants to have autoupdate features.

Here is what I have so far:

  1. create a CAB using the Smart Device CAB Project (is this good enough, or should I be doing something else here)

2.Get the application version number

Assembly.GetExecutingAssembly().GetName().Version.ToString();
  1. Call a WCF web service for to do a version number look up.
  2. Download a new version of the cab file.
  3. ???
  4. Execute WCELoad.exe on the CAB file
  5. Profit
like image 797
Chris Brandsma Avatar asked Apr 15 '09 21:04

Chris Brandsma


2 Answers

I just published WmAutoUpdate, a .NET c# framework that will do auto-updates on the Compact Framework. It's freely available on Github: http://github.com/seboslaw/wmautoupdate

like image 84
Sebastian Avatar answered Sep 26 '22 19:09

Sebastian


Your solution is generally correct, but has a few problems.

  1. You can't update yourself. You have to shut down and have some otehr app update you to prevent the file-sharing issue. This is usually handled by having a dedicated "updater" app that you launch. It might be the target of the app icon and therefore does updates with every launch, or it may be launched via a "check for updates" type of menu item. Regardless, you have to launch it and make sure the actual app isn't running.
  2. It's generally a good idea to provide some form of back-up in the event of a corrupt, interrupted install
  3. CAB updates are going to require wholesale updates of everything. This may not be what you want in the end (you may want to update just a single file, assembly or whatever) so starting with the logic of pulling down individual files is going to make you way more extensible.

An old, but still very valid, resource is Alex Feinman's MSDN article on creating self-updating applications.

like image 38
ctacke Avatar answered Sep 26 '22 19:09

ctacke