Page 1 of 1

IDE Tools cannot launch one specific application

Posted: 8 Aug 2020 21:32
by Harrison Pratt
When I try to set up one particular application (xplorer2_64.exe) to launch from the IDE tools the application window (I think) flashes briefly and closes. It behaves the same whether the Wait status on the Configure Tools dialog is set to Wait, NoWait or Auto.

The application folder and file name are correct, since I can launch the application using the following test clause:

Code: Select all

    onTest(_Source, _MenuTag) :-         F = @"C:\Program Files\zabkat\xplorer2\xplorer2_64.exe",         if file::existExactFile(F) then             ExeProg = F,             CmdStr = "",             CommandLine = string::format("% \"%\"", ExeProg, CmdStr),             CreatedProcess = useExe::new(CommandLine),             CreatedProcess:run()         else             vpiCommonDialogs::error("No such file", F)         end if.
Ashampoo_Snap_Saturday, August 8, 2020_16h23m04s_001_.png
Ashampoo_Snap_Saturday, August 8, 2020_16h23m04s_001_.png (13.9 KiB) Viewed 1554 times

Re: IDE Tools cannot launch one specific application

Posted: 13 Aug 2020 9:06
by Thomas Linder Puls
I have installed the mentioned explorer and I experience the same thing as you do. And it is not obvious why it behaves like that. The tool seems to run but it just seems to close again.

There is a simple workaround though. Create a cmd file somewhere with this contents:
"C:\Program Files\zabkat\xplorer2\xplorer2_64.exe" %*
And then configure that script as a tool instead. If you supply the argument $(file:p) then the explorer will open in the directory of the current file.

Also notice that tools always "run on a current file" and they will not run at all if no file is current. I.e. the tool will only run if:
  • an editor is active
  • or project tree is active and a file is selected

Re: IDE Tools cannot launch one specific application

Posted: 13 Aug 2020 16:51
by Harrison Pratt
Thanks, Thomas!

I looked for hidden characters in the file name and found none.
I tried running Xplorer2 from the Notepad++ command line and got this error message:
Ashampoo_Snap_Thursday, August 13, 2020_11h13m51s_001_.jpg
Ashampoo_Snap_Thursday, August 13, 2020_11h13m51s_001_.jpg (29.02 KiB) Viewed 1464 times
It will run from the command line (Win-R) and from the Xplorer2 command line.

Your command line suggestion works perfectly -- thanks!

Re: IDE Tools cannot launch one specific application

Posted: 13 Aug 2020 17:59
by Harrison Pratt
Surrounding the command C:\Program Files\zabkat\xplorer2\xplorer2_64.exe eliminates the error with Notepad++ but doesn't help with the VIP IDE.

I notice that the Tool commands that are working point to C:\Program Files (x86)\... and the one for Xplorer2_64 is in C:\Program Files\...

Could there be a glitch in the automatic enquoting of the command in the IDE?

Re: IDE Tools cannot launch one specific application

Posted: 14 Aug 2020 13:06
by Harrison Pratt
C:\Program Files\zabkat\xplorer2\xplorer2_64.exe %* in the CMD file works if unquoted.

If it is quoted then xplorer2_64.exe does not handle the command line parameters.
Other applications may interact differently with CMD files with respect to quoting.