PDFsam Basicを確認画面なしでインストール・アンインストールし、展開ツールで検出するためのコマンドです。マニフェストの記載か、インストーラー技術の既定値として確実なコマンドだけを表示しています。
関連ガイド: サイレントインストールのオプション一覧 · レジストリとPowerShellでアンインストールする方法
wingetを使う
PowerShell
winget install --id PDFsam.PDFsam -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id PDFsam.PDFsam -e --silentwinget uninstall --id PDFsam.PDFsam -e --silentインストーラー別
64ビット · MSI · すべてのユーザー
サイレントインストール
msiexec /i pdfsam-basic-6.0.6-windows-x64.msi /qn /norestart /quiet /norestart SKIPTHANKSPAGE=Yesログを出力
msiexec /i pdfsam-basic-6.0.6-windows-x64.msi /qn /norestart /quiet /norestart SKIPTHANKSPAGE=Yes /l*v "%TEMP%\pdfsam-basic-install.log"アンインストール
msiexec /x {3712C9D8-9FE8-4DDA-B75C-E0214767B60B} /qn /norestart- MSIプロダクトコード
- {3712C9D8-9FE8-4DDA-B75C-E0214767B60B}
- アンインストール用レジストリキー
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{3712C9D8-9FE8-4DDA-B75C-E0214767B60B}
- UpgradeCode
- {DB40FA48-1629-11E2-9401-2F676188709B}
PowerShell:ダウンロード・検証・インストール
公式ファイルをダウンロードし、SHA256を検証してからサイレントインストールします。
install-pdfsam-basic.ps1
$url = 'https://github.com/torakiki/pdfsam/releases/download/v6.0.6/pdfsam-basic-6.0.6-windows-x64.msi'
$sha256 = '210996DB06D202A30AC23E23ED3EFDF9C3396894481ABFBC97BC26945A6C6346'
$file = Join-Path $env:TEMP 'pdfsam-basic-6.0.6-windows-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', '/quiet /norestart SKIPTHANKSPAGE=Yes' -Wait