I don't know about returning output to a console from a project packaged with the Windows Forms engine, but I did a project for work where I wanted to provide the same tool through a GUI application as well as from the command line. What I did was this:
I know this isn't the specific answer you're looking for, but it works out great for my project.
- 1) I included in the project a powershell wrapper script to call the cli version of the tool. This gives the users the added convenience of parameter name tab completion, etc.
2) Set the wrapper script Build property to Exclude so it's not included when you build the project
3) Built the project twice - once with the Windows Forms script host, and once with the Command line script host (adding 'cli' to the end of the output file)
4) Finally, for the installer, include both of your packaged executables (the windows forms and the command line exe's) as well as the powershell wrapper script for the cli version.
I know this isn't the specific answer you're looking for, but it works out great for my project.
Statistics: Posted by dwknight — Thu Dec 05, 2024 1:04 pm