如何最好地在 Windows 上实施软件更新?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/37030/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 11:08:02  来源:igfitidea点击:

How to best implement software updates on windows?

windowsinstallation

提问by dF.

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 NSISfor my installers).

我想为 Windows 应用程序实现一个“自动更新”系统。现在我正在半手动创建一个“appcast”,我的程序会检查它,并通知用户有新版本可用。(我的安装程序使用 NSIS)。

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

是否有我可以使用的软件来处理更新的“自动”部分,可能类似于 Mac 上的Sparkle?我应该注意的任何问题/陷阱?

采纳答案by S?ren Kuklau

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

没有比 Sparkle 更流畅的解决方案(据我所知)。

If you need an easy means of deployment and updating applications, ClickOnceis 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).

如果您需要一种简单的部署和更新应用程序的方法,ClickOnce是一个选择。不幸的是,它是不灵活的(例如,没有按机器安装而不是按用户安装)、不透明(您对其部署的实际工作方式几乎没有影响、清晰和控制)和非标准(它存储已安装应用程序的路径)不同于 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.

更接近您所问的是ClickThrough,这是WiX 的一个副项目,但我不确定它是否仍在开发中(如果是,他们应该更清楚……) - 无论如何它都会使用 MSI ,不是 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.

你可能最好自己滚动一些东西。我很想看到一个类似 Sparkle 的 Windows 项目,但到目前为止似乎没有人试过它。

回答by Václav Slavík

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

现在有 Sparkle 的 Windows 端口,请参阅http://winsparkle.org

回答by Mark

Google Chrome auto-update is based on Omaha:

Google Chrome 自动更新基于 Omaha:

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

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

Their overviewhas 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

浏览器通常会通过一长串技术性的、令人困惑的和可怕的对话提示用户,所有这些对话都试图说服用户不要安装。然后,用户会收到一个向导提示,其中充满了他们不需要或不知道如何在其中做出决定的选项。这些因素结合在一起,形成了糟糕的用户体验和应用安装过程中的大量流失

回答by LoneRanger

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.

使用第三方解决方案是个好主意,因为自动更新可能很麻烦,尤其是在 Windows Vista/7 (UAC) 中。就其价值而言,我公司使用的产品是AutoUpdate+,它似乎运行良好。

回答by Jeremy McGee

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.

对于 .NET,不久前 Microsoft Patterns + Practices 发布了Application Updater Block。这(在我看来)相当夸张和过度设计,但做得很好。

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.

本质上,它使用一个“存根加载器”来检查清单和一个 Web 服务,以查看是否有比安装的程序版本更高的程序可用,然后使用 BITS 后台下载器技术下载新版本(如果可用)服务器。

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.

下载并安装新版本后(使用 .NET,这就像将 xcopy 复制到相关文件夹一样简单),应用程序将更新清单。下次加载程序时,将启动新版本。

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.

虽然 Patterns + Practices 代码是特定于 .NET 的,但对于非 .NET 应用程序,没有什么是不能复制的,尤其是当您能够在后台静默运行安装过程时。

回答by yarone

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

wyUpdate 看起来很不错。在此处查看视频:http: //wyday.com/wybuild/help/automatic-updates/

回答by tbreffni

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.

如果您的应用程序是用 .Net 编写的,您可以尝试ClickOnce。但是,使用这种方法在安装期间很难执行管理或自定义操作。

回答by Helge Klein

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.

对于 .NET 应用程序,您可能需要查看NetSparkle,它是 .NET 程序的 Sparkle 变体。它是相当新的(从 2011 年开始)并且正在积极发展。

回答by Dave Arkell

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

刚刚从我自己关于同一主题的问题的答案来到这里 - 我在我的问题中提到了另一个更新解决方案。它使用一个存根加载器和一个 xml 文件来指向最新的可执行文件。