Index: ini.cc =================================================================== RCS file: /cvs/cygwin-apps/setup/ini.cc,v retrieving revision 2.59 diff -u -u -p -r2.59 ini.cc --- ini.cc 14 Nov 2013 21:36:14 -0000 2.59 +++ ini.cc 18 Nov 2013 16:18:01 -0000 @@ -106,11 +106,11 @@ public: } virtual void warning (const std::string& message)const { - MessageBox (0, message.c_str(), "Warning", 0); + mbox (0, message.c_str(), "Warning", 0); } virtual void error(const std::string& message)const { - MessageBox (0, message.c_str(), "Parse Errors", 0); + mbox (0, message.c_str(), "Parse Errors", 0); } virtual ~ GuiParseFeedback () { Index: msg.cc =================================================================== RCS file: /cvs/cygwin-apps/setup/msg.cc,v retrieving revision 2.9 diff -u -u -p -r2.9 msg.cc --- msg.cc 7 Aug 2008 22:59:17 -0000 2.9 +++ msg.cc 18 Nov 2013 16:18:01 -0000 @@ -41,15 +41,9 @@ msg (const char *fmt, ...) OutputDebugString (buf); } -static int -mbox (HWND owner, const char *name, int type, int id, va_list args) +int +mbox (HWND owner, const char *buf, const char *name, int type) { - char buf[1000], fmt[1000]; - - if (LoadString (hinstance, id, fmt, sizeof (fmt)) <= 0) - ExitProcess (0); - - vsnprintf (buf, 1000, fmt, args); log (LOG_PLAIN) << "mbox " << name << ": " << buf << endLog; if (unattended_mode) { @@ -79,6 +73,18 @@ mbox (HWND owner, const char *name, int return MessageBox (owner, buf, "Cygwin Setup", type); } +static int +mbox (HWND owner, const char *name, int type, int id, va_list args) +{ + char buf[1000], fmt[1000]; + + if (LoadString (hinstance, id, fmt, sizeof (fmt)) <= 0) + ExitProcess (0); + + vsnprintf (buf, 1000, fmt, args); + return mbox(owner, buf, name, type); +} + void note (HWND owner, int id, ...) { Index: msg.h =================================================================== RCS file: /cvs/cygwin-apps/setup/msg.h,v retrieving revision 2.4 diff -u -u -p -r2.4 msg.h --- msg.h 29 Aug 2004 16:59:40 -0000 2.4 +++ msg.h 18 Nov 2013 16:18:01 -0000 @@ -37,4 +37,7 @@ void note (HWND owner, int id, ...); /* returns IDYES or IDNO, otherwise same as note() */ int yesno (HWND owner, int id, ...); +/* general MessageBox() wrapper which understands unattended mode */ +int mbox (HWND owner, const char *buf, const char *name, int type); + #endif /* SETUP_MSG_H */