You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Per-user RStudio install should not install to Documents folder on Windows #8598
On Windows 10, RStudio installs itself into the user's Documents folder. This is causes problems:
The Documents folder is conventionally for user-created documents. The opposite is true for everything added to Documents by RStudio's installer. They are simply "commodity things I downloaded to make my program work".
This causes problems with increasingly common cloud file backup utilities that back up the user's Documents folder. If you use OneDrive, Google Backup and Sync (Google Drive), and more, your Documents folder is backed up by default now. This means every time you install or update RStudio, you're creating a lot of pointless work and network traffic for these non-original files to be backed up. Further, RStudio causes me to waste space in the cloud, that I have to pay for.
This may cause errors if there are collisions between the cloud sync utility and the module-installation process. Finally, just now, OneDrive warned me that a ton of files were deleted. That was because RStudio's installer just replaced a lot of older files. Had I pressed the button to restore those files, OneDrive would have dutifully put my RStudio install into an inconsistent state.
Placing the program in the Documents folder suggests that installing RStudio on a per-user basis is preferred. That's fine. I still recommend installing instead following the convention of many other applications, which is to install into the user's own AppData\Local folder.
Some may say "but you can change the install directory". It doesn't change that the default is a poor choice. The default install directory needs to be smarter.
So, something on your system is configured in a way that is forcing a per-user install of RStudio; this is not an option in the RStudio installer itself. Here's the most recent daily build being installed normally:
Hi, that is not correct. It installs to your documents folder by default:
(OneDrive alters the Documents folder's location.)
It does Program Files only if you start it as an admin, typically by right-clicking and selecting Run as administrator. Otherwise, since the installer does not require you to run it as an admin, it goes into your documents folder.
changed the title [-]RStudio should not install to Documents folder on Windows[/-][+]Per-user RStudio install should not install to Documents folder on Windows[/+]on Dec 11, 2020
That is true (should not install to Documents by default for a per-user install, though we don't currently support per-user install). What specific version of Windows are you using?
Just for future reference (for myself), we currently require admin-rights based on this line here (there is a comment that suggests otherwise but it is out of date):
"Windows automatically identifies NSIS installers and decides administrator privileges are required. Because of this, none and admin have virtually the same effect."
I have installed RStudio on various Windows computers over the years. I cannot recall it ever asking me for admin to install. At least, if it used to, it has been so long that I do not recall it. The current machine is Windows 10 Pro 20H2, fully patched.
For the sake of thoroughness, I set up a Windows 10 20H2 on a VM. It's also fully patched. It is totally vanilla. The first thing I did after setting up the VM was to install RStudio 1.3 on it. It does prompt for admin permissions!
I am scratching my head as to why my main machine does not ask for admin privs. The only significant difference I can think of is it is connected to a domain, so there may be some group policy applied to it that causes the OS to install apps just in the user's area if possible. I am merely speculating there; I do not know.
A note: what you mentioned and quoted above aligns with what I've read elsewhere. You cannot force an installer to require admin privileges. It is merely a suggestion, and Windows makes the decision. For some reason, my Windows is deciding that admin privileges are unneeded.
All that notwithstanding, I think we can agree that 1. even if you didn't intend it, it is possible for the RStudio installer to install on a per-user basis and 2. when that happens, RStudio by default gets thrown in the user's Documents folder, which is undesirable.
Thanks for trying those, sounds like it might be some group policy setting on the domain. I'll have to setup a domain and try that out.
In any case, agree we should default to the appropriate location for per-user installs (however they're being triggered), and I'll use this issue to track doing that.
Yes, all our releases have internal names. 1.4.1103 is "Wax Begonia". "Juliet Rose" is a major patch release, so it will still have a 1.4 version number (just a higher one).
One way (without resorting to group policy/domain) to force RStudio to install per-user is to add the following to the registry (e.g. save this to a .reg file and execute it):
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\forcerunasinvoker]
@="Run without privilege elevation"
[HKEY_CLASSES_ROOT\*\shell\forcerunasinvoker\command]
@="cmd /min /C \"set __COMPAT_LAYER=RUNASINVOKER && start \"\" \"%1\"\""
Then right-click on the RStudio installer and select "Run without privilege elevation". You'll probably need to use "Show more options" in the context menu to see this choice.
Activity
gtritchie commentedon Dec 11, 2020
RStudio does not install to Documents by default on Windows. It installs to Program Files.
The only way I know of to make it choose Documents by default is to use a utility to suppress UAC, or something like the RunAsInvoker trick, e.g.:
C:\Users\myaccount\Downloads>cmd.exe /c "set __COMPAT_LAYER=RunAsInvoker && RStudio-1.4.1087.exe"So, something on your system is configured in a way that is forcing a per-user install of RStudio; this is not an option in the RStudio installer itself. Here's the most recent daily build being installed normally:
arencambre commentedon Dec 11, 2020
Hi, that is not correct. It installs to your documents folder by default:

(OneDrive alters the Documents folder's location.)
It does Program Files only if you start it as an admin, typically by right-clicking and selecting Run as administrator. Otherwise, since the installer does not require you to run it as an admin, it goes into your documents folder.
gtritchie commentedon Dec 11, 2020
Again, that is due to something on your system. The installer does normally require admin by default.
arencambre commentedon Dec 11, 2020
You could be right, but even when it doesn't require admin, it should still not ask to install into your documents folder.
[-]RStudio should not install to Documents folder on Windows[/-][+]Per-user RStudio install should not install to Documents folder on Windows[/+]gtritchie commentedon Dec 11, 2020
That is true (should not install to Documents by default for a per-user install, though we don't currently support per-user install). What specific version of Windows are you using?
Just for future reference (for myself), we currently require admin-rights based on this line here (there is a comment that suggests otherwise but it is out of date):
rstudio/package/win32/cmake/modules/NSIS.template.in
Line 58 in fd8b30c
https://nsis.sourceforge.io/Reference/RequestExecutionLevel
"Windows automatically identifies NSIS installers and decides administrator privileges are required. Because of this, none and admin have virtually the same effect."
arencambre commentedon Dec 11, 2020
I have installed RStudio on various Windows computers over the years. I cannot recall it ever asking me for admin to install. At least, if it used to, it has been so long that I do not recall it. The current machine is Windows 10 Pro 20H2, fully patched.
For the sake of thoroughness, I set up a Windows 10 20H2 on a VM. It's also fully patched. It is totally vanilla. The first thing I did after setting up the VM was to install RStudio 1.3 on it. It does prompt for admin permissions!
I am scratching my head as to why my main machine does not ask for admin privs. The only significant difference I can think of is it is connected to a domain, so there may be some group policy applied to it that causes the OS to install apps just in the user's area if possible. I am merely speculating there; I do not know.
A note: what you mentioned and quoted above aligns with what I've read elsewhere. You cannot force an installer to require admin privileges. It is merely a suggestion, and Windows makes the decision. For some reason, my Windows is deciding that admin privileges are unneeded.
All that notwithstanding, I think we can agree that 1. even if you didn't intend it, it is possible for the RStudio installer to install on a per-user basis and 2. when that happens, RStudio by default gets thrown in the user's Documents folder, which is undesirable.
arencambre commentedon Dec 11, 2020
Just checked another Windows 10 Pro 20H2 computer. It's not on a domain. It asks for admin privs before installing.
gtritchie commentedon Dec 11, 2020
Thanks for trying those, sounds like it might be some group policy setting on the domain. I'll have to setup a domain and try that out.
In any case, agree we should default to the appropriate location for per-user installs (however they're being triggered), and I'll use this issue to track doing that.
arencambre commentedon Dec 17, 2020
So you don't feel bad, R has a similar problem, where it inappropriately puts libraries in a user's Documents folder: https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17842
9 remaining items
jmcphers commentedon Jan 15, 2021
Yes, all our releases have internal names. 1.4.1103 is "Wax Begonia". "Juliet Rose" is a major patch release, so it will still have a 1.4 version number (just a higher one).
gtritchie commentedon Jan 15, 2021
You can also see this in the Help/About dialog, e.g.:
arencambre commentedon Jan 15, 2021
Thank you, and I now see that 1.4.1103 is release. Excellent! I was on the 1.4 previews before now.
gtritchie commentedon Jan 21, 2021
@arencambre Just FYI the daily builds are now juliet-rose so include this fix.
arencambre commentedon Jan 21, 2021
Thanks. I confirmed it's fixed with 1.4.1509 from https://dailies.rstudio.com/rstudio/oss/windows/:
Now if R could fix its very similar issue 😁: https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17842
R-Hannibal commentedon Jan 28, 2021
Verified Fixed on: RStudio Version - 1.4.1527, R Version - 4.0.3, Windows 10 - Desktop
Tested that per-user and all-user installs are now correctly installing to Programs rather than Documents folder.
gtritchie commentedon Jan 9, 2024
One way (without resorting to group policy/domain) to force RStudio to install per-user is to add the following to the registry (e.g. save this to a .reg file and execute it):
Then right-click on the RStudio installer and select "Run without privilege elevation". You'll probably need to use "Show more options" in the context menu to see this choice.