Skip to content

Commit 8e76427

Browse files
committed
Fix install.Rtools
1 parent 7c0881a commit 8e76427

3 files changed

Lines changed: 15 additions & 3 deletions

File tree

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Package: installr
22
Type: Package
33
Title: Using R to Install Stuff (Such As: R, 'Rtools', 'RStudio', 'Git', and More!)
44
Version: 0.22.0
5-
Date: 2019-07-17
5+
Date: 2019-07-24
66
Authors@R: c(person("Tal", "Galili", role = c("aut", "cre", "cph"), email =
77
"tal.galili@gmail.com", comment = "http://www.r-statistics.com"),
88
person("Barry", "Rowlingson", role = "ctb", email =

NEWS

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
installr 0.22.0 (2019-07-17)
1+
installr 0.22.0 (2019-07-24)
22
---------------------------
33

44
OTHER NOTES:
@@ -7,6 +7,8 @@ OTHER NOTES:
77
BUG FIXES:
88
* Fix install.RStudio
99
* Fix install.Rtools - foce the user to choose a version to download
10+
* Fix install.Rtools
11+
1012

1113
installr 0.21.3 (2019-06-09)
1214
---------------------------

R/install.R

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,10 @@ install.Rtools <- function(choose_version = TRUE,
498498
# latest_Frozen==T means we get the latest Rtools version which is Frozen (when writing this function it is Rtools215.exe)
499499
# latest_Frozen==F means we get the latest Rtools version which is not Frozen (when writing this function it is Rtools30.exe)
500500

501+
regex <- function(x, expr) {
502+
regmatches(x , regexpr(expr, x))
503+
}
504+
501505
if(check & requireNamespace("pkgbuild")) { # if we have devtools we can check for the existance of rtools
502506
found_rtools <- pkgbuild::find_rtools()
503507
if(found_rtools) {
@@ -540,9 +544,15 @@ install.Rtools <- function(choose_version = TRUE,
540544

541545
if(ROW_id == 0) return(FALSE)
542546

543-
exe_filename <- TABLE[ROW_id,"Download"] # the version the user asked for
547+
exe_filename <- regex(TABLE[ROW_id,"Download"], ".*\\.exe") # TABLE[ROW_id,"Download"] # the version the user asked for
544548
}
545549

550+
if(length(exe_filename) == 0) {
551+
message("You'll need to go to the site and download this yourself. I'm now going to try and open the url for you.")
552+
browseURL(page_with_download_url)
553+
return(FALSE)
554+
}
555+
546556
# install Rtools!
547557
URL <- paste(page_with_download_url, exe_filename, sep = '')
548558
install.URL(URL,...)

0 commit comments

Comments
 (0)