From bca40d8b58ea01ecebb5dcbddcf572cd25c5ce8e Mon Sep 17 00:00:00 2001 From: Jesse Connell Date: Thu, 14 Mar 2019 09:46:17 -0400 Subject: [PATCH 1/4] Add "pause" statement to Windows installer This makes it easier to see the installation outcome. (Otherwise the cmd.exe window closes as soon as the installer finishes.) --- install_windows.cmd | 1 + 1 file changed, 1 insertion(+) 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 From cb3f371495452ebdbc2eac5e349ad562264f2b20 Mon Sep 17 00:00:00 2001 From: Jesse Connell Date: Thu, 14 Mar 2019 09:47:28 -0400 Subject: [PATCH 2/4] Simplify Windows install; do not auto-update deps Only install devtools and msa if not already present; do not run separate dependency install and package test steps as they're already handled in devtools::install(); Disable devtools' automatic package upgrades during install. --- install_windows.R | 33 ++++++++++----------------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/install_windows.R b/install_windows.R index f9fef14..07cc54f 100755 --- a/install_windows.R +++ b/install_windows.R @@ -21,38 +21,25 @@ 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) - -cat("\n") -cat("### Testing CHIIMP\n") -cat("\n") -status <- sum(as.data.frame(devtools::test(path))$failed) -if (status == 1) { +if (! require("devtools", character.only = TRUE, quietly = TRUE)) { cat("\n") + cat("### Installing devtools\n") cat("\n") - cat(" Warning: Tests indicated failures.\n") + install.packages("devtools", repos = "https://cloud.r-project.org") +} + +if (! suppressMessages(require("msa", character.only = TRUE, quietly = TRUE))) { cat("\n") + cat("### Installing Bioconductor and MSA\n") cat("\n") + source("https://bioconductor.org/biocLite.R") + biocLite("msa") } 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") From 349222b116a32719c80b3cc96bca45c0c363f25c Mon Sep 17 00:00:00 2001 From: Jesse Connell Date: Thu, 14 Mar 2019 10:19:34 -0400 Subject: [PATCH 3/4] quieter package checks for windows installer --- install_windows.R | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/install_windows.R b/install_windows.R index 07cc54f..b0e9103 100755 --- a/install_windows.R +++ b/install_windows.R @@ -21,14 +21,20 @@ if (! any(file.access(.libPaths(), 2) == 0)) { .libPaths(dp) } -if (! require("devtools", character.only = TRUE, quietly = TRUE)) { +haspkg <- function(pkgname) { + suppressMessages(suppressWarnings( + require(pkgname, character.only = TRUE, quietly = TRUE) + )) +} + +if (! haspkg("devtools")) { cat("\n") cat("### Installing devtools\n") cat("\n") install.packages("devtools", repos = "https://cloud.r-project.org") } -if (! suppressMessages(require("msa", character.only = TRUE, quietly = TRUE))) { +if (! haspkg("msa")) { cat("\n") cat("### Installing Bioconductor and MSA\n") cat("\n") From f4a904a6c85714ca129038843476a68b0bddeee0 Mon Sep 17 00:00:00 2001 From: Jesse Connell Date: Thu, 14 Mar 2019 10:27:25 -0400 Subject: [PATCH 4/4] Also do not auto-update deps for msa package --- install_windows.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_windows.R b/install_windows.R index b0e9103..1d22178 100755 --- a/install_windows.R +++ b/install_windows.R @@ -39,7 +39,7 @@ if (! haspkg("msa")) { cat("### Installing Bioconductor and MSA\n") cat("\n") source("https://bioconductor.org/biocLite.R") - biocLite("msa") + biocLite("msa", suppressUpdates = TRUE) } cat("\n")