4

To build my package, I need to install RTools on my Windows computer at work, where I don't have admin privileges.

As the installer is a .exe file, I cannot even open it (blocked by Bromium vSentry). So I cannot choose an installation folder where I have write privileges, as I cannot even launch the installer.

I Googled it but could not find a portable version of RTools or a zip I could just uncompress. Does anyone know if it exists and if not, what is the way to build my packages?

Edit:

As a complement to Hong Ooi's answer, I indeed had to update my PATH variable manually for RStudio to find RTools. The PATH to set is not documented anywhere official, so I copied and adapted the PATH from here. My version is:

C:\Unsupported\Rtools\bin;C:\Unsupported\Rtools\gcc-4.6.3\bin;C:\Unsupported\Rtools\perl\bin;C:\Unsupported\Rtools\MinGW\bin;C:\Unsupported\R\R-3.3.2\bin\x64;C:\Unsupported\R\R-3.3.2\bin
Community
  • 1
  • 1
Ben
  • 6,321
  • 9
  • 40
  • 76
  • 1
    I thought you could install it to a location you do have permission. You just won't be able to install it in the default `C` drive. You will just need to update your `PATH` accordingly to point to wherever it is installed. – cdeterman Jan 10 '17 at 16:33
  • It's a .exe file, so I'm not even allowed to launch it, as it comes from an "untrusted" place. What I'm looking for is a zip file I could uncompress. – Ben Jan 10 '17 at 18:43
  • Maybe there is a way to compile RTools from source? Maybe it's even more complicated... – Ben Jan 11 '17 at 08:26
  • 1
    Since you've put RTools in a different location to the default, you may also want to look at [this question](https://stackoverflow.com/questions/37729082/r-3-3-0-installing-a-package-on-windows-gcc-not-found-error) if you're using R 3.3. – Hong Ooi Jan 13 '17 at 09:04
  • @Ben Could you Elaborate a bit more how you manually set the path? I copied an RTools Folder from my own PC, but I am stuck on what to do now. – Max M Apr 19 '18 at 08:14
  • https://superuser.com/a/813298 – Ben Apr 19 '18 at 08:17
  • Thanks, but I do not have enough rights to set a new System variable, let alone open the adminstration panel. using `set` in the `cmd` I could not find a ZIP variable, so I am probably doomed. Did you have to set new System variable? Could you add the exact code you use in R to set the zip variable? – Max M May 16 '18 at 09:04
  • The solution provided by @MaxM works for me. I changed the system path by using the Sys.setenv(PATH = "/path/") command in R. – Huanfa Chen May 21 '19 at 18:13

2 Answers2

2

You could install RTools on your own PC, then zip up the directory it creates (c:\Rtools by default), copy to a USB stick and unzip it on your work PC. Although if your company blocks untrusted exes, I suspect it'll also block USB ports....

Hong Ooi
  • 56,353
  • 13
  • 134
  • 187
  • They don't block USB ports, so that should work, thanks. I was hoping someone already did that operation and that the zip file would have been available on the net. – Ben Jan 11 '17 at 10:15
  • The installer does more than just put the files on your hard disk; it also sets some entries in the registry and updates your path. But you should be able to get by without these. – Hong Ooi Jan 11 '17 at 10:56
-1

I have this same problem too. What worked for me was to find a place on my computer I have read/write access. For me this was on my local C: drive that wasn't connected to network for backups.

When you install R, you need to direct it to install all packages in that same directly you have permission. In R you can do this with .libPaths(). The path for RTools needs to follow same procedure. This worked for me. I installed Rstudio the same way.

Lloyd Christmas
  • 1,016
  • 6
  • 15