Skip to content

Commit 9555f01

Browse files
committed
update: doc
1 parent a23cca3 commit 9555f01

File tree

5 files changed

+56
-6
lines changed

5 files changed

+56
-6
lines changed

src/Compress/CompressSample/CompressSample.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="GeneralUpdate.Core" Version="9.1.4" />
11+
<PackageReference Include="GeneralUpdate.Core" Version="9.1.5" />
1212
</ItemGroup>
1313

1414
</Project>
Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,28 @@
1-
using System.Text;
1+
using System.Diagnostics;
2+
using System.Text;
23
using GeneralUpdate.Common.Compress;
34
using GeneralUpdate.Common.Shared.Object;
45

56
var source = @"D:\packet\release";
6-
var target = @"D:\packet\1.zip";
7-
CompressProvider.Compress(Format.ZIP,source,target, false, Encoding.UTF8);
8-
CompressProvider.Decompress(Format.ZIP,target,source, Encoding.UTF8);
9-
Console.WriteLine($"Done {File.Exists(target)}");
7+
var target = @"D:\packet\update.zip";
8+
//CompressProvider.Compress(Format.ZIP,source,target, false, Encoding.UTF8);
9+
//CompressProvider.Decompress(Format.ZIP,target,source, Encoding.UTF8);
10+
Decompress(source, target);
11+
Console.WriteLine($"Done {File.Exists(target)}");
12+
13+
void Decompress(string source, string target)
14+
{
15+
try
16+
{
17+
//var zipFilePath = Path.Combine(_appPath, $"{version.PacketName}{Format.ZIP}");
18+
CompressProvider.Decompress(Format.ZIP, target, source, Encoding.UTF8);
19+
20+
if (!File.Exists(target)) return;
21+
File.SetAttributes(target, FileAttributes.Normal);
22+
File.Delete(target);
23+
}
24+
catch (Exception e)
25+
{
26+
Debug.WriteLine(e.Message);
27+
}
28+
}

website/docs/doc/GeneralClient.OSS.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,17 @@ public sealed class GeneralClientOSS
6464

6565
5. After the Upgrade completes, it starts the Client and self-closes. The update ends. Compared to the GeneralUpdateBootstrap function, the GeneralUpdateOSS function has a very low usage threshold. If the company does not have high requirements for automatic updates, this feature can be used. In summary, this function downloads the version.json and updates based on the content in the file, downloading each version's update package and extracting it to complete the update.
6666

67+
6. Since the OSS functionality does not include a blacklist mechanism, when creating the update.zip, please ensure that the files used internally by the following components are not added to the package, or directly release them as a single file to avoid occupying space and reducing update complexity.
68+
69+
70+
```json
71+
"Microsoft.Bcl.AsyncInterfaces.dll",
72+
"System.Collections.Immutable.dll",
73+
"System.IO.Pipelines.dll",
74+
"System.Text.Encodings.Web.dll",
75+
"System.Text.Json.dll"
76+
```
77+
6778

6879

6980
The following example defines methods, including the usage of GeneralClientOSS , GeneralUpdateOSS.

website/i18n/en/docusaurus-plugin-content-docs/current/docs/doc/GeneralClient.OSS.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,16 @@ public sealed class GeneralClientOSS
6464

6565
5. After the Upgrade completes, it starts the Client and self-closes. The update ends. Compared to the GeneralUpdateBootstrap function, the GeneralUpdateOSS function has a very low usage threshold. If the company does not have high requirements for automatic updates, this feature can be used. In summary, this function downloads the version.json and updates based on the content in the file, downloading each version's update package and extracting it to complete the update.
6666

67+
6. Since the OSS functionality does not include a blacklist mechanism, when creating the update.zip, please ensure that the files used internally by the following components are not added to the package, or directly release them as a single file to avoid occupying space and reducing update complexity.
68+
69+
```json
70+
"Microsoft.Bcl.AsyncInterfaces.dll",
71+
"System.Collections.Immutable.dll",
72+
"System.IO.Pipelines.dll",
73+
"System.Text.Encodings.Web.dll",
74+
"System.Text.Json.dll"
75+
```
76+
6777

6878

6979
The following example defines methods, including the usage of GeneralClientOSS , GeneralUpdateOSS.

website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/doc/GeneralClient.OSS.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,16 @@ public sealed class GeneralClientOSS
6464

6565
5.Upgrade更新完成之后把Client启动起来,自我关闭。更新结束。 GeneralUpdateOSS的功能和GeneralUpdateBootstrap功能对比来说,使用的门槛非常低如果公司对自动 更新的要求不高的话可以使用这个功能。一句话概括这个功能就是下载version.json根据文件里的内容去逐 版本下载更新包,下载下来之后直接解压更新就结束了。
6666

67+
6.由于OSS功能没有包含黑名单机制,制作update.zip时需要注意请勿将以下组件内部使用的文件添加到包内,或直接发布成single file避免占用降低更新复杂度。
68+
69+
```json
70+
"Microsoft.Bcl.AsyncInterfaces.dll",
71+
"System.Collections.Immutable.dll",
72+
"System.IO.Pipelines.dll",
73+
"System.Text.Encodings.Web.dll",
74+
"System.Text.Json.dll"
75+
```
76+
6777

6878

6979
以下示例定义方法,包含GeneralClientOSS、GeneralUpdateOSS 使用示例:

0 commit comments

Comments
 (0)