用于免交互安装codeusagemonit、卸载以及在部署工具中检测安装状态的命令。只列出确定可用的命令:来自清单文件,或来自安装程序技术的官方默认参数。
相关教程: 静默安装参数大全:MSI、NSIS、Inno Setup · 用注册表或PowerShell卸载程序
使用winget
PowerShell
winget install --id fanchengliu.codeusagemonit -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id fanchengliu.codeusagemonit -e --silentwinget uninstall --id fanchengliu.codeusagemonit -e --silent按安装包
64位 · EXE(Inno Setup) · 仅当前用户
静默安装
codeusagemonit-setup-1.0.2.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-自定义安装目录
codeusagemonit-setup-1.0.2.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP- /DIR="C:\Apps\codeusagemonit"- 卸载注册表项
- HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{A4E8C1D7-6F2B-4C9A-8E15-3B7D9F0A2C64}_is1
- 安装目录
- %LocalAppData%\Programs\codeusagemonit
PowerShell:下载、校验、安装
下载官方文件,校验SHA256后静默安装。
install-codeusagemonit.ps1
$url = 'https://github.com/fanchengliu/codeusagemonit/releases/download/v1.0.2/codeusagemonit-setup-1.0.2.exe'
$sha256 = 'FF8283711A6A021015BBEE93D471549A707EBBB0E7D0704E8F283FCD054429F1'
$file = Join-Path $env:TEMP 'codeusagemonit-setup-1.0.2.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 '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-' -Wait