#52 Print to System.out in GUI mode?

Future
open
nobody
None
5
2015-05-09
2009-08-11
Nam-Quang Tran
No

Hello,

I have a program that has both a GUI and a console interface. In GUI mode, the console should not pop up, but in console mode, the user should see the standard output. Is it possible to do that with Launch4J? That is:
- When the user doubleclicks on the launcher, the program launches _without_ showing the console window.
- But when the user starts the program from a command prompt, the launcher shouldn't terminate immediately. Instead, it should redirect the standard output of the program to the command prompt.

With the current version of Launch4J it seems you can either suppress the console window when doubleclicking the EXE, or print to the console, but you can't do both.

Thanks in advance!

Discussion

  • Justin Murray
    Justin Murray
    2011-03-07

    Hello, if the developers or anyone are interested, I was able to make some fairly simple code changes to guihead.c that essentially implement this feature as requested. I would be happy to share the source code modifications that I made.

     
  • Nam-Quang Tran
    Nam-Quang Tran
    2011-03-07

    @ murrayju:
    Thanks for your work. I'm definitely interested! :)
    I think it's best if you upload the patch as an attachment to this page, so other people can access it, too.

     
  • Justin Murray
    Justin Murray
    2011-03-07

    I am unable to attach files to this issue (as I am not the creator or admin), so I created a new issue to attach my patch. See artifact #3202375. For a working example using this patch, take a look at the latest version of my Temp File Cleaner (http://software.addpcs.com/tfc).

     
  • gohai
    gohai
    2014-08-03

    Is there any plan to get this patch included in official launch4j releases? I am working with the Processing Project (http://processing.org/), and having recently switched to launch4j for our standalone applications applications on Windows, we would want to have this functionality, but being developed by a lot of volunteers in their spare time, we don't have the manpower to maintain a custom lauch4j build ourselves. Thanks!

     
  • Grzegorz Kowal
    Grzegorz Kowal
    2015-05-09

    • Group: --> Future