Skip to content

Latest commit

 

History

History
74 lines (67 loc) · 1.8 KB

v2.1_to_v2.2.md

File metadata and controls

74 lines (67 loc) · 1.8 KB

🫥为了提高组件的扩展性,因此重新设计了调用接口。大家可以参考一下方式进行升级🫥

本来想要保留原有接口(按照过时处理),但是想想这个升级只是调整了调用方式,核心并没有改变,因此直接删除了原有接口。

👾 升级方法

  1. 🤖 HTTP 更新方式
  • 🟠 v2.1.x版本
App oldApp = AutoUpgradeFactory.Create();
oldApp.UseHttpMode("url");
oldApp.Run();
// or
// await oldApp.RunAsync();
  • 🟢 v2.2.x 及以后
IUpgradeApp newApp = UpgradeFactory.CreateHttpApp("url");
newApp.Run();
// or
// await newApp.RunAsync();
  1. 👻 FTP 更新方式
  • 🟠 v2.1.x版本
App oldApp = AutoUpgradeFactory.Create();
oldApp.UseFtpMode("path","username","password");
oldApp.Run();
// or
// await oldApp.RunAsync();
  • 🟢 v2.2.x 及以后
IUpgradeApp newApp = UpgradeFactory.CreateFtpApp("path", "username", "password");
newApp.Run();
// or
// await newApp.RunAsync();
  1. 🥷 自定义配置
  • 🟠 v2.1.x版本
App oldApp = AutoUpgradeFactory.Create().UseHttpMode("url");
// 直接配置参数
oldApp.SetUpgrade(config =>
{
    config.IconPath = "path";
    config.TimeoutSecond = 60;
    config.IsBackgroundCheck = true;
    config.IsCheckSign = true;
    config.Theme = ThemeEnum.System;
    config.Lang = "zh";
    config.VersionFormat = VersionFormatEnum.MajorMinorBuild;
});

await oldApp.RunAsync();
  • 🟢 v2.2.x 及以后
await UpgradeFactory.CreateHttpApp("url")
    .SetUpgrade(builder =>
    {
        builder.WithIcon("path")
        .WithTimeout(60)
        .WithBackgroundCheck(true)
        .WithSignCheck(true)
        .WithTheme(ThemeEnum.System)
        .WithLang("zh")
        .WithVersionFormat(VersionFormatEnum.MajorMinorBuild);
    })
    .RunAsync();