Coder Social home page Coder Social logo

question about installation about isoreader HOT 3 CLOSED

BrianEads avatar BrianEads commented on August 26, 2024
question about installation

from isoreader.

Comments (3)

sebkopf avatar sebkopf commented on August 26, 2024 1

follow-up note for dev team: we may be able to provide an in-package function (with OS an R version params) at some point that generates a bundle for offline installation (including an R script that installs everything once executed on the offline system) using the recursive dependency retrieval function of the miniCRAN package. This would make it a lot easier for users with offline IRMS systems.

from isoreader.

sebkopf avatar sebkopf commented on August 26, 2024

Hi @BrianEads, this is a problem that's come up in the past with offline IRMS systems so we started writing some documentation for it but haven't posted it yet. I'm pasting the current draft below and would very much welcome any feedback on whether it works and if not where it fails. Eventually we'll add this to the main README.md so it's easy to find.

Installing on a system not connected to the internet

IRMS instrumentation is sometimes kept offline to prevent problems with automatic Windows updates and viruses. This requires an offline installation of isoreader to make it possible to use the package directly on the instrument computer (which is typically an older Windows machine).

For this to work, you need to download all the packages that isoreader depends on as well as all packages that those dependencies depend on which can get pretty elaborate pretty quickly. The easiest way to make this possible is thus by just pulling all current release packages from CRAN and transferring them to the offline system (warnings, these are a lot of files, several Gb total, and may take a long time to download). The CRAN directory depends on the operating system, R version (must match!) and source vs. binaries. For example, to download all the R 3.5.x windows binaries, run in the following in a terminal (Note: these are unix/MacOS syntax, not sure exactly about the Windows equivalent):

mkdir CRAN_packages
cd CRAN_packages
wget -nc ftp://cran.r-project.org/pub/R/bin/windows/contrib/3.5/*.zip

As well as the package(s) hosted on GitHub (run in terminal within CRAN_packages folder), which need to be converted to tar balls for installation (zip files don't work with install.packages):

mkdir GitHub_packages
cd GitHub_packages
curl -L -o tmp.zip https://github.com/isoverse/isoreader/archive/master.zip && unzip tmp.zip && rm tmp.zip

Transfer all these files to the offline system e.g. via USB stick, specify the source_path, then generate a package dependency tree (platform dependent) from an RStudio command line or R console, and install the GitHub packages from the sources files.

Dependency tree:

source_path <- "C:/path/to/CRAN_packages" # windows
#source_path <- "/path/to/CRAN_packages" # unix
library(tools)
write_PACKAGES(source_path, type = "win.binary")
#write_PACKAGES(source_path, type = "mac.binary")

Installation:

# local repository
url <- paste0("file:", source_path) # windows
#url <- paste0("file:\\", source_path) # unix

# install devtools
install.packages("devtools", contriburl = url)

# install github package(s) with dependencies
sapply(c("isoreader"), function(i) {
  pkg_path <- file.path(source_path, "GitHub_packages", paste0(i, "-master"))
  stopifnot(file.exists(pkg_path))
  deps <- devtools::dev_package_deps(pkg_path, dep = T)$package
  install.packages(deps, contriburl = url)
  tryCatch(devtools::install(pkg_path), error = function(e) message("NOTE: ", e$message))
  return("")
})

Note that sometimes Rgui.exe on windows will throw an error along the lines of "The procedure entry point ... could not be located in the dynamic library ..." when trying to load the newly installed packages during installation. This can be safely ignored and packages that otherwise installed without trouble should load okay when loading them with library().

Updating a system not connected to the internet

If you're just updating an existing offline installation with a new version of any of the packages (simplest case: a new version of isoreader), download the latest version of the package from github.com/isoverse/isoreader/archive/master.zip, unzip the archive and transfer the isoreader-master folder to the offline system. Then start RStudio or an R console, set your working directory (setwd("path_to_folder")) to the folder where isoreader-master is located (not the isoreader-master folder itself, one folder above that), and run the following command. Adjust as needed for updating other packages.

devtools::install("isoreader-master", reload = FALSE)

from isoreader.

BrianEads avatar BrianEads commented on August 26, 2024

thanks so much for the prompt and VERY detailed reply! I really appreciate your efforts. If we do decide to go down the route of installing on the non-networked computer, I will keep you posted - it does have an open USB so we can copy the data off to another (networked) machine instead.

from isoreader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.