Opened 4 years ago

Closed 17 months ago

#578 closed defect (fixed)

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

Reported by: belg4mit Owned by: osgeo4w-dev@…
Priority: major Component: Package
Version: Keywords:


etc\ini\batchfiles.bat emits the follow uncaught error, causing qgis.bat and other wrappers 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.

Swapping the order of these two clauses at :: 4a in etc\ini\R.bat from the current order (below) 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


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


InstallPath REG_SZ C:\Program Files\R\R-3.3.1

Change History (3)

comment:1 by belg4mit, 4 years ago

Originally QGIS #16441

comment:2 by ndawson, 3 years ago

This can be closed - R support is now plugin based and not part of osgeo4w

comment:3 by jef, 17 months ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.