Why use the R registry entries for Windows "Current Version" and "Set Path"?

Here are the two registry entries I'm asking for. **

HKEY_LOCAL_MACHINE\Software\R-core\R\Current Version HKEY_LOCAL_MACHINE\Software\R-core\R\version\InstallPath 

When R is launched from the command line (or from emacs or statconnDCOM ), it uses any version first in the Windows Path environment variable. On the contrary, double-clicking on the *.Rdata file uses the version indicated by the corresponding file association entry in HKEY_CLASSES_ROOT .

But when or by what two used elements are HKEY_LOCAL_MACHINE ?

EDIT: Brian Diggs points to a set of Windows *.bat that use (and modify) these registry entries, but I'm still interested in that closer to the "core" R uses them. (I hope the answer is no.)


** As described in the R for Windows FAQ , these entries can be installed either during installation (by clicking "Save the version number in the registry") or later from the command line (by typing RSetReg.exe from $RHOME\bin ).

+4
source share
2 answers

The main change:

It appears that these registry entries are mainly used for external applications.

That is why I think so.

  • grep'ing HKEY_LOCAL_MACHINE in sources R appears four times only three files. Files - "extra.c" , "RSetReg.c" and "rhome.c" - are located in R-2.15.0/src/gnuwin/ or its subdirectories.

  • The corresponding occurrence is similar to that in R-2.15.0/src/gnuwin/rhome.c , where it is used by the C function get_R_HOME . This function is intended for

    / * get R_HOME from the environment or registry: used in embedded applications * /

    and it searches the registry only if R_HOME , if it is not already found in the "C environment space" or the "Windows API environment space".

  • get_R_HOME , in turn, is displayed only in the other two files "R-2.15.0/src/gnuwin/embeddedR.c" and "R-2.15.0/src/gnuwin/front-ends/rtest.c" . (According to the readme resident file, the role of "R-2.15.0/src/gnuwin/front-ends/" is to enable the "Link [...] R DLL to other applications".)

  • The sources of R * NIX and the emphasis on portability make it unlikely that anything close to the functionality of R will depend on registry entries. (This item is clearly more speculative.)

Unless I hear otherwise, enough to convince me that the purpose of registry entries only is to provide pointers to external applications, especially those that use an embedded instance of R.

+2
source

One set of programs that use them is R batchfiles , which says

These programs install the R version (and the R Tools and miktex version) by (1) examining the environment variables (R_HOME, R_MIKTEX, R_TOOLS) or (2) if they are not set in the registry.

+2
source

Source: https://habr.com/ru/post/1434270/


All Articles