Gethを確認画面なしでインストール・アンインストールし、展開ツールで検出するためのコマンドです。マニフェストの記載か、インストーラー技術の既定値として確実なコマンドだけを表示しています。
関連ガイド: サイレントインストールのオプション一覧 · レジストリとPowerShellでアンインストールする方法
wingetを使う
PowerShell
winget install --id Ethereum.geth -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id Ethereum.geth -e --silentwinget uninstall --id Ethereum.geth -e --silentインストーラー別
64ビット · EXE(NSIS) · すべてのユーザー
サイレントインストール
geth-windows-amd64-1.17.10-1df30b18.exe /Sインストール先を指定
geth-windows-amd64-1.17.10-1df30b18.exe /S /D=C:\Apps\geth- アンインストール用レジストリキー
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Ethereum Geth
- DisplayVersion
- 1.17.10-1df30b18
PowerShell:ダウンロード・検証・インストール
公式ファイルをダウンロードし、SHA256を検証してからサイレントインストールします。
install-geth.ps1
$url = 'https://gethstore.blob.core.windows.net/builds/geth-windows-amd64-1.17.10-1df30b18.exe'
$sha256 = '717C8133ABB857B891AFC4BD7BC408599EBB2310E9A7BCEF7C460B0D236CCAD8'
$file = Join-Path $env:TEMP 'geth-windows-amd64-1.17.10-1df30b18.exe'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process -FilePath $file -ArgumentList '/S' -Wait