gnuplotを確認画面なしでインストール・アンインストールし、展開ツールで検出するためのコマンドです。マニフェストの記載か、インストーラー技術の既定値として確実なコマンドだけを表示しています。
関連ガイド: サイレントインストールのオプション一覧 · レジストリとPowerShellでアンインストールする方法
wingetを使う
PowerShell
winget install --id gnuplot.gnuplot -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id gnuplot.gnuplot -e --silentwinget uninstall --id gnuplot.gnuplot -e --silentインストーラー別
64ビット · EXE(Inno Setup) · すべてのユーザー · en-US
サイレントインストール
download /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-インストール先を指定
download /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP- /DIR="C:\Apps\gnuplot"- アンインストール用レジストリキー
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{AB419AC3-9BC1-4EC5-A75B-4D8870DD651F}_is1
PowerShell:ダウンロード・検証・インストール
公式ファイルをダウンロードし、SHA256を検証してからサイレントインストールします。
install-gnuplot.ps1
$url = 'https://sourceforge.net/projects/gnuplot/files/gnuplot/6.0.4/gp604-win64-clang.exe/download'
$sha256 = '2C31E3FC91B21C450F4B015F1CD1F2F84F7A8CFC63AFC037F9BA5EFB47CC0C23'
$file = Join-Path $env:TEMP 'download'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process -FilePath $file -ArgumentList '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-' -Wait