From ggrothendieck at gmail.com  Thu Jul 14 16:55:06 2005
From: ggrothendieck at gmail.com (Gabor Grothendieck)
Date: Thu, 14 Jul 2005 10:55:06 -0400
Subject: [Rd] upgrading an R installation to next versoin
In-Reply-To: <42C3ED74.7030905@stats.uwo.ca>
References: <971536df0506300510f6d6ac2@mail.gmail.com>
	<42C3ED74.7030905@stats.uwo.ca>
Message-ID: <971536df0507140755550ab795@mail.gmail.com>

I have been thinking a bit more about the Windows R installation
upgrade discussion below and there are really two cases:

1. one wants to upgrade R and is no longer interested in preserving
the old versions of R

In this case one could configure R to have a ..\R\library folder that 
contains the library and *.site files so that they do not have to be 
moved each time that one upgrades R.  (The old versions of R still 
access the same library and *.site files as the new versions of R 
and over time its likely that they won't work any more with the old
versions of R as we start using the features of the newer R
but in this case we don't really care.)  The problem here is that
the defaults do not support this and one must set environment
variables which complicates setup.   I have some batch files
which will automatically set them although if R would automatically:
1. look into ...\R\library if it cannot find ...\R\rw...\library and 
2. look for ...\R\etc\*.site if it cannot find them in ...\R\rw...\etc\*.site
this could be streamlined substantially.  The only danger in
supporting this is that anyone who used this facility would
not be preserving the identity of different versions on his
system -- although that is already true if they use R_PROFILE,
etc. since that applies to all versions too.

2. one wants to upgrade R but wants to maintain the old versions
in working order.

In this case we need to snapshot the library and *.site files so
we might as well keep them in a version-specific area, viz.
...\R\rw...\library and ...\R\rw...\etc\*.site
and then copy them over to the new version of R when that
new version is installed (so that as they change over time
with the new version the old version of R still has its older
ones).

Thus I would suggest that we:

1. by default search for ..\R\library and \R\*.site if those are not
otherwise found

2. have an option to allow or disallow the installation program to
copy over *.site
and library files from the old version to the new version (or else provide 
registry information on what the old and new versions are so that one can 
write a program to do it oneself)




On 6/30/05, Duncan Murdoch <murdoch at stats.uwo.ca> wrote:
> On 6/30/2005 8:10 AM, Gabor Grothendieck wrote:
> > When I install a new version of R (Windows XP) I have to:
> >
> > 1. copy my rw....\etc\Rprofile.site file to the new installation
> >
> > 2. copy the rw....\share\texmf files to the tex subfolder of the
> >    miktex root directory and then refresh the miktex name database
> >    (I have a batch file that does this for me which I run
> >    whenever I install a new version of R.)
> >
> > 3. setup the shortcut key using 'properties' on my R desktop icon so
> >    that ctrl-alt-R brings up the new rather than the old R.  (This one
> >    really had me confused once since I did not realize I was still
> >    using the old version of R after installing the new one.)
> >
> > 4. reinstall the packages I use or else setup etc\Renviron.site with
> >    an R_LIBS to point to include the old library or perhaps one can
> >    copy the libraries over being careful not to overwrite new versions
> >    of the standard libraries.
> >
> > Many other windows program automatically transfer the settings when
> > you upgrade them.
> >
> > I wonder if the installation process could optionally transfer
> > such settings from an old installation to a new one to make it
> > easier to install R.
> 
> I think a couple of these could be handled by not applying so many
> modifications to the R installation, do more locally.  For example, #1
> needn't be copied, you can just use the R_ENVIRON environment variable
> to point to it and both versions will see it.
> 
> I'd call #2 a bug in MikTeX, but it's probably one we'll have to work
> around one of these days.  (The bug is dropping support for the
> environment variable specification of extra include directories.)
> 
> #3 might be something we could do, but I don't see how.  The installer
> could know what hotkey you used the last time you installed R, but if
> you changed it in the meantime, how would it know about that?  And how
> would it remove the hotkey from the old shortcut?  (A little
> experimentation suggests that XP is buggy in handling multiple shortcuts
> with the same hotkey.  I'd rather stay away from this.)
> 
> #4 is another case where you can put your libraries outside R_HOME.
> 
> Duncan Murdoch
>



[Rd] upgrading an R installation to next versoin
Gabor Grothendieck