`Process failed (The system cannot find the file specified)`.
Note:
- I reverted all of my changes to `filetypes.cs` in https://github.com/geany/geany/discussions/3753 - I added `C:\Program Files\Mono\bin` to Windows' `PATH` - Mono's `mcs` is a script file: on Linux, it's a shell script named `mcs`; on Windows, it's a batch script named `mcs.bat`
My thoughts:
- Should I encapsulate the path to Mono in Windows' `PATH` with double quotes? `"C:\Program Files\Mono\bin"`? There is a space in the path. It could cause problems. Windows Command Prompt has no problem running `mcs`. But Geany is a Linux-first program that is only ported to Windows as an afterthought. - Or it's very likely that Geany has problems calling batch script. Does it assumed the executable to have the extension `.exe`?
The code in Geany to spawn build commands on Windows is Windows specific. It uses `CreateProcessW` which says "If the file name does not contain an extension, .exe is appended." so it is assumed as `.exe` but by Windows, not Geany.
On the command line the shell probably does the checking for `.bat` and other stuff but there is no shell involved in build commands in Geany.
The solution is to launch the program with the shell. You still use `CreateProcessW`, but the process will be `cmd.exe`. For example: `cmd /c external_program /external_program_switch`.
The solution is to launch `mcs` with `cmd /c`. I edited `filetypes.cs` and it worked. Thank you.
Closed #3776 as resolved.
github-comments@lists.geany.org