windows 软件自动更新

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5130765/
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 16:17:39  来源:igfitidea点击:

Software Auto Update

c#sql-serverwindowsauto-update

提问by CharithJ

We are developing a Windows based application in C#. I want to provide auto updates for the software. In fact, once the user run the program it should be able to notify the user that it is going to get the latest version from the server. We have created our setup by using Visual Studio setup creator. Then the software can capture if there is any updated version. We are providing support for all our users and we update their servers if there is any updates from our side. If there is any update we can update an entry in the user's database. My question now is, where should I store the latest updates for users.

我们正在用 C# 开发一个基于 Windows 的应用程序。我想为软件提供自动更新。事实上,一旦用户运行程序,它应该能够通知用户它将从服务器获取最新版本。我们已经使用 Visual Studio 安装程序创建器创建了我们的安装程序。然后软件可以捕获是否有任何更新版本。我们为所有用户提供支持,如果我们这边有任何更新,我们会更新他们的服务器。如果有任何更新,我们可以更新用户数据库中的条目。我现在的问题是,我应该在哪里存储用户的最新更新。

My intial approach was to store the updated setup files in a shared folder in their server. But our company has had a lot of troubles with that approach in the past. So, I had to given up that approach. What I am thinking now is to upload the executables in the SQL Server. Our setup file is 60Mb at the moment but it can be increased over 100Mb some time in future. What do you think? Would it be a feasible solution? Do you have any better ideas?

我最初的方法是将更新的安装文件存储在他们服务器的共享文件夹中。但是我们公司过去在这种方法上遇到了很多麻烦。所以,我不得不放弃这种方法。我现在在想的是在 SQL Server 中上传可执行文件。我们的安装文件目前是 60Mb,但将来可以增加到 100Mb 以上。你怎么认为?这会是一个可行的解决方案吗?你有什么更好的想法吗?

回答by cubski

Try NetSparkle. Its an easy-to-use software update framework for .NET developers.

试试NetSparkle。它是一个易于使用的软件更新框架,适用于 .NET 开发人员。

回答by Philip Rieck

It's very hard to give any meaningful answer without knowing whyyou don't like clickonce. Personally, I find that while clickonce isn't great for all deployments, it is very good for many - and in many cases it isn't adopted because developers don't know how to configure for it or get the most from it.

在不知道为什么不喜欢 clickonce 的情况下,很难给出任何有意义的答案。就我个人而言,我发现虽然 clickonce 并不适用于所有部署,但它对许多部署都非常有用 - 在许多情况下它没有被采用,因为开发人员不知道如何对其进行配置或从中获得最大收益。

If you really can't use clickonce, take a look at Google's project omaha, which is a neat auto-updater that is already installed on any windows machine running Chrome.

如果您真的无法使用 clickonce,请查看 Google 的项目 omaha,这是一个简洁的自动更新程序,已安装在任何运行 Chrome 的 Windows 机器上。

And finally, if you are going to roll your own, I would probably not suggest storing it in SQL Server without first checking to see how this would affect your backup and replication strategies, at the least. I don't really see what advantage you would get over a HTTP, UNC, FTP, or similar storage area.

最后,如果您打算自己推出,我可能不建议将其存储在 SQL Server 中,除非首先检查这至少会如何影响您的备份和复制策略。我真的看不出相比 HTTP、UNC、FTP 或类似的存储区域会有什么优势。

回答by Steve

Don't store a large executable in the database.

不要在数据库中存储大型可执行文件。

I'm sure you could find a pre-build solution, but if you are determined to write it on your own, you might consider simply storing a URL pointing to the latest version, on a server you deploy. The update software on the client would simply authenticate with that server, download the new version and then install it.

我相信您可以找到预构建解决方案,但如果您决定自己编写它,您可能会考虑简单地将指向最新版本的 URL 存储在您部署的服务器上。客户端上的更新软件将简单地与该服务器进行身份验证,下载新版本然后安装它。