Skip to content

[R-pkg-devel] problem with regdmp finding v4.2.x under Windows

6 messages · Jonathan Godfrey, Ivan Krylov, Uwe Ligges +3 more

#
Hi all,

In order to support my local students and other blind users, I install every version of R and re-build every document used, almost all of which are R markdown documents.

That means re-installing or updating packages as if I was a novice user following instructions. I try to give my students a clean start experience at the beginning of semester so that we're all using the same versions, and gives me time to sort out the messes before semester begins.

To do all of that efficiently, I make extensive use of batch files (Windows user alert) and a key ingredient of those batch files is that I avoid having to edit the R version number with each installation.

I've been using a Windows utility called regdmp to look in the registry for the highest version number. Up to v4.1.3, that was working extremely well for me.

In addition, I've been investigating quarto, and have struck the same problem because quarto looks for the path to Rscript.exe using the regdmp utility. I've had help from the quarto team, and we've established that the regdmp utility should be finding a version of R if one exists. On my newish laptop where there is just one R installation (4.2.0) regdmp fails to find any installation because it has an "Access denied" error message.

On my older desktop which has multiple R installations, I do not get an "Access denied" error, quarto finds the path to the 4.2.0 installation via brute force, but regdmp via my batch files gives me 4.1.x instead.

I'm currently able to provide the service to my students I want, but only by doing all R work by explicitly naming the version of R I want used. I really do want to get back to my previous workflow so that I just install new versions of R and carry on.

I'm now seeking your advice on the differences in installation of versions 4.2.x and 4.1.x that could have an impact on the Windows registry and therefore regdmp's ability to find the relevant entries there.


Many thanks,
Jonathan
#
Hi Jonathan,

Since we don't have a separate "R on Windows" or "R installation
and administration" mailing list, I think that this question is a
better fit for R-help, not R-package-devel. Although R-devel could be
an option too (if we determine that the R installer is doing something
wrong), the last time R installer has been significantly changed is
2020, so the problem is likely elsewhere.

On Tue, 5 Jul 2022 01:59:43 +0000
Jonathan Godfrey <A.J.Godfrey at massey.ac.nz> wrote:

            
Can you show us the relevant parts of the batch files?
What is the output of the following commands on the machines where you
have troubles finding R-4.2.x?

reg query "HKEY_LOCAL_MACHINE\Software\R-core"
reg query "HKEY_CURRENT_USER\Software\R-core"
This mailing list removes the HTML parts from our messages, so we only
see the automatically-generated plain text part. In this case, I think
that your message wasn't damaged at all, but sometimes (especially when
pasting code or output examples) the results can be undesirable.
#
The installer asks you

"Save Version in Registry" with Description "Save the R version and 
install path in the Registry". If this is checked in the installation 
wizard, it should work, otherwise not.

Best,
Uwe Ligges
On 05.07.2022 10:15, Ivan Krylov wrote:
#
Hi Jonathan,

I'm not certain if this is the issue you're encountering, but I've
noticed that different versions of R may write to different locations
in the registry.

Right now, on my machine, I see entries for R 4.1.3 installed at:

    Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\R-core\R

And for my installation of R 4.2.1, I see it at:

    Computer\HKEY_LOCAL_MACHINE\SOFTWARE\R-core\R

Note that the registry location for R 4.2.1 is no longer part of the
WOW6432Node.

I'm not sure if this is a hiccup unique to my own local machine, but
perhaps you're seeing something similar? A way to verify would be to
check and compare what you see with:

    reg query HKEY_LOCAL_MACHINE\SOFTWARE\R-core\R /reg:32
    reg query HKEY_LOCAL_MACHINE\SOFTWARE\R-core\R /reg:64

In my case, I see:

C:\Users\kevin>reg query HKEY_LOCAL_MACHINE\SOFTWARE\R-core\R /reg:32

HKEY_LOCAL_MACHINE\SOFTWARE\R-core\R
    InstallPath    REG_SZ    C:\R\R-4.1.3
    Current Version    REG_SZ    4.1.3

C:\Users\kevin>reg query HKEY_LOCAL_MACHINE\SOFTWARE\R-core\R /reg:64

HKEY_LOCAL_MACHINE\SOFTWARE\R-core\R
    InstallPath    REG_SZ    C:\R\R-4.2.1
    Current Version    REG_SZ    4.2.1

Best,
Kevin

On Tue, Jul 5, 2022 at 8:00 AM Uwe Ligges
<ligges at statistik.tu-dortmund.de> wrote:
#
Jonathon,
Are you using a very old version of regdump?  Could it be a 32 bit
version?

Greg

On Tue, 5 Jul 2022 at 12:00, Jonathan Godfrey <A.J.Godfrey at massey.ac.nz>
wrote:

  
  
1 day later
#
On 7/5/22 19:27, Kevin Ushey wrote:
The R installer does not write R version information to the 32-bit view 
of the registry when installing only 64-bit files. This is the same with 
previous versions of R as can be seen from the code. I've tested with 
4.1.3 - when you opt out from installing 32-bit files, version 
information won't appear in the 32-bit view. In principle, one could 
still write something to the 32-bit view, though I think this decision 
was intentional as it required an extra condition in the sources.

R 4.2.x doesn't support 32-bit files anymore, hence? for users using the 
defaults, it is R 4.2.0 when the version information no longer appears 
in the 32-bit view.

One could proceed by searching both the 32-bit and the 64-bit views when 
looking for the newest installed version, preferring 64-bit. For 
practical use on current systems, using the 64-bit view only should 
probably do.

Best,
Tomas