I'm trying to develop a small Installer-Tool for our application which should be able to simply do its job by double click the EXE. That's the easy part. During the installation a little progress bar informs the user about the whole progress. All fine.. But now I want to use the same installer in another application to verify if an update is available. For that I provided the parameter "--printVersion" within my installer which should then simply print out relevant version information to the console. This is to let the (other) application know if it needs to be upgraded. The other application is starting my installer via
Process installer = new Process();
// ...
installer.StartInfo.RedirectStandardOutput = true;
installer.Start();
and later try to read its response via installer.StandardOutput...
If I keep the type "Windows Application" and if I use Console.WriteLine("...") to print any kind of information to the console, this text is not showing up in the console (tried by starting the app via cmd). If I understand correctly, then a "Windows Application" is detached from the parent (starting) process. This is maybe the reason why I can't see the console output. If I switch to "Console Application" the console output is there and is readable but then a black window if showing while the installer runs which is annoying.
How can I print something to the console but otherwise not showing a black windows if I just double click the EXE from within the explorer?