Go Down

Topic: CreateProcess error = 2 (Read 665 times) previous topic - next topic

WizIO

Hello

at my platform.txt I have:

tools.Quectel_Flash_Tool.cmd.path={runtime.tools.bc66_tools.path}
tools.Quectel_Flash_Tool.erase.pattern="START /D {cmd.path} /W FlashTool.exe"

but after click Tools -> Burn ... I get error...

java.io.IOException:
Cannot run program "START /D C:\Users\Wiz\AppData\Local\Arduino15\packages\WizIO\tools\bc66_tools\1.0 /W FlashTool.exe"
CreateProcess error=2, The system cannot find the file specified


The link to EXE is OK

FlashTool.exe should be started from a specified directory and I use windows command "start /D folder... /W application"


pert

#1
Dec 28, 2018, 12:02 pm Last Edit: Dec 28, 2018, 12:03 pm by pert
The error is caused by trying to run start. It has nothing to do with FlashTool.exe. The way to do this is via cmd /C:
Code: [Select]
tools.Quectel_Flash_Tool.erase.pattern=cmd /C START /D "{cmd.path}" /W FlashTool.exe

This will only work on Windows. If you really need to specify OS-specific recipes, you should do it like this:
Code: [Select]
tools.Quectel_Flash_Tool.erase.pattern=...
tools.Quectel_Flash_Tool.erase.pattern.windows=cmd /C START /D "{cmd.path}" /W FlashTool.exe

where the first recipe would be for non-Windows OS. You can also specify individual recipes for each OS:
https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5-3rd-party-Hardware-specification#automatic-property-override-for-specific-os

I don't understand why you need to use start at all. Is FlashTool.exe in {cmd.path}?

WizIO


THANKS !!! ... this is ok:

tools.Quectel_Flash_Tool.erase.pattern=cmd "/C START /D {cmd.path} /W FlashTool.exe"


FlashTool.exe looking for INI file from his folder, but started forder point arduino app folder ...
https://ss64.com/nt/start.html

"non-Windows" yep, but I not have FlashTool and console Uploader for other OS

pert

I'm not sure about your quote placement. Usually, we quote paths in order to handle folders that have spaces in them. The Arduino IDE seems to try to do some automated handling of this, which causes more problems than it fixes in my experience.

Anyway, I'm glad it's working now!

WizIO

"quote placement"
I think ... java CreateProcess run APP as first argument and other arguments
Process p = new ProcessBuilder("application", "arguments").start();

so it works :)

Go Up