免互動安裝QuPath、解除安裝,以及在部署工具中偵測安裝狀態所用的指令。只列出確定可用的指令:來自資訊清單,或是安裝程式技術的官方預設參數。
相關教學: 靜默安裝參數總整理:MSI、NSIS、Inno Setup · 用登錄檔或PowerShell解除安裝程式
使用winget
PowerShell
winget install --id UniversityOfEdinburgh.QuPath -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id UniversityOfEdinburgh.QuPath -e --silentwinget uninstall --id UniversityOfEdinburgh.QuPath -e --silent依安裝檔
64位元 · MSI · 僅目前使用者 · en-US
靜默安裝
msiexec /i QuPath-v0.7.0-Windows.msi /qn /norestart寫入記錄檔
msiexec /i QuPath-v0.7.0-Windows.msi /qn /norestart /l*v "%TEMP%\qupath-install.log"解除安裝
msiexec /x {2D29F351-33F1-318E-9A68-9C925969A070} /qn /norestart- MSI產品代碼
- {2D29F351-33F1-318E-9A68-9C925969A070}
- 解除安裝登錄機碼
- HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{2D29F351-33F1-318E-9A68-9C925969A070}
- UpgradeCode
- {3D26AFDD-75FD-3065-B7C3-F8526C07DCD3}
PowerShell:下載、驗證、安裝
下載官方檔案,驗證SHA256後靜默安裝。
install-qupath.ps1
$url = 'https://github.com/qupath/qupath/releases/download/v0.7.0/QuPath-v0.7.0-Windows.msi'
$sha256 = '03999C2D8DFAD1841786EBC5704B2ADC111471A77FB39466B6008C322FCAFB2C'
$file = Join-Path $env:TEMP 'QuPath-v0.7.0-Windows.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