Cannot call external program (.bat or .exe) from within Oxygen on Windows 8
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 24
- Joined: Tue May 05, 2020 9:57 am
- Location: Tübingen, Germany
- Contact:
Cannot call external program (.bat or .exe) from within Oxygen on Windows 8
I have prepared an Oxygen project setup for a team of around 10 people. My setup contains an external tool integration that calls a windows executable file (I tried for both .exe and .bat files). The project setup works for all users except one. The main difference that I can see is that this one user is still working on a Windows 8 platform, while all (?) others are running Windows 10. We're all running Oxygen 21.1 at the moment.
I am aware that this is difficult to debug with just a description of the problem and without access to the actual machine, but maybe somebody can give me hints on what I could do to further debug and pinpoint the actual problem? So here are the details:
My external tool setup is:
Working folder: ${pd}/tools
The error message displayed in the execution window of the affected user is:
When I execute a right-click on the Batch file in the project window and select "open with system application" I have the same results: It works on my computer (Win 10) and fails on the affected user's (Win 8 ). And a third test I ran was: I added a transformation scenario, which generates a batch file on the fly. The transformation scenario stores the generated batch file unter `${pd}/tools/preview.bat` and I set the option "Open the generated file in browser/system application" after the transform has run. Again: When executing the transformation scenario on my Win 10, this will automatically execute the generated batch file, but comes up with a file not found error on the other user's Win 8.
I don't think that this is a problem with any PATH environment variable issues, as the path is actually not needed. I am only dealing with absolute paths to the executables that I want to run, the executables are always inside the project folder. So what could cause this, any ideas?
I am aware that this is difficult to debug with just a description of the problem and without access to the actual machine, but maybe somebody can give me hints on what I could do to further debug and pinpoint the actual problem? So here are the details:
My external tool setup is:
Working folder: ${pd}/tools
Code: Select all
curl.exe -i -F "${cfne}=@${cf}" -F "user=${env(username)}" https://.... some URL .../api
So it is basically a file not found exception, while I can say that the file is definitely stored under the given path. I have also asserted that the user has execution rights for the program. Furthermore I tried to wrap my call of curl.exe in a Windows-Batch file (.bat), with the same result: It tells me that filename.bat cannot be found under the given path.Could not start: Cannot run program "curl.exe" (in directory "C:\Users\Manuela\Documents\Git\dh-unitue-rke-proj\tools"): CreateProcess error=2, Das System kann die angegebene Datei nicht finden
java.io.IOException: Cannot run program "curl.exe" (in directory "C:\Users\Manuela\Documents\Git\dh-unitue-rke-proj\tools"): CreateProcess error=2, Das System kann die angegebene Datei nicht finden
at java.lang.ProcessBuilder.start(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at ro.sync.cmdline.h.b(Unknown Source)
at ro.sync.cmdline.e$1.dxd(Unknown Source)
at ro.sync.ui.application.mb.run(Unknown Source)
Caused by: java.io.IOException: CreateProcess error=2, Das System kann die angegebene Datei nicht finden
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
... 5 more
Process ended with exit code: -1234567
When I execute a right-click on the Batch file in the project window and select "open with system application" I have the same results: It works on my computer (Win 10) and fails on the affected user's (Win 8 ). And a third test I ran was: I added a transformation scenario, which generates a batch file on the fly. The transformation scenario stores the generated batch file unter `${pd}/tools/preview.bat` and I set the option "Open the generated file in browser/system application" after the transform has run. Again: When executing the transformation scenario on my Win 10, this will automatically execute the generated batch file, but comes up with a file not found error on the other user's Win 8.
I don't think that this is a problem with any PATH environment variable issues, as the path is actually not needed. I am only dealing with absolute paths to the executables that I want to run, the executables are always inside the project folder. So what could cause this, any ideas?
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: Cannot call external program (.bat or .exe) from within Oxygen on Windows 8
Hi,
From what I tested it doesn't work as intuitively expected: folder path in Working directory and exe name in command line.
Try using the full path for the executable in the Command line field. Use double quotes around the path. Like so:
It's not a problem with the PATH environment variable, but it probably works for you because your PATH may contain a folder where curl.exe is located. For those that don't have it, it will fail.
Try on your machine in a Command Prompt window:
If it's in the PATH, you'll get the location as a result.
Regards,
Adrian
From what I tested it doesn't work as intuitively expected: folder path in Working directory and exe name in command line.
Try using the full path for the executable in the Command line field. Use double quotes around the path. Like so:
Code: Select all
"${pd}/tools/curl.exe" ...
Try on your machine in a Command Prompt window:
Code: Select all
where curl.exe
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 24
- Joined: Tue May 05, 2020 9:57 am
- Location: Tübingen, Germany
- Contact:
Re: Cannot call external program (.bat or .exe) from within Oxygen on Windows 8
Dear Adrian,
thanks a lot, that worked!
(At least for the external tool definition. I didn't ask our customer to check if the starting of a generated batch file at the end a transformation scenario run would work. I assume it doesn't, because we have changed nothing there. However, our problem is solved, the transformation scenario was only an attempted workaround.)
thanks a lot, that worked!
(At least for the external tool definition. I didn't ask our customer to check if the starting of a generated batch file at the end a transformation scenario run would work. I assume it doesn't, because we have changed nothing there. However, our problem is solved, the transformation scenario was only an attempted workaround.)
image.png
You do not have the required permissions to view the files attached to this post.
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service