Lisp HUG Maillist Archive

Delivering command-line executable for Windows

Hi,

How to create a command line app for Windows which does not create a separate window?
I'm trying to deliver the app the following way:
(deliver 'f *delivered-image-name* 0 :multiprocessing t :console :io :startup-bitmap-file nil :interface nil)

and still the delivered executable creates a separate console window upon running.

Br,
/Alexey

Re: Delivering command-line executable for Windows

Nevermind, somehow during experiments I've missed that the flag :console t fixed this.

Br,
/Alexey

On Fri, Oct 23, 2020 at 4:01 PM Alexey Veretennikov <txm.fourier@gmail.com> wrote:
Hi,

How to create a command line app for Windows which does not create a separate window?
I'm trying to deliver the app the following way:
(deliver 'f *delivered-image-name* 0 :multiprocessing t :console :io :startup-bitmap-file nil :interface nil)

and still the delivered executable creates a separate console window upon running.

Br,
/Alexey

Re: Delivering command-line executable for Windows

It seems that UIOP:DUMP-IMAGE could benefit from this knowledge: see https://gitlab.common-lisp.net/asdf/asdf/-/blob/master/uiop/image.lisp#L399-402 that does not have a mention of the :console t flag.

Would you mind if I copypasted this mail to an UIOP issue on the clnet GitLab instance? (Unless you'd like to register there and make the issue yourself.)

BR
~phoe

On 23.10.2020 16:03, Alexey Veretennikov wrote:
Nevermind, somehow during experiments I've missed that the flag :console t fixed this.

Br,
/Alexey

On Fri, Oct 23, 2020 at 4:01 PM Alexey Veretennikov <txm.fourier@gmail.com> wrote:
Hi,

How to create a command line app for Windows which does not create a separate window?
I'm trying to deliver the app the following way:
(deliver 'f *delivered-image-name* 0 :multiprocessing t :console :io :startup-bitmap-file nil :interface nil)

and still the delivered executable creates a separate console window upon running.

Br,
/Alexey

Re: Delivering command-line executable for Windows

Just a possible hint after I just read something related this morning… Whenever you start a Lisp executable like this, the default Standard Error stream is created on a Terminal window. Maybe that is related?

- DM

> On Oct 23, 2020, at 7:01 AM, Alexey Veretennikov <txm.fourier@gmail.com> wrote:
> 
> Hi,
> 
> How to create a command line app for Windows which does not create a separate window? 
> I'm trying to deliver the app the following way:
> (deliver 'f *delivered-image-name* 0 :multiprocessing t :console :io :startup-bitmap-file nil :interface nil)
> 
> and still the delivered executable creates a separate console window upon running.
> 
> Br,
> /Alexey


_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html

Re: Delivering command-line executable for Windows

With regards to adding support in `uiop:dump-image`, note that the function already has the following parameter:

#+(and sbcl os-windows) application-type  

I'd expect it to leverage that same parameter to choose between console/gui.

For anyone unaware, native Windows executable files (PE files) have a flag saying whether they are console executables, or GUI executables. When Windows launches programs, if it finds the console flag, it will have the following behaviour:
1. if the parent process is a GUI program, create a new cmdproxy process which opens a terminal window, and hook up stdin/out/err to it (unless specified otherwise)
2. if the parent process is itself a console process, do not create a cmdproxy, attach to existing stdin/out/err (unless specified otherwise)

When it launches a gui program, it will not launch nor reuse a cmdproxy window.

Hope that helps.


On Fri, Oct 23, 2020 at 10:26 AM dbm@refined-audiometrics.com <dbm@refined-audiometrics.com> wrote:
Just a possible hint after I just read something related this morning… Whenever you start a Lisp executable like this, the default Standard Error stream is created on a Terminal window. Maybe that is related?

- DM

> On Oct 23, 2020, at 7:01 AM, Alexey Veretennikov <txm.fourier@gmail.com> wrote:
>
> Hi,
>
> How to create a command line app for Windows which does not create a separate window?
> I'm trying to deliver the app the following way:
> (deliver 'f *delivered-image-name* 0 :multiprocessing t :console :io :startup-bitmap-file nil :interface nil)
>
> and still the delivered executable creates a separate console window upon running.
>
> Br,
> /Alexey


_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


--
Wilfredo Velázquez-Rodríguez
Updated at: 2020-12-10 08:28 UTC