installr (version 0.22.0)

install.URL: Downloads and runs a .exe installer file for some software from a URL

Description

Gets a character with a link to an installer file, downloads it, runs it, and then erases it.

Usage

install.URL(exe_URL, keep_install_file = FALSE, wait = TRUE,
  download_dir = tempdir(), message = TRUE, installer_option = NULL,
  download_fun = download.file, ...)

Arguments

exe_URL

A character with a link to an installer file (with the .exe file extension)

keep_install_file

If TRUE - the installer file will not be erased after it is downloaded and run.

wait

should the R interpreter wait for the command to finish? The default is to NOT wait.

download_dir

A character of the directory into which to download the file. (default is tempdir())

message

boolean. Should a message on the file be printed or not (default is TRUE)

installer_option

A character of the command line arguments

download_fun

a function to use for downloading. Default is download.file. We can also use curl_download (but it doesn't give as good of an output while downloading the file).

...

parameters passed to 'shell'

Value

invisible(TRUE/FALSE) - was the installation successful or not. (this is based on the output of shell of running the command being either 0 or 1/2. 0 means the file was successfully installed, while 1 or 2 means there was a failure in running the installer.)

Details

This function is used by many functions in the installr package. The .exe file is downloaded into a temporary directory, where it is erased after installation has started (by default - though this can be changed)

See Also

shell

Examples

Run this code
# NOT RUN {
install.URL("adfadf") # shows the error produced when the URL is not valid.
# }

Run the code above in your browser using DataCamp Workspace