免互動安裝gitui、解除安裝,以及在部署工具中偵測安裝狀態所用的指令。只列出確定可用的指令:來自資訊清單,或是安裝程式技術的官方預設參數。
相關教學: 靜默安裝參數總整理:MSI、NSIS、Inno Setup · 用登錄檔或PowerShell解除安裝程式
使用winget
PowerShell
winget install --id StephanDilly.gitui -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id StephanDilly.gitui -e --silentwinget uninstall --id StephanDilly.gitui -e --silent依安裝檔
64位元 · MSI · 所有使用者 · en-US
靜默安裝
msiexec /i gitui-win.msi /qn /norestart寫入記錄檔
msiexec /i gitui-win.msi /qn /norestart /l*v "%TEMP%\gitui-install.log"解除安裝
msiexec /x {5B5FB6E7-5EB7-48C7-A342-82504D331743} /qn /norestart- MSI產品代碼
- {5B5FB6E7-5EB7-48C7-A342-82504D331743}
- 解除安裝登錄機碼
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{5B5FB6E7-5EB7-48C7-A342-82504D331743}
- UpgradeCode
- {C1CADE63-A601-4E02-96CC-FB921D5B174E}
PowerShell:下載、驗證、安裝
下載官方檔案,驗證SHA256後靜默安裝。
install-gitui.ps1
$url = 'https://github.com/extrawurst/gitui/releases/download/v0.28.1/gitui-win.msi'
$sha256 = '6B720D82C4AFAEB5ED07EB5B99C4E89868B5DF59530528CB873CF1A8D2D598E3'
$file = Join-Path $env:TEMP 'gitui-win.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