Skip to content

Commit

Permalink
Merge pull request #30 from ShawHahnLab/windows-installer
Browse files Browse the repository at this point in the history
Improvements to Windows installer
  • Loading branch information
ressy authored Mar 14, 2019
2 parents 44927eb + f4a904a commit 3491d23
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 22 deletions.
37 changes: 15 additions & 22 deletions install_windows.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
1 change: 1 addition & 0 deletions install_windows.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ set pkgdir=%~dp0

REM Run bulk of the install within R.
"%rscript%" --vanilla "%pkgdir%\install_windows.R"
pause

0 comments on commit 3491d23

Please sign in to comment.