免互動安裝Prometheus、解除安裝,以及在部署工具中偵測安裝狀態所用的指令。只列出確定可用的指令:來自資訊清單,或是安裝程式技術的官方預設參數。
相關教學: 靜默安裝參數總整理:MSI、NSIS、Inno Setup · 用登錄檔或PowerShell解除安裝程式
使用winget
PowerShell
winget install --id Mouseww.Prometheus -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id Mouseww.Prometheus -e --silentwinget uninstall --id Mouseww.Prometheus -e --silent依安裝檔
64位元 · EXE(NSIS) · 僅目前使用者
靜默安裝
Prometheus_0.21.6_x64-setup.exe /S自訂安裝資料夾
Prometheus_0.21.6_x64-setup.exe /S /D=C:\Apps\prometheus- 解除安裝登錄機碼
- HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Prometheus
- 安裝資料夾
- %LocalAppData%\Prometheus
64位元 · MSI · 所有使用者
靜默安裝
msiexec /i Prometheus_0.21.6_x64_en-US.msi /qn /norestart寫入記錄檔
msiexec /i Prometheus_0.21.6_x64_en-US.msi /qn /norestart /l*v "%TEMP%\prometheus-install.log"解除安裝
msiexec /x {14F37107-8F76-4CDA-93E7-EC9124E1F681} /qn /norestart- MSI產品代碼
- {14F37107-8F76-4CDA-93E7-EC9124E1F681}
- 解除安裝登錄機碼
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{14F37107-8F76-4CDA-93E7-EC9124E1F681}
- UpgradeCode
- {585FD20A-B31F-5AE5-AA54-FF9804385120}
- 安裝資料夾
- %ProgramFiles%\Prometheus
PowerShell:下載、驗證、安裝
下載官方檔案,驗證SHA256後靜默安裝。
install-prometheus.ps1
$url = 'https://github.com/Mouseww/Prometheus/releases/download/v0.21.6/Prometheus_0.21.6_x64-setup.exe'
$sha256 = 'F66ED43BA2B83427E184D26F562BF558A577A519FE8DE20B2B85CCA56B028418'
$file = Join-Path $env:TEMP 'Prometheus_0.21.6_x64-setup.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 '/S' -Wait install-prometheus.ps1
$url = 'https://github.com/Mouseww/Prometheus/releases/download/v0.21.6/Prometheus_0.21.6_x64_en-US.msi'
$sha256 = 'DF2D8A008FC29D2BE07F81118F7533496CCF96AB89D184D45AA951AAAC5A15C7'
$file = Join-Path $env:TEMP 'Prometheus_0.21.6_x64_en-US.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