views:

2700

answers:

9

What are some good solutions for handling automatic web based software updates for windows forms projects? I am aware of microsoft one-click, but am not interested in it at this time.

+1  A: 

it really depends on how complex of an update process is needed.

I have had a few clients with simple needs where we created our own process setup that handled it, in about 3 hours of development we have a fully working solution that met all of their needs.

Mitchel Sellers
+1  A: 

Microsoft one-click? Do you mean ClickOnce? Click once for win form is very nice. Deployement is fast and all the update process is handled by itself.

Daok
A: 

but ClickOnce is the best you can have and you can select if users need to download the new version, use the old ones, go back versions, etc...

you can always built your own solution, check the version number of a XML setting file in some web address, if it is newer than the current one, alter user to download the new version for example...

balexandre
+11  A: 

ClickOnce is good for cookie cutter stuff, but has some limitations around security (i.e. can't create a desktop icon, no access to COM, etc)

Assuming you are using MSI to install your application. Use WIX (http://wix.sourceforge.net/) to create a patch (.msp). You will want to look into Least Privileged User Account (LUA) Patching for Vista as UAC will screw you if you don't.

Then your application does the follows:

  1. Check for a new version via HTTP
  2. Download the MSP (be careful of where you DL it to in Vista because of UAC)
  3. Start a Shim exe that
  4. waits for your app to close
  5. launches the msp (in non-interactive mode)
  6. restarts your app

This can all happen automatically behind the scenes with zero user interaction on both XP and Vista.

A good place to start with this, and with WIX in general is:

http://www.tramontana.co.hu/wix/index.php (Lesson 4 is on Updates)

Greg Dean
I can create Desktop Icon with ClickOnce....
Daok
not without hacking you can't (If the app is uninstalled, it's not removed)
Greg Dean
This sounds like a fantastic piece of software, and the documentation on tramontana.co.hu looks great.Nice post, gets my vote.
lb
A: 

I've also heard it called clicktwice :+> The WIX solution is more what I was interested in. Are there any sample applications (with source) for using this technique?

I edited my answer to include a link to the tutorials.
Greg Dean
Building a system like this is not a small undertaking. I have done it, but never found a comprehensive tutorial.
Greg Dean
+3  A: 

Not to get too spammy, but our company offers an automatic updating solution. It comes in 3 parts:

wyUpdate handles all of the Vista/Windows 7 UAC problems and all the file permission problems that inevitably pop up when you're trying to update complex software.

Wyatt O'Day
+3  A: 

We wrote our own at one time... That wasn't a good idea. In many cases you can use ClickOnce. We actually use a product called AutoUpdate+ which we can recommend. Its particularly special feature is that it can avoid UAC popup issues.

Testing123
A: 

Hi,

I want to recommend you BitsUpdater. It is simple and extendable library for automatic update process using BITS (technology used by Windows Update).

There is a sample for processes (special project called ApplicationLauncher) and you can extend library with your own solution for updating any other services (database, ...).

jakubgarfield
A: 

Here's an open-source solution I wrote to address specific needs we had for WinForms and WPF apps. The general idea is to have the greatest flexibility, at the lowest overhead possible.

So, integration is super-easy, and the library does pretty much everything for you, including synchronizing operations. It is also highly flexible, and lets you determine what tasks to execute and on what conditions - you make the rules (or use some that are there already). Last by not least is the support for any updates source (web, BitTorrent, etc) and any feed format - whatever is not implemented you can just write for yourself.

Cold updates (requiring an application restart) is also supported, and done automatically unless "hot-swap" is specified for the task.

This boild down to one DLL, less than 70kb in size.

More details at http://www.code972.com/blog/2010/08/nappupdate-application-auto-update-framework-for-dotnet/

Code is at http://github.com/synhershko/NAppUpdate (Licensed under the Apache 2.0 license)

synhershko