Commands for installing GnuWin32: DiffUtils 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 GnuWin32.DiffUtils -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id GnuWin32.DiffUtils -e --silentwinget uninstall --id GnuWin32.DiffUtils -e --silentBy installer
32-bit · EXE (Inno Setup)
Silent install
download /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-Custom folder
download /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP- /DIR="C:\Apps\gnuwin32-diffutils"PowerShell: download, verify, install
Downloads the official file, checks its SHA256 and installs it silently.
install-gnuwin32-diffutils.ps1
$url = 'https://sourceforge.net/projects/gnuwin32/files/diffutils/2.8.7-1/diffutils-2.8.7-1.exe/download'
$sha256 = '5DE7D06512DCBDE50BDB9BD6731332C3141515962CC69AFF9F7DA7A3F97BEF17'
$file = Join-Path $env:TEMP 'download'
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