Commands for installing Haskell Stack 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 commercialhaskell.stack -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id commercialhaskell.stack -e --silentwinget uninstall --id commercialhaskell.stack -e --silentBy installer
64-bit · EXE (NSIS) · Current user · en-US
Silent install
stack-3.11.1-windows-x86_64-installer.exe /SCustom folder
stack-3.11.1-windows-x86_64-installer.exe /S /D=C:\Apps\haskell-stack- Uninstall registry key
- HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Haskell Stack
- Install folder
- %AppData%\local\bin
PowerShell: download, verify, install
Downloads the official file, checks its SHA256 and installs it silently.
install-haskell-stack.ps1
$url = 'https://github.com/commercialhaskell/stack/releases/download/v3.11.1/stack-3.11.1-windows-x86_64-installer.exe'
$sha256 = 'CBAFD92B9FB1AC87B5F06C6BBA08D47D54503BCD48EC78BC6E9923B44FF3805C'
$file = Join-Path $env:TEMP 'stack-3.11.1-windows-x86_64-installer.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