Arduino CLIを確認画面なしでインストール・アンインストールし、展開ツールで検出するためのコマンドです。マニフェストの記載か、インストーラー技術の既定値として確実なコマンドだけを表示しています。
関連ガイド: サイレントインストールのオプション一覧 · レジストリとPowerShellでアンインストールする方法
wingetを使う
PowerShell
winget install --id ArduinoSA.CLI -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id ArduinoSA.CLI -e --silentwinget uninstall --id ArduinoSA.CLI -e --silentインストーラー別
64ビット · MSI · すべてのユーザー · en-US
サイレントインストール
msiexec /i arduino-cli_1.6.0_Windows_64bit.msi /qn /norestartログを出力
msiexec /i arduino-cli_1.6.0_Windows_64bit.msi /qn /norestart /l*v "%TEMP%\arduino-cli-install.log"アンインストール
msiexec /x {7D561C01-58C7-4C5B-ADE0-A1004F13FBB1} /qn /norestart- MSIプロダクトコード
- {7D561C01-58C7-4C5B-ADE0-A1004F13FBB1}
- アンインストール用レジストリキー
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{7D561C01-58C7-4C5B-ADE0-A1004F13FBB1}
- UpgradeCode
- {96AEA20C-2FB2-431D-87A4-D7A6E57F70B7}
- インストール先フォルダー
- %ProgramFiles%/Arduino CLI
PowerShell:ダウンロード・検証・インストール
公式ファイルをダウンロードし、SHA256を検証してからサイレントインストールします。
install-arduino-cli.ps1
$url = 'https://github.com/arduino/arduino-cli/releases/download/v1.6.0/arduino-cli_1.6.0_Windows_64bit.msi'
$sha256 = 'FE89BCFBBFE30A9F179CB6FD0FB4A9EBD2FB6D1F57348D8F7C37E8C16C6118B6'
$file = Join-Path $env:TEMP 'arduino-cli_1.6.0_Windows_64bit.msi'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process msiexec.exe -ArgumentList '/i', ('"{0}"' -f $file), '/qn', '/norestart' -Wait