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