diff --git a/install_windows.R b/install_windows.R index f9fef14..1d22178 100755 --- a/install_windows.R +++ b/install_windows.R @@ -21,38 +21,31 @@ if (! any(file.access(.libPaths(), 2) == 0)) { .libPaths(dp) } -cat("\n") -cat("### Installing devtools\n") -cat("\n") -install.packages("devtools", repos = "https://cloud.r-project.org") - -cat("\n") -cat("### Installing Bioconductor and MSA\n") -cat("\n") -source("https://bioconductor.org/biocLite.R") -biocLite("msa") - -cat("\n") -cat("### Installing dependencies\n") -cat("\n") -devtools::install_deps(path, dependencies = TRUE) +haspkg <- function(pkgname) { + suppressMessages(suppressWarnings( + require(pkgname, character.only = TRUE, quietly = TRUE) + )) +} -cat("\n") -cat("### Testing CHIIMP\n") -cat("\n") -status <- sum(as.data.frame(devtools::test(path))$failed) -if (status == 1) { +if (! haspkg("devtools")) { cat("\n") + cat("### Installing devtools\n") cat("\n") - cat(" Warning: Tests indicated failures.\n") + install.packages("devtools", repos = "https://cloud.r-project.org") +} + +if (! haspkg("msa")) { cat("\n") + cat("### Installing Bioconductor and MSA\n") cat("\n") + source("https://bioconductor.org/biocLite.R") + biocLite("msa", suppressUpdates = TRUE) } cat("\n") cat("### Installing CHIIMP\n") cat("\n") -devtools::install(path) +devtools::install(path, upgrade = "never") shortcut_path <- file.path(UPROF, "Desktop", "CHIIMP.lnk") chiimp_path <- system.file("bin", "chiimp.cmd", package = "chiimp") diff --git a/install_windows.cmd b/install_windows.cmd index 3441b26..4517fd3 100755 --- a/install_windows.cmd +++ b/install_windows.cmd @@ -17,3 +17,4 @@ set pkgdir=%~dp0 REM Run bulk of the install within R. "%rscript%" --vanilla "%pkgdir%\install_windows.R" +pause