From simon.urbanek at math.uni-augsburg.de  Mon Nov 29 00:51:15 2004
From: simon.urbanek at math.uni-augsburg.de (Simon Urbanek)
Date: Mon Nov 29 00:51:24 2004
Subject: [Rd] Version names
In-Reply-To: <loom.20041128T235131-532@post.gmane.org>
References: <loom.20041128T190755-473@post.gmane.org>
	<bl6kq05o6vuscam0rrlg00ndvchi68jals@4ax.com>
	<loom.20041128T200019-382@post.gmane.org>
	<eujkq0lbgdji3073ud8sjg73016upfdb1u@4ax.com>
	<loom.20041128T235131-532@post.gmane.org>
Message-ID: <6463A9E0-4198-11D9-9579-0003938AF008@math.uni-augsburg.de>

On Nov 28, 2004, at 11:58 PM, Gabor Grothendieck wrote:

> Quite so but unfortunately if I want to produce a script
> that has no dependencies then I need to use what is provided
> in Windows and Windows batch commands seem to be the best
> way to do that.

Batch scripts are also quite dependent on the system and settings used. 
Moreover what are you trying to do? The rwXXX scheme is just a 
suggestion, every user is free to change the name during the 
installation, so there is no way to know by folder name which version 
you're dealing with... The only half-way sensible solution I can think 
of is looking for Rterm.exe and running each one to get the 
corresponding R version - I suppose you can do that with a batch script 
;).

If all you want to do is to determine the current (most recently 
installed) R version, then all it takes is two lines of C code [just 
read one registry entry] - and it's at least as portable across Windows 
systems as a batch script, but far more flexible. (There may even be a 
way to get that info w/o coding at all - I'm not sure whether regedit 
has any batch mode or something ...).

Cheers,
Simon


[Rd] Version names
Simon Urbanek