Update 2.4.7

dotnet add package Update --version 2.4.7
NuGet\Install-Package Update -Version 2.4.7
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Update" Version="2.4.7" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Update --version 2.4.7
#r "nuget: Update, 2.4.7"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Update as a Cake Addin
#addin nuget:?package=Update&version=2.4.7

// Install Update as a Cake Tool
#tool nuget:?package=Update&version=2.4.7

Update

编译

  • 默认支持 .Net4.0 。
  • 静态导入了 fy_directui(UI) 和 SharpCompress(解压) 库 。

Debug

  • 仅用来调试,无法实现自更新。
  • 调试时,更新目标位于 _Output\Debug\Test 目录下 。

Release

  • 发布版本,可以实现自更新。
  • 一般由主程序检测到可用更新后,启动更新程序并将主程序自身的启动路径作为第一个参数传递给更新程序。

部署目录

  • 服务端要求使用 packages.txt 存放更新包列表。
  • packages.txt 文件跟更新包文件夹必须为同一文件夹。

更新包格式

  • 更新包为单文件压缩包,支持格式由 SharpCompress 库决定。主要有:zip、rar、7z、gz 等。
  • 更新包必须包含新版的主程序,否则会出现循环更新的情况。
  • 实际部署的时候扩展名可以带也可不带。如果带扩展名,扩展名不能为纯数字。否则会当作版本号,导致解析错误。
  • 压缩时不要在外层嵌套文件夹,直接选中要更新的多个文件压缩即可。
  • 更新程序可自更新,所以更新程序可也压缩到更新包中。
  • 更新包内顶层目录中 delete.txt 可指定要删除的过时文件或目录,每行一个,使用相对路径。

更新包命名

增量更新包
格式:<FROM>_[to_]<TO>[.EXT | _EXT]
  • <> 表示必选项。[] 表示可选项。
  • [.EXT | _EXT] 表示一串用 '.' 或 '__' 连接的字符串,每个子串不能为纯数字。

正确:

1.0.0_1.0.1
1.0.0_to_1.0.1
1.0.0_1.0.1.7z
1.0.0_1.0.1.a1.7z
1.0.0_1.0.1_a1_zip

错误:

1.0.0-1.1.1                 //版本分割符为半角 ‘_’
1.0.0_1.1.1.zip.77          //[.EXT | _EXT] 有一段为纯数字
1.0.0_1.1.1.zip_77_7z       //同上

推荐:

1.0.0.0_to_1.0.0.1.rar
1.0.0.0_to_1.0.0.1_diff.rar
全量更新包
格式:<TO>[.EXT | _EXT]
  • 要求同增量更新包。

正确:

1.0.1
_1.0.1.7z
1.0.1.a1.7z
1.0.1_a1_zip

错误:

-1.1.1                //版本分割符为半角 ‘_’
1.1.1.zip.77          //[.EXT | _EXT] 有一段为纯数字
1.1.1.zip_77_7z       //同上

推荐:

1.0.0.1.rar
1.0.0.1_full.rar

packages.txt 内容

  • 每行一个更新包文件名,必须完全一致,包含扩展名,区分大小写。
  • 可以存在空行,空行会被自动忽略。
  • 顺序无关,可随意排序。

正确

1.0.0.1_to_1.0.2.rar
1.0.0.0_to_1.0.1_diff.zip

更新顺序

  • 先查找最新的全量包,如果 TO 比当前版本高,则先下载该包,然后逐个增量包开始更新。
  • 如果没有可用的全量包,则直接逐个增量包开始更新。

注意事项

  • 增量更新包 FROM 必须唯一,但 TO 可以有多个。
  • 全量更新包 TO 必须唯一。
  • 增量包和全量包之间互不影响。

正确:

1.0.0.0_to_1.0.3_diff.zip
1.0.0.1_to_1.0.3.rar

错误:

1.0.0.1_to_1.0.3_diff.zip   //增量 FROM 重复
1.0.0.1_to_1.0.2.rar

错误:

1.0.3_full.zip              //全量 TO 重复
1.0.3.7z
Product Compatible and additional computed target framework versions.
.NET Framework net40 is compatible.  net403 was computed.  net45 was computed.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.4.7 4,585 10/9/2018
2.4.5 2,669 3/31/2017
2.4.4 1,176 3/1/2017
2.4.3 1,130 1/23/2017
2.4.2 1,108 1/5/2017
2.4.1 1,069 12/28/2016
2.4.0 1,235 12/9/2016