Discussions related to Visual Prolog
Harrison Pratt
VIP Member
Posts: 439
Joined: 5 Nov 2000 0:01

IDE Tools cannot launch one specific application

Unread post 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 9522 times
User avatar
Thomas Linder Puls
VIP Member
Posts: 1398
Joined: 28 Feb 2000 0:01

Re: IDE Tools cannot launch one specific application

Unread post 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
Regards Thomas Linder Puls
PDC
Harrison Pratt
VIP Member
Posts: 439
Joined: 5 Nov 2000 0:01

Re: IDE Tools cannot launch one specific application

Unread post 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 9432 times
It will run from the command line (Win-R) and from the Xplorer2 command line.

Your command line suggestion works perfectly -- thanks!
Harrison Pratt
VIP Member
Posts: 439
Joined: 5 Nov 2000 0:01

Re: IDE Tools cannot launch one specific application

Unread post 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?
Harrison Pratt
VIP Member
Posts: 439
Joined: 5 Nov 2000 0:01

Re: IDE Tools cannot launch one specific application

Unread post 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.
Post Reply