Skip to content

Per-user RStudio install should not install to Documents folder on Windows #8598

Closed

Description

@arencambre

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.

Activity

  1. gtritchie commented on Dec 11, 2020

    @gtritchie
    Member

    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:

    screenshot of folder selection in RStudio installer on Windows

  2. arencambre commented on Dec 11, 2020

    @arencambre
    Author

    Hi, that is not correct. It installs to your documents folder by default:
    image

    (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.

  3. gtritchie commented on Dec 11, 2020

    @gtritchie
    Member

    Again, that is due to something on your system. The installer does normally require admin by default.

  4. arencambre commented on Dec 11, 2020

    @arencambre
    Author

    You could be right, but even when it doesn't require admin, it should still not ask to install into your documents folder.

  5. 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
  6. gtritchie commented on Dec 11, 2020

    @gtritchie
    Member

    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):

    RequestExecutionLevel none

    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."

  7. arencambre commented on Dec 11, 2020

    @arencambre
    Author

    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.

  8. arencambre commented on Dec 11, 2020

    @arencambre
    Author

    Just checked another Windows 10 Pro 20H2 computer. It's not on a domain. It asks for admin privs before installing.

  9. gtritchie commented on Dec 11, 2020

    @gtritchie
    Member

    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.

  10. self-assigned this
    on Dec 14, 2020
  11. arencambre commented on Dec 17, 2020

    @arencambre
    Author

    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

  12. 9 remaining items

  13. jmcphers commented on Jan 15, 2021

    @jmcphers
    Member

    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).

  14. gtritchie commented on Jan 15, 2021

    @gtritchie
    Member

    You can also see this in the Help/About dialog, e.g.:

    screenshot of Help About from 1.4.1103 highlighting the Wax Begonia name

  15. arencambre commented on Jan 15, 2021

    @arencambre
    Author

    Thank you, and I now see that 1.4.1103 is release. Excellent! I was on the 1.4 previews before now.

  16. self-assigned this
    on Jan 20, 2021
  17. gtritchie commented on Jan 21, 2021

    @gtritchie
    Member

    @arencambre Just FYI the daily builds are now juliet-rose so include this fix.

  18. arencambre commented on Jan 21, 2021

    @arencambre
    Author
  19. R-Hannibal commented on Jan 28, 2021

    @R-Hannibal

    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.

  20. gtritchie commented on Jan 9, 2024

    @gtritchie
    Member

    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.

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

Metadata

Metadata

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions