Bug report #16441

R detection fails, preventing QGIS.bat from launching desktop app

Added by belg4mit - over 7 years ago. Updated about 6 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Build/Install
Affected QGIS version:3.2.2 Regression?:No
Operating System:Windows Easy fix?:No
Pull Request or Patch supplied:Yes Resolution:up/downstream
Crashes QGIS or corrupts data:No Copied to github as #:24350

Description

etc\\ini\
batchfiles.bat emits the follow uncaught error, causing qgis.bat to bail

C:\\PROGRA~1\\QGIS2~1.18>IF EXIST "C:\\Program Files\\R\\" C:\\PROGRA~1\\QGIS2~1.18\\apps\
batchfiles\\R path
\\R\\R-2.15.0 was unexpected at this time.

History

#1 Updated by Giovanni Manghi over 7 years ago

  • Easy fix? set to No
  • Regression? set to No

#2 Updated by Giovanni Manghi over 7 years ago

  • Description updated (diff)
  • Status changed from Open to Feedback
  • Priority changed from High to Normal

Can you detail a little bit more (how you got into this issue, as R detection usually works ok)?
Do you really got this issues on master (QGIS3)?

#3 Updated by Giovanni Manghi over 7 years ago

  • Resolution set to not reproducable
  • Status changed from Feedback to Closed

Closing for lack of feedback.

#4 Updated by belg4mit - about 6 years ago

  • Status changed from Closed to Reopened
  • Regression? changed from No to Yes

This bug is back/remains.

I've tried to install 3.2.2 on my machine (Windows 10) twice, once with the giant installer file, and once with the net installer. Both times shortcuts for GRASS, SAGA and OSGeo shell are created, but not QGIS. However, these shortcuts do not function. If I try to run the SAGA or GRASS scripts from the command line I receive the following error:

\R\R-2.15.0 was unexpected at this time.

Which is not a path that exists on my system. I do have C:\Program Files\R\R-3.3.1

#5 Updated by Giovanni Manghi about 6 years ago

  • Regression? changed from Yes to No
  • Status changed from Reopened to Closed

belg4mit - wrote:

This bug is back/remains.

I've tried to install 3.2.2 on my machine (Windows 10) twice, once with the giant installer file, and once with the net installer. Both times shortcuts for GRASS, SAGA and OSGeo shell are created, but not QGIS. However, these shortcuts do not function. If I try to run the SAGA or GRASS scripts from the command line I receive the following error:

[...]

Which is not a path that exists on my system. I do have C:\Program Files\R\R-3.3.1

this is likely because of legacy configurations/registry entries. Could you try if this happens also on a clean system? If it does we can reopen this. Thanks.

#6 Updated by belg4mit - about 6 years ago

  • Status changed from Closed to Reopened
  • Operating System set to Windows
  • Pull Request or Patch supplied changed from No to Yes
  • Resolution deleted (not reproducable)

This seems like a premature close.

I'm not going to wipe my system to try installing a newer QGIS. Nor do I want to uninstall existing versions of QGIS, since some plugins are likely to no longer be compatible with the newer version, or there may be bugs with 3.2. Support for multiple installations seems perfectly reasonable given these, and other rationales.

Swapping the order of these two clauses at :: 4a in etc\ini\R.bat allows things to work:

if not defined R_HOME for /f "tokens=2*" %%a in (
    'reg query hklm\software\wow6432Node\r-core\r /v InstallPath 2^>NUL ^| findstr InstallPath'
    ) do set R_HOME=%%~b

if not defined R_HOME for /f "tokens=2*" %%a in (
    'reg query hklm\software\R-core\R /v InstallPath 2^>NUL ^| findstr InstallPath'
    ) do set R_HOME=%%~b

I don't know why the first one fails, but since it seems to detect older versions of R, it should probably be the fallback and not the first choice anyhow.

C:\Program Files\QGIS 3.2>reg query hklm\software\wow6432Node\r-core\r /v InstallPath

HKEY_LOCAL_MACHINE\software\wow6432Node\r-core\r
    InstallPath    REG_SZ    C:\Program Files (x86)\R\R-2.15.0

C:\Program Files\QGIS 3.2>reg query hklm\software\R-core\R /v InstallPath

HKEY_LOCAL_MACHINE\software\R-core\R
    InstallPath    REG_SZ    C:\Program Files\R\R-3.3.1

#7 Updated by Giovanni Manghi about 6 years ago

  • Affected QGIS version changed from master to 3.2.2
  • Status changed from Reopened to Feedback

I'm not going to wipe my system to try installing a newer QGIS.

I didn't suggested that. On the other hand on clean systems the issue you are pointing does not happen.

#8 Updated by Jürgen Fischer about 6 years ago

  • Resolution set to up/downstream

This is a OSGeo4W issue (package rbatch)

#9 Updated by Giovanni Manghi about 6 years ago

  • Status changed from Feedback to Closed

#10 Updated by belg4mit - about 6 years ago

Giovanni Manghi wrote:

I'm not going to wipe my system to try installing a newer QGIS.

I didn't suggested that. On the other hand on clean systems the issue you are pointing does not happen.

I'm not sure what else you might have meant by clean system. In any event, I'll create a bug report in OSGEO;
it's a shame that there are multiple systems preventing easy reassignment.

#11 Updated by Giovanni Manghi about 6 years ago

I'm not sure what else you might have meant by clean system.

another PC that had never had qgis installed? a disposable VM? a VM snapshot?

Also available in: Atom PDF