-1

我想在我的应用程序中包含一个软件更新,该更新将检查共享位置或 URL,例如来自 Google Drive 的共享 URL,它将替换旧的 .exe 和配置文件。如果有新的更新可用,那么用户应该收到通知等。有人可以指导我如何实现这一点或者这是否可行?

4

1 回答 1

3

这是完全可行的。

有一个名为 ClickOnce 的解决方案可以在每次启动时检查更新。

另一种方法是让另一个程序成为您的更新程序,因为 Windows 不允许您覆盖打开的文件(主程序可以更新更新程序)

但是,我建议使用 dropbox 的公用文件夹来托管您的文件,它比 Gdrive 恕我直言有几个优点(直接下载链接(GDrive 共享链接重定向到下载页面,GDrive 主机 URL 不报告下载的文件大小))

编辑:要将 ClickOnce 与 Dropbox 的公用文件夹一起使用,请按照以下步骤操作:

(我假设您安装了 Dropbox 同步客户端)

1. (not mandatory if you plan to host only one project) create a subfolder in your dropbox public folder :)
2. Open your project's properties go in the "Properties tab"
3. The first box is where you will publish your application (select the folder created in 1)
4. The second box is where the installer/updater will fetch the files, this one is a little trickier.
  4.1. Create a file in the folder created in 1
  4.2. Wait for it to be synchronised... Right-click on it, then click on "Copy public link"
  4.3. Paste the link in the second box (back in VS)
  4.4. Remove the file name from the path you just pasted 
5. Click on the "Updates" button then tick the checkbox "THe application must check for updates" then choose if you want the updates to be downloaded before or after the application launch.

这就是基本配置。

还有其他可能性,但这不是这里的主题:)

于 2015-04-29T17:05:05.593 回答