Commands for installing Gpg4win (Beta) without prompts, removing it again and detecting it from deployment tools. A command is shown only when it is certain: from the manifest or the installer technology’s documented default.
Related guide: Silent install switches: MSI, NSIS, Inno Setup · Uninstall a program with the registry or PowerShell
With winget
PowerShell
winget install --id GnuPG.Gpg4win.Beta -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id GnuPG.Gpg4win.Beta -e --silentwinget uninstall --id GnuPG.Gpg4win.Beta -e --silentBy installer
64-bit · EXE (NSIS) · All users · en-US
Silent install
gpg4win-5.0.0-beta395.exe /SCustom folder
gpg4win-5.0.0-beta395.exe /S /D=C:\Apps\gpg4win-beta- Uninstall registry key
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Gpg4win
- Install folder
- %ProgramFiles%\Gpg4win
PowerShell: download, verify, install
Downloads the official file, checks its SHA256 and installs it silently.
install-gpg4win-beta.ps1
$url = 'https://files.gpg4win.org/Beta/gpg4win-5.0.0-beta395/gpg4win-5.0.0-beta395.exe'
$sha256 = 'A0D045F2167B69DA2DFE4BB6E5E3D0FE86E35D24EE68322F3B698ABE044C276A'
$file = Join-Path $env:TEMP 'gpg4win-5.0.0-beta395.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 '/S' -Wait