hMailServerを確認画面なしでインストール・アンインストールし、展開ツールで検出するためのコマンドです。マニフェストの記載か、インストーラー技術の既定値として確実なコマンドだけを表示しています。
関連ガイド: サイレントインストールのオプション一覧 · レジストリとPowerShellでアンインストールする方法
wingetを使う
PowerShell
winget install --id hMailServer.hMailServer -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id hMailServer.hMailServer -e --silentwinget uninstall --id hMailServer.hMailServer -e --silentインストーラー別
64ビット · EXE(Inno Setup) · すべてのユーザー
サイレントインストール
hMailServer-5.7.2-B3164-x64.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-インストール先を指定
hMailServer-5.7.2-B3164-x64.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP- /DIR="C:\Apps\hmailserver"- アンインストール用レジストリキー
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\hMailServer_is1
- インストール先フォルダー
- %ProgramFiles%\hMailServer
PowerShell:ダウンロード・検証・インストール
公式ファイルをダウンロードし、SHA256を検証してからサイレントインストールします。
install-hmailserver.ps1
$url = 'https://github.com/hmailserver/hmailserver/releases/download/hMailServer-5.7.2-b3164/hMailServer-5.7.2-B3164-x64.exe'
$sha256 = '7AEBA848EFF2AF24BAEFD9F327BE54534C590B29D788CA85DC5206B7A692ED3F'
$file = Join-Path $env:TEMP 'hMailServer-5.7.2-B3164-x64.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