Skip to content
This repository has been archived by the owner on Oct 18, 2022. It is now read-only.

Windows: invest runs popup in a new cmd shell #47

Closed
davemfish opened this issue Oct 2, 2020 · 4 comments · Fixed by #50
Closed

Windows: invest runs popup in a new cmd shell #47

davemfish opened this issue Oct 2, 2020 · 4 comments · Fixed by #50
Assignees
Labels
bug Something isn't working in progress This issue is being actively worked on
Milestone

Comments

@davemfish
Copy link
Collaborator

davemfish commented Oct 2, 2020

After setting up a run and clicking 'Execute', instead of switching to the workbench's Log tab display, Windows opens a new cmd window and invest runs there.

Probably we need to have a Windows-specific child_process call for launching invest to match the behavior we get with spawn on mac & linux.

@davemfish davemfish added the bug Something isn't working label Oct 2, 2020
@davemfish davemfish added this to the 0.1.0-alpha milestone Oct 2, 2020
@davemfish davemfish self-assigned this Oct 2, 2020
@davemfish davemfish added the in progress This issue is being actively worked on label Oct 2, 2020
@phargogh
Copy link
Member

phargogh commented Oct 2, 2020

Hey @davemfish I see you're already working on this, but it sounds like the pyinstaller build on this might be related. On Windows, we have to specify a binary application as either a command-line application (where a CMD shell will show up, which is how InVEST is currently built), or a GUI application, where the application's stdout is not attached to a shell at all (and it's presumed that the application is reporting its logging somewhere appropriate). I coincidentally created https://github.com/natcap/invest/issues/325 for the Qt application's logging just this morning, but also since you're doing a separate build for the workbench, I wonder if this might include flipping the CLI/GUI application switch in the pyinstaller specfile?

@davemfish
Copy link
Collaborator Author

Hmm I don't fully understand the logging issue, but putting that aside I'd certainly like to try what you're suggesting. I tried the --windowed flag when running PyInstaller, but did not observe any change. Is there another "switch" you know of in the spec file?

One thing that is puzzling: the invest cli binary and the flask launcher binary are both created by Pyinstaller. The flask app is launched by node like this and works on all OS:

spawn(path.basename(serverExe), {
    env: { PATH: path.dirname(serverExe) },
});

@davemfish
Copy link
Collaborator Author

Okay, I think I'm making progress on this without getting into the PyInstaller stuff.

@phargogh
Copy link
Member

phargogh commented Oct 2, 2020

Great! Yes, the --windowed flag was what I was thinking of, and strange that building the application with and without --windowed has the same effect. I'm glad that this isn't ultimately an issue with pyinstaller.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working in progress This issue is being actively worked on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants