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