Skip to content

Commit c1346eb

Browse files
committed
fix type of installation (binary for windows)
1 parent 180ad6d commit c1346eb

3 files changed

Lines changed: 13 additions & 7 deletions

File tree

build/.Rprofile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ local({
88
})
99

1010
# install package list
11-
install_pkg <- function(pkg_list, force_update = TRUE, R_lib = NULL) {
11+
install_pkg <- function(pkg_list, force_update = TRUE, R_lib = NULL,
12+
type = getOption("pkgType")) {
1213

1314
message("---------------------------------")
1415

@@ -22,7 +23,7 @@ install_pkg <- function(pkg_list, force_update = TRUE, R_lib = NULL) {
2223
!(pkg_list %in% old_pkg_list)]
2324

2425
if(length(pkg_ok_list) > 0) {
25-
message("Available and up-to-date packages:")
26+
message("-- Available and up-to-date packages:")
2627
message(paste(pkg_ok_list, collapse = "\n"))
2728
message("---------------------------------")
2829
}
@@ -31,23 +32,23 @@ install_pkg <- function(pkg_list, force_update = TRUE, R_lib = NULL) {
3132
pkg2update_list <- pkg_list[pkg_list %in% old_pkg_list]
3233

3334
if(length(pkg2update_list) > 0) {
34-
message("Packages to update:")
35+
message("-- Packages to update:")
3536
message(paste(pkg2update_list, collapse = "\n"))
3637
message("--> updating")
3738
Sys.sleep(2)
38-
update.packages(lib.loc = R_lib, oldPkgs = pkg2update_list)
39+
install.packages(pkg2update_list, lib = R_lib, type = type)
3940
message("---------------------------------")
4041
}
4142

4243
# missing package
4344
missing_pkg_list <- pkg_list[!pkg_list %in% cur_pkg_list]
4445

4546
if(length(missing_pkg_list) > 0) {
46-
message("Missing packages:")
47+
message("-- Missing packages:")
4748
message(paste(missing_pkg_list, collapse = "\n"))
4849
message("--> installing")
4950
Sys.sleep(2)
50-
install.packages(missing_pkg_list, lib = R_lib)
51+
install.packages(missing_pkg_list, lib = R_lib, type = type)
5152
message("---------------------------------")
5253
}
5354
}

build/DIYABC-RF_GUI_windows

build/prepare_build.R

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
# force update ?
66
force_update <- TRUE
77

8+
# install type
9+
type <- getOption("pkgType")
10+
if(R.version$os %in% c("mingw32", "windows"))
11+
type <- "binary"
12+
813
# requirement: .Renviron file generated by 'generate_Renviron.R'
914
if(!file.exists(".Renviron"))
1015
stop("You should run 'generate_Renviron.R'")

0 commit comments

Comments
 (0)