install.ps1
Invokes PowerShell HTTP request cmdletInvokes PowerShell REST request cmdlet
SHA-2567938cb7e015df57a4430ba606ccf038ee2a9fb6dc4e7b23fdfcca31b39ffe8a5
Evidence
1# EOS CLI ���方安装脚本(Windows PowerShell)
2#
3# 用法:
4# irm https://cdn.jsdelivr.net/gh/eosaios/eos@main/scripts/install.ps1 | iex
5# .\install.ps1 -Version v1.0.0-beta.3
6#
7# 行为:GitHub Releases 拉取 windows 归档 → SHA256 校验 → ���装到
8# %LOCALAPPDATA%\Programs\eos(eos.exe + core\)→ 用户 PATH ���加该目录。
9# `eos update` ���后原地自升级。
10# ���口走 jsdelivr CDN:raw.githubusercontent.com ���国内网络不可达。
11
12param(
13 [string]$Version = "",
14 [ValidateSet("", "stable", "beta")][string]$Channel = "",
15 [switch]$ResolveOnly,
16 [switch]$NoPathUpdate,
17 [string]$InstallDir = ""
18)
19
20$ErrorActionPreference = "Stop"
21# Windows PowerShell 5.1 下 IWR ���染进度条会把大文件下载拖慢 10 ���以上
22$ProgressPreference = "SilentlyContinue"
23$Repo = "eosaios/eos"
24
25if (-not $InstallDir) {
26 $InstallDir = Join-Path $env:LOCALAPPDATA "Programs\eos"
27}
28
29$Arch = switch ($env:PROCESSOR_ARCHITECTURE) {
30 "ARM64" { "arm64" }
31 default { "amd64" }
32}
33
34function Get …
43:14… ctual
44}
45function Get-ReleaseMetadata([string]$Url) {
46 return Invoke-RestMethod -Uri $Url -Headers @{ 'User-Agent' = 'EOS-Install'; 'Accept' = 'application/vnd.github+json' } -TimeoutSec 30
47}
48
49try {
50 if ($InstallDir.Replace('\', '/').ToLower() -match '/(cellar|homebrew/caskroom|scoop/ap …
53:5… $markerPath = Join-Path $InstallDir 'eos-install.json'
54 if (Test-Path $markerPath) {
55 $installed = Get-Content $markerPath -Raw | ConvertFrom-Json
56 if ($installed.channel -notin @('stable', 'beta') -or $installed.method -notin @('script', 'archive' …
57:109… ��管���器更新' }
58 if (-not $Channel -and -not $Version) { $Channel = $installed.channel }
59 }
60 $installedExe = Join-Path $InstallDir 'eos.exe'
61 if (-not $Channel -and -not $Version -and (Test-Path $installedExe)) {
62 $installedVersion = (& $installedExe version …
64:10… Channel = Get-EosChannel $installedVersion[1]
65 }
66 $api = "https://api.github.com/repos/$Repo/releases"
67 if ($Version) {
68 $Version = 'v' + $Version.TrimStart('v')
69 $release = Get-ReleaseMetadata "$ap …