Skip to content

Install and Switch to R fails on Windows with an invalid R link file error #19468

Done

Description

@ronblum

System details

RStudio Edition : Desktop
RStudio Version : 2026.12.0, built from a branch that includes main through 330045c29e (after https://github.com/rstudio/rstudio/pull/19158)
OS Version      : Windows 11 Home 10.0.26200
R Version       : 4.4.3 (x64)

Steps to reproduce the problem

Before starting, rig's R links from earlier user-mode installs must exist in %USERPROFILE%\.local\bin. On the machine where this occurs they include R-release.exe, R-4.4.3-x86_64.exe and R.exe.

  1. Create a project and set its .Rproj file to an R version that isn't installed, with a different major.minor version than the running R:

    RVersion: 4.3.3
    
  2. Open the project.

    • The Console notice offers "Install and Switch to R 4.3.3".
  3. Click "Install and Switch to R 4.3.3".

  4. In the "Install R 4.3.3" dialog, leave the default folder and click "Install and Switch to R 4.3.3".

    • The install job starts and stops right away with:
    Error: Cannot extract R version from C:\Users\<user>\.local\bin\R-release.exe, invalid R link file?
    
    • Nothing is installed.

The same error comes from rig alone (rig 0.11.0, as bundled with RStudio), from a Command Prompt, when RIG_R_INSTALL_DIR is written with forward slashes:

set RIG_R_INSTALL_DIR=C:/Users/<user>/AppData/Roaming/rig/data/r
rig list --user

With backslashes in RIG_R_INSTALL_DIR, or with it unset, rig list --user lists the installed versions.

Describe the problem in detail

On Windows, installing R from the project R version notice fails whenever rig's R links already exist in %USERPROFILE%\.local\bin. The install job's output shows the folder as C:/Users/<user>/AppData/Roaming/rig/data/r, with forward slashes. This was seen on Windows 11 ARM64 with the x64 RStudio. I haven't checked it on an x64 Windows machine.

Describe the behavior you expected

R 4.3.3 installs into the confirmed folder and RStudio switches to it.

Activity

  1. added theissue type on Nov 6, 2026
  2. self-assigned this
    on Nov 6, 2026
  3. self-assigned this
    on Nov 10, 2026
  4. kevinushey commented on Dec 2, 2026

    @kevinushey
    Collaborator

    Fixed by #19476. Installing into a folder other than the one rig's links point into is tracked in #19561.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions