DBTを確認画面なしでインストール・アンインストールし、展開ツールで検出するためのコマンドです。マニフェストの記載か、インストーラー技術の既定値として確実なコマンドだけを表示しています。
関連ガイド: サイレントインストールのオプション一覧 · レジストリとPowerShellでアンインストールする方法
wingetを使う
PowerShell
winget install --id DuxburySystems.DBT -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id DuxburySystems.DBT -e --silentwinget uninstall --id DuxburySystems.DBT -e --silentインストーラー別
32ビット · MSI · すべてのユーザー
サイレントインストール
msiexec /i dbt-1501sr2.msi /qn /norestartログを出力
msiexec /i dbt-1501sr2.msi /qn /norestart /l*v "%TEMP%\dbt-install.log"アンインストール
msiexec /x {2E1C5599-378A-45A5-830E-B94F36C606A5} /qn /norestart- MSIプロダクトコード
- {2E1C5599-378A-45A5-830E-B94F36C606A5}
- アンインストール用レジストリキー
- HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{2E1C5599-378A-45A5-830E-B94F36C606A5}
- UpgradeCode
- {821B7A43-D044-4236-9361-0409A25F57D1}
PowerShell:ダウンロード・検証・インストール
公式ファイルをダウンロードし、SHA256を検証してからサイレントインストールします。
install-dbt.ps1
$url = 'https://www.duxburysystems.org/downloads/dbt_15.1/dbt-1501sr2.msi'
$sha256 = '2EC28B9FDB6752C68947B278AF18670C574D039816A23A81CF09188BFFDF3AA7'
$file = Join-Path $env:TEMP 'dbt-1501sr2.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