[ESS] Emacs finding "R" on Windows {was "Release of ESS 5.3.5"}

Martin Maechler maechler at stat.math.ethz.ch
Fri Aug 24 09:06:23 CEST 2007


>>>>> "PL" == Phillip Lord <phillip.lord at newcastle.ac.uk>
>>>>>     on Thu, 23 Aug 2007 11:50:38 +0100 writes:

>>>>> "FAT" == Frede Aakmann Tøgersen <FredeA.Togersen at agrsci.dk> writes:
    >>> Well, finding all the versions of R is going to be heuristic, so there is
    >>> nothing to stop you from doing both. I would suggest the following:
    >>> 
    >>> 1) Check a variable set by the user -- they can always
    >>> override things.
    >>> 2) Check c:/Program Files as this is the canonical and
    >>> default location for storing programs on windows.

    FAT> Yes, for the english version of Windows XP. For instance in the danish
    FAT> version it is

    FAT> c:/Programmer

    FAT> How many language-specific versions of Windoze are there?

[ !! Thanks, Frede, for that! ]

 
    PL> Ah. I didn't know that windows internationalised that. 

{{ AFAIK they've even internationalized the function names in
   Excel/Vbasic ...   the Horror-Land ... }}

    PL> For me (getenv "ProgramFiles") returns the right location though. So

    PL> (directory-files 
    PL> (concat (getenv "ProgramFiles")
    PL> "\\R"))


    PL> Should return all the R directories in the standard place. For me that is...

    PL> ("." ".." "R-2.5.1")

Indeed (and it also works with "/" instead of "\\");
I've changed the ESS sources to use  (getenv "ProgramFiles")
everywhere instead of  "c:/progr.......

    PL> Failing that 

    PL> (executable-find "R.exe")

    PL> which is...

    PL> "c:/Program Files/R/R-2.5.1/bin/R.exe"

    PL> will work iff R is in the path. 

(which it is not, I think, after a default installation of R on windows)


    PL> After that, 

    PL> HKEY_LOCAL_MACHINE\Software\R-core\R\Current Version

    PL> gives the current version


    PL> HKEY_LOCAL_MACHINE\Software\R-core\R\[version]\InstallPath

    PL> gives it's location. w32-regdat gives access to these values, although this
    PL> also requires an external executable. 

Hmm, on the GNU emacs 22.1 (on Windows Server 2003) which I've
got from Vincent's,
I don't seem to get anything from 
   w32-regdat  (variable)
or w32-regdat  (function).

and the "emacs-official"   w32-fns.el  file full of Windows (NT)
support functions does not contain the string "regis"
which would mean it has no official e-lisp support for accessing
the registry ?

    PL> If I get the time, I'll try and write some lisp to get this to work. 

That would be quite useful for the community, thank you in
advance!

Martin




More information about the ESS-help mailing list