Opened 8 months ago

Last modified 8 months ago

#578 new defect

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 (1)

comment:1 Changed 8 months ago by belg4mit

Originally QGIS #16441

Note: See TracTickets for help on using tickets.