views:

214

answers:

4

I have searched through google and SO for possible answers to this question, but can only find small bits of information scattered around the place, most of which appear to be personal opinion.

I'm aware that this question could be considered subjective, but I'm not looking for personal opinion, rather facts with reasons (e.g. past experience) or even a single link to a blog/wiki which describes best practices for this (this is what I'd prefer to be honest). What I'm not looking for is how to make this work, I know how to create a self updating desktop application.

I want to know about the best practices for creating a self updating desktop application. The sort of best practices I'm especially curious about are:

  • Do you force an update if the clients software is out of date, but not going to break when trying to communicate with other version of the software or the database itself? If so how do you signify this breaking change?
  • How often should you check for updates? Weekly/daily/hourly and exactly why?
  • Should the update be visible to the user or run behind the scenes from a UI point of view?
  • Should you even notify the user that there is an update available if it is not a major update? (for instance fixing a single button in a remote part of the application which only one user actually requires)
  • Should you try to patch the application or do you re-download the entire application from scratch Macintosh style?
  • Should you allow users to update from a central location or only allow updating through the specified application? (for closed business applications).

Surely there is some written rules/suggestions about this stuff? One of the most annoying things about a lot of applications is the updating, as it's hard to find a good balance between "out of date" and "in the users face".

If it helps consider this to be written in .net C# for a single client, running on machines with constant available connectivity to the update server, all of these machines talk to each other through the application, and all also talk to a central database server.

A: 
  • Do you force an update if the clients software is out of date, but not going to break when trying to communicate with other version of the software or the database itself? If so how do you signify this breaking change?

Ask the user.

  • How often should you check for updates? Weekly/daily/hourly and exactly why?

Ask the user.

  • Should the update be visible to the user or run behind the scenes from a UI point of view?

Ask the user.

  • Should you even notify the user that there is an update available if it is not a major update? (for instance fixing a single button in a remote part of the application which only one user actually requires)

Ask the user (notice a trend here?).

  • Should you try to patch the application or do you re-download the entire application from scratch Macintosh style?

Typically, patch, if the application is of any significant size.

As far as the "ask the user" responses go, it doesn't mean always prompt them every single time. Instead, give them the option to set what they should be prompted for and what should just be done invisibly (and the first time a given thing occurs, ask them what should be done in the future, and remember that). This shouldn't be very difficult and you gain a lot of goodwill from a larger portion of your user base, since it's very hard to have fixed settings suit the desires of everyone who uses your app. When in doubt, more options are better than less - especially when they're the kind of option that's fairly trivial to code.

Amber
Sorry I forgot to mention in the question is that though this is an application which would be distributed to multiple users, it would be written specifically for a single business. Though in this case I assume your answer would be changed to "Ask the client." :P That's a fair call. I was more hoping that there would be some sort of standards which you could link me to, for instance "Don't check for updates weekly because it can break on emergency database changes" or something (as bad as the example is). Thanks for your simple solution :)
Jay
+1  A: 

It's hard to give a general answer. It depends on the context: criticality of the update, what kind of app is it, user preferences, #users, network width, etc. Here are some of the options/trade-offs.

  • Do you force an update if the clients software is out of date, but not going to break when trying to communicate with other version of the software or the database itself? If so how do you signify this breaking change?

    As a developer your best interest is to have all apps out there to be as up to date as possible. This reduces your maintenance effort. Thus, if the user does not mind you should update.

  • How often should you check for updates? Weekly/daily/hourly and exactly why?

    If the updates are transparent to the user, do not require an immediate restart of the app, then I'd suggest that you do it as often as your the communication bandwidth allows (considering both the update check-frequent but small-and the download-infrequent but large)

  • Should the update be visible to the user or run behind the scenes from a UI point of view?

    Depends on the user preferences but also on the type of the update: bug fixes vs. functionality/UI changes (the user will be puzzled to see the look and feel has changed with no previous alert)

  • Should you even notify the user that there is an update available if it is not a major update? (for instance fixing a single button in a remote part of the application which only one user actually requires)

    same arguments as the previous question

  • Should you try to patch the application or do you re-download the entire application from scratch Macintosh style?

    if app size is small download it from scratch. This will prevent all sort of weird bugs created to mismatch between the different patches ("DLL hell"). However, this may require large download times or impose heavy toll on your network.

  • Should you allow users to update from a central location or only allow updating through the specified application? (for closed business applications).

    I think both

Itay
This is exactly the sort of thing that I was looking for :) Though I'm assuming these are personal preference, you don't happen to have any links to lists of these by any chance? Thanks
Jay
No I don't. These are based on my personal experience: a few years ago I worked for a company that developed a free desktop app that had several million users. Naturally it had an auto-update mechanism.
Itay
+1  A: 

From practical experience, don't forget to add functionality for updating the update engine. Which means that performing an update is usually a two step approach

  1. Check if there are updates to the update engine
  2. Check if there are updates to the actual application

Do you force an update if the clients software is out of date, but not going to break when trying to communicate with other version of the software or the database itself? If so how do you signify this breaking change?

A common practice is to have a "ProtocolVersion" method which indicates the lowest/oldest version allowed.

The "ProtocolVersion" can either supplied by the client or the server depending on the trust level you have between the client and the server. In a low trust level it is probably better to have the client provide the "ProtocolVersion" and then deny access server side until the client is updated. In a "high trust level" scenario it will be easier to have the server supply the "ProtocolVersion" it accepts, and then all the logic for adapting to this - including updating the client application - implemented in the client only. Giving the benefit that the version check/handling code only needs to be in one place.

Anton
+1 nice point about the update engine, something I had completely forgotten about
Jay
+2  A: 
Taneli Waltari
+1 thanks mate, very helpful :) (especially the point about the update engine running to run the update GUI when updating the update engine, something I think a lot of people would forget about)
Jay