用于免交互安装gnuplot、卸载以及在部署工具中检测安装状态的命令。只列出确定可用的命令:来自清单文件,或来自安装程序技术的官方默认参数。
相关教程: 静默安装参数大全:MSI、NSIS、Inno Setup · 用注册表或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