From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19829 invoked by alias); 18 Nov 2013 16:49:53 -0000 Mailing-List: contact cygwin-apps-help@cygwin.com; run by ezmlm Precedence: bulk Sender: cygwin-apps-owner@cygwin.com List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Mail-Followup-To: cygwin-apps@cygwin.com Received: (qmail 19816 invoked by uid 89); 18 Nov 2013 16:49:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.7 required=5.0 tests=AWL,BAYES_50,RDNS_NONE autolearn=no version=3.3.2 X-HELO: smtpout13.bt.lon5.cpcloud.co.uk Received: from Unknown (HELO smtpout13.bt.lon5.cpcloud.co.uk) (65.20.0.133) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 18 Nov 2013 16:47:48 +0000 X-CTCH-RefID: str=0001.0A090207.528A44AB.013F,ss=1,re=0.100,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0 X-Junkmail-Premium-Raw: score=28/97,refid=2.7.2:2013.11.18.133915:17:28.394,ip=86.177.101.33,rules=__MOZILLA_MSGID, __HAS_MSGID, __SANE_MSGID, __HAS_FROM, __USER_AGENT, __MOZILLA_USER_AGENT, __MIME_VERSION, __TO_MALFORMED_2, __TO_NO_NAME, __PHISH_SPEAR_SUBJECT, __SUBJ_ALPHA_END, __PHISH_SUBJ_PHRASE7, __CT, __CTYPE_HAS_BOUNDARY, __CTYPE_MULTIPART, __CTYPE_MULTIPART_MIXED, __BAT_BOUNDARY, __ANY_URI, __URI_NO_WWW, __URI_NO_PATH, BODYTEXTP_SIZE_3000_LESS, BODY_SIZE_3000_3999, __MIME_TEXT_ONLY, RDNS_GENERIC_POOLED, __URI_NS, SXL_IP_DYNAMIC[33.101.177.86.fur], HTML_00_01, HTML_00_10, BODY_SIZE_5000_LESS, RDNS_SUSP_GENERIC, RDNS_SUSP, BODY_SIZE_7000_LESS, MIME_TEXT_ONLY_MP_MIXED X-CTCH-Spam: Unknown Received: from [192.168.1.72] (86.177.101.33) by smtpout13.bt.lon5.cpcloud.co.uk (8.6.100.99.10223) (authenticated as jonturney@btinternet.com) id 5285476F003D8034 for cygwin-apps@cygwin.com; Mon, 18 Nov 2013 16:47:39 +0000 Message-ID: <528A44B3.4020706@dronecode.org.uk> Date: Mon, 18 Nov 2013 16:49:00 -0000 From: Jon TURNEY User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: cygwin-apps@cygwin.com Subject: [PATCH] Don't show setup version warning message box in unattended mode Content-Type: multipart/mixed; boundary="------------000904030604070308010202" X-SW-Source: 2013-11/txt/msg00076.txt.bz2 This is a multi-part message in MIME format. --------------000904030604070308010202 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-length: 535 As was pointed out on IRC a week or two ago, setup can show a "The current ini file is from a newer version of setup..." message box even in unattended mode. Attached is a patch to fix. There are other uses of MessageBox() which probably present a similar problem and still need fixing. 2013-11-18 Jon TURNEY * msg.cc (mbox): Generalize to a MessgeBox() wrapper which knows what to do in unattended mode. * msg.h: Add prototype. * ini.cc (IniParseFeedback): Use here rather than MessageBox(). --------------000904030604070308010202 Content-Type: text/plain; charset=windows-1252; name="unattended.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="unattended.patch" Content-length: 2434 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 */ --------------000904030604070308010202--