免互動安裝PDFtk Server、解除安裝,以及在部署工具中偵測安裝狀態所用的指令。只列出確定可用的指令:來自資訊清單,或是安裝程式技術的官方預設參數。
相關教學: 靜默安裝參數總整理:MSI、NSIS、Inno Setup · 用登錄檔或PowerShell解除安裝程式
使用winget
PowerShell
winget install --id PDFLabs.PDFtk.Server -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id PDFLabs.PDFtk.Server -e --silentwinget uninstall --id PDFLabs.PDFtk.Server -e --silent依安裝檔
32位元 · EXE(Inno Setup) · 所有使用者
靜默安裝
pdftk_server-2.02-win-setup.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-自訂安裝資料夾
pdftk_server-2.02-win-setup.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP- /DIR="C:\Apps\pdftk-server"- 解除安裝登錄機碼
- HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{E3617D29-6D71-4B5C-B9E2-C927C705E317}_is1
PowerShell:下載、驗證、安裝
下載官方檔案,驗證SHA256後靜默安裝。
install-pdftk-server.ps1
$url = 'https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/pdftk_server-2.02-win-setup.exe'
$sha256 = 'CC8F6A43FC91026BB739AD0AD9A124C24750D6127662FB3638EC1D44403AABD2'
$file = Join-Path $env:TEMP 'pdftk_server-2.02-win-setup.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