Commands for installing GNU Emacs 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 GNU.Emacs -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id GNU.Emacs -e --silentwinget uninstall --id GNU.Emacs -e --silentBy installer
64-bit · EXE (NSIS) · All users · en-US
Silent install
emacs-31.1-installer-UCRT64.exe /SCustom folder
emacs-31.1-installer-UCRT64.exe /S /D=C:\Apps\gnu-emacs- Uninstall registry key
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\emacs-31.1
PowerShell: download, verify, install
Downloads the official file, checks its SHA256 and installs it silently.
install-gnu-emacs.ps1
$url = 'https://ftp.gnu.org/gnu/emacs/windows/emacs-31/emacs-31.1-installer-UCRT64.exe'
$sha256 = '077888B990468059EAFC77C2C4FE335DE4E88938CC131C818C61B1C4469B80C1'
$file = Join-Path $env:TEMP 'emacs-31.1-installer-UCRT64.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