Commands for installing Rtools 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 RProject.Rtools -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id RProject.Rtools -e --silentwinget uninstall --id RProject.Rtools -e --silentBy installer
64-bit · EXE (Inno Setup) · All users
Silent install
rtools45-6768-6492.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-Custom folder
rtools45-6768-6492.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP- /DIR="C:\Apps\rtools"- Uninstall registry key
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Rtools45_is1
ARM64 · EXE (Inno Setup) · All users
Silent install
rtools45-aarch64-6768-6492.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-Custom folder
rtools45-aarch64-6768-6492.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP- /DIR="C:\Apps\rtools"- Uninstall registry key
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Rtools45-aarch64_is1
PowerShell: download, verify, install
Downloads the official file, checks its SHA256 and installs it silently.
install-rtools.ps1
$url = 'https://cloud.r-project.org/bin/windows/Rtools/rtools45/files/rtools45-6768-6492.exe'
$sha256 = '614C7378150A012E70B16EDCFE5236DCEAD47F491F1F54203EA8D451C7743A75'
$file = Join-Path $env:TEMP 'rtools45-6768-6492.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 '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-' -Wait install-rtools.ps1
$url = 'https://cloud.r-project.org/bin/windows/Rtools/rtools45/files/rtools45-aarch64-6768-6492.exe'
$sha256 = '34A797766B3A76D07EE3B3BCB2D50B7F3FD1D4F8FAC1B25E6E11BFD183A9CCA7'
$file = Join-Path $env:TEMP 'rtools45-aarch64-6768-6492.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 '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-' -Wait