Removing background console on Neko target

When I compile to Neko, whether debug or release, the resulting program always opens with a background console window. This is only when I actually double-click on the actual .exe (not when I compile and run in FlashDevelop). Although it can be helpful for seeing traces outside of FD, it’s not ideal when distributing the application.

Any ideas? I’d like to point out again that this happens when I compile for release, as well as debug.

First you can disable trace() for release build with <haxeflag name="--no-traces" if="release"/>

Thanks, although that doesn’t remove the console. I also tried these:

<haxeflag name="-D no_console" />
<haxedef name="no_console" />
<setenv name="no_console" value="1" />

None of these work though.

This is currently the way Neko works, and is expected. I resolved this before in our Windows C++ target, but Neko likes having a command-prompt (perhaps using the Windows “console” subsystem)

I’ve also found that Neko has trouble finding libraries, on a system without Neko installed, it might not run properly. I’ve been wondering if we should more seriously dig into contributing patches to Neko to improve it’s ability to be used in production (and for cross-desktop builds) or if we should consider an alternative, such as node.js, node-webkit or Java

For the libraries, I’ve been able to test it on my own machine by having a little script that corrupts the Neko directory and thus I can run the application without it and see which libraries it needs. Then I add those before I distribute it. I would personally really like it if it would be possible for OpenFL to automatically detect the required .ndlls and add them.

However, if there’s no way to remove the background console, then I might end up using C++ for distribution purposes then.

In the past, I had trouble with Neko actually finding the libraries, even when they were all in the same directory. I’d be happy to hear if the tools are missing something, and standalone Neko binaries are possible.

If we built Neko from the source, it might be possible to get the console to disappear – basically it happens automatically when you use the Windows “console” subsystem, but I have found ways to make a “windows” subsystem application work both from the console and without, so we could try doing the same if we can get Neko working without an install :slight_smile:

Hello singmajesty,

Did you look into this any further?
I’d also like Neko builds to run without the console window.

This is probably something within Neko itself. An alternative (perhaps) would be if we embedded Neko inside of a Lime application, that would allow the Lime C++ application to control the windowing (and thereby not create a console window) but to still execute Neko code, otherwise we’re looking at modifying Neko itself