How to best implement software updates on windows?

2019-01-30 02:50发布

问题:

I want to implement an "automatic update" system for a windows application. Right now I'm semi-manually creating an "appcast" which my program checks, and notifies the user that a new version is available. (I'm using NSIS for my installers).

Is there software that I can use that will handle the "automatic" part of the updates, perhaps similar to Sparkle on the mac? Any issues/pitfalls that I should be aware of?

回答1:

There is no solution quite as smooth as Sparkle (that I know of).

If you need an easy means of deployment and updating applications, ClickOnce is an option. Unfortunately, it's inflexible (e.g., no per-machine installation instead of per-user), opaque (you have very little influence and clarity and control over how its deployment actually works) and non-standard (the paths it stores the installed app in are unlike anything else on Windows).

Much closer to what you're asking would be ClickThrough, a side project of WiX, but I'm not sure it's still in development (if it is, they should be clearer about that…) — and it would use MSI in any case, not NSIS.

You're likely best off rolling something on your own. I'd love to see a Sparkle-like project for Windows, but nobody seems to have given it a shot thus far.



回答2:

There's now a Windows port of Sparkle, see http://winsparkle.org.



回答3:

Google Chrome auto-update is based on Omaha:

http://code.google.com/p/omaha/

Their overview has a great section on why it was needed:

The browser typically prompted the user with a long series of techy, confusing and scary dialogs all trying to convince the user not to install. Then the user was prompted with a wizard filled with choices that they did not need to or know how to decide amongst. These factors combined to form a bad user experience and large drop-off during the app installation process



回答4:

It's a good idea to use a third-party solution, cause autoupdates can be a pain, especially with Windows Vista/7 (UAC). For what it's worth, the product my company uses is AutoUpdate+ and it seems to work fairly well.



回答5:

For .NET, a while back Microsoft Patterns + Practices published the Application Updater Block. This was (to my mind) rather overblown and over-engineered, but did the job quite well.

In essence it used a "stub loader" to check a manifest and a Web service to see if a later version of the program than the one installed was available, then used the BITS background downloader technology to download a new version if one was available on the server.

Once the new version was downloaded and installed (with .NET this is as simple as an xcopy to the relevant folder), the application would update the manifest. The next time the program was loaded the new version would be launched.

While the Patterns + Practices code is .NET specific, there's nothing there that couldn't be copied for a non-.NET application, especially if you have the ability to silently run the install process in the background.



回答6:

I asked a similar question. Follow the link to see the responses. Self Updating



回答7:

If your application is written in .Net, you could try ClickOnce. However, it's difficult to perform administrative or custom actions during install using this approach.



回答8:

wyUpdate looks really nice. See video here: http://wyday.com/wybuild/help/automatic-updates/



回答9:

For .NET applications you might want to have a look at NetSparkle, a Sparkle variant for .NET programs. It is pretty new (from 2011) and developed actively.



回答10:

Just came here from an answer to my own question on the same subject - I mention one other updating solution in my question. It uses a stub loader, and an xml file to point to the latest executable.