Skip to content
Browse files

BUG FIX: install.URL didn't work on Windows. It was because "system" …

…did not run .exe, and "shell" was the correct choice to use here. It is now fixed.
  • Loading branch information...
1 parent abd12ab commit a408160be7adf064dfe8d4caee1b7111e7948d12 @talgalili committed Aug 23, 2013
Showing with 36 additions and 22 deletions.
  1. +2 −2 DESCRIPTION
  2. +18 −18 NAMESPACE
  3. +6 −0 NEWS
  4. +10 −2 R/install.r
View
4 DESCRIPTION
@@ -1,8 +1,8 @@
Package: installr
Type: Package
Title: using R to install stuff (such as: R, Rtools RStudio, git, and more!)
-Version: 0.12.0
-Date: 2013-08-21
+Version: 0.12.1
+Date: 2013-08-23
Authors@R: c(person("Tal Galili", "Developer", role = c("aut", "cre", "ctb"),
email = "tal.galili@math.tau.ac.il"), person("Barry Rowlingson",
"Developer", role = "ctb", email = "b.rowlingson@lancaster.ac.uk"),
View
36 NAMESPACE
@@ -1,3 +1,4 @@
+export(R_version_in_a_folder)
export(add_load_installr_on_startup_menu)
export(add_remove_installr_from_startup_menu)
export(ask.user.yn.question)
@@ -15,40 +16,40 @@ export(format_RStudio_CRAN_data)
export(freegeoip)
export(get.installed.R.folders)
export(install.7zip)
-export(install.cygwin)
export(install.Cygwin)
-export(install.ffmpeg)
export(install.FFmpeg)
+export(install.GitHub)
+export(install.GraphicsMagick)
+export(install.ImageMagick)
+export(install.LaTeX2RTF)
+export(install.LyX)
+export(install.MikTeX)
+export(install.R)
+export(install.RStudio)
+export(install.Rdevel)
+export(install.Rtools)
+export(install.SWFTools)
+export(install.URL)
+export(install.cygwin)
+export(install.ffmpeg)
export(install.git)
export(install.github)
-export(install.GitHub)
export(install.graphicsmagick)
-export(install.GraphicsMagick)
export(install.imagemagick)
-export(install.ImageMagick)
export(install.latex2rtf)
-export(install.LaTeX2RTF)
export(install.lyx)
-export(install.LyX)
export(install.miktex)
-export(install.MikTeX)
export(install.notepadpp)
export(install.npptor)
export(install.packages.zip)
export(install.pandoc)
-export(install.R)
-export(install.Rdevel)
export(install.rstudio)
-export(install.RStudio)
export(install.rtools)
-export(install.Rtools)
export(install.swftools)
-export(install.SWFTools)
-export(install.URL)
export(installr)
-export(is.empty)
-export(is.Rgui)
export(is.RStudio)
+export(is.Rgui)
+export(is.empty)
export(is.windows)
export(lineplot_package_downloads)
export(load_installr_on_startup)
@@ -62,14 +63,13 @@ export(os.shutdown)
export(os.sleep)
export(package_authors)
export(pkgDNLs_worldmapcolor)
-export(R_version_in_a_folder)
export(read_RStudio_CRAN_data)
export(require2)
export(restart_RGui)
export(rm_installr_from_startup)
export(source.https)
export(system.PATH)
-export(uninstall.r)
export(uninstall.R)
+export(uninstall.r)
export(up_folder)
export(updateR)
View
6 NEWS
@@ -1,3 +1,9 @@
+installr 0.12.1 (2013-08-23)
+---------------------------
+BUG FIXES:
+ * install.URL - didn't work on Windows. It was because "system" did not run .exe, and "shell" was the correct choice to use here.
+
+
installr 0.12.0 (2013-08-21)
---------------------------
NEW FUNCTIONS ADDED:
View
12 R/install.r
@@ -14,7 +14,11 @@
#' url <- "http://cran.r-project.org/bin/windows/base/R-2.15.3-win.exe"
#' file.name.from.url(url) # returns: "R-2.15.3-win.exe"
#' }
-file.name.from.url <- function(URL) tail(strsplit(URL, "/")[[1]],1)
+file.name.from.url <- function(URL) {
+ # tail(strsplit(URL, "/")[[1]],1)
+ # corrected to use R's base function thanks to Uwe's remark.
+ basename(URL)
+}
@@ -95,7 +99,11 @@ install.URL <- function(exe_URL, keep_install_file = FALSE, wait = TRUE, ...) {
wait <- TRUE
warning("wait was set to TRUE since you wanted to installation file removed. In order to be able to run the installer AND remove the file - we must first wait for the isntaller to finish running before removing the file.")
}
- shell_output <- system(exe_filename, wait = wait,...) # system(exe_filename) # I suspect shell works better than system
+ if(is.windows()) {
+ shell_output <- shell(exe_filename, wait = wait,...) # system(exe_filename) # I suspect shell works better than system
+ } else {
+ shell_output <- system(exe_filename, wait = wait,...) # system(exe_filename) # I suspect shell works better than system
+ }
if(!keep_install_file) unlink(exe_filename, force = TRUE) # on.exit(unlink(exe_filename)) # on.exit doesn't work in case of problems in the running of the file
# unlink can take some time until done, for some reason.
# file.remove(exe_filename)

0 comments on commit a408160

Please sign in to comment.
Something went wrong with that request. Please try again.