【问题标题】:ClickOnce background update + copy old user settings + delete old versionClickOnce后台更新+复制旧用户设置+删除旧版本
【发布时间】:2014-05-07 09:16:38
【问题描述】:

可能有人问过以下问题,如果是,请相应地指导我。

我有一个要求,我需要实现以下目标。

1. Check for new version of the application.
2. Download the latest version in a background mode without troubling the user current operation.
3. Prompt the user about the new version to "save the current work" and then exit and restart the application
4. After the application update is complete, remove the older version, but copy the old user settings file to the new version installed folder

对于#1、#2 和#3,我已经成功实现了我需要的参考:http://www.thejoyofcode.com/Taming_ClickOnce_ndash_taking_charge_of_updates.aspx

但是对于#4,我不确定如何继续。

【问题讨论】:

    标签: c# wpf visual-studio-2012 clickonce .net-4.5


    【解决方案1】:

    使用 ClickOnce,您的用户设置文件不会被删除,因此您无需管理版本文件夹或更改文件。 ClickOnce 已经为您做到了。

    但是,在某些情况下,您可能需要执行多项操作,例如更新本地数据库架构。如果是这样,您可以创建一个配置文件,其中包含启动时的最后一个应用程序版本号。应用程序启动后,检查当前版本是否与文件中的版本相同,如果是,则没有发生更新,如果没有,则应用程序已更新,因此您可以执行新版本 init 方法并更新应用程序版本文件。

    【讨论】:

      猜你喜欢
      • 2011-03-22
      • 2018-01-24
      • 1970-01-01
      • 2017-05-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-02-01
      相关资源
      最近更新 更多