Message-Id: <200410140612.i9E6CUYZ018567@delorie.com> Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com From: "Gary R. Van Sickle" To: Subject: RE: non-interactive cygwin setup Date: Thu, 14 Oct 2004 01:12:20 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit In-Reply-To: <20041013210453.GJ8866@trixie.casa.cgf.cx> X-IsSubscribed: yes [snip] > >I thought if a GUI app called printf it generally caused a > console to > >be opened for it. Maybe that's only with msvcrt. In any case, the > >fact is that it is being run from a cmdline and so it certainly can > >communicate with the console. The presence of command-line > options in > >argc/argv could be taken as a fairly strong hint that it was > being run > >from a shell rather than an icon. And there's always > "isatty (1)" if > >you really really want to be sure. > > This is a windows limitation. GUI apps (apps created with > -mwindows) can't send output to or receive input from the > console. Of course, a GUI can interpret command line > information. It just cannot send output to the console that > started it. > > You could use AllocConsole to create a separate console which > the GUI could then use, however. Here's a maybe-less-icky way to do it. Have two exes, one "setup.exe" which is a 100% command-line program that normally just spawns "winsetup.exe", the current GUI setup, and goes away. Give it "--help", and it prints help in the regular command-line way and exits. Yeah, two exes, but worse tragedies have happened. -- Gary R. Van Sickle -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/