Thursday, February 19, 2009

 

Auto Update for Vista Gadget

I got this question from a Gadget developer!

"We have an auto-upgrade mechanism in place which gets notified if a new version is available thanks to a Web service.

Clearly this will alert users to the presence of a new version, and allow them to download it. However, once downloaded we’d like the old version to be replaced by the new one. Right now we are finding that the new one appears side-by-side with the old one, and the user has to remove it manually.

Do you have any ideas about how to prevent this
?"


If you have a similar concern, here is a detail on what needs to be in the new version and what happens when the user download a new version of your existing Gadget.

To replace the existing gadget with a new version the following needs to be there:
  1. Name of the Gadget should be same.
  2. Gadget configuration file need to be same except for the version number which needs to be greater.
  3. The current gadget must be closed from the sidebar.
What happens is, when user downloads a gadget in the temp folder, the gadget is renamed to gadget(1).gadget (if old gadget is also there), so technically this becomes a different gadget(rule 1 above). And If the current gadget is in the sidebar the new gadget install itself again(rule 3). Although there is no direct way to close the gadget from the side bar, what you can do is this.
  1. When an upgrade is available. Give an Alert message that:
  2. a> User need to download the gadget in there desktop
    b> They need to close the existing gadget. before installing the new version
  3. Instead of giving your user a URL of the gadget, redirect them to the upgrade page where you can put step-by-step instructions.
  4. The best way of course is to Avoid an Upgrade all together, in my experience very few people go for an upgrade if existing gadget is working.
Auto-update is also discussed in the "Appendix A: Tips and Tricks" section of the book.

Labels: , , ,


Comments:
System.Shell.execute(System.Gadget.path + "\\My.gadget");

System.Gadget.close();
 
Post a Comment



Links to this post:

Create a Link



<< Home