NewLife/LuckyClover

幸运四叶草,无依赖编译为linux-arm/linux-x86/windows,用于自动安装主流.NET运行时。
Detail
Zip
Compare
Readme.MD
## 幸运四叶草 LuckyClover 基于低版本运行时,自动安装主流.NET运行时。 ## .NET版本识别 各种版本.NET运行时的识别方式。 ### 安装策略 只安装**最新补丁版本**的长期支持(LTS)通道,以及最新的未过期标准支持(STS)通道。跨版本原地升级,已安装更高补丁时不再重复安装。 | 通道 | 版本 | 类型 | 默认场景 | | --- | --- | --- | --- | | .NET 6 | 6.0.36 | LTS | Win7 SP1 / Win8.1 首选 | | .NET 8 | 8.0.33 | LTS | 手动指定 | | .NET 10 | 10.0.14 | LTS | Win10 1607+ / Win11 / Server 2016+ 首选 | | .NET 11 | 11.0.0 | STS | 手动指定 | 已过期通道(如 .NET 7、.NET 9)不再提供安装入口;`Scripts` 目录中的历史安装脚本保留,仅供特定环境使用。 ### NET45以下 读取 `HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP` 下的 `Install` 值,逐个子键判断 1.0/1.1/2.0/3.0/3.5 是否安装;.NET 3.5 已安装时视为提供 2.0 运行时。 ### NET45以上 读取 `HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full` 的 `Release` 数值,按官方阈值映射版本(4.5=378389,4.5.2=379893,4.6.2=394802,4.7.2=461808,4.8=528040,4.8.1=533320)。 ### NETCore 扫描 `%ProgramFiles%\dotnet\shared\Microsoft.NETCore.App` 等目录,取指定主版本的最高已安装版本;目录不存在时回退 `dotnet --list-runtimes`。 ## 安装器用法 ### clover(.NET 版,支持 Windows 与 Linux) ```bash clover # 按操作系统自动选择 clover net10 # 安装 .NET 10 最新补丁 clover net10-aspnet # 安装 ASP.NET Core 运行时 clover net10-desktop # 安装 Windows 桌面运行时 clover net10-host # 安装托管捆绑包 clover net6|net8|net11 # 其它通道,同样支持 -desktop/-aspnet/-host clover net20|net40|net45|net48 # .NET Framework clover md5 [pattern] # 生成目录内文件的 MD5 ``` 支持 `-silent` 静默安装、`-force` 强制安装;`server.txt` 或命令行 URL 可指定下载源。 ### clover.exe(C++ 版,Windows XP 及以上) ```bat clover.exe :: 按操作系统自动选择 clover.exe list :: 查看已安装版本与自动安装计划 clover.exe net6|net8|net10|net11 :: 安装指定核心运行时 clover.exe net20|net40|net45|net48 clover.exe all :: 安装当前系统支持的全部运行时 ``` 支持 `-silent`、`-force`(忽略系统支持性检查)、`-dryrun`(只打印计划)、`-server <url>`。 ### 自动安装矩阵 | 操作系统 | 自动安装 | | --- | --- | | Windows 2000/XP/2003 | net20 + net40 | | Vista / Server 2008 | net45(4.5.2) | | Win7 SP1 / Server 2008 R2 SP1 | net48 + net6 | | Win8 / 8.1 / Server 2012 / 2012 R2 | net48 + net6 | | Win10 1607+ / Win11 / Server 2016+ | net48(4.8.1)+ net10 | .NET 8/10/11 在 Win7/8.x 上不受官方支持,需 `-force` 才会尝试;Win7 安装 .NET 6 前会自动安装 KB3063858(UCRT)与 VC++ 运行时。 > 版本号在 `Shared/NetVersions.cs` 与 `Clover/Clover.cpp` 中维护,升级版本时必须同步修改这两处。 ## 生态版图 NewLife 生态按依赖分层,各项目独立版本、独立发版。下面的版图在所有 NewLife 仓库中逐字一致;每个项目链接到代码仓库与主 NuGet 包。 | 项目 | 一句话定位 | 下载量 | | --- | --- | --- | | **基础底座** | | | | [NewLife.Core](https://github.com/NewLifeX/X) | 日志、配置、缓存、网络、序列化、定时调度与 APM 追踪。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.Core?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.Core) | | [NewLife.XCode](https://github.com/NewLifeX/NewLife.XCode) | 数据中间件:单表百亿级、自动分表、读写分离,支持 10 多种数据库。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.XCode?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.XCode) | | [NewLife.Net](https://github.com/NewLifeX/NewLife.Net) | 高性能网络库:单机 177 万 pps、14.5 Gbps(TCP 1KB,2026-10 实测),400 万 Tcp 长连接。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.Net?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.Net) | | [NewLife.Remoting](https://github.com/NewLifeX/NewLife.Remoting) | 协议通信与 RPC 框架,面向 CS 应用与物联网设备。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.Remoting?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.Remoting) | | [NewLife.Agent](https://github.com/NewLifeX/NewLife.Agent) | 把 .NET 应用安装为操作系统守护进程:Windows 服务与 Linux systemd。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.Agent?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.Agent) | | [NewLife.Templates](https://github.com/NewLifeX/NewLife.Zero) | `dotnet new` 项目模板:控制台、Web、WebApi、服务、数据与物联网。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.Templates?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.Templates) | | **数据存储与消息** | | | | [NewLife.Redis](https://github.com/NewLifeX/NewLife.Redis) | Redis 客户端:微秒级延迟、百万级吞吐,内置消息队列。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.Redis?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.Redis) | | [NewLife.RocketMQ](https://github.com/NewLifeX/NewLife.RocketMQ) | 纯托管 RocketMQ 客户端,支持 Apache RocketMQ 与阿里云消息队列。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.RocketMQ?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.RocketMQ) | | [NewLife.MQTT](https://github.com/NewLifeX/NewLife.MQTT) | MQTT 客户端与服务端,客户端支持阿里云物联网。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.MQTT?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.MQTT) | | [NewLife.NovaDb](https://github.com/NewLifeX/NewLife.NovaDb) | C# 混合数据库:嵌入/网络双模,关系型、时序、消息队列与 KV 于一体。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.NovaDb?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.NovaDb) | | [NewLife.MySql](https://github.com/NewLifeX/NewLife.MySql) | MySql 驱动与数据访问辅助层,基于 NewLife 数据栈实现。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.MySql?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.MySql) | | **Web、AI 与分布式** | | | | [NewLife.Cube](https://github.com/NewLifeX/NewLife.Cube) | 魔方快速开发平台:用户权限、SSO、OAuth 服务端与 CRUD 脚手架。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.Cube?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.Cube) | | [Stardust](https://github.com/NewLifeX/Stardust) | 星尘分布式服务平台:节点管理、APM、配置中心、注册中心与发布中心。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.Stardust?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.Stardust) | | [AntJob](https://github.com/NewLifeX/AntJob) | 蚂蚁调度:分布式任务与实时数据平台,支持分片、重试与回溯补算。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.AntJob?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.AntJob) | | [NewLife.AI](https://github.com/NewLifeX/NewLife.AI) | 统一接入 46 家大模型服务商,附带开箱即用的 ChatAI Web 对话应用。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.AI?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.AI) | | **工业与物联网** | | | | [NewLife.IoT](https://github.com/NewLifeX/NewLife.IoT) | IoT 标准库,定义物联网通信协议契约与设备抽象。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.IoT?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.IoT) | | [NewLife.Modbus](https://github.com/NewLifeX/NewLife.Modbus) | Modbus TCP/RTU/ASCII,基于 NewLife.IoT 实现。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.Modbus?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.Modbus) | | [NewLife.Siemens](https://github.com/NewLifeX/NewLife.Siemens) | 西门子 PLC 协议,基于 NewLife.IoT 实现。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.Siemens?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.Siemens) | | [NewLife.Omron](https://github.com/NewLifeX/NewLife.Omron) | 欧姆龙 PLC 协议,基于 NewLife.IoT 实现。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.Omron?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.Omron) | | [NewLife.Melsec](https://github.com/NewLifeX/NewLife.Melsec) | 三菱 Melsec PLC 协议,基于 NewLife.IoT 实现。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.Melsec?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.Melsec) | | [NewLife.OPC](https://github.com/NewLifeX/NewLife.OPC) | OPC 客户端,用于工业数据采集。 | — | | [NewLife.BACnet](https://github.com/NewLifeX/NewLife.BACnet) | BACnet 楼宇自控协议栈。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.BACnet?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.BACnet) | | [ZeroIoT](https://github.com/NewLifeX/ZeroIoT) | 开源轻量级 IoT 平台,含网关与设备管理。 | — | | **车联网** | | | | [NewLife.JT808](https://github.com/NewLifeX/NewLife.JT808) | JT/T 808 车辆定位协议:70+ 消息体,覆盖 2011/2013/2019 三个版本。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.JT808?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.JT808) | | [NewLife.JT809](https://github.com/NewLifeX/NewLife.JT809) | JT/T 809 部标平台互联协议,面向运输管理部门。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.JT809?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.JT809) | | [NewLife.JT1078](https://github.com/NewLifeX/NewLife.JT1078) | JT/T 1078 车载视频:RTP 解析、FLV/fMP4 转封装与直播推送。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.JT1078?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.JT1078) | | **领域组件** | | | | [NewLife.Office](https://github.com/NewLifeX/NewLife.Office) | 一个包覆盖 Excel、Word、PPT、PDF 等 15+ 文档格式。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.Office?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.Office) | | [NewLife.Audio](https://github.com/NewLifeX/NewLife.Audio) | 跨平台音频:编解码、设备 IO、DSP、容器与流式处理。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.Audio?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.Audio) | | [NewLife.Video](https://github.com/NewLifeX/NewLife.Video) | 视频编解码、封装格式、帧处理与流媒体。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.Video?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.Video) | | [NewLife.Map](https://github.com/NewLifeX/NewLife.Map) | 百度/高德/腾讯/天地图统一接口,支持地理编码与坐标转换。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.Map?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.Map) | | [NewLife.IP](https://github.com/NewLifeX/NewLife.IP) | IPv4 归属地:离线内存映射库 + 在线 API 双源。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.IP?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.IP) | | **工具与产品** | | | | [CrazyCoder](https://github.com/NewLifeX/XCoder) | 码神工具:网络、串口、加解密、正则、Modbus 与 MQTT。 | [![NuGet](https://img.shields.io/nuget/dt/NewLife.XCoder?style=flat-square&logo=nuget&label=downloads)](https://www.nuget.org/packages/NewLife.XCoder) | | [GitCandy](https://github.com/NewLifeX/GitCandy) | 自托管 Git 源代码管理系统。 | — | | [LuckyClover](https://github.com/NewLifeX/LuckyClover) | 从低版本宿主启动时,自动安装匹配的 .NET 运行时。 | — | > 徽章取各项目主包;主题包、扩展包与卫星包见对应 NuGet 页面。未在表中列出的 30 多个包(FTP、LoRa、Office 扩展、各类协议驱动等)见 [NewLifeX 组织](https://github.com/NewLifeX) 与 [newlifex.com](https://newlifex.com)。 ## 新生命开发团队 <img src="https://newlifex.com/logo.png" width="48" align="right" alt="NewLife" /> 新生命团队成立于 2002 年,二十余年专注 .NET 与物联网技术生态,主导开源项目近百个(生态版图收录 34 个主干项目),为电力、物流、医疗、工控、互联网等行业提供软硬件一体化解决方案;以“学无先后达者为师”为信条。 开源组件在 NuGet 累计下载 <!--nuget-total:start-->6.48M<!--nuget-total:end--> 次(全生态口径,截至 2026-10)。 网站:https://newlifex.com · 开源组织:https://github.com/NewLifeX <details> <summary>微信公众号:智能大石头(扫码关注)</summary> ![智能大石头](https://newlifex.com/stone.jpg) </details>