Closed dadul96 closed 3 years ago
There might be a problem with this PR: as I can see, this will add the same string to PATH each time the batch file will be executed. I think there should be a safeguard implemented to add the string only if the string does not already exist in PATH.
According to this post the solution would be different, but I am not sure that such change is really needed. Usually, if you install Java it will add the new installation path to global PATH, so that after a PC restart the batch file should run ok.
There might be a problem with this PR: as I can see, this will add the same string to PATH each time the batch file will be executed. I think there should be a safeguard implemented to add the string only if the string does not already exist in PATH.
As far as I understand the PATH is only set temporarily. See: set-command
Ok, that might be true. However, the path you set here is a custom path. Many users (just like me) use the standalone package of Arduino IDE, which means that it may be then installed into another custom folder. In these cases this PR will not work, right?
Yes, that is correct. This PR will only affect users which installed the Arduino IDE in the default directory, but it won't break anything for other installation variants.
I think the best solution is to pass the Arduino IDE installation path to the batch file so that the correct path to Java can be set independent on the user preferences.
I have tested it and it works.
Necessary changes:
Can you please try these changes and adapt this PR accordingly?
This solution is way better, thanks! I will update the PR tomorrow. There is only one change necessary to work properly:
- tools.maple_upload.upload.pattern="{path}/{cmd}" {serial.port.file} {upload.altID} {upload.usbID} "{build.path}/{build.project_name}.bin" {runtime.ide.path}
+ tools.maple_upload.upload.pattern="{path}/{cmd}" {serial.port.file} {upload.altID} {upload.usbID} "{build.path}/{build.project_name}.bin" "{runtime.ide.path}"
This allows having a space in the path string.
This solves the problem where this batch file may use a different Java version compared to the one provided by the Arduino IDE. (see Issue #813)