用于免交互安装winpython、卸载以及在部署工具中检测安装状态的命令。只列出确定可用的命令:来自清单文件,或来自安装程序技术的官方默认参数。
相关教程: 静默安装参数大全:MSI、NSIS、Inno Setup · 用注册表或PowerShell卸载程序
使用winget
PowerShell
winget install --id winpython.winpython -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id winpython.winpython -e --silentwinget uninstall --id winpython.winpython -e --silent按安装包
32位 · EXE
静默安装
Winpython64-3.12.0.1dotb5.exe -y -o".\winpython"PowerShell:下载、校验、安装
下载官方文件,校验SHA256后静默安装。
install-winpython.ps1
$url = 'https://github.com/winpython/winpython/releases/download/7.0.20231126final/Winpython64-3.12.0.1dotb5.exe'
$sha256 = '2AFFFD563B0FC5C7A49B3A3D3500A9A624E4E03FE8B616CAE808027916BABCB3'
$file = Join-Path $env:TEMP 'Winpython64-3.12.0.1dotb5.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 '-y -o".\winpython"' -Wait