New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plugin can't execute bat file command under Windows OS with error "The system cannot find the file specified" #2261
Comments
How to fix: Easy path:
Not easy path:
#include <AutoItConstants.au3>
#include <MsgBoxConstants.au3>
RunPlantUML()
Func RunPlantUML()
Local $iPID = Run(@comspec & StringFormat(" /C java -jar ""%s"" %s", "!!!PUT THERE FULL PATH TO plantuml.jar!!!", $CmdLineRaw), "", @SW_HIDE, BitOR($STDERR_CHILD, $STDOUT_CHILD))
ProcessWaitClose($iPID)
Local $sOutput = ""
While 1
$sOutput &= StdoutRead($iPID)
If @error Then
ExitLoop
EndIf
MsgBox($MB_SYSTEMMODAL, "Stdout Read:", $sOutput)
WEnd
$sOutput = ''
While 1
$sOutput &= StderrRead($iPID)
If @error Then
ExitLoop
EndIf
MsgBox($MB_SYSTEMMODAL, "Stderr Read:", $sOutput)
WEnd
EndFunc ;==>RunPlantUML
Current situation: My thoughts:
|
@Toggoren in tryexec/_lookup function: zim-desktop-wiki/zim/applications.py Lines 217 to 226 in 2d2970f
A note about the workaround above, I didn't test it yet, but I think it may most likely doesn't work strange away if there is executable in PATH environment. The reason is either Python or Zim doesn't actually work well with the PATH in Windows for some reason. Usually, I have to put the thing into Zim folder to make it works. I have a serval case like that already. About the workaround, it is actually simple that I can just modify the plugin python file to call run with argument
|
Describe the bug
When insert UML diagram, it will fail to generate image with error "The system cannot find the file specified"
It is because Python has a problem to detect the command file with .bat extension
I believe it is this part in applications.py:
zim-desktop-wiki/zim/applications.py
Lines 294 to 309 in 2d2970f
Should add shell = True to compatible for Windows?
Reference of similar issue in another repo: mikitex70/plantuml-markdown#11
To Reproduce
Logs:
Expected behavior
Should no error and able to execute command of bat file.
Screenshots
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: