Skip to content

Install and Switch to R fails on Windows when the destination isn't the folder rig's links point into #19561

Open

Description

@kevinushey

Follow-up to #19468 / #19476, which fixed the case where R is installed into the folder rig's existing links already point into.

Problem

On Windows, "Install and Switch to R" still fails when the chosen destination is not the folder rig's R-release.exe / R-oldrel.exe / R-next.exe links (in %USERPROFILE%\.local\bin) point into. The job stops with:

Cannot extract R version from C:\Users\<user>\.local\bin\R-release.exe, invalid R link file?

and nothing is installed.

Steps to reproduce

  1. On Windows, have an R installed by rig in user mode in its default folder (%APPDATA%\rig\data\r), so that R-release.exe exists in %USERPROFILE%\.local\bin.
  2. In RStudio, start "Install and Switch to R" for a version that isn't installed, and change the destination in the dialog to another folder (say D:\R).

The same happens when the default folder is reached through a junction or symlink: RStudio resolves it with normalizePath(), so the path rig is given differs from the one it wrote into the link.

Cause

This is in rig 0.11.0, the version RStudio bundles. Before downloading, rig add --user lists the installed versions, and on Windows find_aliases() fails the whole command when any alias link's target isn't under RIG_R_INSTALL_DIR (mod.rs#L1348-L1371); macOS and Linux skip such a link.

Reported upstream as r-lib/rig#506 and fixed by r-lib/rig#507 (merged 2026-11-07), which skips links outside the current root. The fix is not in a release yet: v0.11.1 predates it.

Proposed fix

Update the bundled rig (dependencies/common/rig.cmake, and the pinned version in SessionRig.R) to the first release that includes r-lib/rig#507, then check the two cases above on Windows.

Activity

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

    @kevinushey
    CollaboratorAuthor

    rig v0.11.1 predates r-lib/rig#507, so there's no release to bump to yet; this is blocked on the next rig release. Note that a Windows rig add into another root also deletes the quick links of the default root's R versions in make-links, which r-lib/rig#507 doesn't change.

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

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions