north-road / qgis-processing-saga-nextgen

GNU General Public License v3.0
21 stars 11 forks source link

cmd.exe not found #35

Open GaRyu opened 9 months ago

GaRyu commented 9 months ago
'cmd.exe' is not recognized as an internal or external command,
operable program or batch file.

On Windows, jumping through a few hoops is required to even get SAGA visible in QGIS. First you have to install the binaries, then you have to go into QGIS settings under system environment and add the SAGA binaries path without spaces (C:\progra~1\saga). Finally install the SAGA nextgen processing plugin. This makes SAGA visible in the toolbox.

When trying to run any tool I get the error at the top. What I think is happening is that underscore needs to be escaped in the code, so calling "saga_cmd.exe" should be called as "saga\_cmd.exe".

I cannot find the code where saga is called though. Can someone point me to where this is so I can try a quick fix?

GaRyu commented 9 months ago

Found a solution. The saga-nextgen plugin is under C:\user\name\appdata....

In utils.py on row 195 has to be changed to this:

command = ['C:\\Windows\\System32\\cmd.exe', '/C ', safeSagaBatchJobFilename]

Perhaps would be even better to use a path.join(). After that change, everything works.

nyalldawson commented 9 months ago

@GaRyu can you submit a PR with this change?