BITS 仍然是一种好的后台更新技术吗?
我的爱好应用程序之一使用 SQLite 后端来存储应用程序数据。 该应用程序经过设置,以便用户可以单击典型的“检查更新”按钮,该按钮将查询 Web 服务以查看是否有可用更新。 如果是,用户单击“更新”按钮并下载新数据库(通过 HTTP),然后将其安装在应用程序中。 此过程当前是“模式”的,因为在下载和安装完成之前用户无法在应用程序中执行任何其他操作。
我正在努力更新应用程序,我想要做的一件事是让此更新过程在幕后发生,例如 Windows 更新。 当应用程序启动时,将查询服务,如果有可用更新,则会自动下载更新,但在后台进行,以便用户可以继续完成他们的工作。 下载完成后,系统将提示用户安装更新。
我广泛研究了 BITS,并且尽管迄今为止我还没有看到任何 API 可以利用该技术,但我已经看到了一些示例代码,并相信我可以使其工作。
但这是实现数据库“后台更新”的最佳方法吗?还是还有其他解决方案/方法?
One of my hobby applications uses a SQLite back end to store the application data. The application is setup so that the user can click the typical "Check for Updates" button, which will query a webservice to see if an update is available. If it is, the user clicks the "update" button and downloads a the new database (via HTTP) which then gets installed in the application. This process is currently "modal" in that the user cannot do anything else in the application until the download and install are complete.
I'm working on updating the application, and one thing I want to make happen is to have this update process occur behind the scenes, ala Windows Update. When the application fires up, the service would be queried, and if an update is available, it would automatically be downloaded, but in the background so the user could continue to do their work. Once the download is complete, the user would be prompted to install the update.
I've looked extensively into BITS, and even though there are no APIs I've seen to date to leverage the technology, I have seen some sample code and believe I can make it work.
But is this the best away to approach a "background update" for a data library, or are there some other solutions/approaches out there?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您仅在 MS Windows 上运行,并且您的客户端正在使用足够新的操作系统版本来支持 BITS,那么我认为您当然应该利用平台中已经内置的功能,而不是像其他人那样做和编写您自己的后台更新检查器位于我的任务栏通知区域中,并且不必要地使用系统资源。
至于有关 BITS 的信息:
关于 BITS
BITS 参考
后台智能传输服务,来自维基百科
If you are only running on MS Windows, and your clients are using a new enough version of the operating system to support BITS, then I think certainly you should leverage the functionality already built into the platform, rather than doing what everyone else does and write your own background update checker that sits in my taskbar notification area and uses system resources unnecessarily.
As for information about BITS:
About BITS
BITS Reference
Background Intelligent Transfer Service, From Wikipedia
我是 Windows BITS 团队的 PM — 是的,当您需要以对用户友好的方式下载(或上传)数据时,BITS 技术非常适合很多时候。 BITS 会尽量小心占用网络带宽、当前电源状态和网络成本,并会在失败时自动重试下载。 我们还刚刚在 GitHub 上为所有使用 C# 编程的人创建了一个新的示例 BITS Manager 程序和.NET!
I'm the PM for the BITS team in Windows -- yes, the BITS technology is a good fit for lots of times when you need to download (or upload) data in a way that's friendly to the user. BITS tries to be careful about hogging network bandwidth, the current power status, and network costs, and will automatically retry downloads on failure. We've also just created a new sample BITS Manager program on GitHub for everyone who programs in C# and .NET!
这确实感觉您应该考虑同步框架 http://msdn.microsoft.com /en-us/sync/bb736753.aspx 而不是 BITS。
This really feels like you should be considering Sync Framework http://msdn.microsoft.com/en-us/sync/bb736753.aspx rather than BITS.