免互動安裝HashHash、解除安裝,以及在部署工具中偵測安裝狀態所用的指令。只列出確定可用的指令:來自資訊清單,或是安裝程式技術的官方預設參數。
相關教學: 靜默安裝參數總整理:MSI、NSIS、Inno Setup · 用登錄檔或PowerShell解除安裝程式
使用winget
PowerShell
winget install --id RussellBanks.HashHash -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id RussellBanks.HashHash -e --silentwinget uninstall --id RussellBanks.HashHash -e --silent依安裝檔
64位元 · EXE(WiX Burn) · 所有使用者
靜默安裝
HashHash-1.12.0.exe /quiet /norestart64位元 · MSI · 所有使用者
靜默安裝
msiexec /i HashHash-1.12.0.msi /qn /norestart寫入記錄檔
msiexec /i HashHash-1.12.0.msi /qn /norestart /l*v "%TEMP%\hashhash-install.log"解除安裝
msiexec /x {E08C7511-E56F-34F3-8C89-B5530C99076C} /qn /norestart- MSI產品代碼
- {E08C7511-E56F-34F3-8C89-B5530C99076C}
- 解除安裝登錄機碼
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{E08C7511-E56F-34F3-8C89-B5530C99076C}
PowerShell:下載、驗證、安裝
下載官方檔案,驗證SHA256後靜默安裝。
install-hashhash.ps1
$url = 'https://github.com/russellbanks/HashHash/releases/download/v1.12.0/HashHash-1.12.0.exe'
$sha256 = 'DC4802461F6E9C14CD6332357955B388A6EADF84353D319AE69591583511EFE4'
$file = Join-Path $env:TEMP 'HashHash-1.12.0.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 '/quiet /norestart' -Wait install-hashhash.ps1
$url = 'https://github.com/russellbanks/HashHash/releases/download/v1.12.0/HashHash-1.12.0.msi'
$sha256 = '191A165A587393C19AF47F397C43622E93245C1D1BDA558C0FA411FFB2AEEA20'
$file = Join-Path $env:TEMP 'HashHash-1.12.0.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