MongoDB Compassを確認画面なしでインストール・アンインストールし、展開ツールで検出するためのコマンドです。マニフェストの記載か、インストーラー技術の既定値として確実なコマンドだけを表示しています。
関連ガイド: サイレントインストールのオプション一覧 · レジストリとPowerShellでアンインストールする方法
wingetを使う
PowerShell
winget install --id MongoDB.Compass.Full -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id MongoDB.Compass.Full -e --silentwinget uninstall --id MongoDB.Compass.Full -e --silentインストーラー別
64ビット · MSI · すべてのユーザー · en-US
サイレントインストール
msiexec /i mongodb-compass-1.53.3-win32-x64.msi /qn /norestartログを出力
msiexec /i mongodb-compass-1.53.3-win32-x64.msi /qn /norestart /l*v "%TEMP%\mongodb-compass-install.log"アンインストール
msiexec /x {EDBC3612-ED1C-441C-B006-34D12240C52B} /qn /norestart- MSIプロダクトコード
- {EDBC3612-ED1C-441C-B006-34D12240C52B}
- アンインストール用レジストリキー
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{EDBC3612-ED1C-441C-B006-34D12240C52B}
- UpgradeCode
- {0152273D-2F9F-4913-B67F-0FCD3557FFD1}
- インストール先フォルダー
- %ProgramFiles%/MongoDB Compass
- DisplayVersion
- 1.53.3.0
PowerShell:ダウンロード・検証・インストール
公式ファイルをダウンロードし、SHA256を検証してからサイレントインストールします。
install-mongodb-compass.ps1
$url = 'https://github.com/mongodb-js/compass/releases/download/v1.53.3/mongodb-compass-1.53.3-win32-x64.msi'
$sha256 = '5A9D8452EEA1DD2A8A66D4D3DCB6FA53F965F9C24437A99A915C235057A0E786'
$file = Join-Path $env:TEMP 'mongodb-compass-1.53.3-win32-x64.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