tilemill-project / tilemill

TileMill is a modern map design studio
https://tilemill-project.github.io/tilemill/
BSD 3-Clause "New" or "Revised" License
3.12k stars 528 forks source link

Console-less node on Windows #1159

Closed yhahn closed 12 years ago

yhahn commented 12 years ago

Dane's looking at this, original from (https://github.com/mapbox/tilemill/issues/1122#issuecomment-3489022). Looks like there may be some lessons to learn from the Python codebase which exposes a pythonw.exe executable which runs without spawning a console in Windows.

springmeyer commented 12 years ago

after fa02e52 the node window is minimized and logs go to the user directory, so this feels more like gravy.

springmeyer commented 12 years ago

holding off on looking at this until after release because I need to figure out how to capture stdout and stderr, which, when the process not longer has a console has no where to go...

springmeyer commented 12 years ago

started looking into this again as part of a research push at moving from a .bat to a .exe. From an .exe we can call CreateProcess to launch a subprocess. We can pass a creation flag of CREATE_NO_WINDOW to hide the console, so this seems much easier than compiling a nodew.exe version with a different subsystem. I'm now working on catching and directing the stdout to a logfile from the process handle - looking tricky but doable.

springmeyer commented 12 years ago

New, win-exe branch has a C++ wrapper that starts node.exe as a subprocess and redirects its stdout/stderr to the log. This avoids the need to compile a nodew.exe version. Only when javascript support for launching a UI is needed will a nodew.exe be needed.

Closing.